mirror of
				https://github.com/amix/vimrc
				synced 2025-10-31 14:43:35 +08:00 
			
		
		
		
	Updated plugins
This commit is contained in:
		| @ -57,7 +57,75 @@ if get(g:, "go_textobj_enabled", 1) | ||||
| endif | ||||
|  | ||||
| if get(g:, "go_auto_type_info", 0) || get(g:, "go_auto_sameids", 0) | ||||
|   setlocal updatetime=800 | ||||
|   let &l:updatetime= get(g:, "go_updatetime", 800) | ||||
| endif | ||||
|  | ||||
| " NOTE(arslan): experimental, disabled by default, doesn't work well. No | ||||
| " documentation as well. If anyone feels adventerous, enable the following and | ||||
| " try to search for Go identifiers ;) | ||||
| " | ||||
| " if get(g:, "go_sameid_search_enabled", 0) | ||||
| "   autocmd FileType go nnoremap <buffer> <silent> * :<c-u>call Sameids_search(0)<CR> | ||||
| "   autocmd FileType go nnoremap <buffer> <silent> # :<c-u>call Sameids_search(1)<CR> | ||||
| "   autocmd FileType go nnoremap <buffer> <silent> n :<c-u>call Sameids_repeat(0)<CR> | ||||
| "   autocmd FileType go nnoremap <buffer> <silent> N :<c-u>call Sameids_repeat(1)<CR> | ||||
| "   autocmd FileType go cabbrev nohlsearch <C-r>=Sameids_nohlsearch()<CR> | ||||
| " endif | ||||
|  | ||||
| " " mode 0: next 1: prev | ||||
| " function! Sameids_repeat(mode) | ||||
| "   let matches = getmatches() | ||||
| "   if empty(matches) | ||||
| "     return | ||||
| "   endif | ||||
| "   let cur_offset = go#util#OffsetCursor() | ||||
|  | ||||
| "   " reverse list to make it easy to find the prev occurence | ||||
| "   if a:mode | ||||
| "    call reverse(matches) | ||||
| "   endif | ||||
|  | ||||
| "   for m in matches | ||||
| "     if !has_key(m, "group") | ||||
| "       return | ||||
| "     endif | ||||
|  | ||||
| "     if m.group != "goSameId" | ||||
| "       return | ||||
| "     endif | ||||
|  | ||||
| "     let offset = go#util#Offset(m.pos1[0], m.pos1[1]) | ||||
|  | ||||
| "     if a:mode && cur_offset > offset | ||||
| "       call cursor(m.pos1[0], m.pos1[1]) | ||||
| "       return | ||||
| "     elseif !a:mode && cur_offset < offset | ||||
| "       call cursor(m.pos1[0], m.pos1[1]) | ||||
| "       return | ||||
| "     endif | ||||
| "   endfor | ||||
|  | ||||
| "   " reached start/end, jump to the end/start | ||||
| "   let initial_match = matches[0] | ||||
| "   if !has_key(initial_match, "group") | ||||
| "     return | ||||
| "   endif | ||||
|  | ||||
| "   if initial_match.group != "goSameId" | ||||
| "     return | ||||
| "   endif | ||||
|  | ||||
| "   call cursor(initial_match.pos1[0], initial_match.pos1[1]) | ||||
| " endfunction | ||||
|  | ||||
| " function! Sameids_search(mode) | ||||
| "   call go#guru#SameIds() | ||||
| "   call Sameids_repeat(a:mode) | ||||
| " endfunction | ||||
|  | ||||
| " function! Sameids_nohlsearch() | ||||
| "   call go#guru#ClearSameIds() | ||||
| "   return "nohlsearch" | ||||
| " endfunction | ||||
|  | ||||
| " vim: sw=2 ts=2 et | ||||
|  | ||||
| @ -17,15 +17,15 @@ command! -nargs=? GoGuruTags call go#guru#Tags(<f-args>) | ||||
|  | ||||
| command! -nargs=* -range GoAddTags call go#util#AddTags(<line1>, <line2>, <f-args>) | ||||
|  | ||||
| command! -range=% GoSameIds call go#guru#SameIds(<count>) | ||||
| command! -range=0 GoSameIds call go#guru#SameIds() | ||||
| command! -range=0 GoSameIdsClear call go#guru#ClearSameIds() | ||||
| command! -range=% GoSameIdsToggle call go#guru#ToggleSameIds(<count>) | ||||
| command! -range=0 GoSameIdsToggle call go#guru#ToggleSameIds() | ||||
| command! -range=0 GoSameIdsAutoToggle call go#guru#AutoToogleSameIds() | ||||
|  | ||||
| " -- tool | ||||
| command! -nargs=0 GoFiles echo go#tool#Files() | ||||
| command! -nargs=0 GoDeps echo go#tool#Deps() | ||||
| command! -nargs=* GoInfo call go#complete#Info(0) | ||||
| command! -nargs=* GoInfo call go#tool#Info(0) | ||||
| command! -nargs=0 GoAutoTypeInfoToggle call go#complete#ToggleAutoTypeInfo() | ||||
|  | ||||
| " -- cmd | ||||
|  | ||||
| @ -31,7 +31,7 @@ nnoremap <silent> <Plug>(go-coverage-browser) :<C-u>call go#coverage#Browser(!g: | ||||
|  | ||||
| nnoremap <silent> <Plug>(go-files) :<C-u>call go#tool#Files()<CR> | ||||
| nnoremap <silent> <Plug>(go-deps) :<C-u>call go#tool#Deps()<CR> | ||||
| nnoremap <silent> <Plug>(go-info) :<C-u>call go#complete#Info(0)<CR> | ||||
| nnoremap <silent> <Plug>(go-info) :<C-u>call go#tool#Info(0)<CR> | ||||
| nnoremap <silent> <Plug>(go-import) :<C-u>call go#import#SwitchImport(1, '', expand('<cword>'), '')<CR> | ||||
| nnoremap <silent> <Plug>(go-imports) :<C-u>call go#fmt#Format(1)<CR> | ||||
|  | ||||
| @ -43,9 +43,9 @@ nnoremap <silent> <Plug>(go-callstack) :<C-u>call go#guru#Callstack(-1)<CR> | ||||
| xnoremap <silent> <Plug>(go-freevars) :<C-u>call go#guru#Freevars(0)<CR> | ||||
| nnoremap <silent> <Plug>(go-channelpeers) :<C-u>call go#guru#ChannelPeers(-1)<CR> | ||||
| nnoremap <silent> <Plug>(go-referrers) :<C-u>call go#guru#Referrers(-1)<CR> | ||||
| nnoremap <silent> <Plug>(go-sameids) :<C-u>call go#guru#SameIds(-1)<CR> | ||||
| nnoremap <silent> <Plug>(go-sameids) :<C-u>call go#guru#SameIds()<CR> | ||||
| nnoremap <silent> <Plug>(go-whicherrs) :<C-u>call go#guru#Whicherrs(-1)<CR> | ||||
| nnoremap <silent> <Plug>(go-sameids-toggle) :<C-u>call go#guru#ToggleSameIds(-1)<CR> | ||||
| nnoremap <silent> <Plug>(go-sameids-toggle) :<C-u>call go#guru#ToggleSameIds()<CR> | ||||
|  | ||||
| nnoremap <silent> <Plug>(go-rename) :<C-u>call go#rename#Rename(!g:go_jump_to_error)<CR> | ||||
|  | ||||
| @ -65,6 +65,7 @@ nnoremap <silent> <Plug>(go-doc-split) :<C-u>call go#doc#Open("new", "split")<CR | ||||
| nnoremap <silent> <Plug>(go-doc-browser) :<C-u>call go#doc#OpenBrowser()<CR> | ||||
|  | ||||
| nnoremap <silent> <Plug>(go-metalinter) :<C-u>call go#lint#Gometa(0)<CR> | ||||
| nnoremap <silent> <Plug>(go-lint) :<C-u>call go#lint#Golint()<CR> | ||||
| nnoremap <silent> <Plug>(go-vet) :<C-u>call go#lint#Vet(!g:go_jump_to_error)<CR> | ||||
|  | ||||
| nnoremap <silent> <Plug>(go-alternate-edit) :<C-u>call go#alternate#Switch(0, "edit")<CR> | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 amix
					amix