mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-02-03 00:10:07 +08:00
Merge branch 'dev' into plugin_manager
This commit is contained in:
commit
051acf57ff
@ -85,6 +85,13 @@ let g:spacevim_plugin_bundle_dir
|
|||||||
" let g:spacevim_realtime_leader_guide = 1
|
" let g:spacevim_realtime_leader_guide = 1
|
||||||
" <
|
" <
|
||||||
let g:spacevim_realtime_leader_guide = 0
|
let g:spacevim_realtime_leader_guide = 0
|
||||||
|
""
|
||||||
|
" Enable/Disable key frequency catching of SpaceVim. default value is 0. to
|
||||||
|
" enable it:
|
||||||
|
" >
|
||||||
|
" let g:spacevim_enable_key_frequency = 1
|
||||||
|
" <
|
||||||
|
let g:spacevim_enable_key_frequency = 0
|
||||||
let g:spacevim_autocomplete_method = ''
|
let g:spacevim_autocomplete_method = ''
|
||||||
let g:spacevim_enable_cursorcolumn = 0
|
let g:spacevim_enable_cursorcolumn = 0
|
||||||
""
|
""
|
||||||
@ -109,6 +116,13 @@ let g:spacevim_enable_ycm = 0
|
|||||||
" Set the width of the SpaceVim sidebar. Default is 30.
|
" Set the width of the SpaceVim sidebar. Default is 30.
|
||||||
" This value will be used by tagbar and vimfiler.
|
" This value will be used by tagbar and vimfiler.
|
||||||
let g:spacevim_sidebar_width = 30
|
let g:spacevim_sidebar_width = 30
|
||||||
|
""
|
||||||
|
" Set the snippet engine of SpaceVim, default is neosnippet. to enable
|
||||||
|
" ultisnips:
|
||||||
|
" >
|
||||||
|
" let g:spacevim_snippet_engine = 'ultisnips'
|
||||||
|
" <
|
||||||
|
let g:spacevim_snippet_engine = 'neosnippet'
|
||||||
let g:spacevim_enable_neocomplcache = 0
|
let g:spacevim_enable_neocomplcache = 0
|
||||||
""
|
""
|
||||||
" Enable/Disable cursorline. Default is 0.
|
" Enable/Disable cursorline. Default is 0.
|
||||||
@ -259,6 +273,12 @@ let g:spacevim_lint_on_save = 1
|
|||||||
" let g:spacevim_enable_vimfiler_welcome = 0
|
" let g:spacevim_enable_vimfiler_welcome = 0
|
||||||
" <
|
" <
|
||||||
let g:spacevim_enable_vimfiler_welcome = 1
|
let g:spacevim_enable_vimfiler_welcome = 1
|
||||||
|
""
|
||||||
|
" Enable/Disable gitstatus colum in vimfiler buffer, default is 0.
|
||||||
|
let g:spacevim_enable_vimfiler_gitstatus = 0
|
||||||
|
""
|
||||||
|
" Enable/Disable filetypeicon colum in vimfiler buffer, default is 0.
|
||||||
|
let g:spacevim_enable_vimfiler_filetypeicon = 0
|
||||||
let g:spacevim_smartcloseignorewin = ['__Tagbar__' , 'vimfiler:default']
|
let g:spacevim_smartcloseignorewin = ['__Tagbar__' , 'vimfiler:default']
|
||||||
let g:spacevim_smartcloseignoreft = ['help']
|
let g:spacevim_smartcloseignoreft = ['help']
|
||||||
let g:spacevim_altmoveignoreft = ['Tagbar' , 'vimfiler']
|
let g:spacevim_altmoveignoreft = ['Tagbar' , 'vimfiler']
|
||||||
|
27
autoload/SpaceVim/api/vim/compatible.vim
Normal file
27
autoload/SpaceVim/api/vim/compatible.vim
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
function! SpaceVim#api#vim#compatible#get() abort
|
||||||
|
return map({
|
||||||
|
\ 'execute' : '',
|
||||||
|
\ },
|
||||||
|
\ "function('s:' . v:key)"
|
||||||
|
\ )
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:execute(cmd, ...) abort
|
||||||
|
if a:0 == 0
|
||||||
|
let s = 'silent'
|
||||||
|
else
|
||||||
|
let s = a:1
|
||||||
|
endif
|
||||||
|
redir => output
|
||||||
|
if s ==# 'silent'
|
||||||
|
silent execute a:cmd
|
||||||
|
elseif s ==# 'silent!'
|
||||||
|
silent! execute a:cmd
|
||||||
|
else
|
||||||
|
execute a:cmd
|
||||||
|
endif
|
||||||
|
redir END
|
||||||
|
return output
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" vim:set et sw=2 cc=80:
|
35
autoload/SpaceVim/api/vim/mapping.vim
Normal file
35
autoload/SpaceVim/api/vim/mapping.vim
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
let s:VIM = SpaceVim#api#import('vim#compatible')
|
||||||
|
|
||||||
|
function! SpaceVim#api#vim#mapping#get() abort
|
||||||
|
return map({
|
||||||
|
\ 'map' : '',
|
||||||
|
\ },
|
||||||
|
\ "function('s:' . v:key)"
|
||||||
|
\ )
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:map(...) abort
|
||||||
|
if a:0 == 1
|
||||||
|
return s:parser(s:VIM.execute(':map ' . a:1))
|
||||||
|
endif
|
||||||
|
return []
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:parser(rst) abort
|
||||||
|
let mappings = split(a:rst, "\n")
|
||||||
|
let mappings = map(mappings, 'split(v:val)')
|
||||||
|
let rst = []
|
||||||
|
for mapping in mappings
|
||||||
|
if len(mapping) >= 3
|
||||||
|
let mode = mapping[0]
|
||||||
|
let key = mapping[1]
|
||||||
|
let m = maparg(key, mode, 0, 1)
|
||||||
|
if !empty(m)
|
||||||
|
call add(rst, m)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
return rst
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" vim:set et sw=2 cc=80:
|
@ -64,7 +64,6 @@ function! SpaceVim#autocmds#init() abort
|
|||||||
autocmd FocusGained * call s:reload_touchpad_status()
|
autocmd FocusGained * call s:reload_touchpad_status()
|
||||||
endif
|
endif
|
||||||
autocmd BufWritePost *.vim call s:generate_doc()
|
autocmd BufWritePost *.vim call s:generate_doc()
|
||||||
autocmd FileType * set scrolloff=7
|
|
||||||
autocmd VimEnter * if !argc() | call SpaceVim#welcome() | endif
|
autocmd VimEnter * if !argc() | call SpaceVim#welcome() | endif
|
||||||
augroup END
|
augroup END
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -26,8 +26,26 @@ function! SpaceVim#commands#load() abort
|
|||||||
command! -nargs=*
|
command! -nargs=*
|
||||||
\ -complete=customlist,SpaceVim#commands#complete_SPConfig
|
\ -complete=customlist,SpaceVim#commands#complete_SPConfig
|
||||||
\ SPConfig call SpaceVim#commands#config(<f-args>)
|
\ SPConfig call SpaceVim#commands#config(<f-args>)
|
||||||
|
""
|
||||||
|
" Command for update plugin, support completion of plugin name.
|
||||||
|
" >
|
||||||
|
" :SPUpdate vim-airline
|
||||||
|
" <
|
||||||
|
command! -nargs=*
|
||||||
|
\ -complete=custom,SpaceVim#commands#complete_plugin
|
||||||
|
\ SPUpdate call SpaceVim#commands#update_plugin(<f-args>)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" @vimlint(EVL103, 1, a:ArgLead)
|
||||||
|
" @vimlint(EVL103, 1, a:CmdLine)
|
||||||
|
" @vimlint(EVL103, 1, a:CursorPos)
|
||||||
|
function! SpaceVim#commands#complete_plugin(ArgLead, CmdLine, CursorPos) abort
|
||||||
|
return join(g:_spacevim_plugins, "\n")
|
||||||
|
endfunction
|
||||||
|
" @vimlint(EVL103, 0, a:ArgLead)
|
||||||
|
" @vimlint(EVL103, 0, a:CmdLine)
|
||||||
|
" @vimlint(EVL103, 0, a:CursorPos)
|
||||||
|
|
||||||
" @vimlint(EVL103, 1, a:ArgLead)
|
" @vimlint(EVL103, 1, a:ArgLead)
|
||||||
" @vimlint(EVL103, 1, a:CmdLine)
|
" @vimlint(EVL103, 1, a:CmdLine)
|
||||||
" @vimlint(EVL103, 1, a:CursorPos)
|
" @vimlint(EVL103, 1, a:CursorPos)
|
||||||
@ -46,6 +64,14 @@ function! SpaceVim#commands#config(...) abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! SpaceVim#commands#update_plugin(plug) abort
|
||||||
|
if g:spacevim_plugin_manager ==# 'neobundle'
|
||||||
|
elseif g:spacevim_plugin_manager ==# 'dein'
|
||||||
|
call dein#update([a:plug])
|
||||||
|
elseif g:spacevim_plugin_manager ==# 'vim-plug'
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! SpaceVim#commands#version() abort
|
function! SpaceVim#commands#version() abort
|
||||||
echo 'SpaceVim ' . g:spacevim_version . '-' . s:SHA() . "\n" .
|
echo 'SpaceVim ' . g:spacevim_version . '-' . s:SHA() . "\n" .
|
||||||
|
@ -96,7 +96,7 @@ function! SpaceVim#default#SetOptions() abort
|
|||||||
set complete=.,w,b,u,t
|
set complete=.,w,b,u,t
|
||||||
" limit completion menu height
|
" limit completion menu height
|
||||||
set pumheight=15
|
set pumheight=15
|
||||||
set scrolloff=7
|
set scrolloff=3
|
||||||
set incsearch
|
set incsearch
|
||||||
set hlsearch
|
set hlsearch
|
||||||
set laststatus=2
|
set laststatus=2
|
||||||
@ -158,11 +158,11 @@ endfunction
|
|||||||
function! SpaceVim#default#SetMappings() abort
|
function! SpaceVim#default#SetMappings() abort
|
||||||
|
|
||||||
"mapping
|
"mapping
|
||||||
imap <silent><expr><TAB> SpaceVim#mapping#tab()
|
imap <silent><expr><TAB> SpaceVim#mapping#tab#i_tab()
|
||||||
imap <expr><S-TAB> pumvisible() ? "\<C-p>" : ""
|
imap <expr><S-TAB> pumvisible() ? "\<C-p>" : ""
|
||||||
imap <silent><expr><S-TAB> SpaceVim#mapping#shift_tab()
|
imap <silent><expr><S-TAB> SpaceVim#mapping#shift_tab()
|
||||||
smap <expr><TAB> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
|
smap <expr><TAB> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
|
||||||
inoremap <silent><expr><CR> SpaceVim#mapping#enter()
|
imap <silent><expr><CR> SpaceVim#mapping#enter#i_enter()
|
||||||
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
|
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
|
||||||
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
|
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
|
||||||
inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>"
|
inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>"
|
||||||
|
@ -31,8 +31,17 @@ function! SpaceVim#layers#autocomplete#plugins() abort
|
|||||||
\ ['Shougo/neopairs.vim', { 'on_i' : 1}],
|
\ ['Shougo/neopairs.vim', { 'on_i' : 1}],
|
||||||
\ ['Raimondi/delimitMate', { 'merged' : 0}],
|
\ ['Raimondi/delimitMate', { 'merged' : 0}],
|
||||||
\ ]
|
\ ]
|
||||||
|
" snippet
|
||||||
|
if g:spacevim_snippet_engine ==# 'neosnippet'
|
||||||
|
call add(plugins, ['Shougo/neosnippet.vim', { 'on_i' : 1 ,
|
||||||
|
\ 'on_ft' : 'neosnippet',
|
||||||
|
\ 'loadconf' : 1,
|
||||||
|
\ 'on_cmd' : 'NeoSnippetEdit'}])
|
||||||
|
elseif g:spacevim_snippet_engine ==# 'ultisnips'
|
||||||
|
call add(plugins, ['SirVer/ultisnips',{ 'loadconf_before' : 1,
|
||||||
|
\ 'merged' : 0}])
|
||||||
|
endif
|
||||||
if g:spacevim_autocomplete_method ==# 'ycm'
|
if g:spacevim_autocomplete_method ==# 'ycm'
|
||||||
call add(plugins, ['SirVer/ultisnips', { 'loadconf_before' : 1, 'merged' : 0}])
|
|
||||||
call add(plugins, ['ervandew/supertab', { 'loadconf_before' : 1, 'merged' : 0}])
|
call add(plugins, ['ervandew/supertab', { 'loadconf_before' : 1, 'merged' : 0}])
|
||||||
call add(plugins, ['Valloric/YouCompleteMe', { 'loadconf_before' : 1, 'merged' : 0}])
|
call add(plugins, ['Valloric/YouCompleteMe', { 'loadconf_before' : 1, 'merged' : 0}])
|
||||||
elseif g:spacevim_autocomplete_method ==# 'neocomplete'
|
elseif g:spacevim_autocomplete_method ==# 'neocomplete'
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
function! SpaceVim#layers#lang#plugins() abort
|
function! SpaceVim#layers#lang#plugins() abort
|
||||||
let plugins = [
|
let plugins = [
|
||||||
\ ['Shougo/neosnippet.vim', { 'on_i' : 1 , 'on_ft' : 'neosnippet', 'loadconf' : 1, 'on_cmd' : 'NeoSnippetEdit'}],
|
|
||||||
\ ['groenewege/vim-less', { 'on_ft' : ['less']}],
|
\ ['groenewege/vim-less', { 'on_ft' : ['less']}],
|
||||||
\ ['cakebaker/scss-syntax.vim', { 'on_ft' : ['scss','sass']}],
|
\ ['cakebaker/scss-syntax.vim', { 'on_ft' : ['scss','sass']}],
|
||||||
\ ['hail2u/vim-css3-syntax', { 'on_ft' : ['css','scss','sass']}],
|
\ ['hail2u/vim-css3-syntax', { 'on_ft' : ['css','scss','sass']}],
|
||||||
|
@ -47,6 +47,7 @@ function! SpaceVim#layers#lang#c#plugins() abort
|
|||||||
else
|
else
|
||||||
call add(plugins, ['Rip-Rip/clang_complete'])
|
call add(plugins, ['Rip-Rip/clang_complete'])
|
||||||
endif
|
endif
|
||||||
|
call add(plugins, ['lyuts/vim-rtags'])
|
||||||
return plugins
|
return plugins
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -4,7 +4,9 @@ function! SpaceVim#layers#lang#javascript#plugins() abort
|
|||||||
if has('nvim')
|
if has('nvim')
|
||||||
call add(plugins,['carlitux/deoplete-ternjs', { 'on_ft' : ['javascript']}])
|
call add(plugins,['carlitux/deoplete-ternjs', { 'on_ft' : ['javascript']}])
|
||||||
else
|
else
|
||||||
call add(plugins,['ternjs/tern_for_vim', { 'on_ft' : ['javascript']}])
|
call add(plugins,['ternjs/tern_for_vim', { 'on_ft' : ['javascript'],
|
||||||
|
\ 'build' : 'npm install',
|
||||||
|
\ }])
|
||||||
endif
|
endif
|
||||||
call add(plugins,['othree/javascript-libraries-syntax.vim', { 'on_ft' : ['javascript','coffee','ls','typescript']}])
|
call add(plugins,['othree/javascript-libraries-syntax.vim', { 'on_ft' : ['javascript','coffee','ls','typescript']}])
|
||||||
call add(plugins,['mmalecki/vim-node.js', { 'on_ft' : ['javascript']}])
|
call add(plugins,['mmalecki/vim-node.js', { 'on_ft' : ['javascript']}])
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
function! SpaceVim#layers#lang#php#plugins() abort
|
function! SpaceVim#layers#lang#php#plugins() abort
|
||||||
let plugins = []
|
let plugins = []
|
||||||
call add(plugins, ['php-vim/phpcd.vim', { 'on_ft' : 'php'}])
|
call add(plugins, ['php-vim/phpcd.vim', { 'on_ft' : 'php', 'build' : 'composer install'}])
|
||||||
call add(plugins, ['StanAngeloff/php.vim', { 'on_ft' : 'php'}])
|
call add(plugins, ['StanAngeloff/php.vim', { 'on_ft' : 'php'}])
|
||||||
call add(plugins, ['2072/PHP-Indenting-for-VIm', { 'on_ft' : 'php'}])
|
call add(plugins, ['2072/PHP-Indenting-for-VIm', { 'on_ft' : 'php'}])
|
||||||
call add(plugins, ['rafi/vim-phpspec', { 'on_ft' : 'php'}])
|
call add(plugins, ['rafi/vim-phpspec', { 'on_ft' : 'php'}])
|
||||||
|
@ -38,7 +38,11 @@ function! SpaceVim#mapping#def(type, key, value, ...) abort
|
|||||||
let gexe = substitute(gexe, '<Esc>', "\<Esc>", 'g')
|
let gexe = substitute(gexe, '<Esc>', "\<Esc>", 'g')
|
||||||
else
|
else
|
||||||
endif
|
endif
|
||||||
exec a:type . ' ' . a:key . ' ' . a:value
|
if g:spacevim_enable_key_frequency
|
||||||
|
exec a:type . ' <expr> ' . a:key . " SpaceVim#mapping#frequency#update('" . a:key . "', '" . a:value . "')"
|
||||||
|
else
|
||||||
|
exec a:type . ' ' . a:key . ' ' . a:value
|
||||||
|
endif
|
||||||
if a:0 > 0
|
if a:0 > 0
|
||||||
let desc = a:1
|
let desc = a:1
|
||||||
let description = '➤ '
|
let description = '➤ '
|
||||||
|
23
autoload/SpaceVim/mapping/enter.vim
Normal file
23
autoload/SpaceVim/mapping/enter.vim
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
|
||||||
|
if g:spacevim_snippet_engine ==# 'neosnippet'
|
||||||
|
function! SpaceVim#mapping#enter#i_enter() abort
|
||||||
|
if pumvisible()
|
||||||
|
if neosnippet#expandable()
|
||||||
|
return "\<plug>(neosnippet_expand)"
|
||||||
|
else
|
||||||
|
return "\<c-y>"
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
return "\<Enter>"
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
elseif g:spacevim_snippet_engine ==# 'ultisnips'
|
||||||
|
function! SpaceVim#mapping#enter#i_enter() abort
|
||||||
|
if pumvisible()
|
||||||
|
return "\<c-y>"
|
||||||
|
else
|
||||||
|
return "\<Enter>"
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
|
" vim:set et sw=2 cc=80:
|
31
autoload/SpaceVim/mapping/frequency.vim
Normal file
31
autoload/SpaceVim/mapping/frequency.vim
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
let s:data = {}
|
||||||
|
|
||||||
|
function! SpaceVim#mapping#frequency#update(key, rhs) abort
|
||||||
|
if has_key(s:data, a:key)
|
||||||
|
let s:data[a:key] += 1
|
||||||
|
else
|
||||||
|
let s:data[a:key] = 1
|
||||||
|
endif
|
||||||
|
return a:rhs
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! SpaceVim#mapping#frequency#view(keys) abort
|
||||||
|
if type(a:keys) == 1
|
||||||
|
echo 'The frequency of ' . a:keys . ' is ' . s:get(a:keys)
|
||||||
|
elseif type(a:keys) == 3
|
||||||
|
for key in a:keys
|
||||||
|
call SpaceVim#mapping#frequency#view(key)
|
||||||
|
endfor
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
function! SpaceVim#mapping#frequency#viewall() abort
|
||||||
|
echo string(s:data)
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:get(key) abort
|
||||||
|
if has_key(s:data, a:key)
|
||||||
|
return s:data[a:key]
|
||||||
|
else
|
||||||
|
return 0
|
||||||
|
endif
|
||||||
|
endfunction
|
@ -154,6 +154,9 @@ endfunction
|
|||||||
|
|
||||||
function! SpaceVim#mapping#leader#defindDeniteLeader(key) abort
|
function! SpaceVim#mapping#leader#defindDeniteLeader(key) abort
|
||||||
if !empty(a:key)
|
if !empty(a:key)
|
||||||
|
if a:key == 'F'
|
||||||
|
nnoremap <leader>F F
|
||||||
|
endif
|
||||||
exe 'nnoremap <silent><nowait> [denite] :<c-u>LeaderGuide "' .
|
exe 'nnoremap <silent><nowait> [denite] :<c-u>LeaderGuide "' .
|
||||||
\ a:key . '"<CR>'
|
\ a:key . '"<CR>'
|
||||||
exe 'nmap ' .a:key . ' [denite]'
|
exe 'nmap ' .a:key . ' [denite]'
|
||||||
@ -185,6 +188,9 @@ endfunction
|
|||||||
|
|
||||||
function! SpaceVim#mapping#leader#defindUniteLeader(key) abort
|
function! SpaceVim#mapping#leader#defindUniteLeader(key) abort
|
||||||
if !empty(a:key)
|
if !empty(a:key)
|
||||||
|
if a:key == 'f'
|
||||||
|
nnoremap <leader>f f
|
||||||
|
endif
|
||||||
" The prefix key.
|
" The prefix key.
|
||||||
exe 'nnoremap <silent><nowait> [unite] :<c-u>LeaderGuide "' .
|
exe 'nnoremap <silent><nowait> [unite] :<c-u>LeaderGuide "' .
|
||||||
\ a:key . '"<CR>'
|
\ a:key . '"<CR>'
|
||||||
|
32
autoload/SpaceVim/mapping/tab.vim
Normal file
32
autoload/SpaceVim/mapping/tab.vim
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
if g:spacevim_snippet_engine ==# 'neosnippet'
|
||||||
|
function! SpaceVim#mapping#tab#i_tab() abort
|
||||||
|
if getline('.')[col('.')-2] ==# '{'&& pumvisible()
|
||||||
|
return "\<C-n>"
|
||||||
|
endif
|
||||||
|
if index(g:spacevim_plugin_groups, 'autocomplete') != -1
|
||||||
|
if neosnippet#expandable() && getline('.')[col('.')-2] ==# '(' && !pumvisible()
|
||||||
|
return "\<Plug>(neosnippet_expand)"
|
||||||
|
elseif neosnippet#jumpable()
|
||||||
|
\ && getline('.')[col('.')-2] ==# '(' && !pumvisible()
|
||||||
|
\ && !neosnippet#expandable()
|
||||||
|
return "\<plug>(neosnippet_jump)"
|
||||||
|
elseif neosnippet#expandable_or_jumpable() && getline('.')[col('.')-2] !=#'('
|
||||||
|
let g:wsd = 1
|
||||||
|
return "\<plug>(neosnippet_expand_or_jump)"
|
||||||
|
elseif pumvisible()
|
||||||
|
return "\<C-n>"
|
||||||
|
else
|
||||||
|
return "\<tab>"
|
||||||
|
endif
|
||||||
|
elseif pumvisible()
|
||||||
|
return "\<C-n>"
|
||||||
|
else
|
||||||
|
return "\<tab>"
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
elseif g:spacevim_snippet_engine ==# 'ultisnips'
|
||||||
|
function! SpaceVim#mapping#tab#i_tab() abort
|
||||||
|
return "\<tab>"
|
||||||
|
endfunction
|
||||||
|
endif
|
||||||
|
" vim:set et sw=2 cc=80:
|
@ -16,9 +16,9 @@ function! s:load_plugins() abort
|
|||||||
call zvim#plug#add(plugin[0], plugin[1])
|
call zvim#plug#add(plugin[0], plugin[1])
|
||||||
if zvim#plug#tap(split(plugin[0], '/')[-1]) && get(plugin[1], 'loadconf', 0 )
|
if zvim#plug#tap(split(plugin[0], '/')[-1]) && get(plugin[1], 'loadconf', 0 )
|
||||||
call zvim#plug#defind_hooks(split(plugin[0], '/')[-1])
|
call zvim#plug#defind_hooks(split(plugin[0], '/')[-1])
|
||||||
if get(plugin[1], 'loadconf_before', 0 )
|
endif
|
||||||
call zvim#plug#loadPluginBefore(split(plugin[0], '/')[-1])
|
if zvim#plug#tap(split(plugin[0], '/')[-1]) && get(plugin[1], 'loadconf_before', 0 )
|
||||||
endif
|
call zvim#plug#loadPluginBefore(split(plugin[0], '/')[-1])
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
call zvim#plug#add(plugin[0])
|
call zvim#plug#add(plugin[0])
|
||||||
|
51
autoload/vimfiler/columns/filetypeicon.vim
Normal file
51
autoload/vimfiler/columns/filetypeicon.vim
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
scriptencoding utf-8
|
||||||
|
|
||||||
|
let s:FILE = SpaceVim#api#import('file')
|
||||||
|
|
||||||
|
let s:fish = &shell =~# 'fish'
|
||||||
|
|
||||||
|
function! vimfiler#columns#filetypeicon#define() abort
|
||||||
|
return s:column
|
||||||
|
endfunction"}}}
|
||||||
|
|
||||||
|
let s:column = {
|
||||||
|
\ 'name' : 'filetypeicon',
|
||||||
|
\ 'description' : 'plugin for vimfiler that provides filetype icon',
|
||||||
|
\ 'syntax' : 'vimfilerColumn__FileType',
|
||||||
|
\ }
|
||||||
|
|
||||||
|
" @vimlint(EVL103, 1, a:files)
|
||||||
|
" @vimlint(EVL103, 1, a:context)
|
||||||
|
function! s:column.length(files, context) abort
|
||||||
|
return 3
|
||||||
|
endfunction
|
||||||
|
" @vimlint(EVL103, 0, a:files)
|
||||||
|
" @vimlint(EVL103, 0, a:context)
|
||||||
|
|
||||||
|
" @vimlint(EVL103, 1, a:context)
|
||||||
|
function! s:column.define_syntax(context) abort
|
||||||
|
endfunction
|
||||||
|
" @vimlint(EVL103, 0, a:context)
|
||||||
|
|
||||||
|
" @vimlint(EVL103, 1, a:context)
|
||||||
|
function! s:column.get(file, context) abort
|
||||||
|
if a:file.vimfiler__is_directory
|
||||||
|
return ' '
|
||||||
|
else
|
||||||
|
let icon = s:FILE.fticon(a:file.action__path)
|
||||||
|
|
||||||
|
if !empty(icon)
|
||||||
|
return '[' . icon . ']'
|
||||||
|
else
|
||||||
|
return ' '
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
" @vimlint(EVL103, 0, a:context)
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
unlet s:save_cpo
|
||||||
|
|
||||||
|
" vim:set et sw=2:
|
@ -148,7 +148,7 @@ let s:plugins = []
|
|||||||
fu! s:parser(args) abort
|
fu! s:parser(args) abort
|
||||||
return a:args
|
return a:args
|
||||||
endf
|
endf
|
||||||
|
let g:_spacevim_plugins = []
|
||||||
function! zvim#plug#add(repo,...) abort
|
function! zvim#plug#add(repo,...) abort
|
||||||
let g:spacevim_plugin_name = ''
|
let g:spacevim_plugin_name = ''
|
||||||
if g:spacevim_plugin_manager ==# 'neobundle'
|
if g:spacevim_plugin_manager ==# 'neobundle'
|
||||||
@ -161,6 +161,7 @@ function! zvim#plug#add(repo,...) abort
|
|||||||
call dein#add(a:repo)
|
call dein#add(a:repo)
|
||||||
endif
|
endif
|
||||||
let g:spacevim_plugin_name = g:dein#name
|
let g:spacevim_plugin_name = g:dein#name
|
||||||
|
call add(g:_spacevim_plugins, g:dein#name)
|
||||||
elseif g:spacevim_plugin_manager ==# 'vim-plug'
|
elseif g:spacevim_plugin_manager ==# 'vim-plug'
|
||||||
if len(a:000) > 0
|
if len(a:000) > 0
|
||||||
exec "Plug '".a:repo."', ".join(a:000,',')
|
exec "Plug '".a:repo."', ".join(a:000,',')
|
||||||
|
@ -25,7 +25,7 @@ let g:neocomplete#enable_auto_delimiter = get(g:, 'neocomplete#enable_auto_delim
|
|||||||
if !exists('g:neocomplete#keyword_patterns')
|
if !exists('g:neocomplete#keyword_patterns')
|
||||||
let g:neocomplete#keyword_patterns = {}
|
let g:neocomplete#keyword_patterns = {}
|
||||||
endif
|
endif
|
||||||
let g:neocomplete#keyword_patterns._ = get(g:neocomplete#keyword_pattern, '_', '\h\k*(\?')
|
let g:neocomplete#keyword_patterns._ = get(g:neocomplete#keyword_patterns, '_', '\h\k*(\?')
|
||||||
|
|
||||||
" AutoComplPop like behavior.
|
" AutoComplPop like behavior.
|
||||||
let g:neocomplete#enable_auto_select = 0
|
let g:neocomplete#enable_auto_select = 0
|
||||||
|
@ -1,17 +1,26 @@
|
|||||||
let g:neosnippet#snippets_directory = get(g:,'neosnippet#snippets_directory', '')
|
let g:neosnippet#snippets_directory = get(g:,'neosnippet#snippets_directory',
|
||||||
|
\ '')
|
||||||
if empty(g:neosnippet#snippets_directory)
|
if empty(g:neosnippet#snippets_directory)
|
||||||
let g:neosnippet#snippets_directory = [expand('~/.SpaceVim/snippets/'), expand('~/.SpaceVim.d/snippets/')]
|
let g:neosnippet#snippets_directory = [expand('~/.SpaceVim/snippets/'),
|
||||||
|
\ expand('~/.SpaceVim.d/snippets/')]
|
||||||
elseif type(g:spacevim_force_global_config) == type('')
|
elseif type(g:spacevim_force_global_config) == type('')
|
||||||
let g:neosnippet#snippets_directory = [expand('~/.SpaceVim/snippets/'), expand('~/.SpaceVim.d/snippets/')] + [g:neosnippet#snippets_directory]
|
let g:neosnippet#snippets_directory = [expand('~/.SpaceVim/snippets/'),
|
||||||
|
\ expand('~/.SpaceVim.d/snippets/')] +
|
||||||
|
\ [g:neosnippet#snippets_directory]
|
||||||
elseif type(g:spacevim_force_global_config) == type([])
|
elseif type(g:spacevim_force_global_config) == type([])
|
||||||
let g:neosnippet#snippets_directory = [expand('~/.SpaceVim/snippets/'), expand('~/.SpaceVim.d/snippets/')] + g:neosnippet#snippets_directory
|
let g:neosnippet#snippets_directory = [expand('~/.SpaceVim/snippets/'),
|
||||||
|
\ expand('~/.SpaceVim.d/snippets/')] +
|
||||||
|
\ g:neosnippet#snippets_directory
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if g:spacevim_force_global_config == 0
|
if g:spacevim_force_global_config == 0
|
||||||
let g:neosnippet#snippets_directory = [getcwd() . '/.Spacevim.d/snippets'] + g:neosnippet#snippets_directory
|
let g:neosnippet#snippets_directory = [getcwd() . '/.Spacevim.d/snippets'] +
|
||||||
|
\ g:neosnippet#snippets_directory
|
||||||
endif
|
endif
|
||||||
let g:neosnippet#enable_snipmate_compatibility = get(g:, 'neosnippet#enable_snipmate_compatibility', 1)
|
let g:neosnippet#enable_snipmate_compatibility =
|
||||||
let g:neosnippet#enable_complete_done = get(g:, 'neosnippet#enable_complete_done', 1)
|
\ get(g:, 'neosnippet#enable_snipmate_compatibility', 1)
|
||||||
|
let g:neosnippet#enable_complete_done =
|
||||||
|
\ get(g:, 'neosnippet#enable_complete_done', 1)
|
||||||
|
|
||||||
if !exists('g:neosnippet#completed_pairs')
|
if !exists('g:neosnippet#completed_pairs')
|
||||||
let g:neosnippet#completed_pairs = {}
|
let g:neosnippet#completed_pairs = {}
|
||||||
@ -20,19 +29,5 @@ let g:neosnippet#completed_pairs.java = {'(' : ')'}
|
|||||||
if g:neosnippet#enable_complete_done
|
if g:neosnippet#enable_complete_done
|
||||||
let g:neopairs#enable = 0
|
let g:neopairs#enable = 0
|
||||||
endif
|
endif
|
||||||
augroup neosnippet_complete_done
|
|
||||||
autocmd!
|
|
||||||
autocmd CompleteDone * call s:my_complete_done()
|
|
||||||
augroup END
|
|
||||||
function! s:my_complete_done() abort "{{{
|
|
||||||
if !empty(get(v:,'completed_item',''))
|
|
||||||
let snippet = neosnippet#parser#_get_completed_snippet(v:completed_item,neosnippet#util#get_cur_text(), neosnippet#util#get_next_text())
|
|
||||||
if snippet ==# ''
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
let [cur_text, col] = neosnippet#mappings#_pre_trigger()[0:1]
|
|
||||||
call neosnippet#view#_insert(snippet, {}, cur_text, col)
|
|
||||||
endif
|
|
||||||
endfunction"}}}
|
|
||||||
|
|
||||||
" vim:set et sw=2:
|
" vim:set et sw=2 cc=80:
|
||||||
|
@ -262,10 +262,6 @@ call unite#custom#profile('buffer,buffer_tab', 'context', {
|
|||||||
\ 'keep_focus' : 1,
|
\ 'keep_focus' : 1,
|
||||||
\ })
|
\ })
|
||||||
nnoremap <silent><leader>um :<C-u>Unite -start-insert mapping<CR>
|
nnoremap <silent><leader>um :<C-u>Unite -start-insert mapping<CR>
|
||||||
"" Tag search
|
|
||||||
""" For searching the word in the cursor in tag file
|
|
||||||
nnoremap <silent><leader>f :<c-u>Unite tag/include:<C-R><C-w><CR>
|
|
||||||
nnoremap <silent><leader>ff :<c-u>Unite tag/include -start-insert<CR>
|
|
||||||
"" grep dictionay
|
"" grep dictionay
|
||||||
""" For searching the word in the cursor in the current directory
|
""" For searching the word in the cursor in the current directory
|
||||||
nnoremap <silent><leader>v :Unite
|
nnoremap <silent><leader>v :Unite
|
||||||
|
@ -23,24 +23,37 @@ if has('mac')
|
|||||||
else
|
else
|
||||||
let g:vimfiler_quick_look_command = 'gloobus-preview'
|
let g:vimfiler_quick_look_command = 'gloobus-preview'
|
||||||
endif
|
endif
|
||||||
try
|
function! s:setcolum() abort
|
||||||
call vimfiler#custom#profile('default', 'context', {
|
if g:spacevim_enable_vimfiler_filetypeicon && !g:spacevim_enable_vimfiler_gitstatus
|
||||||
\ 'explorer' : 1,
|
return 'filetypeicon'
|
||||||
\ 'winwidth' : g:spacevim_sidebar_width,
|
elseif !g:spacevim_enable_vimfiler_filetypeicon && g:spacevim_enable_vimfiler_gitstatus
|
||||||
\ 'winminwidth' : 30,
|
return 'gitstatus'
|
||||||
\ 'toggle' : 1,
|
elseif g:spacevim_enable_vimfiler_filetypeicon && g:spacevim_enable_vimfiler_gitstatus
|
||||||
\ 'auto_expand': 1,
|
return 'filetypeicon:gitstatus'
|
||||||
\ 'direction' : 'rightbelow',
|
else
|
||||||
\ 'parent': 0,
|
return ''
|
||||||
\ 'status' : 1,
|
endif
|
||||||
\ 'safe' : 0,
|
endfunction
|
||||||
\ 'split' : 1,
|
"try
|
||||||
\ 'hidden': 1,
|
call vimfiler#custom#profile('default', 'context', {
|
||||||
\ 'no_quit' : 1,
|
\ 'explorer' : 1,
|
||||||
\ 'force_hide' : 0,
|
\ 'winwidth' : g:spacevim_sidebar_width,
|
||||||
\ })
|
\ 'winminwidth' : 30,
|
||||||
catch
|
\ 'toggle' : 1,
|
||||||
endtry
|
\ 'auto_expand': 1,
|
||||||
|
\ 'direction' : 'rightbelow',
|
||||||
|
\ 'explorer_columns' : s:setcolum(),
|
||||||
|
\ 'parent': 0,
|
||||||
|
\ 'status' : 1,
|
||||||
|
\ 'safe' : 0,
|
||||||
|
\ 'split' : 1,
|
||||||
|
\ 'hidden': 1,
|
||||||
|
\ 'no_quit' : 1,
|
||||||
|
\ 'force_hide' : 0,
|
||||||
|
\ })
|
||||||
|
|
||||||
|
"catch
|
||||||
|
"endtry
|
||||||
augroup vfinit
|
augroup vfinit
|
||||||
au!
|
au!
|
||||||
autocmd FileType vimfiler call s:vimfilerinit()
|
autocmd FileType vimfiler call s:vimfilerinit()
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
|
" If you want :UltiSnipsEdit to split your window.
|
||||||
|
let g:UltiSnipsEditSplit="vertical"
|
||||||
let g:UltiSnipsExpandTrigger='<tab>'
|
let g:UltiSnipsExpandTrigger='<tab>'
|
||||||
|
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
|
||||||
let g:UltiSnipsJumpForwardTrigger='<tab>'
|
let g:UltiSnipsJumpForwardTrigger='<tab>'
|
||||||
let g:UltiSnipsJumpBackwardTrigger='<S-tab>'
|
let g:UltiSnipsSnippetsDir = '~/.SpaceVim.d/UltiSnips'
|
||||||
let g:UltiSnipsSnippetsDir='~/DotFiles/snippets'
|
|
||||||
|
@ -116,6 +116,13 @@ Enable/Disable realtime leader guide. Default is 0.
|
|||||||
let g:spacevim_realtime_leader_guide = 1
|
let g:spacevim_realtime_leader_guide = 1
|
||||||
<
|
<
|
||||||
|
|
||||||
|
*g:spacevim_enable_key_frequency*
|
||||||
|
Enable/Disable key frequency catching of SpaceVim. default value is 0. to
|
||||||
|
enable it:
|
||||||
|
>
|
||||||
|
let g:spacevim_enable_key_frequency = 1
|
||||||
|
<
|
||||||
|
|
||||||
*g:spacevim_enable_neomake*
|
*g:spacevim_enable_neomake*
|
||||||
SpaceVim default checker is neomake. If you want to use syntastic, use:
|
SpaceVim default checker is neomake. If you want to use syntastic, use:
|
||||||
>
|
>
|
||||||
@ -138,6 +145,13 @@ Enable/Disable YouCompleteMe. Default is 0.
|
|||||||
Set the width of the SpaceVim sidebar. Default is 30. This value will be used
|
Set the width of the SpaceVim sidebar. Default is 30. This value will be used
|
||||||
by tagbar and vimfiler.
|
by tagbar and vimfiler.
|
||||||
|
|
||||||
|
*g:spacevim_snippet_engine*
|
||||||
|
Set the snippet engine of SpaceVim, default is neosnippet. to enable
|
||||||
|
ultisnips:
|
||||||
|
>
|
||||||
|
let g:spacevim_snippet_engine = 'ultisnips'
|
||||||
|
<
|
||||||
|
|
||||||
*g:spacevim_enable_cursorline*
|
*g:spacevim_enable_cursorline*
|
||||||
Enable/Disable cursorline. Default is 0.
|
Enable/Disable cursorline. Default is 0.
|
||||||
>
|
>
|
||||||
@ -282,6 +296,12 @@ vim to start up slowly if there are too many files in the current directory.
|
|||||||
let g:spacevim_enable_vimfiler_welcome = 0
|
let g:spacevim_enable_vimfiler_welcome = 0
|
||||||
<
|
<
|
||||||
|
|
||||||
|
*g:spacevim_enable_vimfiler_gitstatus*
|
||||||
|
Enable/Disable gitstatus colum in vimfiler buffer, default is 0.
|
||||||
|
|
||||||
|
*g:spacevim_enable_vimfiler_filetypeicon*
|
||||||
|
Enable/Disable filetypeicon colum in vimfiler buffer, default is 0.
|
||||||
|
|
||||||
*g:spacevim_hosts_url*
|
*g:spacevim_hosts_url*
|
||||||
The host file url. This option is for Chinese users who can not use Google and
|
The host file url. This option is for Chinese users who can not use Google and
|
||||||
Twitter.
|
Twitter.
|
||||||
@ -314,6 +334,12 @@ COMMANDS *SpaceVim-commands*
|
|||||||
:SPConfig -g
|
:SPConfig -g
|
||||||
<
|
<
|
||||||
|
|
||||||
|
:SPUpdate *:SPUpdate*
|
||||||
|
Command for update plugin, support completion of plugin name.
|
||||||
|
>
|
||||||
|
:SPUpdate vim-airline
|
||||||
|
<
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
FUNCTIONS *SpaceVim-functions*
|
FUNCTIONS *SpaceVim-functions*
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user