mirror of
				https://github.com/amix/vimrc
				synced 2025-10-31 14:43:35 +08:00 
			
		
		
		
	Replace YanRing with yank-stack and update plugins
This commit is contained in:
		| @ -87,7 +87,7 @@ command! -nargs=? -complete=file GoDecls call go#decls#Decls(0, <q-args>) | ||||
| command! -nargs=? -complete=dir GoDeclsDir call go#decls#Decls(1, <q-args>) | ||||
|  | ||||
| " -- impl | ||||
| command! -nargs=* -buffer -complete=customlist,go#impl#Complete GoImpl call go#impl#Impl(<f-args>) | ||||
| command! -nargs=* -complete=customlist,go#impl#Complete GoImpl call go#impl#Impl(<f-args>) | ||||
|  | ||||
| " -- template | ||||
| command! -nargs=0 GoTemplateAutoCreateToggle call go#template#ToggleAutoCreate() | ||||
|  | ||||
| @ -3,13 +3,8 @@ if exists("g:go_loaded_gosnippets") | ||||
| endif | ||||
| let g:go_loaded_gosnippets = 1 | ||||
|  | ||||
| " by default UltiSnips | ||||
| if !exists("g:go_snippet_engine") | ||||
|   let g:go_snippet_engine = "ultisnips" | ||||
| endif | ||||
|  | ||||
| function! s:GoUltiSnips() | ||||
|   if globpath(&rtp, 'plugin/UltiSnips.vim') == "" | ||||
| function! s:GoUltiSnips() abort | ||||
|   if get(g:, 'did_plugin_ultisnips') isnot 1 | ||||
|     return | ||||
|   endif | ||||
|  | ||||
| @ -20,29 +15,53 @@ function! s:GoUltiSnips() | ||||
|   endif | ||||
| endfunction | ||||
|  | ||||
| function! s:GoNeosnippet() | ||||
|   if globpath(&rtp, 'plugin/neosnippet.vim') == "" | ||||
| function! s:GoNeosnippet() abort | ||||
|   if get(g:, 'loaded_neosnippet') isnot 1 | ||||
|     return | ||||
|   endif | ||||
|  | ||||
|   let g:neosnippet#enable_snipmate_compatibility = 1 | ||||
|  | ||||
|   let gosnippets_dir = globpath(&rtp, 'gosnippets/snippets') | ||||
|   let l:gosnippets_dir = globpath(&rtp, 'gosnippets/snippets') | ||||
|   if type(g:neosnippet#snippets_directory) == type([]) | ||||
|     let g:neosnippet#snippets_directory += [gosnippets_dir] | ||||
|     let g:neosnippet#snippets_directory += [l:gosnippets_dir] | ||||
|   elseif type(g:neosnippet#snippets_directory) == type("") | ||||
|     if strlen(g:neosnippet#snippets_directory) > 0 | ||||
|       let g:neosnippet#snippets_directory = g:neosnippet#snippets_directory . "," . gosnippets_dir | ||||
|       let g:neosnippet#snippets_directory = g:neosnippet#snippets_directory . "," . l:gosnippets_dir | ||||
|     else | ||||
|       let g:neosnippet#snippets_directory = gosnippets_dir | ||||
|       let g:neosnippet#snippets_directory = l:gosnippets_dir | ||||
|     endif | ||||
|   endif | ||||
| endfunction | ||||
|  | ||||
| if g:go_snippet_engine == "ultisnips" | ||||
| function! s:GoMinisnip() abort | ||||
|   if get(g:, 'loaded_minisnip') isnot 1 | ||||
|     return | ||||
|   endif | ||||
|  | ||||
|   if exists('g:minisnip_dir') | ||||
|     let g:minisnip_dir .= ':' . globpath(&rtp, 'gosnippets/minisnip') | ||||
|   else | ||||
|     let g:minisnip_dir = globpath(&rtp, 'gosnippets/minisnip') | ||||
|   endif | ||||
| endfunction | ||||
|  | ||||
|  | ||||
| let s:engine = get(g:, 'go_snippet_engine', 'automatic') | ||||
| if s:engine is? "automatic" | ||||
|   if get(g:, 'did_plugin_ultisnips') is 1 | ||||
|     call s:GoUltiSnips() | ||||
|   elseif get(g:, 'loaded_neosnippet') is 1 | ||||
|     call s:GoNeosnippet() | ||||
|   elseif get(g:, 'loaded_minisnip') is 1 | ||||
|     call s:GoMinisnip() | ||||
|   endif | ||||
| elseif s:engine is? "ultisnips" | ||||
|   call s:GoUltiSnips() | ||||
| elseif g:go_snippet_engine == "neosnippet" | ||||
| elseif s:engine is? "neosnippet" | ||||
|   call s:GoNeosnippet() | ||||
| elseif s:engine is? "minisnip" | ||||
|   call s:GoMinisnip() | ||||
| endif | ||||
|  | ||||
| " vim: sw=2 ts=2 et | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 amix
					amix