mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 07:20:04 +08:00
Clone from wsdjeg/Dotfiles/config/nvim
This commit is contained in:
parent
71b387a755
commit
c0ad3bf837
38
autoload/zvim.vim
Normal file
38
autoload/zvim.vim
Normal file
@ -0,0 +1,38 @@
|
||||
function! zvim#tab() abort
|
||||
if getline('.')[col('.')-2] ==# '{'&& pumvisible()
|
||||
return "\<C-n>"
|
||||
endif
|
||||
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] !=#'('
|
||||
return "\<plug>(neosnippet_expand_or_jump)"
|
||||
elseif pumvisible()
|
||||
return "\<C-n>"
|
||||
else
|
||||
return "\<tab>"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! zvim#enter() abort
|
||||
if pumvisible()
|
||||
if getline('.')[col('.') - 2]==# '{'
|
||||
return "\<Enter>"
|
||||
elseif g:settings.autocomplete_method ==# 'neocomplete'||g:settings.autocomplete_method ==# 'deoplete'
|
||||
return "\<C-y>"
|
||||
else
|
||||
return "\<esc>a"
|
||||
endif
|
||||
elseif getline('.')[col('.') - 2]==#'{'&&getline('.')[col('.')-1]==#'}'
|
||||
return "\<Enter>\<esc>ko"
|
||||
else
|
||||
return "\<Enter>"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! zvim#format() abort
|
||||
let save_cursor = getcurpos()
|
||||
normal! gg=G
|
||||
call setpos('.', save_cursor)
|
||||
endfunction
|
13
autoload/zvim/debug.vim
Normal file
13
autoload/zvim/debug.vim
Normal file
@ -0,0 +1,13 @@
|
||||
let s:debug_message = []
|
||||
function! zvim#debug#completion_debug(ArgLead, CmdLine, CursorPos) abort
|
||||
call add(s:debug_message, "arglead:[".a:ArgLead ."] cmdline:[" .a:CmdLine ."] cursorpos:[" .a:CursorPos ."]")
|
||||
endfunction
|
||||
|
||||
function! zvim#debug#get_message() abort
|
||||
return join(s:debug_message, "\n")
|
||||
endfunction
|
||||
|
||||
function! zvim#debug#clean_message() abort
|
||||
let s:debug_message = []
|
||||
return s:debug_message
|
||||
endfunction
|
34
autoload/zvim/mpv.vim
Normal file
34
autoload/zvim/mpv.vim
Normal file
@ -0,0 +1,34 @@
|
||||
let s:playId = 0
|
||||
fu! s:handler(id, data, event) abort
|
||||
if a:event ==# 'exit'
|
||||
echom 'job ' . a:id . ' exit with code:' . string(a:data)
|
||||
let s:playId = 0
|
||||
endif
|
||||
endf
|
||||
function! zvim#mpv#stop() abort
|
||||
if s:playId != 0
|
||||
call jobstop(s:playId)
|
||||
let s:playId = 0
|
||||
endif
|
||||
delcommand MStop
|
||||
endfunction
|
||||
function! zvim#mpv#play(file,...) abort
|
||||
if has('nvim')
|
||||
if s:playId != 0
|
||||
call jobstop(s:playId)
|
||||
let s:playId = 0
|
||||
endif
|
||||
let s:playId = jobstart(['mpv','--vid=no',a:file],{
|
||||
\ 'on_stdout': function('s:handler'),
|
||||
\ 'on_stderr': function('s:handler'),
|
||||
\ 'on_exit': function('s:handler'),
|
||||
\ })
|
||||
else
|
||||
if type(s:playId) == 8 && job_status(s:playId) ==# 'run'
|
||||
call job_stop(s:playId)
|
||||
let s:playId =0
|
||||
endif
|
||||
let s:playId = job_start(['mpv','--vid=no',a:file])
|
||||
endif
|
||||
command! MStop call zvim#mpv#stop()
|
||||
endfunction
|
185
autoload/zvim/plug.vim
Normal file
185
autoload/zvim/plug.vim
Normal file
@ -0,0 +1,185 @@
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
function! s:install_manager()
|
||||
" Fsep && Psep
|
||||
if has('win16') || has('win32') || has('win64')
|
||||
let s:Psep = ';'
|
||||
let s:Fsep = '\'
|
||||
else
|
||||
let s:Psep = ':'
|
||||
let s:Fsep = '/'
|
||||
endif
|
||||
" auto install plugin manager
|
||||
if g:settings.plugin_manager ==# 'neobundle'
|
||||
"auto install neobundle
|
||||
if filereadable(expand(g:settings.plugin_bundle_dir)
|
||||
\ . 'neobundle.vim'. s:Fsep. 'README.md')
|
||||
let g:settings.neobundle_installed = 1
|
||||
else
|
||||
if executable('git')
|
||||
exec '!git clone '
|
||||
\ .'https://github.com/'
|
||||
\ .'Shougo/neobundle.vim'
|
||||
\ . ' '
|
||||
\ . g:settings.plugin_bundle_dir
|
||||
\ . 'neobundle.vim'
|
||||
let g:settings.neobundle_installed = 1
|
||||
else
|
||||
echohl WarningMsg
|
||||
echom "You need install git!"
|
||||
echohl None
|
||||
endif
|
||||
endif
|
||||
exec 'set runtimepath+='
|
||||
\ . g:settings.plugin_bundle_dir
|
||||
\ . 'neobundle.vim'
|
||||
elseif g:settings.plugin_manager == 'dein'
|
||||
"auto install dein
|
||||
if filereadable(expand(g:settings.plugin_bundle_dir)
|
||||
\ . join(['repos', 'github.com',
|
||||
\ 'Shougo', 'dein.vim', 'README.md'],
|
||||
\ s:Fsep))
|
||||
let g:settings.dein_installed = 1
|
||||
else
|
||||
if executable('git')
|
||||
exec '!git clone https://github.com/Shougo/dein.vim '
|
||||
\ . g:settings.plugin_bundle_dir
|
||||
\ . join(['repos', 'github.com',
|
||||
\ 'Shougo', 'dein.vim'], s:Fsep)
|
||||
let g:settings.dein_installed = 1
|
||||
else
|
||||
echohl WarningMsg
|
||||
echom "You need install git!"
|
||||
echohl None
|
||||
endif
|
||||
endif
|
||||
exec 'set runtimepath+='.g:settings.plugin_bundle_dir
|
||||
\ . join(['repos', 'github.com', 'Shougo',
|
||||
\ 'dein.vim'], s:Fsep)
|
||||
elseif g:settings.plugin_manager == 'vim-plug'
|
||||
"auto install vim-plug
|
||||
if filereadable(expand('~/.cache/vim-plug/autoload/plug.vim'))
|
||||
let g:settings.dein_installed = 1
|
||||
else
|
||||
if executable('curl')
|
||||
exec '!curl -fLo '
|
||||
\ . '~/.cache/vim-plug/autoload/plug.vim'
|
||||
\ . ' --create-dirs '
|
||||
\ . 'https://raw.githubusercontent.com/'
|
||||
\ . 'junegunn/vim-plug/master/plug.vim'
|
||||
let g:settings.dein_installed = 1
|
||||
else
|
||||
echohl WarningMsg
|
||||
echom "You need install curl!"
|
||||
echohl None
|
||||
endif
|
||||
endif
|
||||
exec 'set runtimepath+=~/.cache/vim-plug/'
|
||||
endif
|
||||
endf
|
||||
|
||||
if get(g:settings, 'enable_plugins', 1)
|
||||
call s:install_manager()
|
||||
endif
|
||||
|
||||
function! zvim#plug#begin(path) abort
|
||||
let g:unite_source_menu_menus.AddedPlugins =
|
||||
\ {'description':
|
||||
\ 'All the Added plugins'
|
||||
\ . ' <leader>lp'}
|
||||
let g:unite_source_menu_menus.AddedPlugins.command_candidates = []
|
||||
nnoremap <silent><Leader>lp :Unite -silent
|
||||
\ -winheight=17 -start-insert menu:AddedPlugins<CR>
|
||||
if g:settings.plugin_manager == 'neobundle'
|
||||
call neobundle#begin(a:path)
|
||||
elseif g:settings.plugin_manager == 'dein'
|
||||
call dein#begin(a:path)
|
||||
elseif g:settings.plugin_manager == 'vim-plug'
|
||||
call plug#begin(a:path)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! zvim#plug#end() abort
|
||||
if g:settings.plugin_manager == 'neobundle'
|
||||
call neobundle#end()
|
||||
if g:settings.checkinstall == 1
|
||||
NeoBundleCheck
|
||||
endif
|
||||
elseif g:settings.plugin_manager == 'dein'
|
||||
call dein#end()
|
||||
if g:settings.checkinstall == 1
|
||||
if dein#check_install()
|
||||
call dein#install()
|
||||
endif
|
||||
endif
|
||||
call dein#call_hook('source')
|
||||
elseif g:settings.plugin_manager == 'vim-plug'
|
||||
call plug#end()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! zvim#plug#defind_hooks(bundle) abort
|
||||
if g:settings.plugin_manager == 'neobundle'
|
||||
let s:hooks = neobundle#get_hooks(a:bundle)
|
||||
func! s:hooks.on_source(bundle) abort
|
||||
call zvim#util#source_rc('plugins/' . split(a:bundle['name'],'\.')[0] . '.vim')
|
||||
endf
|
||||
elseif g:settings.plugin_manager == 'dein'
|
||||
call dein#config(g:dein#name, {
|
||||
\ 'hook_source' : "call zvim#util#source_rc('plugins/" . split(g:dein#name,'\.')[0] . ".vim')"
|
||||
\ })
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! zvim#plug#fetch() abort
|
||||
if g:settings.plugin_manager == 'neobundle'
|
||||
NeoBundleFetch 'Shougo/neobundle.vim'
|
||||
elseif g:settings.plugin_manager == 'dein'
|
||||
call dein#add('Shougo/dein.vim')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:plugins = []
|
||||
|
||||
fu! s:parser(args)
|
||||
return a:args
|
||||
endf
|
||||
|
||||
function! zvim#plug#add(repo,...) abort
|
||||
if g:settings.plugin_manager == 'neobundle'
|
||||
exec 'NeoBundle "'.a:repo.'"'.','.join(a:000,',')
|
||||
elseif g:settings.plugin_manager == 'dein'
|
||||
if len(a:000) > 0
|
||||
call dein#add(a:repo,s:parser(a:000[0]))
|
||||
else
|
||||
call dein#add(a:repo)
|
||||
endif
|
||||
endif
|
||||
exec 'call add(g:unite_source_menu_menus'
|
||||
\ . '.AddedPlugins.command_candidates, ["['
|
||||
\ . a:repo
|
||||
\ . (len(a:000) > 0 ? (']'
|
||||
\ . repeat(' ', 40 - len(a:repo))
|
||||
\ . '[lazy loaded] [' . string(a:000[0])) : '')
|
||||
\ . ']","OpenBrowser https://github.com/'
|
||||
\ . a:repo
|
||||
\ . '"])'
|
||||
call add(s:plugins, a:repo)
|
||||
endfunction
|
||||
|
||||
function! zvim#plug#tap(plugin) abort
|
||||
if g:settings.plugin_manager == 'neobundle'
|
||||
return neobundle#tap(a:plugin)
|
||||
elseif g:settings.plugin_manager == 'dein'
|
||||
return dein#tap(a:plugin)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! zvim#plug#enable_plug() abort
|
||||
return g:settings.neobundle_installed
|
||||
\ || g:settings.dein_installed
|
||||
\ || g:settings.vim_plug_installed
|
||||
endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
269
autoload/zvim/util.vim
Normal file
269
autoload/zvim/util.vim
Normal file
@ -0,0 +1,269 @@
|
||||
scriptencoding utf-8
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
let g:unite_source_menu_menus =
|
||||
\ get(g:,'unite_source_menu_menus',{})
|
||||
let g:unite_source_menu_menus.CustomKeyMaps = {'description':
|
||||
\ 'Custom mapped keyboard shortcuts [unite]<SPACE>'}
|
||||
let g:unite_source_menu_menus.CustomKeyMaps.command_candidates =
|
||||
\ get(g:unite_source_menu_menus.CustomKeyMaps,'command_candidates', [])
|
||||
let g:unite_source_menu_menus.MyStarredrepos = {'description':
|
||||
\ 'All github repos starred by me <leader>ls'}
|
||||
let g:unite_source_menu_menus.MyStarredrepos.command_candidates =
|
||||
\ get(g:unite_source_menu_menus.MyStarredrepos,'command_candidates', [])
|
||||
let g:unite_source_menu_menus.MpvPlayer = {'description':
|
||||
\ 'Musics list <leader>lm'}
|
||||
let g:unite_source_menu_menus.MpvPlayer.command_candidates =
|
||||
\ get(g:unite_source_menu_menus.MpvPlayer,'command_candidates', [])
|
||||
fu! zvim#util#defineMap(type,key,value,desc,...) abort
|
||||
exec a:type . ' ' . a:key . ' ' . a:value
|
||||
let description = '➤ '
|
||||
\. a:desc
|
||||
\. repeat(' ', 80 - len(a:desc) - len(a:key))
|
||||
\. a:key
|
||||
let cmd = len(a:000) > 0 ? a:000[0] : a:value
|
||||
call add(g:unite_source_menu_menus.CustomKeyMaps.command_candidates, [description,cmd])
|
||||
|
||||
endf
|
||||
fu! zvim#util#source_rc(file) abort
|
||||
if filereadable(g:Config_Main_Home. '/' . a:file)
|
||||
execute 'source ' . g:Config_Main_Home . '/' . a:file
|
||||
endif
|
||||
endf
|
||||
|
||||
fu! zvim#util#SmartClose() abort
|
||||
let ignorewin = get(g:settings,'smartcloseignorewin',[])
|
||||
let ignoreft = get(g:settings,'smartcloseignoreft',[])
|
||||
let win_count = winnr('$')
|
||||
let num = win_count
|
||||
for i in range(1,win_count)
|
||||
if index(ignorewin , bufname(winbufnr(i))) != -1 || index(ignoreft, getbufvar(bufname(winbufnr(i)),'&filetype')) != -1
|
||||
let num = num - 1
|
||||
endif
|
||||
if getbufvar(winbufnr(i),'&buftype') ==# 'quickfix'
|
||||
let num = num - 1
|
||||
endif
|
||||
endfor
|
||||
if num == 1
|
||||
else
|
||||
close
|
||||
endif
|
||||
endf
|
||||
|
||||
fu! s:findFileInParent(what, where) abort " {{{2
|
||||
let old_suffixesadd = &suffixesadd
|
||||
let &suffixesadd = ''
|
||||
let file = findfile(a:what, escape(a:where, ' ') . ';')
|
||||
let &suffixesadd = old_suffixesadd
|
||||
return file
|
||||
endf " }}}2
|
||||
fu! s:findDirInParent(what, where) abort " {{{2
|
||||
let old_suffixesadd = &suffixesadd
|
||||
let &suffixesadd = ''
|
||||
let dir = finddir(a:what, escape(a:where, ' ') . ';')
|
||||
let &suffixesadd = old_suffixesadd
|
||||
return dir
|
||||
endf " }}}2
|
||||
fu! zvim#util#CopyToClipboard(...) abort
|
||||
if a:0
|
||||
if executable('git')
|
||||
let repo_home = fnamemodify(s:findDirInParent('.git', expand('%:p')), ':p:h:h')
|
||||
if repo_home !=# '' || !isdirectory(repo_home)
|
||||
let branch = split(systemlist('git -C '. repo_home. ' branch -a |grep "*"')[0],' ')[1]
|
||||
let remotes = filter(systemlist('git -C '. repo_home. ' remote -v'),"match(v:val,'^origin') >= 0 && match(v:val,'fetch') > 0")
|
||||
if len(remotes) > 0
|
||||
let remote = remotes[0]
|
||||
if stridx(remote, '@') > -1
|
||||
let repo_url = 'https://github.com/'. split(split(remote,' ')[0],':')[1]
|
||||
let repo_url = strpart(repo_url, 0, len(repo_url) - 4)
|
||||
else
|
||||
let repo_url = split(remote,' ')[0]
|
||||
let repo_url = strpart(repo_url, stridx(repo_url, 'http'),len(repo_url) - 4 - stridx(repo_url, 'http'))
|
||||
endif
|
||||
let f_url =repo_url. '/blob/'. branch. '/'. strpart(expand('%:p'), len(repo_home) + 1, len(expand('%:p')))
|
||||
if WINDOWS()
|
||||
let f_url = substitute(f_url, '\', '/', 'g')
|
||||
endif
|
||||
if a:1 == 2
|
||||
let current_line = line('.')
|
||||
let f_url .= '#L' . current_line
|
||||
elseif a:1 == 3
|
||||
let f_url .= '#L' . getpos("'<")[1] . '-L' . getpos("'>")[1]
|
||||
endif
|
||||
let @+=f_url
|
||||
echo 'Copied to clipboard'
|
||||
else
|
||||
echohl WarningMsg | echom 'This git repo has no remote host' | echohl None
|
||||
endif
|
||||
else
|
||||
echohl WarningMsg | echom 'This file is not in a git repo' | echohl None
|
||||
endif
|
||||
else
|
||||
echohl WarningMsg | echom 'You need install git!' | echohl None
|
||||
endif
|
||||
else
|
||||
let @+=expand('%:p')
|
||||
echo 'Copied to clipboard'
|
||||
endif
|
||||
endf
|
||||
|
||||
fu! zvim#util#check_if_expand_tab() abort
|
||||
let has_noexpandtab = search('^\t','wn')
|
||||
let has_expandtab = search('^ ','wn')
|
||||
if has_noexpandtab && has_expandtab
|
||||
let idx = inputlist ( ['ERROR: current file exists both expand and noexpand TAB, python can only use one of these two mode in one file.\nSelect Tab Expand Type:',
|
||||
\ '1. expand (tab=space, recommended)',
|
||||
\ '2. noexpand (tab=\t, currently have risk)',
|
||||
\ '3. do nothing (I will handle it by myself)'])
|
||||
let tab_space = printf('%*s',&tabstop,'')
|
||||
if idx == 1
|
||||
let has_noexpandtab = 0
|
||||
let has_expandtab = 1
|
||||
silent exec '%s/\t/' . tab_space . '/g'
|
||||
elseif idx == 2
|
||||
let has_noexpandtab = 1
|
||||
let has_expandtab = 0
|
||||
silent exec '%s/' . tab_space . '/\t/g'
|
||||
else
|
||||
return
|
||||
endif
|
||||
endif
|
||||
if has_noexpandtab == 1 && has_expandtab == 0
|
||||
echomsg 'substitute space to TAB...'
|
||||
set noexpandtab
|
||||
echomsg 'done!'
|
||||
elseif has_noexpandtab == 0 && has_expandtab == 1
|
||||
echomsg 'substitute TAB to space...'
|
||||
set expandtab
|
||||
echomsg 'done!'
|
||||
else
|
||||
" it may be a new file
|
||||
" we use original vim setting
|
||||
endif
|
||||
endf
|
||||
|
||||
function! zvim#util#BufferEmpty() abort
|
||||
let l:current = bufnr('%')
|
||||
if ! getbufvar(l:current, '&modified')
|
||||
enew
|
||||
silent! execute 'bdelete '.l:current
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! zvim#util#loadMusics() abort
|
||||
let musics = globpath('~/Musics', '*.mp3', 0, 1)
|
||||
let g:unite_source_menu_menus.MpvPlayer.command_candidates = []
|
||||
for m in musics
|
||||
call add(g:unite_source_menu_menus.MpvPlayer.command_candidates,
|
||||
\ [fnamemodify(m, ':t'),
|
||||
\ "call zvim#mpv#play('" . m . "')"])
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! zvim#util#listDirs(dir) abort
|
||||
let dir = fnamemodify(a:dir, ':p')
|
||||
if isdirectory(dir)
|
||||
let cmd = printf('ls -F %s | grep /$', dir)
|
||||
return map(systemlist(cmd), 'v:val[:-2]')
|
||||
endif
|
||||
return []
|
||||
endfunction
|
||||
|
||||
function! zvim#util#OpenVimfiler() abort
|
||||
if bufnr('vimfiler') == -1
|
||||
VimFiler
|
||||
AirlineRefresh
|
||||
wincmd p
|
||||
IndentLinesToggle
|
||||
IndentLinesToggle
|
||||
wincmd p
|
||||
else
|
||||
VimFiler
|
||||
AirlineRefresh
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let s:plugins_argv = ['-update', '-openurl']
|
||||
|
||||
function! zvim#util#complete_plugs(ArgLead, CmdLine, CursorPos) abort
|
||||
call zvim#debug#completion_debug(a:ArgLead, a:CmdLine, a:CursorPos)
|
||||
if a:CmdLine =~# 'Plugin\s*$' || a:ArgLead =~# '^-[a-zA-Z]*'
|
||||
return join(s:plugins_argv, "\n")
|
||||
endif
|
||||
return join(plugins#list(), "\n")
|
||||
endfunction
|
||||
|
||||
function! zvim#util#Plugin(...) abort
|
||||
let adds = []
|
||||
let updates = []
|
||||
let flag = 0
|
||||
for a in a:000
|
||||
if flag == 1
|
||||
call add(adds, a)
|
||||
elseif flag == 2
|
||||
call add(updates, a)
|
||||
endif
|
||||
if a ==# '-update'
|
||||
let flag = 1
|
||||
elseif a ==# '-openurl'
|
||||
let flag = 2
|
||||
endif
|
||||
endfor
|
||||
echo string(adds) . "\n" . string(updates)
|
||||
endfunction
|
||||
|
||||
function! zvim#util#complete_project(ArgLead, CmdLine, CursorPos) abort
|
||||
call zvim#debug#completion_debug(a:ArgLead, a:CmdLine, a:CursorPos)
|
||||
let dir = get(g:settings, 'src_root', '~')
|
||||
"return globpath(dir, '*')
|
||||
let result = split(globpath(dir, '*'), "\n")
|
||||
let ps = []
|
||||
for p in result
|
||||
if isdirectory(p) && isdirectory(p. '\' . '.git')
|
||||
call add(ps, fnamemodify(p, ':t'))
|
||||
endif
|
||||
endfor
|
||||
return join(ps, "\n")
|
||||
endfunction
|
||||
|
||||
function! zvim#util#OpenProject(p) abort
|
||||
let dir = get(g:settings, 'src_root', '~') . a:p
|
||||
exe 'CtrlP '. dir
|
||||
endfunction
|
||||
|
||||
function! zvim#util#UpdateHosts(...) abort
|
||||
if len(a:000) == 0
|
||||
let url = get(g:settings, 'hosts_url', '')
|
||||
else
|
||||
let url = a:1
|
||||
endif
|
||||
let hosts = systemlist('curl -s ' . url)
|
||||
if WINDOWS()
|
||||
let local_hosts = $SystemRoot . expand('\System32\drivers\etc\hosts')
|
||||
else
|
||||
let local_hosts = '/etc/hosts'
|
||||
endif
|
||||
if writefile(hosts, local_hosts, 'a') == -1
|
||||
echo 'failed!'
|
||||
else
|
||||
echo 'successfully!'
|
||||
endif
|
||||
endfunction
|
||||
fu! zvim#util#Generate_ignore(ignore,tool) abort
|
||||
let ignore = []
|
||||
if a:tool ==# 'ag'
|
||||
for ig in split(a:ignore,',')
|
||||
call add(ignore, '--ignore')
|
||||
call add(ignore, ig)
|
||||
endfor
|
||||
elseif a:tool ==# 'rg'
|
||||
for ig in split(a:ignore,',')
|
||||
call add(ignore, '-g')
|
||||
call add(ignore, '!' . ig)
|
||||
endfor
|
||||
endif
|
||||
return ignore
|
||||
endf
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
78
config/autocmds.vim
Normal file
78
config/autocmds.vim
Normal file
@ -0,0 +1,78 @@
|
||||
"autocmds
|
||||
augroup My_autocmds
|
||||
au!
|
||||
autocmd BufWinEnter quickfix nnoremap <silent> <buffer>
|
||||
\ q :cclose<cr>:lclose<cr>
|
||||
autocmd BufEnter * if (winnr('$') == 1 && &buftype ==# 'quickfix' ) |
|
||||
\ bd|
|
||||
\ q | endif
|
||||
autocmd FileType jsp call JspFileTypeInit()
|
||||
autocmd FileType html,css,jsp EmmetInstall
|
||||
autocmd FileType java call JavaFileTypeInit()
|
||||
autocmd BufEnter,WinEnter,InsertLeave * set cursorline
|
||||
autocmd BufLeave,WinLeave,InsertEnter * set nocursorline
|
||||
autocmd BufReadPost *
|
||||
\ if line("'\"") > 0 && line("'\"") <= line("$") |
|
||||
\ exe "normal! g`\"" |
|
||||
\ endif
|
||||
autocmd BufNewFile,BufEnter * set cpoptions+=d " NOTE: ctags find the tags file from the current path instead of the path of currect file
|
||||
autocmd BufEnter * :syntax sync fromstart " ensure every file does syntax highlighting (full)
|
||||
autocmd BufNewFile,BufRead *.avs set syntax=avs " for avs syntax file.
|
||||
autocmd FileType text setlocal textwidth=78 " for all text files set 'textwidth' to 78 characters.
|
||||
autocmd FileType c,cpp,cs,swig set nomodeline " this will avoid bug in my project with namespace ex, the vim will tree ex:: as modeline.
|
||||
autocmd FileType c,cpp,java,javascript set comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,f://
|
||||
autocmd FileType cs set comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,f:///,f://
|
||||
autocmd FileType vim set comments=sO:\"\ -,mO:\"\ \ ,eO:\"\",f:\"
|
||||
autocmd FileType lua set comments=f:--
|
||||
autocmd FileType vim setlocal foldmethod=marker
|
||||
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
|
||||
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
|
||||
autocmd Filetype html setlocal omnifunc=htmlcomplete#CompleteTags
|
||||
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
|
||||
autocmd FileType xml call XmlFileTypeInit()
|
||||
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
|
||||
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
|
||||
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
|
||||
autocmd FileType php setlocal omnifunc=phpcomplete_extended#CompletePHP
|
||||
autocmd BufEnter *
|
||||
\ if empty(&buftype)&&has('nvim')
|
||||
\| nnoremap <silent><buffer> <C-]> :call MyTagfunc()<CR>
|
||||
\| nnoremap <silent><buffer> <C-[> :call MyTagfuncBack()<CR>
|
||||
\| else
|
||||
\| nnoremap <silent><buffer> <leader>] :call MyTagfunc()<CR>
|
||||
\| nnoremap <silent><buffer> <leader>[ :call MyTagfuncBack()<CR>
|
||||
\| endif
|
||||
"}}}
|
||||
autocmd FileType python,coffee call zvim#util#check_if_expand_tab()
|
||||
" Instead of reverting the cursor to the last position in the buffer, we
|
||||
" set it to the first line when editing a git commit message
|
||||
au FileType gitcommit au! BufEnter COMMIT_EDITMSG call setpos('.', [0, 1, 1, 0])
|
||||
autocmd InsertEnter * call s:tool()
|
||||
if executable('synclient')
|
||||
let s:touchpadoff = 0
|
||||
autocmd InsertEnter * call s:disable_touchpad()
|
||||
autocmd InsertLeave * call s:enable_touchpad()
|
||||
autocmd FocusLost * call system('synclient touchpadoff=0')
|
||||
autocmd FocusGained * call s:reload_touchpad_status()
|
||||
endif
|
||||
augroup END
|
||||
function! s:reload_touchpad_status()
|
||||
if s:touchpadoff
|
||||
call s:disable_touchpad()
|
||||
endif
|
||||
endf
|
||||
function! s:disable_touchpad() abort
|
||||
let s:touchpadoff = 1
|
||||
call system('synclient touchpadoff=1')
|
||||
endfunction
|
||||
function! s:enable_touchpad() abort
|
||||
let s:touchpadoff = 0
|
||||
call system('synclient touchpadoff=0')
|
||||
endfunction
|
||||
fu! s:tool()
|
||||
if !exists('s:done')
|
||||
IndentLinesToggle
|
||||
IndentLinesToggle
|
||||
let s:done = 1
|
||||
endif
|
||||
endf
|
8
config/commands.vim
Normal file
8
config/commands.vim
Normal file
@ -0,0 +1,8 @@
|
||||
" Convenient command to see the difference between the current buffer and the
|
||||
" file it was loaded from, thus the changes you made. Only define it when not
|
||||
" defined already.
|
||||
command! DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis
|
||||
\ | wincmd p | diffthis
|
||||
command -nargs=* -complete=custom,zvim#util#complete_plugs Plugin :call zvim#util#Plugin(<f-args>)
|
||||
"command for open project
|
||||
command -nargs=+ -complete=custom,zvim#util#complete_project OpenProject :call zvim#util#OpenProject(<f-args>)
|
236
config/functions.vim
Normal file
236
config/functions.vim
Normal file
@ -0,0 +1,236 @@
|
||||
"Detect OS
|
||||
function! OSX()
|
||||
return has('macunix')
|
||||
endfunction
|
||||
function! LINUX()
|
||||
return has('unix') && !has('macunix') && !has('win32unix')
|
||||
endfunction
|
||||
function! WINDOWS()
|
||||
return (has('win16') || has('win32') || has('win64'))
|
||||
endfunction
|
||||
function! OnmiConfigForJsp()
|
||||
let pos1 = search("</script>","nb",line("w0"))
|
||||
let pos2 = search("<script","nb",line("w0"))
|
||||
let pos3 = search("</script>","n",line("w$"))
|
||||
let pos0 = line('.')
|
||||
if pos1 < pos2 && pos2 < pos0 && pos0 < pos3
|
||||
set omnifunc=javascriptcomplete#CompleteJS
|
||||
return "\<esc>a."
|
||||
else
|
||||
set omnifunc=javacomplete#Complete
|
||||
return "\<esc>a."
|
||||
endif
|
||||
endf
|
||||
function! ToggleNumber()
|
||||
let s:isThereNumber = &nu
|
||||
let s:isThereRelativeNumber = &relativenumber
|
||||
if s:isThereNumber && s:isThereRelativeNumber
|
||||
set paste!
|
||||
set nonumber
|
||||
set norelativenumber
|
||||
else
|
||||
set paste!
|
||||
set number
|
||||
set relativenumber
|
||||
endif
|
||||
endf
|
||||
function! ToggleBG()
|
||||
let s:tbg = &background
|
||||
" Inversion
|
||||
if s:tbg == "dark"
|
||||
set background=light
|
||||
else
|
||||
set background=dark
|
||||
endif
|
||||
endfunction
|
||||
function! BracketsFunc()
|
||||
let line = getline('.')
|
||||
let col = col('.')
|
||||
if line[col - 2] == "]"
|
||||
return "{}\<esc>i"
|
||||
else
|
||||
return "{\<cr>}\<esc>O"
|
||||
endif
|
||||
endf
|
||||
function! XmlFileTypeInit()
|
||||
set omnifunc=xmlcomplete#CompleteTags
|
||||
if filereadable("AndroidManifest.xml")
|
||||
set dict+=~/.vim/bundle/vim-dict/dict/android_xml.dic
|
||||
endif
|
||||
endf
|
||||
function! JavaFileTypeInit()
|
||||
set omnifunc=javacomplete#Complete
|
||||
set tags +=~/others/openjdksrc/java/tags
|
||||
set tags +=~/others/openjdksrc/javax/tags
|
||||
inoremap <silent> <buffer> <leader>UU <esc>bgUwea
|
||||
inoremap <silent> <buffer> <leader>uu <esc>bguwea
|
||||
inoremap <silent> <buffer> <leader>ua <esc>bgulea
|
||||
inoremap <silent> <buffer> <leader>Ua <esc>bgUlea
|
||||
nmap <silent><buffer> <F4> <Plug>(JavaComplete-Imports-Add)
|
||||
imap <silent><buffer> <F4> <Plug>(JavaComplete-Imports-Add)
|
||||
endf
|
||||
function! WSDAutoComplete(char)
|
||||
if(getline(".")=~?'^\s*.*\/\/')==0
|
||||
let line = getline('.')
|
||||
let col = col('.')
|
||||
if a:char == "."
|
||||
return a:char."\<c-x>\<c-o>\<c-p>"
|
||||
elseif line[col - 2] == " "||line[col -2] == "("||line[col - 2] == ","
|
||||
return a:char."\<c-x>\<c-o>\<c-p>"
|
||||
elseif line[col - 3] == " "&&line[col - 2] =="@"
|
||||
return a:char."\<c-x>\<c-o>\<c-p>"
|
||||
else
|
||||
return a:char
|
||||
endif
|
||||
else
|
||||
"bug exists
|
||||
normal! ma
|
||||
let commentcol = searchpos('//','b',line('.'))[1]
|
||||
normal! `a
|
||||
if commentcol == 0
|
||||
return a:char."\<c-x>\<c-o>\<c-p>"
|
||||
else
|
||||
return "\<Right>".a:char
|
||||
endif
|
||||
endif
|
||||
endf
|
||||
function! ClosePair(char)
|
||||
if getline('.')[col('.') - 1] == a:char
|
||||
return "\<Right>"
|
||||
else
|
||||
return a:char
|
||||
endif
|
||||
endf
|
||||
|
||||
function! CloseBracket()
|
||||
if match(getline(line('.') + 1), '\s*}') < 0
|
||||
return "\<CR>}"
|
||||
else
|
||||
return "\<Esc>j0f}a"
|
||||
endif
|
||||
endf
|
||||
|
||||
function! QuoteDelim(char)
|
||||
let line = getline('.')
|
||||
let col = col('.')
|
||||
if line[col - 2] == "\\"
|
||||
"Inserting a quoted quotation mark into the string
|
||||
return a:char
|
||||
elseif line[col - 1] == a:char
|
||||
"Escaping out of the string
|
||||
return "\<Right>"
|
||||
else
|
||||
"Starting a string
|
||||
return a:char.a:char."\<Esc>i"
|
||||
endif
|
||||
endf
|
||||
function! JspFileTypeInit()
|
||||
set tags+=/home/wsdjeg/others/openjdk-8-src/tags
|
||||
set omnifunc=javacomplete#Complete
|
||||
inoremap . <c-r>=OnmiConfigForJsp()<cr>
|
||||
nnoremap <F4> :JCimportAdd<cr>
|
||||
inoremap <F4> <esc>:JCimportAddI<cr>
|
||||
endfunction
|
||||
function! MyTagfunc() abort
|
||||
mark H
|
||||
let s:MyTagfunc_flag = 1
|
||||
UniteWithCursorWord -immediately tag
|
||||
endfunction
|
||||
|
||||
function! MyTagfuncBack() abort
|
||||
if exists('s:MyTagfunc_flag')&&s:MyTagfunc_flag
|
||||
exe "normal! `H"
|
||||
let s:MyTagfunc_flag =0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! MyEnterfunc() abort
|
||||
if pumvisible()
|
||||
if getline('.')[col('.') - 2]=="{"
|
||||
return "\<Enter>"
|
||||
elseif g:settings.autocomplete_method == 'neocomplete'||g:settings.autocomplete_method == 'deoplete'
|
||||
return "\<C-y>"
|
||||
else
|
||||
return "\<esc>a"
|
||||
endif
|
||||
elseif getline('.')[col('.') - 2]=="{"&&getline('.')[col('.')-1]=="}"
|
||||
return "\<Enter>\<esc>ko"
|
||||
else
|
||||
return "\<Enter>"
|
||||
endif
|
||||
endf
|
||||
|
||||
function! MyLeaderTabfunc() abort
|
||||
if g:settings.autocomplete_method == 'deoplete'
|
||||
if g:settings.enable_javacomplete2_py
|
||||
return deoplete#mappings#manual_complete(['javacomplete2'])
|
||||
else
|
||||
return deoplete#mappings#manual_complete(['omni'])
|
||||
endif
|
||||
elseif g:settings.autocomplete_method == 'neocomplete'
|
||||
return neocomplete#start_manual_complete(['omni'])
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! MyTabfunc() abort
|
||||
if getline('.')[col('.')-2] =='{'&& pumvisible()
|
||||
return "\<C-n>"
|
||||
endif
|
||||
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] !='('
|
||||
return "\<plug>(neosnippet_expand_or_jump)"
|
||||
elseif pumvisible()
|
||||
return "\<C-n>"
|
||||
else
|
||||
return "\<tab>"
|
||||
endif
|
||||
endfunction
|
||||
func! Openpluginrepo()
|
||||
try
|
||||
exec "normal! ".'"ayi'."'"
|
||||
exec 'OpenBrowser https://github.com/'.@a
|
||||
catch
|
||||
echohl WarningMsg | echomsg "can not open the web of current plugin" | echohl None
|
||||
endtry
|
||||
endf
|
||||
func! Update_current_plugin()
|
||||
try
|
||||
let a_save = @a
|
||||
let @a=''
|
||||
normal! "ayi'
|
||||
let plug_name = match(@a, '/') >= 0 ? split(@a, '/')[1] : @a
|
||||
finally
|
||||
let @a = a_save
|
||||
endtry
|
||||
call dein#update([plug_name])
|
||||
endf
|
||||
func! Show_Log_for_current_plugin()
|
||||
try
|
||||
let a_save = @a
|
||||
let @a=''
|
||||
normal! "ayi'
|
||||
let plug = match(@a, '/') >= 0 ? @a : 'vim-scripts/'.@a
|
||||
finally
|
||||
let @a = a_save
|
||||
endtry
|
||||
call unite#start([['output/shellcmd',
|
||||
\ 'git --no-pager -C ~/.cache/vimfiles/repos/github.com/'
|
||||
\ . plug
|
||||
\ . ' log -n 15 --oneline']], {'log': 1, 'wrap': 1,'start_insert':0})
|
||||
exe "nnoremap <buffer><CR> :call <SID>Opencommit('". plug ."', strpart(split(getline('.'),'[33m')[1],0,7))<CR>"
|
||||
endf
|
||||
fu! s:Opencommit(repo,commit)
|
||||
exe "OpenBrowser https://github.com/" . a:repo ."/commit/". a:commit
|
||||
endf
|
||||
|
||||
fu! UpdateStarredRepos()
|
||||
let repos = githubapi#users#GetStarred('wsdjeg')
|
||||
for repo in repos
|
||||
let description = repo.full_name . repeat(' ', 40 - len(repo.full_name)) . repo.description
|
||||
let cmd = "OpenBrowser " . repo.html_url
|
||||
call add(g:unite_source_menu_menus.MyStarredrepos.command_candidates, [description,cmd])
|
||||
endfor
|
||||
endf
|
125
config/general.vim
Normal file
125
config/general.vim
Normal file
@ -0,0 +1,125 @@
|
||||
scriptencoding utf-8
|
||||
" basic vim settiing
|
||||
if has("gui_running")
|
||||
set guioptions-=m " 隐藏菜单栏
|
||||
set guioptions-=T " 隐藏工具栏
|
||||
set guioptions-=L " 隐藏左侧滚动条
|
||||
set guioptions-=r " 隐藏右侧滚动条
|
||||
set guioptions-=b " 隐藏底部滚动条
|
||||
set showtabline=0 " 隐藏Tab栏
|
||||
if WINDOWS()
|
||||
" please install the font in 'Dotfiles\font'
|
||||
set guifont=DejaVu_Sans_Mono_for_Powerline:h11:cANSI:qDRAFT
|
||||
else
|
||||
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 11
|
||||
endif
|
||||
endif
|
||||
|
||||
" indent use backspace delete indent, eol use backspace delete line at
|
||||
" begining start delete the char you just typed in if you do not use set
|
||||
" nocompatible ,you need this
|
||||
set backspace=indent,eol,start
|
||||
|
||||
"显示相对行号
|
||||
set relativenumber
|
||||
|
||||
" 显示行号
|
||||
set number
|
||||
|
||||
" 自动缩进,自动智能对齐
|
||||
set autoindent
|
||||
set smartindent
|
||||
set cindent
|
||||
|
||||
" 状态栏预览命令
|
||||
set wildmenu
|
||||
|
||||
"整词换行
|
||||
set linebreak
|
||||
|
||||
"Tab键的宽度
|
||||
set tabstop=4
|
||||
"用空格来执行tab
|
||||
set expandtab
|
||||
" 统一缩进为4
|
||||
set softtabstop=4
|
||||
set shiftwidth=4
|
||||
"set nobackup
|
||||
set backup
|
||||
set undofile
|
||||
set undolevels=1000
|
||||
let g:data_dir = $HOME . '/.data/'
|
||||
let g:backup_dir = g:data_dir . 'backup'
|
||||
let g:swap_dir = g:data_dir . 'swap'
|
||||
let g:undo_dir = g:data_dir . 'undofile'
|
||||
if finddir(g:data_dir) == ''
|
||||
silent call mkdir(g:data_dir)
|
||||
endif
|
||||
if finddir(g:backup_dir) == ''
|
||||
silent call mkdir(g:backup_dir)
|
||||
endif
|
||||
if finddir(g:swap_dir) == ''
|
||||
silent call mkdir(g:swap_dir)
|
||||
endif
|
||||
if finddir(g:undo_dir) == ''
|
||||
silent call mkdir(g:undo_dir)
|
||||
endif
|
||||
unlet g:backup_dir
|
||||
unlet g:swap_dir
|
||||
unlet g:data_dir
|
||||
unlet g:undo_dir
|
||||
set undodir=$HOME/.data/undofile
|
||||
set backupdir=$HOME/.data/backup
|
||||
set directory=$HOME/.data/swap
|
||||
set nofoldenable "关闭自动折叠 折叠按键 'za'
|
||||
set nowritebackup
|
||||
set matchtime=0
|
||||
set ruler
|
||||
set showcmd "命令行显示输入的命令
|
||||
set showmatch "设置匹配模式,显示匹配的括号
|
||||
set showmode "命令行显示当前vim的模式
|
||||
"menuone: show the pupmenu when only one match
|
||||
set completeopt=menu,menuone,longest " disable preview scratch window,
|
||||
set complete=.,w,b,u,t " h: 'complete'
|
||||
set pumheight=15 " limit completion menu height
|
||||
set scrolloff=7 "最低显示行数
|
||||
set incsearch
|
||||
set autowrite
|
||||
set hlsearch
|
||||
set laststatus=2
|
||||
set completeopt=longest,menu
|
||||
exe "set wildignore+=" . g:settings.wildignore
|
||||
set wildignorecase
|
||||
let g:markdown_fenced_languages = ['vim', 'java', 'bash=sh', 'sh', 'html', 'python']
|
||||
set mouse=
|
||||
set hidden
|
||||
set ttimeout
|
||||
set ttimeoutlen=50
|
||||
" shell
|
||||
if has('filterpipe')
|
||||
set noshelltemp
|
||||
endif
|
||||
filetype plugin indent on
|
||||
syntax on
|
||||
if count(g:settings.plugin_groups, 'colorscheme')&&g:settings.colorscheme!='' "{{{
|
||||
set background=dark
|
||||
try
|
||||
exec 'colorscheme '. g:settings.colorscheme
|
||||
catch
|
||||
exec 'colorscheme '. g:settings.colorscheme_default
|
||||
endtry
|
||||
endif
|
||||
if g:settings.enable_cursorline == 1
|
||||
set cursorline "显示当前行
|
||||
endif
|
||||
if g:settings.enable_cursorcolumn == 1
|
||||
set cursorcolumn "显示当前列
|
||||
endif
|
||||
if g:settings.hiddenfileinfo == 1 && has("patch-7.4.1570")
|
||||
set shortmess=filnxtToOFs
|
||||
endif
|
||||
if exists('+termguicolors')
|
||||
set termguicolors
|
||||
elseif exists('+guicolors')
|
||||
set guicolors
|
||||
endif
|
170
config/init.vim
Normal file
170
config/init.vim
Normal file
@ -0,0 +1,170 @@
|
||||
scriptencoding utf-8
|
||||
" Enable nocompatible
|
||||
if has('vim_starting')
|
||||
if &compatible
|
||||
set nocompatible
|
||||
endif
|
||||
endif
|
||||
|
||||
" Fsep && Psep
|
||||
if has('win16') || has('win32') || has('win64')
|
||||
let s:Psep = ';'
|
||||
let s:Fsep = '\'
|
||||
else
|
||||
let s:Psep = ':'
|
||||
let s:Fsep = '/'
|
||||
endif
|
||||
"Use English for anything in vim
|
||||
if WINDOWS()
|
||||
silent exec 'lan mes en_US.UTF-8'
|
||||
elseif OSX()
|
||||
silent exec 'language en_US'
|
||||
else
|
||||
let s:uname = system('uname -s')
|
||||
if s:uname ==# "Darwin\n"
|
||||
" in mac-terminal
|
||||
silent exec 'language en_US'
|
||||
else
|
||||
" in linux-terminal
|
||||
silent exec 'language en_US.utf8'
|
||||
endif
|
||||
endif
|
||||
|
||||
" try to set encoding to utf-8
|
||||
if WINDOWS()
|
||||
" Be nice and check for multi_byte even if the config requires
|
||||
" multi_byte support most of the time
|
||||
if has('multi_byte')
|
||||
" Windows cmd.exe still uses cp850. If Windows ever moved to
|
||||
" Powershell as the primary terminal, this would be utf-8
|
||||
set termencoding=cp850
|
||||
" Let Vim use utf-8 internally, because many scripts require this
|
||||
set encoding=utf-8
|
||||
setglobal fileencoding=utf-8
|
||||
" Windows has traditionally used cp1252, so it's probably wise to
|
||||
" fallback into cp1252 instead of eg. iso-8859-15.
|
||||
" Newer Windows files might contain utf-8 or utf-16 LE so we might
|
||||
" want to try them first.
|
||||
set fileencodings=ucs-bom,utf-8,utf-16le,cp1252,iso-8859-15
|
||||
endif
|
||||
|
||||
else
|
||||
" set default encoding to utf-8
|
||||
set encoding=utf-8
|
||||
set termencoding=utf-8
|
||||
endif
|
||||
|
||||
" Enable 256 colors
|
||||
if $COLORTERM ==# 'gnome-terminal'
|
||||
set t_Co=256
|
||||
endif
|
||||
|
||||
"Vim settings
|
||||
let g:settings = get(g:, 'settings', {})
|
||||
let g:settings.default_indent = 2
|
||||
let g:settings.max_column = 120
|
||||
let g:settings.enable_googlesuggest = 0
|
||||
let g:settings.auto_download_neobundle = 0
|
||||
let g:settings.neobundle_installed = 0
|
||||
let g:settings.dein_installed = 0
|
||||
let g:settings.vim_plug_installed = 0
|
||||
let g:settings.plugin_bundle_dir = $HOME. join(['', '.cache', 'vimfiles', ''],s:Fsep)
|
||||
let g:settings.autocomplete_method = ''
|
||||
let g:settings.enable_cursorcolumn = 0
|
||||
let g:settings.enable_neomake = 1
|
||||
let g:settings.enable_ycm = 0
|
||||
let g:settings.enable_neocomplcache = 0
|
||||
let g:settings.enable_cursorline = 0
|
||||
let g:settings.error_symbol = '✖'
|
||||
let g:settings.warning_symbol = '⚠'
|
||||
let g:settings.use_colorscheme = 1
|
||||
let g:settings.vim_help_language = 'en'
|
||||
let g:settings.colorscheme = 'gruvbox'
|
||||
let g:settings.colorscheme_default = 'desert'
|
||||
let g:settings.filemanager = 'vimfiler'
|
||||
let g:settings.plugin_manager = 'dein' " neobundle or dein or vim-plug
|
||||
let g:settings.checkinstall = 0
|
||||
let g:settings.hiddenfileinfo = 1
|
||||
let g:settings.plugin_groups_exclude = []
|
||||
let g:settings.smartcloseignorewin = ['__Tagbar__' , 'vimfiler:default']
|
||||
let g:settings.smartcloseignoreft = ['help']
|
||||
let g:settings.altmoveignoreft = ['Tagbar' , 'vimfiler']
|
||||
let g:settings.enable_javacomplete2_py = 0
|
||||
let g:settings.src_root = 'E:\sources\'
|
||||
let g:settings.hosts_url = 'https://raw.githubusercontent.com/racaljk/hosts/master/hosts'
|
||||
let g:settings.wildignore = '*/tmp/*,*.so,*.swp,*.zip,*.class,tags,*.jpg,
|
||||
\*.ttf,*.TTF,*.png,*/target/*,
|
||||
\.git,.svn,.hg,.DS_Store'
|
||||
|
||||
"core vimrc
|
||||
let g:settings.plugin_groups = []
|
||||
call add(g:settings.plugin_groups, 'web')
|
||||
call add(g:settings.plugin_groups, 'javascript')
|
||||
call add(g:settings.plugin_groups, 'ruby')
|
||||
call add(g:settings.plugin_groups, 'python')
|
||||
call add(g:settings.plugin_groups, 'scala')
|
||||
call add(g:settings.plugin_groups, 'go')
|
||||
call add(g:settings.plugin_groups, 'scm')
|
||||
call add(g:settings.plugin_groups, 'editing')
|
||||
call add(g:settings.plugin_groups, 'indents')
|
||||
call add(g:settings.plugin_groups, 'navigation')
|
||||
call add(g:settings.plugin_groups, 'misc')
|
||||
|
||||
call add(g:settings.plugin_groups, 'core')
|
||||
call add(g:settings.plugin_groups, 'unite')
|
||||
if has('python3')
|
||||
call add(g:settings.plugin_groups, 'denite')
|
||||
endif
|
||||
call add(g:settings.plugin_groups, 'ctrlp')
|
||||
call add(g:settings.plugin_groups, 'autocomplete')
|
||||
if ! has('nvim')
|
||||
call add(g:settings.plugin_groups, 'vim')
|
||||
else
|
||||
call add(g:settings.plugin_groups, 'nvim')
|
||||
endif
|
||||
|
||||
|
||||
if g:settings.vim_help_language ==# 'cn'
|
||||
call add(g:settings.plugin_groups, 'chinese')
|
||||
endif
|
||||
if g:settings.use_colorscheme==1
|
||||
call add(g:settings.plugin_groups, 'colorscheme')
|
||||
endif
|
||||
if OSX()
|
||||
call add(g:settings.plugin_groups, 'osx')
|
||||
endif
|
||||
if WINDOWS()
|
||||
call add(g:settings.plugin_groups, 'windows')
|
||||
endif
|
||||
if LINUX()
|
||||
call add(g:settings.plugin_groups, 'linux')
|
||||
endif
|
||||
|
||||
if has('nvim')
|
||||
let g:settings.autocomplete_method = 'deoplete'
|
||||
elseif has('lua')
|
||||
let g:settings.autocomplete_method = 'neocomplete'
|
||||
else
|
||||
let g:settings.autocomplete_method = 'neocomplcache'
|
||||
endif
|
||||
if g:settings.enable_ycm
|
||||
let g:settings.autocomplete_method = 'ycm'
|
||||
endif
|
||||
if g:settings.enable_neocomplcache
|
||||
let g:settings.autocomplete_method = 'neocomplcache'
|
||||
endif
|
||||
|
||||
for s:group in g:settings.plugin_groups_exclude
|
||||
let s:i = index(g:settings.plugin_groups, s:group)
|
||||
if s:i != -1
|
||||
call remove(g:settings.plugin_groups, s:i)
|
||||
endif
|
||||
endfor
|
||||
|
||||
" python host for neovim
|
||||
let g:python_host_prog = '/usr/bin/python2'
|
||||
let g:python3_host_prog = '/usr/bin/python3'
|
||||
if WINDOWS()
|
||||
let g:python_host_prog = 'D:\Python27\python.exe'
|
||||
let g:python3_host_prog = 'C:\Users\wsdjeg\AppData\Local\Programs\Python\Python35-32\python.exe'
|
||||
endif
|
27
config/main.vim
Normal file
27
config/main.vim
Normal file
@ -0,0 +1,27 @@
|
||||
let g:Config_Main_Home = fnamemodify(expand('<sfile>'), ':p:h:gs?\\?'.((has('win16') || has('win32') || has('win64'))?'\':'/') . '?')
|
||||
try
|
||||
call zvim#util#source_rc('functions.vim')
|
||||
catch
|
||||
execute "set rtp +=" . fnamemodify(g:Config_Main_Home, ':p:h:h')
|
||||
call zvim#util#source_rc('functions.vim')
|
||||
endtry
|
||||
|
||||
call zvim#util#source_rc('init.vim')
|
||||
|
||||
scriptencoding utf-8
|
||||
|
||||
call zvim#util#source_rc('local.vim')
|
||||
|
||||
call zvim#util#source_rc('plugins.vim')
|
||||
|
||||
call zvim#util#source_rc('general.vim')
|
||||
|
||||
call zvim#util#source_rc('mappings.vim')
|
||||
|
||||
call zvim#util#source_rc('autocmds.vim')
|
||||
|
||||
if has('nvim')
|
||||
call zvim#util#source_rc('neovim.vim')
|
||||
endif
|
||||
|
||||
call zvim#util#source_rc('commands.vim')
|
239
config/mappings.vim
Normal file
239
config/mappings.vim
Normal file
@ -0,0 +1,239 @@
|
||||
scriptencoding utf-8
|
||||
"mapping
|
||||
"全局映射
|
||||
"也可以通过'za'打开或者关闭折叠
|
||||
nnoremap <silent><leader><space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>
|
||||
"Super paste it does not work
|
||||
"ino <C-v> <esc>:set paste<cr>mui<C-R>+<esc>mv'uV'v=:set nopaste<cr>
|
||||
"对于没有权限的文件使用 :w!!来保存
|
||||
cnoremap w!! %!sudo tee > /dev/null %
|
||||
" cmap W!! w !sudo tee % >/dev/null " I can not understand
|
||||
" Save a file with sudo
|
||||
" http://forrst.com/posts/Use_w_to_sudo_write_a_file_with_Vim-uAN
|
||||
|
||||
|
||||
" 映射Ctrl+上下左右来切换窗口
|
||||
nnoremap <silent><C-Right> :<C-u>wincmd l<CR>
|
||||
nnoremap <silent><C-Left> :<C-u>wincmd h<CR>
|
||||
nnoremap <silent><C-Up> :<C-u>wincmd k<CR>
|
||||
nnoremap <silent><C-Down> :<C-u>wincmd j<CR>
|
||||
if has('nvim')
|
||||
exe 'tnoremap <silent><C-Right> <C-\><C-n>:<C-u>wincmd l<CR>'
|
||||
exe 'tnoremap <silent><C-Left> <C-\><C-n>:<C-u>wincmd h<CR>'
|
||||
exe 'tnoremap <silent><C-Up> <C-\><C-n>:<C-u>wincmd k<CR>'
|
||||
exe 'tnoremap <silent><C-Down> <C-\><C-n>:<C-u>wincmd j<CR>'
|
||||
exe 'tnoremap <silent><esc> <C-\><C-n>'
|
||||
endif
|
||||
|
||||
"for buftabs
|
||||
noremap <silent><Leader>bp :bprev<CR>
|
||||
noremap <silent><Leader>bn :bnext<CR>
|
||||
|
||||
"Quickly add empty lines
|
||||
nnoremap <silent>[<space> :<c-u>put! =repeat(nr2char(10), v:count1)<cr>
|
||||
nnoremap <silent>]<space> :<c-u>put =repeat(nr2char(10), v:count1)<cr>
|
||||
|
||||
"Use jk switch to normal model
|
||||
inoremap jk <esc>
|
||||
|
||||
"]e or [e move current line ,count can be useed
|
||||
nnoremap <silent>[e :<c-u>execute 'move -1-'. v:count1<cr>
|
||||
nnoremap <silent>]e :<c-u>execute 'move +'. v:count1<cr>
|
||||
|
||||
"]<End> or ]<Home> move current line to the end or the begin of current buffer
|
||||
nnoremap <silent>]<End> ddGp``
|
||||
nnoremap <silent>]<Home> ddggP``
|
||||
vnoremap <silent>]<End> dGp``
|
||||
vnoremap <silent>]<Home> dggP``
|
||||
|
||||
|
||||
"Ctrl+Shift+上下移动当前行
|
||||
nnoremap <silent><C-S-Down> :m .+1<CR>==
|
||||
nnoremap <silent><C-S-Up> :m .-2<CR>==
|
||||
inoremap <silent><C-S-Down> <Esc>:m .+1<CR>==gi
|
||||
inoremap <silent><C-S-Up> <Esc>:m .-2<CR>==gi
|
||||
"上下移动选中的行
|
||||
vnoremap <silent><C-S-Down> :m '>+1<CR>gv=gv
|
||||
vnoremap <silent><C-S-Up> :m '<-2<CR>gv=gv
|
||||
"background
|
||||
noremap <silent><leader>bg :call ToggleBG()<CR>
|
||||
"numbers
|
||||
noremap <silent><leader>nu :call ToggleNumber()<CR>
|
||||
" download gvimfullscreen.dll from github, copy gvimfullscreen.dll to
|
||||
" the directory that has gvim.exe
|
||||
nnoremap <F11> :call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)<cr>
|
||||
" yark and paste
|
||||
vmap <Leader>y "+y
|
||||
vmap <Leader>d "+d
|
||||
nmap <Leader>p "+p
|
||||
nmap <Leader>P "+P
|
||||
vmap <Leader>p "+p
|
||||
vmap <Leader>P "+P
|
||||
|
||||
" Start new line
|
||||
inoremap <S-Return> <C-o>o
|
||||
|
||||
" Improve scroll, credits: https://github.com/Shougo
|
||||
nnoremap <expr> zz (winline() == (winheight(0)+1) / 2) ?
|
||||
\ 'zt' : (winline() == 1) ? 'zb' : 'zz'
|
||||
noremap <expr> <C-f> max([winheight(0) - 2, 1])
|
||||
\ ."\<C-d>".(line('w$') >= line('$') ? "L" : "H")
|
||||
noremap <expr> <C-b> max([winheight(0) - 2, 1])
|
||||
\ ."\<C-u>".(line('w0') <= 1 ? "H" : "L")
|
||||
noremap <expr> <C-e> (line("w$") >= line('$') ? "j" : "3\<C-e>")
|
||||
noremap <expr> <C-y> (line("w0") <= 1 ? "k" : "3\<C-y>")
|
||||
|
||||
" Select blocks after indenting
|
||||
xnoremap < <gv
|
||||
xnoremap > >gv|
|
||||
|
||||
" Use tab for indenting in visual mode
|
||||
xnoremap <Tab> >gv|
|
||||
xnoremap <S-Tab> <gv
|
||||
nnoremap > >>_
|
||||
nnoremap < <<_
|
||||
|
||||
" smart up and down
|
||||
nnoremap <silent><Down> gj
|
||||
nnoremap <silent><Up> gk
|
||||
|
||||
" Select last paste
|
||||
nnoremap <silent><expr> gp '`['.strpart(getregtype(), 0, 1).'`]'
|
||||
|
||||
" Disable Q and gQ
|
||||
nnoremap Q <Nop>
|
||||
nnoremap gQ <Nop>
|
||||
|
||||
" Navigate window
|
||||
nnoremap <silent><C-q> <C-w>
|
||||
nnoremap <silent><C-x> <C-w>x
|
||||
|
||||
" Navigation in command line
|
||||
cnoremap <C-a> <Home>
|
||||
cnoremap <C-b> <Left>
|
||||
cnoremap <C-f> <Right>
|
||||
|
||||
" When pressing <leader>cd switch to the directory of the open buffer
|
||||
" map <Leader>cd :cd %:p:h<CR>:pwd<CR> "I use <Plug>RooterChangeToRootDirectory
|
||||
|
||||
" Fast saving
|
||||
nnoremap <Leader>w :w<CR>
|
||||
vnoremap <Leader>w <Esc>:w<CR>
|
||||
nnoremap <C-s> :<C-u>w<CR>
|
||||
vnoremap <C-s> :<C-u>w<CR>
|
||||
cnoremap <C-s> <C-u>w<CR>
|
||||
|
||||
" Toggle editor visuals
|
||||
nmap <Leader>ts :setlocal spell!<cr>
|
||||
nmap <Leader>tn :setlocal nonumber! norelativenumber!<CR>
|
||||
nmap <Leader>tl :setlocal nolist!<CR>
|
||||
nmap <Leader>th :nohlsearch<CR>
|
||||
nmap <Leader>tw :setlocal wrap! breakindent!<CR>
|
||||
|
||||
" Tabs
|
||||
nnoremap <silent>g0 :<C-u>tabfirst<CR>
|
||||
nnoremap <silent>g$ :<C-u>tablast<CR>
|
||||
nnoremap <silent>gr :<C-u>tabprevious<CR>
|
||||
|
||||
" Remove spaces at the end of lines
|
||||
nnoremap <silent> ,<Space> :<C-u>silent! keeppatterns %substitute/\s\+$//e<CR>
|
||||
|
||||
" C-r: Easier search and replace
|
||||
xnoremap <C-r> :<C-u>call VSetSearch('/')<CR>:%s/\V<C-R>=@/<CR>//gc<Left><Left><Left>
|
||||
|
||||
" Location list movement
|
||||
nmap <silent><Leader>lj :lnext<CR>
|
||||
nmap <silent><Leader>lk :lprev<CR>
|
||||
nmap <silent><Leader>lq :lclose<CR>
|
||||
|
||||
" quickfix list movement
|
||||
nmap <silent><Leader>qj :cnext<CR>
|
||||
nmap <silent><Leader>qk :cprev<CR>
|
||||
nmap <silent><Leader>qq :cclose<CR>
|
||||
|
||||
" Duplicate lines
|
||||
nnoremap <Leader>d m`YP``
|
||||
vnoremap <Leader>d YPgv
|
||||
|
||||
fu! s:tobur(num)
|
||||
if index(get(g:settings,'altmoveignoreft',[]), &filetype) == -1
|
||||
if a:num ==# 'bnext'
|
||||
bnext
|
||||
elseif a:num ==# 'bprev'
|
||||
bprev
|
||||
else
|
||||
let ls = split(execute(':ls'), "\n")
|
||||
let buffers = []
|
||||
for b in ls
|
||||
let nr = matchstr(b, '\d\+')
|
||||
call add(buffers, nr)
|
||||
endfor
|
||||
if len(buffers) >= a:num
|
||||
exec 'buffer ' . buffers[a:num - 1]
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endf
|
||||
"irssi like hot key
|
||||
nnoremap <silent><M-1> :<C-u>call <SID>tobur(1)<CR>
|
||||
nnoremap <silent><M-2> :<C-u>call <SID>tobur(2)<CR>
|
||||
nnoremap <silent><M-3> :<C-u>call <SID>tobur(3)<CR>
|
||||
nnoremap <silent><M-4> :<C-u>call <SID>tobur(4)<CR>
|
||||
nnoremap <silent><M-5> :<C-u>call <SID>tobur(5)<CR>
|
||||
nnoremap <silent><M-Right> :<C-U>call <SID>tobur("bnext")<CR>
|
||||
nnoremap <silent><M-Left> :<C-U>call <SID>tobur("bprev")<CR>
|
||||
|
||||
"qqmsg hot key
|
||||
nnoremap <silent><M-x> :call chat#qq#OpenMsgWin()<CR>
|
||||
"weixin hot key
|
||||
nnoremap <silent><M-w> :call chat#weixin#OpenMsgWin()<CR>
|
||||
"chatting hot key
|
||||
nnoremap <silent><M-c> :call chat#chatting#OpenMsgWin()<CR>
|
||||
|
||||
"format current buffer
|
||||
nnoremap <silent> g= :call zvim#format()<cr>
|
||||
|
||||
|
||||
call zvim#util#defineMap('vnoremap', '<Leader>S', "y:execute @@<CR>:echo 'Sourced selection.'<CR>",
|
||||
\ 'Sourced selection.',
|
||||
\ "echo 'Use <leader>S to sourced selection.'")
|
||||
call zvim#util#defineMap('nnoremap','<Leader>S',"^vg_y:execute @@<CR>:echo 'Sourced line.'<CR>",'Source line',
|
||||
\ "echo 'Use <leader>S to sourced line.'")
|
||||
|
||||
call zvim#util#defineMap('nnoremap <silent>', '<C-c>', ':<c-u>call zvim#util#CopyToClipboard()<cr>',
|
||||
\ 'Copy buffer absolute path to X11 clipboard','call zvim#util#CopyToClipboard()')
|
||||
call zvim#util#defineMap('nnoremap <silent>', '<Leader><C-c>',
|
||||
\ ':<c-u>call zvim#util#CopyToClipboard(1)<cr>',
|
||||
\ 'Yank the github link of current file to X11 clipboard',
|
||||
\ 'call zvim#util#CopyToClipboard(1)')
|
||||
call zvim#util#defineMap('nnoremap <silent>', '<Leader><C-l>',
|
||||
\ ':<c-u>call zvim#util#CopyToClipboard(2)<cr>',
|
||||
\ 'Yank the github link of current line to X11 clipboard',
|
||||
\ 'call zvim#util#CopyToClipboard(2)')
|
||||
call zvim#util#defineMap('vnoremap <silent>', '<Leader><C-l>',
|
||||
\ ':<c-u>call zvim#util#CopyToClipboard(3)<cr>',
|
||||
\ 'Yank the github link of current selection to X11 clipboard',
|
||||
\ 'call zvim#util#CopyToClipboard(3)')
|
||||
" Window prefix
|
||||
call zvim#util#defineMap('nnoremap', '[Window]', '<Nop>' , 'Defind window prefix' ,'normal [Window]')
|
||||
call zvim#util#defineMap('nmap' , 's' , '[Window]', 'Use s as window prefix' ,'normal s')
|
||||
|
||||
call zvim#util#defineMap('nnoremap <silent>', '<Tab>', ':wincmd w<CR>', 'Switch to another buffer','wincmd w')
|
||||
call zvim#util#defineMap('nnoremap <silent>', '[Window]p', ':<C-u>vsplit<CR>:wincmd w<CR>',
|
||||
\'vsplit vertically,switch to next window','vsplit | wincmd w')
|
||||
call zvim#util#defineMap('nnoremap <silent>', '[Window]v', ':<C-u>split<CR>', 'split window','split')
|
||||
call zvim#util#defineMap('nnoremap <silent>', '[Window]g', ':<C-u>vsplit<CR>', 'vsplit window','vsplit')
|
||||
call zvim#util#defineMap('nnoremap <silent>', '[Window]t', ':<C-u>tabnew<CR>', 'Create new tab','tabnew')
|
||||
call zvim#util#defineMap('nnoremap <silent>', '[Window]o', ':<C-u>only<CR>', 'Close other windows','only')
|
||||
call zvim#util#defineMap('nnoremap <silent>', '[Window]x', ':<C-u>call zvim#util#BufferEmpty()<CR>',
|
||||
\'Empty current buffer','call zvim#util#BufferEmpty()')
|
||||
call zvim#util#defineMap('nnoremap <silent>', '[Window]\', ':<C-u>b#<CR>', 'Switch to the last buffer','b#')
|
||||
call zvim#util#defineMap('nnoremap <silent>', '[Window]q', ':<C-u>close<CR>', 'Close current windows','close')
|
||||
call zvim#util#defineMap('nnoremap <silent>', 'q', ':<C-u>call zvim#util#SmartClose()<cr>',
|
||||
\ 'Smart close windows',
|
||||
\ 'call zvim#util#SmartClose()')
|
||||
call zvim#util#defineMap('nnoremap <silent>', '<Leader>qr', 'q', 'Toggle recording','')
|
||||
call zvim#util#defineMap('nnoremap <silent>', '<Leader>sv', ':split<CR>:wincmd p<CR>:e#<CR>',
|
||||
\'Open previous buffer in split window' , 'split|wincmd p|e#')
|
||||
call zvim#util#defineMap('nnoremap <silent>', '<Leader>sg', ':vsplit<CR>:wincmd p<CR>:e#<CR>',
|
||||
\'Open previous buffer in vsplit window' , 'vsplit|wincmd p|e#')
|
65
config/neovim.vim
Normal file
65
config/neovim.vim
Normal file
@ -0,0 +1,65 @@
|
||||
function! s:GetVisual()
|
||||
let [lnum1, col1] = getpos("'<")[1:2]
|
||||
let [lnum2, col2] = getpos("'>")[1:2]
|
||||
let lines = getline(lnum1, lnum2)
|
||||
let lines[-1] = lines[-1][:col2 - 2]
|
||||
let lines[0] = lines[0][col1 - 1:]
|
||||
return lines
|
||||
endfunction
|
||||
|
||||
function! REPLSend(lines)
|
||||
call jobsend(g:last_terminal_job_id, add(a:lines, ''))
|
||||
endfunction
|
||||
" }}}
|
||||
" Commands {{{
|
||||
" REPL integration {{{
|
||||
command! -range=% REPLSendSelection call REPLSend(s:GetVisual())
|
||||
command! REPLSendLine call REPLSend([getline('.')])
|
||||
" }}}
|
||||
"let $NVIM_TUI_ENABLE_TRUE_COLOR=1
|
||||
"let $NVIM_TUI_ENABLE_CURSOR_SHAPE=1
|
||||
"silent! let &t_SI = "\<Esc>]50;CursorShape=1\x7"
|
||||
"silent! let &t_SR = "\<Esc>]50;CursorShape=2\x7"
|
||||
"silent! let &t_EI = "\<Esc>]50;CursorShape=0\x7"
|
||||
" dark0 + gray
|
||||
let g:terminal_color_0 = "#282828"
|
||||
let g:terminal_color_8 = "#928374"
|
||||
|
||||
" neurtral_red + bright_red
|
||||
let g:terminal_color_1 = "#cc241d"
|
||||
let g:terminal_color_9 = "#fb4934"
|
||||
|
||||
" neutral_green + bright_green
|
||||
let g:terminal_color_2 = "#98971a"
|
||||
let g:terminal_color_10 = "#b8bb26"
|
||||
|
||||
" neutral_yellow + bright_yellow
|
||||
let g:terminal_color_3 = "#d79921"
|
||||
let g:terminal_color_11 = "#fabd2f"
|
||||
|
||||
" neutral_blue + bright_blue
|
||||
let g:terminal_color_4 = "#458588"
|
||||
let g:terminal_color_12 = "#83a598"
|
||||
|
||||
" neutral_purple + bright_purple
|
||||
let g:terminal_color_5 = "#b16286"
|
||||
let g:terminal_color_13 = "#d3869b"
|
||||
|
||||
" neutral_aqua + faded_aqua
|
||||
let g:terminal_color_6 = "#689d6a"
|
||||
let g:terminal_color_14 = "#8ec07c"
|
||||
|
||||
" light4 + light1
|
||||
let g:terminal_color_7 = "#a89984"
|
||||
let g:terminal_color_15 = "#ebdbb2"
|
||||
augroup Terminal
|
||||
au!
|
||||
au TermOpen * let g:last_terminal_job_id = b:terminal_job_id | IndentLinesDisable
|
||||
au WinEnter term://* startinsert | IndentLinesDisable
|
||||
"au TermClose * exec &buftype == 'terminal' ? 'bd!' : ''
|
||||
au TermClose * exe expand('<abuf>').'bd!'
|
||||
augroup END
|
||||
augroup nvimrc_aucmd
|
||||
autocmd!
|
||||
autocmd CursorHold,FocusGained,FocusLost * rshada|wshada
|
||||
augroup END
|
475
config/plugins.vim
Normal file
475
config/plugins.vim
Normal file
@ -0,0 +1,475 @@
|
||||
scriptencoding utf-8
|
||||
|
||||
if zvim#plug#enable_plug()
|
||||
call zvim#plug#begin(g:settings.plugin_bundle_dir)
|
||||
call zvim#plug#fetch()
|
||||
if count(g:settings.plugin_groups, 'core') "{{{
|
||||
call zvim#plug#add('Shougo/vimproc.vim', {'build': 'make'})
|
||||
endif
|
||||
if count(g:settings.plugin_groups, 'denite')
|
||||
call zvim#plug#add('Shougo/denite.nvim',{ 'merged' : 0})
|
||||
if zvim#plug#tap('denite.nvim')
|
||||
call zvim#plug#defind_hooks('denite.nvim')
|
||||
endif
|
||||
endif
|
||||
if count(g:settings.plugin_groups, 'unite') "{{{
|
||||
call zvim#plug#add('Shougo/unite.vim',{ 'merged' : 0})
|
||||
if zvim#plug#tap('unite.vim')
|
||||
call zvim#plug#defind_hooks('unite.vim')
|
||||
endif
|
||||
call zvim#plug#add('Shougo/neoyank.vim')
|
||||
call zvim#plug#add('soh335/unite-qflist')
|
||||
call zvim#plug#add('ujihisa/unite-equery')
|
||||
call zvim#plug#add('m2mdas/unite-file-vcs')
|
||||
call zvim#plug#add('Shougo/neomru.vim')
|
||||
call zvim#plug#add('kmnk/vim-unite-svn')
|
||||
call zvim#plug#add('basyura/unite-rails')
|
||||
call zvim#plug#add('nobeans/unite-grails')
|
||||
call zvim#plug#add('choplin/unite-vim_hacks')
|
||||
call zvim#plug#add('mattn/webapi-vim')
|
||||
call zvim#plug#add('mattn/gist-vim')
|
||||
if zvim#plug#tap('gist-vim')
|
||||
call zvim#plug#defind_hooks('gist-vim')
|
||||
endif
|
||||
call zvim#plug#add('henices/unite-stock')
|
||||
call zvim#plug#add('mattn/wwwrenderer-vim')
|
||||
call zvim#plug#add('thinca/vim-openbuf')
|
||||
call zvim#plug#add('ujihisa/unite-haskellimport')
|
||||
call zvim#plug#add('oppara/vim-unite-cake')
|
||||
call zvim#plug#add('thinca/vim-ref')
|
||||
if zvim#plug#tap('vim-ref')
|
||||
call zvim#plug#defind_hooks('vim-ref')
|
||||
endif
|
||||
call zvim#plug#add('heavenshell/unite-zf')
|
||||
call zvim#plug#add('heavenshell/unite-sf2')
|
||||
call zvim#plug#add('osyo-manga/unite-vimpatches')
|
||||
call zvim#plug#add('Shougo/unite-outline')
|
||||
call zvim#plug#add('hewes/unite-gtags')
|
||||
if zvim#plug#tap('unite-gtags')
|
||||
call zvim#plug#defind_hooks('unite-gtags')
|
||||
endif
|
||||
call zvim#plug#add('rafi/vim-unite-issue')
|
||||
call zvim#plug#add('joker1007/unite-pull-request')
|
||||
call zvim#plug#add('tsukkee/unite-tag')
|
||||
call zvim#plug#add('ujihisa/unite-launch')
|
||||
call zvim#plug#add('ujihisa/unite-gem')
|
||||
call zvim#plug#add('osyo-manga/unite-filetype')
|
||||
call zvim#plug#add('thinca/vim-unite-history')
|
||||
call zvim#plug#add('Shougo/neobundle-vim-recipes')
|
||||
call zvim#plug#add('Shougo/unite-help')
|
||||
call zvim#plug#add('ujihisa/unite-locate')
|
||||
call zvim#plug#add('kmnk/vim-unite-giti')
|
||||
call zvim#plug#add('ujihisa/unite-font')
|
||||
call zvim#plug#add('t9md/vim-unite-ack')
|
||||
call zvim#plug#add('mileszs/ack.vim',{'on_cmd' : 'Ack'})
|
||||
call zvim#plug#add('albfan/ag.vim',{'on_cmd' : 'Ag'})
|
||||
let g:ag_prg='ag --vimgrep'
|
||||
let g:ag_working_path_mode='r'
|
||||
call zvim#plug#add('dyng/ctrlsf.vim',{'on_cmd' : 'CtrlSF', 'on_map' : '<Plug>CtrlSF'})
|
||||
if zvim#plug#tap('ctrlsf.vim')
|
||||
call zvim#plug#defind_hooks('ctrlsf.vim')
|
||||
nmap <silent><leader>sn <Plug>CtrlSFCwordExec
|
||||
endif
|
||||
call zvim#plug#add('daisuzu/unite-adb')
|
||||
call zvim#plug#add('osyo-manga/unite-airline_themes')
|
||||
call zvim#plug#add('mattn/unite-vim_advent-calendar')
|
||||
call zvim#plug#add('mattn/unite-remotefile')
|
||||
call zvim#plug#add('sgur/unite-everything')
|
||||
call zvim#plug#add('kannokanno/unite-dwm')
|
||||
call zvim#plug#add('raw1z/unite-projects')
|
||||
call zvim#plug#add('voi/unite-ctags')
|
||||
call zvim#plug#add('Shougo/unite-session')
|
||||
call zvim#plug#add('osyo-manga/unite-quickfix')
|
||||
call zvim#plug#add('Shougo/vimfiler.vim',{'on_cmd' : 'VimFiler'})
|
||||
if zvim#plug#tap('vimfiler.vim')
|
||||
call zvim#plug#defind_hooks('vimfiler.vim')
|
||||
noremap <silent> <F3> :call zvim#util#OpenVimfiler()<CR>
|
||||
endif
|
||||
if g:settings.enable_googlesuggest
|
||||
call zvim#plug#add('mopp/googlesuggest-source.vim')
|
||||
call zvim#plug#add('mattn/googlesuggest-complete-vim')
|
||||
endif
|
||||
call zvim#plug#add('ujihisa/unite-colorscheme')
|
||||
call zvim#plug#add('mattn/unite-gist')
|
||||
call zvim#plug#add('tacroe/unite-mark')
|
||||
call zvim#plug#add('tacroe/unite-alias')
|
||||
call zvim#plug#add('tex/vim-unite-id')
|
||||
call zvim#plug#add('sgur/unite-qf')
|
||||
call zvim#plug#add('lambdalisue/unite-grep-vcs', {
|
||||
\ 'autoload': {
|
||||
\ 'unite_sources': ['grep/git', 'grep/hg'],
|
||||
\}})
|
||||
call zvim#plug#add('lambdalisue/vim-gista', {
|
||||
\ 'on_cmd': 'Gista'
|
||||
\})
|
||||
call zvim#plug#add('lambdalisue/vim-gista-unite')
|
||||
call zvim#plug#add('wsdjeg/unite-radio.vim')
|
||||
let g:unite_source_radio_play_cmd='mpv'
|
||||
"call zvim#plug#add('ujihisa/quicklearn')
|
||||
endif "}}}
|
||||
|
||||
|
||||
"{{{ctrlpvim settings
|
||||
if count(g:settings.plugin_groups, 'ctrlp') "{{{
|
||||
call zvim#plug#add('ctrlpvim/ctrlp.vim')
|
||||
if zvim#plug#tap('ctrlp.vim')
|
||||
call zvim#plug#defind_hooks('ctrlp.vim')
|
||||
endif
|
||||
if !has('nvim')
|
||||
call zvim#plug#add('wsdjeg/ctrlp-unity3d-docs', { 'on_cmd' : 'CtrlPUnity3DDocs'})
|
||||
endif
|
||||
call zvim#plug#add('voronkovich/ctrlp-nerdtree.vim', { 'on_cmd' : 'CtrlPNerdTree'})
|
||||
call zvim#plug#add('elentok/ctrlp-objects.vim', { 'on_cmd' : [
|
||||
\'CtrlPModels',
|
||||
\'CtrlPViews',
|
||||
\'CtrlPControllers',
|
||||
\'CtrlPTemplates',
|
||||
\'CtrlPPresenters']})
|
||||
call zvim#plug#add('h14i/vim-ctrlp-buftab', { 'on_cmd' : 'CtrlPBufTab'})
|
||||
call zvim#plug#add('vim-scripts/ctrlp-cmdpalette', { 'on_cmd' : 'CtrlPCmdPalette'})
|
||||
call zvim#plug#add('mattn/ctrlp-windowselector', { 'on_cmd' : 'CtrlPWindowSelector'})
|
||||
call zvim#plug#add('the9ball/ctrlp-gtags', { 'on_cmd' : ['CtrlPGtagsX','CtrlPGtagsF','CtrlPGtagsR']})
|
||||
call zvim#plug#add('thiderman/ctrlp-project', { 'on_cmd' : 'CtrlPProject'})
|
||||
call zvim#plug#add('mattn/ctrlp-google', { 'on_cmd' : 'CtrlPGoogle'})
|
||||
call zvim#plug#add('ompugao/ctrlp-history', { 'on_cmd' : ['CtrlPCmdHistory','CtrlPSearchHistory']})
|
||||
call zvim#plug#add('pielgrzym/ctrlp-sessions', { 'on_cmd' : ['CtrlPSessions','MkS']})
|
||||
call zvim#plug#add('tacahiroy/ctrlp-funky', { 'on_cmd' : 'CtrlPFunky'})
|
||||
call zvim#plug#add('mattn/ctrlp-launcher', { 'on_cmd' : 'CtrlPLauncher'})
|
||||
call zvim#plug#add('sgur/ctrlp-extensions.vim', { 'on_cmd' : ['CtrlPCmdline','CtrlPMenu','CtrlPYankring']})
|
||||
call zvim#plug#add('FelikZ/ctrlp-py-matcher')
|
||||
call zvim#plug#add('lambdalisue/vim-gista-ctrlp', { 'on_cmd' : 'CtrlPGista'})
|
||||
endif "}}}
|
||||
|
||||
|
||||
if count(g:settings.plugin_groups, 'autocomplete') "{{{
|
||||
call zvim#plug#add('honza/vim-snippets',{'on_i' : 1})
|
||||
imap <silent><expr><TAB> zvim#tab()
|
||||
smap <expr><TAB> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
|
||||
inoremap <silent><expr><CR> zvim#enter()
|
||||
inoremap <silent> <Leader><Tab> <C-r>=MyLeaderTabfunc()<CR>
|
||||
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
|
||||
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
|
||||
inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>"
|
||||
inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"
|
||||
imap <expr><S-TAB> pumvisible() ? "\<C-p>" : ""
|
||||
smap <expr><S-TAB> pumvisible() ? "\<C-p>" : ""
|
||||
if g:settings.autocomplete_method ==# 'ycm' "{{{
|
||||
call zvim#plug#add('SirVer/ultisnips')
|
||||
let g:UltiSnipsExpandTrigger='<tab>'
|
||||
let g:UltiSnipsJumpForwardTrigger='<tab>'
|
||||
let g:UltiSnipsJumpBackwardTrigger='<S-tab>'
|
||||
let g:UltiSnipsSnippetsDir='~/DotFiles/snippets'
|
||||
call zvim#plug#add('ervandew/supertab')
|
||||
let g:SuperTabContextDefaultCompletionType = '<c-n>'
|
||||
let g:SuperTabDefaultCompletionType = '<C-n>'
|
||||
"autocmd InsertLeave * if pumvisible() ==# 0|pclose|endif
|
||||
let g:neobundle#install_process_timeout = 1500
|
||||
call zvim#plug#add('Valloric/YouCompleteMe')
|
||||
"let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
|
||||
"let g:ycm_confirm_extra_conf = 0
|
||||
let g:ycm_collect_identifiers_from_tags_files = 1
|
||||
let g:ycm_collect_identifiers_from_comments_and_strings = 1
|
||||
let g:ycm_key_list_select_completion = ['<C-TAB>', '<Down>']
|
||||
let g:ycm_key_list_previous_completion = ['<C-S-TAB>','<Up>']
|
||||
let g:ycm_seed_identifiers_with_syntax = 1
|
||||
let g:ycm_key_invoke_completion = '<leader><tab>'
|
||||
let g:ycm_semantic_triggers = {
|
||||
\ 'c' : ['->', '.'],
|
||||
\ 'objc' : ['->', '.'],
|
||||
\ 'ocaml' : ['.', '#'],
|
||||
\ 'cpp,objcpp' : ['->', '.', '::'],
|
||||
\ 'perl' : ['->'],
|
||||
\ 'php' : ['->', '::'],
|
||||
\ 'cs,javascript,d,python,perl6,scala,vb,elixir,go' : ['.'],
|
||||
\ 'java,jsp' : ['.'],
|
||||
\ 'vim' : ['re![_a-zA-Z]+[_\w]*\.'],
|
||||
\ 'ruby' : ['.', '::'],
|
||||
\ 'lua' : ['.', ':'],
|
||||
\ 'erlang' : [':'],
|
||||
\ }
|
||||
elseif g:settings.autocomplete_method ==# 'neocomplete' "{{{
|
||||
call zvim#plug#add('Shougo/neocomplete', {
|
||||
\ 'on_i' : 1,
|
||||
\ })
|
||||
if zvim#plug#tap('neocomplete')
|
||||
call zvim#plug#defind_hooks('neocomplete.vim')
|
||||
endif
|
||||
elseif g:settings.autocomplete_method ==# 'neocomplcache' "{{{
|
||||
call zvim#plug#add('Shougo/neocomplcache.vim', {
|
||||
\ 'on_i' : 1,
|
||||
\ })
|
||||
if zvim#plug#tap('neocomplcache.vim')
|
||||
call zvim#plug#defind_hooks('neocomplcache.vim')
|
||||
endif
|
||||
elseif g:settings.autocomplete_method ==# 'deoplete'
|
||||
call zvim#plug#add('Shougo/deoplete.nvim', {
|
||||
\ 'on_i' : 1,
|
||||
\ })
|
||||
if zvim#plug#tap('deoplete.nvim')
|
||||
call zvim#plug#defind_hooks('deoplete.nvim')
|
||||
endif
|
||||
call zvim#plug#add('zchee/deoplete-jedi', { 'on_ft' : 'python'})
|
||||
endif "}}}
|
||||
call zvim#plug#add('Shougo/neco-syntax', { 'on_i' : 1})
|
||||
call zvim#plug#add('ujihisa/neco-look', { 'on_i' : 1})
|
||||
call zvim#plug#add('Shougo/neco-vim', { 'on_i' : 1})
|
||||
if !exists('g:necovim#complete_functions')
|
||||
let g:necovim#complete_functions = {}
|
||||
endif
|
||||
let g:necovim#complete_functions.Ref =
|
||||
\ 'ref#complete'
|
||||
call zvim#plug#add('Shougo/context_filetype.vim', { 'on_i' : 1})
|
||||
call zvim#plug#add('Shougo/neoinclude.vim', { 'on_i' : 1})
|
||||
call zvim#plug#add('Shougo/neosnippet-snippets', { 'merged' : 0})
|
||||
call zvim#plug#add('Shougo/neosnippet.vim', { 'on_i' : 1 , 'on_ft' : 'neosnippet'})
|
||||
if zvim#plug#tap('neosnippet.vim')
|
||||
call zvim#plug#defind_hooks('neosnippet.vim')
|
||||
endif
|
||||
call zvim#plug#add('Shougo/neopairs.vim', { 'on_i' : 1})
|
||||
endif "}}}
|
||||
|
||||
if count(g:settings.plugin_groups, 'colorscheme') "{{{
|
||||
"colorscheme
|
||||
call zvim#plug#add('morhetz/gruvbox')
|
||||
if zvim#plug#tap('gruvbox')
|
||||
call zvim#plug#defind_hooks('gruvbox')
|
||||
endif
|
||||
call zvim#plug#add('kabbamine/yowish.vim')
|
||||
call zvim#plug#add('tomasr/molokai')
|
||||
call zvim#plug#add('mhinz/vim-janah')
|
||||
call zvim#plug#add('mhartington/oceanic-next')
|
||||
call zvim#plug#add('nanotech/jellybeans.vim')
|
||||
call zvim#plug#add('altercation/vim-colors-solarized')
|
||||
call zvim#plug#add('kristijanhusak/vim-hybrid-material')
|
||||
endif
|
||||
|
||||
if count(g:settings.plugin_groups, 'chinese') "{{{
|
||||
call zvim#plug#add('vimcn/vimcdoc')
|
||||
endif
|
||||
|
||||
call zvim#plug#add('junegunn/vim-github-dashboard', { 'on_cmd':['GHD','GHA','GHActivity','GHDashboard']})
|
||||
if count(g:settings.plugin_groups, 'vim') "{{{
|
||||
call zvim#plug#add('Shougo/vimshell.vim', { 'on_cmd':['VimShell']})
|
||||
call zvim#plug#add('mattn/vim-terminal', { 'on_cmd':['Terminal']})
|
||||
call zvim#plug#add('davidhalter/jedi-vim', { 'on_ft' : 'python'})
|
||||
if zvim#plug#tap('jedi-vim')
|
||||
call zvim#plug#defind_hooks('jedi-vim')
|
||||
endif
|
||||
endif
|
||||
if count(g:settings.plugin_groups, 'nvim') "{{{
|
||||
call zvim#plug#add('m2mdas/phpcomplete-extended', { 'on_ft' : 'php'})
|
||||
if zvim#plug#tap('phpcomplete-extended')
|
||||
call zvim#plug#defind_hooks('phpcomplete-extended')
|
||||
endif
|
||||
endif
|
||||
call zvim#plug#add('tpope/vim-scriptease')
|
||||
call zvim#plug#add('tpope/vim-fugitive')
|
||||
call zvim#plug#add('cohama/agit.vim', { 'on_cmd':['Agit','AgitFile']})
|
||||
call zvim#plug#add('gregsexton/gitv', { 'on_cmd':['Gitv']})
|
||||
call zvim#plug#add('tpope/vim-surround')
|
||||
call zvim#plug#add('terryma/vim-multiple-cursors')
|
||||
let g:multi_cursor_next_key='<C-j>'
|
||||
let g:multi_cursor_prev_key='<C-k>'
|
||||
let g:multi_cursor_skip_key='<C-x>'
|
||||
let g:multi_cursor_quit_key='<Esc>'
|
||||
|
||||
"web plugins
|
||||
|
||||
call zvim#plug#add('groenewege/vim-less', { 'on_ft':['less']})
|
||||
call zvim#plug#add('cakebaker/scss-syntax.vim', { 'on_ft':['scss','sass']})
|
||||
call zvim#plug#add('hail2u/vim-css3-syntax', { 'on_ft':['css','scss','sass']})
|
||||
call zvim#plug#add('ap/vim-css-color', { 'on_ft':['css','scss','sass','less','styl']})
|
||||
call zvim#plug#add('othree/html5.vim', { 'on_ft':['html']})
|
||||
call zvim#plug#add('wavded/vim-stylus', { 'on_ft':['styl']})
|
||||
call zvim#plug#add('digitaltoad/vim-jade', { 'on_ft':['jade']})
|
||||
call zvim#plug#add('juvenn/mustache.vim', { 'on_ft':['mustache']})
|
||||
call zvim#plug#add('Valloric/MatchTagAlways', { 'on_ft':['html' , 'xhtml' , 'xml' , 'jinja']})
|
||||
call zvim#plug#add('pangloss/vim-javascript', { 'on_ft':['javascript']})
|
||||
call zvim#plug#add('maksimr/vim-jsbeautify', { 'on_ft':['javascript']})
|
||||
call zvim#plug#add('leafgarland/typescript-vim', { 'on_ft':['typescript']})
|
||||
call zvim#plug#add('kchmck/vim-coffee-script', { 'on_ft':['coffee']})
|
||||
call zvim#plug#add('mmalecki/vim-node.js', { 'on_ft':['javascript']})
|
||||
call zvim#plug#add('leshill/vim-json', { 'on_ft':['javascript','json']})
|
||||
call zvim#plug#add('othree/javascript-libraries-syntax.vim', { 'on_ft':['javascript','coffee','ls','typescript']})
|
||||
if g:settings.enable_javacomplete2_py
|
||||
call zvim#plug#add('wsdjeg/vim-javacomplete2', { 'on_ft' : ['java','jsp']})
|
||||
else
|
||||
call zvim#plug#add('artur-shaik/vim-javacomplete2', { 'on_ft' : ['java','jsp']})
|
||||
endif
|
||||
let g:JavaComplete_UseFQN = 1
|
||||
let g:JavaComplete_ServerAutoShutdownTime = 300
|
||||
let g:JavaComplete_MavenRepositoryDisable = 0
|
||||
call zvim#plug#add('wsdjeg/vim-dict', { 'on_ft' : 'java'})
|
||||
call zvim#plug#add('wsdjeg/SourceCounter.vim', { 'on_cmd' : 'SourceCounter'})
|
||||
call zvim#plug#add('wsdjeg/java_getset.vim', { 'on_ft' : 'java'})
|
||||
if zvim#plug#tap('java_getset.vim')
|
||||
call zvim#plug#defind_hooks('java_getset.vim')
|
||||
endif
|
||||
call zvim#plug#add('wsdjeg/JavaUnit.vim', { 'on_ft' : 'java'})
|
||||
call zvim#plug#add('jaxbot/github-issues.vim', { 'on_cmd' : 'Gissues'})
|
||||
call zvim#plug#add('wsdjeg/Mysql.vim', { 'on_cmd' : 'SQLGetConnection'})
|
||||
call zvim#plug#add('wsdjeg/vim-cheat', { 'on_cmd' : 'Cheat'})
|
||||
call zvim#plug#add('wsdjeg/vim-chat', { 'merged' : 0})
|
||||
call zvim#plug#add('wsdjeg/job.vim', { 'merged' : 0})
|
||||
call zvim#plug#add('wsdjeg/GitHub-api.vim')
|
||||
call zvim#plug#add('vim-jp/vim-java', { 'on_ft' : 'java'})
|
||||
call zvim#plug#add('vim-airline/vim-airline', { 'merged' : 0})
|
||||
call zvim#plug#add('vim-airline/vim-airline-themes', { 'merged' : 0})
|
||||
if zvim#plug#tap('vim-airline')
|
||||
call zvim#plug#defind_hooks('vim-airline')
|
||||
endif
|
||||
call zvim#plug#add('mattn/emmet-vim', { 'on_cmd' : 'EmmetInstall'})
|
||||
let g:user_emmet_install_global = 0
|
||||
let g:user_emmet_leader_key='<C-e>'
|
||||
let g:user_emmet_mode='a'
|
||||
let g:user_emmet_settings = {
|
||||
\ 'jsp' : {
|
||||
\ 'extends' : 'html',
|
||||
\ },
|
||||
\}
|
||||
" use this two command to find how long the plugin take!
|
||||
"profile start vim-javacomplete2.log
|
||||
"profile! file */vim-javacomplete2/*
|
||||
if g:settings.enable_neomake
|
||||
call zvim#plug#add('neomake/neomake',{'merged' : 0})
|
||||
if zvim#plug#tap('neomake')
|
||||
call zvim#plug#defind_hooks('neomake')
|
||||
augroup Neomake_wsd
|
||||
au!
|
||||
autocmd! BufWritePost * Neomake
|
||||
augroup END
|
||||
endif
|
||||
else
|
||||
call zvim#plug#add('wsdjeg/syntastic', {'on_event': 'WinEnter'})
|
||||
if zvim#plug#tap('syntastic')
|
||||
call zvim#plug#defind_hooks('syntastic')
|
||||
endif
|
||||
endif
|
||||
call zvim#plug#add('syngan/vim-vimlint',{'on_ft' : 'vim'})
|
||||
let g:syntastic_vimlint_options = {
|
||||
\'EVL102': 1 ,
|
||||
\'EVL103': 1 ,
|
||||
\'EVL205': 1 ,
|
||||
\'EVL105': 1 ,
|
||||
\}
|
||||
call zvim#plug#add('ynkdir/vim-vimlparser',{'on_ft' : 'vim'})
|
||||
call zvim#plug#add('todesking/vint-syntastic',{'on_ft' : 'vim'})
|
||||
"let g:syntastic_vim_checkers = ['vint']
|
||||
call zvim#plug#add('gcmt/wildfire.vim',{'on_map' : '<Plug>(wildfire-'})
|
||||
noremap <SPACE> <Plug>(wildfire-fuel)
|
||||
vnoremap <C-SPACE> <Plug>(wildfire-water)
|
||||
let g:wildfire_objects = ["i'", 'i"', 'i)', 'i]', 'i}', 'ip', 'it']
|
||||
|
||||
call zvim#plug#add('scrooloose/nerdcommenter')
|
||||
call zvim#plug#add('easymotion/vim-easymotion',{'on_map' : '<Plug>(easymotion-prefix)'})
|
||||
if zvim#plug#tap('vim-easymotion')
|
||||
map <Leader><Leader> <Plug>(easymotion-prefix)
|
||||
endif
|
||||
|
||||
call zvim#plug#add('MarcWeber/vim-addon-mw-utils')
|
||||
call zvim#plug#add('mhinz/vim-startify')
|
||||
if zvim#plug#tap('vim-startify')
|
||||
call zvim#plug#defind_hooks('vim-startify')
|
||||
endif
|
||||
call zvim#plug#add('mhinz/vim-signify')
|
||||
let g:signify_disable_by_default = 0
|
||||
let g:signify_line_highlight = 0
|
||||
call zvim#plug#add('mhinz/vim-grepper' , { 'on_cmd' : 'Grepper' } )
|
||||
if zvim#plug#tap('vim-grepper')
|
||||
call zvim#plug#defind_hooks('vim-grepper')
|
||||
endif
|
||||
call zvim#plug#add('airblade/vim-rooter')
|
||||
let g:rooter_silent_chdir = 1
|
||||
call zvim#plug#add('Yggdroot/indentLine')
|
||||
let g:indentLine_color_term = 239
|
||||
let g:indentLine_color_gui = '#09AA08'
|
||||
let g:indentLine_char = '¦'
|
||||
let g:indentLine_concealcursor = 'niv' " (default 'inc')
|
||||
let g:indentLine_conceallevel = 2 " (default 2)
|
||||
call zvim#plug#add('godlygeek/tabular', { 'on_cmd': 'Tabularize'})
|
||||
call zvim#plug#add('benizi/vim-automkdir')
|
||||
"[c ]c jump between prev or next hunk
|
||||
call zvim#plug#add('airblade/vim-gitgutter',{'on_cmd' : 'GitGutterEnable'})
|
||||
call zvim#plug#add('itchyny/calendar.vim', { 'on_cmd' : 'Calendar'})
|
||||
call zvim#plug#add('lilydjwg/fcitx.vim', { 'on_i' : 1})
|
||||
call zvim#plug#add('junegunn/goyo.vim', { 'on_cmd' : 'Goyo'})
|
||||
if zvim#plug#tap('goyo.vim')
|
||||
call zvim#plug#defind_hooks('goyo.vim')
|
||||
endif
|
||||
"vim Wimdows config
|
||||
call zvim#plug#add('scrooloose/nerdtree',{'on_cmd':'NERDTreeToggle'})
|
||||
if zvim#plug#tap('nerdtree')
|
||||
call zvim#plug#defind_hooks('nerdtree')
|
||||
function! OpenOrCloseNERDTree()
|
||||
exec 'normal! A'
|
||||
endfunction
|
||||
noremap <silent> <F9> :NERDTreeToggle<CR>
|
||||
let g:NERDTreeWinPos='right'
|
||||
let g:NERDTreeWinSize=31
|
||||
let g:NERDTreeChDirMode=1
|
||||
autocmd bufenter * if (winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree()) | q | endif
|
||||
augroup nerdtree_zvim
|
||||
autocmd!
|
||||
autocmd FileType nerdtree nnoremap <silent><buffer><Space> :call OpenOrCloseNERDTree()<cr>
|
||||
augroup END
|
||||
endif
|
||||
call zvim#plug#add('tpope/vim-projectionist',{'on_cmd':['A','AS','AV','AT','AD','Cd','Lcd','ProjectDo']})
|
||||
call zvim#plug#add('Xuyuanp/nerdtree-git-plugin')
|
||||
call zvim#plug#add('taglist.vim',{'on_cmd' : 'TlistToggle'})
|
||||
if zvim#plug#tap('taglist.vim')
|
||||
call zvim#plug#defind_hooks('taglist.vim')
|
||||
noremap <silent> <F8> :TlistToggle<CR>
|
||||
endif
|
||||
call zvim#plug#add('ntpeters/vim-better-whitespace',{'on_cmd' : 'StripWhitespace'})
|
||||
call zvim#plug#add('junegunn/rainbow_parentheses.vim',{'on_cmd' : 'RainbowParentheses'})
|
||||
augroup rainbow_lisp
|
||||
autocmd!
|
||||
autocmd FileType lisp,clojure,scheme,java RainbowParentheses
|
||||
augroup END
|
||||
let g:rainbow#max_level = 16
|
||||
let g:rainbow#pairs = [['(', ')'], ['[', ']'],['{','}']]
|
||||
" List of colors that you do not want. ANSI code or #RRGGBB
|
||||
let g:rainbow#blacklist = [233, 234]
|
||||
call zvim#plug#add('majutsushi/tagbar')
|
||||
if zvim#plug#tap('tagbar')
|
||||
call zvim#plug#defind_hooks('tagbar')
|
||||
noremap <silent> <F2> :TagbarToggle<CR>
|
||||
endif
|
||||
"}}}
|
||||
|
||||
call zvim#plug#add('floobits/floobits-neovim', { 'on_cmd' : ['FlooJoinWorkspace','FlooShareDirPublic','FlooShareDirPrivate']})
|
||||
call zvim#plug#add('wsdjeg/MarkDown.pl', { 'on_cmd' : 'MarkDownPreview'})
|
||||
call zvim#plug#add('plasticboy/vim-markdown', { 'on_ft' : 'markdown'})
|
||||
let g:vim_markdown_conceal = 0
|
||||
let g:vim_markdown_folding_disabled = 1
|
||||
call zvim#plug#add('simnalamburt/vim-mundo', { 'on_cmd' : 'MundoToggle'})
|
||||
nnoremap <silent> <F7> :MundoToggle<CR>
|
||||
call zvim#plug#add('TaskList.vim', { 'on_cmd' : 'TaskList'})
|
||||
map <unique> <Leader>td <Plug>TaskList
|
||||
call zvim#plug#add('ianva/vim-youdao-translater', { 'on_cmd' : ['Ydv','Ydc','Yde']})
|
||||
vnoremap <silent> <C-l> <Esc>:Ydv<CR>
|
||||
nnoremap <silent> <C-l> <Esc>:Ydc<CR>
|
||||
call zvim#plug#add('elixir-lang/vim-elixir', { 'on_ft' : 'elixir'})
|
||||
call zvim#plug#add('editorconfig/editorconfig-vim', { 'on_cmd' : 'EditorConfigReload'})
|
||||
call zvim#plug#add('junegunn/fzf', { 'on_cmd' : 'FZF'})
|
||||
nnoremap <Leader>fz :FZF<CR>
|
||||
call zvim#plug#add('junegunn/gv.vim', { 'on_cmd' : 'GV'})
|
||||
call zvim#plug#add('tyru/open-browser.vim', {
|
||||
\'on_cmd' : ['OpenBrowserSmartSearch','OpenBrowser','OpenBrowserSearch'],
|
||||
\'on_map' : '<Plug>(openbrowser-',
|
||||
\})
|
||||
if zvim#plug#tap('open-brower.vim')
|
||||
call zvim#plug#defind_hooks('open-brower.vim')
|
||||
endif
|
||||
call zvim#plug#add('racer-rust/vim-racer', {'on_ft' : 'rust'})
|
||||
let g:racer_cmd = $HOME.'/.cargo/bin/racer'
|
||||
call zvim#plug#add('rust-lang/rust.vim')
|
||||
call zvim#plug#add('PotatoesMaster/i3-vim-syntax', {'on_ft' : 'i3'})
|
||||
call zvim#plug#add('isundil/vim-irssi-syntax', {'on_ft' : 'irssi'})
|
||||
call zvim#plug#add('vimperator/vimperator.vim', {'on_ft' : 'vimperator'})
|
||||
call zvim#plug#add('lambdalisue/vim-gita', {'on_cmd': 'Gita'})
|
||||
call zvim#plug#add('tweekmonster/helpful.vim', {'on_cmd': 'HelpfulVersion'})
|
||||
" google plugins
|
||||
call zvim#plug#add('google/vim-searchindex')
|
||||
call zvim#plug#end()
|
||||
endif
|
54
config/plugins/ctrlp.vim
Normal file
54
config/plugins/ctrlp.vim
Normal file
@ -0,0 +1,54 @@
|
||||
let g:ctrlp_map = '<c-p>'
|
||||
let g:ctrlp_cmd = 'CtrlP'
|
||||
let g:ctrlp_working_path_mode = 'ra'
|
||||
let g:ctrlp_root_markers = 'pom.xml'
|
||||
let g:ctrlp_match_window = 'bottom,order:btt,min:1,max:15,results:15'
|
||||
let g:ctrlp_show_hidden = 1
|
||||
"for caching
|
||||
let g:ctrlp_use_caching = 500
|
||||
let g:ctrlp_clear_cache_on_exit = 1
|
||||
let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
|
||||
"let g:ctrlp_map = ',,'
|
||||
"let g:ctrlp_open_multiple_files = 'v'
|
||||
"if you have install ag, the g:ctrlp_custom_ignore will not work
|
||||
let g:ctrlp_custom_ignore = {
|
||||
\ 'dir': '\v[\/]\.(git|hg|svn)$|target',
|
||||
\ 'file': '\v\.(exe|so|dll|ttf|png)$|\-rplugin\~',
|
||||
\ 'link': 'some_bad_symbolic_links',
|
||||
\ }
|
||||
if executable('rg')
|
||||
let g:ctrlp_user_command = 'rg %s --no-ignore --hidden --files -g "" '
|
||||
\ . join(zvim#util#Generate_ignore(g:settings.wildignore,'rg'))
|
||||
elseif executable('ag')
|
||||
let g:ctrlp_user_command = 'ag %s --hidden -i -g "" ' . join(zvim#util#Generate_ignore(g:settings.wildignore,'ag'))
|
||||
endif
|
||||
let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
|
||||
"nnoremap <Leader>kk :CtrlPMixed<Cr>
|
||||
" comment for ctrlp-funky {{{
|
||||
nnoremap <Leader>fu :CtrlPFunky<Cr>
|
||||
" narrow the list down with a word under cursor
|
||||
nnoremap <Leader>fU :execute 'CtrlPFunky ' . expand('<cword>')<Cr>
|
||||
let g:ctrlp_funky_syntax_highlight = 1
|
||||
" }}}
|
||||
"for ctrlp_nerdtree {{{
|
||||
let g:ctrlp_nerdtree_show_hidden = 1
|
||||
"}}}
|
||||
"for ctrlp_sessions{{{
|
||||
let g:ctrlp_extensions = ['funky', 'sessions' , 'k' , 'tag', 'mixed', 'quickfix', 'undo', 'line', 'changes', 'cmdline', 'menu']
|
||||
"}}}
|
||||
"for k.vim {{{
|
||||
nnoremap <silent> <leader>qe :CtrlPK<CR>
|
||||
"}}}
|
||||
" for ctrlp-launcher {{{
|
||||
nnoremap <Leader>pl :<c-u>CtrlPLauncher<cr>
|
||||
"}}}
|
||||
""for ctrlp-cmatcher {{{
|
||||
"let g:ctrlp_max_files = 0
|
||||
"let g:ctrlp_match_func = {'match' : 'matcher#cmatch' }
|
||||
""}}}
|
||||
|
||||
augroup Fix_command_in_help_buffer
|
||||
au!
|
||||
autocmd FileType help exec 'nnoremap <buffer><silent><c-p> :<c-u>CtrlP ' . getcwd() .'<cr>'
|
||||
au FileType help exec "nnoremap <silent><buffer> q :q<CR>"
|
||||
augroup END
|
7
config/plugins/ctrlsf.vim
Normal file
7
config/plugins/ctrlsf.vim
Normal file
@ -0,0 +1,7 @@
|
||||
nmap <leader>sf <Plug>CtrlSFPrompt
|
||||
vmap <leader>sf <Plug>CtrlSFVwordPath
|
||||
vmap <leader>sF <Plug>CtrlSFVwordExec
|
||||
nmap <leader>sp <Plug>CtrlSFPwordPath
|
||||
nnoremap <leader>so :CtrlSFOpen<CR>
|
||||
nnoremap <leader>st :CtrlSFToggle<CR>
|
||||
inoremap <leader>st <Esc>:CtrlSFToggle<CR>
|
1
config/plugins/denite.vim
Normal file
1
config/plugins/denite.vim
Normal file
@ -0,0 +1 @@
|
||||
let g:denite_config_loaded = 1
|
28
config/plugins/deoplete.vim
Normal file
28
config/plugins/deoplete.vim
Normal file
@ -0,0 +1,28 @@
|
||||
let g:deoplete#enable_at_startup = 1
|
||||
let g:deoplete#enable_ignore_case = 1
|
||||
let g:deoplete#enable_smart_case = 1
|
||||
let g:deoplete#enable_camel_case = 1
|
||||
let g:deoplete#enable_refresh_always = 1
|
||||
let g:deoplete#max_abbr_width = 0
|
||||
let g:deoplete#max_menu_width = 0
|
||||
let g:deoplete#omni#input_patterns = get(g:,'deoplete#omni#input_patterns',{})
|
||||
let g:deoplete#omni#input_patterns.java = [
|
||||
\'[^. \t0-9]\.\w*',
|
||||
\'[^. \t0-9]\->\w*',
|
||||
\'[^. \t0-9]\::\w*',
|
||||
\]
|
||||
let g:deoplete#omni#input_patterns.jsp = ['[^. \t0-9]\.\w*']
|
||||
let g:deoplete#omni#input_patterns.php = '\h\w*\|[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'
|
||||
let g:deoplete#ignore_sources = {}
|
||||
if g:settings.enable_javacomplete2_py
|
||||
let g:deoplete#ignore_sources.java = ['omni']
|
||||
call deoplete#custom#set('javacomplete2', 'mark', '')
|
||||
else
|
||||
let g:deoplete#ignore_sources.java = ['javacomplete2']
|
||||
call deoplete#custom#set('omni', 'mark', '')
|
||||
endif
|
||||
call deoplete#custom#set('_', 'matchers', ['matcher_full_fuzzy'])
|
||||
"call deoplete#custom#set('omni', 'min_pattern_length', 0)
|
||||
inoremap <expr><C-h> deoplete#mappings#smart_close_popup()."\<C-h>"
|
||||
inoremap <expr><BS> deoplete#mappings#smart_close_popup()."\<C-h>"
|
||||
set isfname-==
|
18
config/plugins/goyo.vim
Normal file
18
config/plugins/goyo.vim
Normal file
@ -0,0 +1,18 @@
|
||||
function! s:goyo_enter()
|
||||
silent !tmux set status off
|
||||
set noshowmode
|
||||
set noshowcmd
|
||||
set scrolloff=999
|
||||
Limelight
|
||||
endfunction
|
||||
|
||||
function! s:goyo_leave()
|
||||
silent !tmux set status on
|
||||
set showmode
|
||||
set showcmd
|
||||
set scrolloff=5
|
||||
endfunction
|
||||
augroup goyo_map
|
||||
autocmd! User GoyoEnter nested call <SID>goyo_enter()
|
||||
autocmd! User GoyoLeave nested call <SID>goyo_leave()
|
||||
augroup END
|
1
config/plugins/gruvbox.vim
Normal file
1
config/plugins/gruvbox.vim
Normal file
@ -0,0 +1 @@
|
||||
let g:gruvbox_italic = 1
|
19
config/plugins/java_getset.vim
Normal file
19
config/plugins/java_getset.vim
Normal file
@ -0,0 +1,19 @@
|
||||
let g:java_getset_disable_map = 1
|
||||
let g:javagetset_setterTemplate =
|
||||
\ "/**\n" .
|
||||
\ " * Set %varname%.\n" .
|
||||
\ " *\n" .
|
||||
\ " * @param %varname% the value to set.\n" .
|
||||
\ " */\n" .
|
||||
\ "%modifiers% void %funcname%(%type% %varname%){\n" .
|
||||
\ " this.%varname% = %varname%;\n" .
|
||||
\ "}"
|
||||
let g:javagetset_getterTemplate =
|
||||
\ "/**\n" .
|
||||
\ " * Get %varname%.\n" .
|
||||
\ " *\n" .
|
||||
\ " * @return %varname% as %type%.\n" .
|
||||
\ " */\n" .
|
||||
\ "%modifiers% %type% %funcname%(){\n" .
|
||||
\ " return %varname%;\n" .
|
||||
\ "}"
|
0
config/plugins/jedi-vim.vim
Normal file
0
config/plugins/jedi-vim.vim
Normal file
84
config/plugins/neocomplcache.vim
Normal file
84
config/plugins/neocomplcache.vim
Normal file
@ -0,0 +1,84 @@
|
||||
"---------------------------------------------------------------------------
|
||||
" neocomplache.vim
|
||||
"
|
||||
let g:neocomplcache_enable_at_startup = 1
|
||||
" Use smartcase
|
||||
let g:neocomplcache_enable_smart_case = 1
|
||||
" Use camel case completion.
|
||||
let g:neocomplcache_enable_camel_case_completion = 1
|
||||
" Use underbar completion.
|
||||
let g:neocomplcache_enable_underbar_completion = 1
|
||||
" Use fuzzy completion.
|
||||
let g:neocomplcache_enable_fuzzy_completion = 1
|
||||
|
||||
" Set minimum syntax keyword length.
|
||||
let g:neocomplcache_min_syntax_length = 3
|
||||
" Set auto completion length.
|
||||
let g:neocomplcache_auto_completion_start_length = 2
|
||||
" Set manual completion length.
|
||||
let g:neocomplcache_manual_completion_start_length = 0
|
||||
" Set minimum keyword length.
|
||||
let g:neocomplcache_min_keyword_length = 3
|
||||
" let g:neocomplcache_enable_cursor_hold_i = v:version > 703 ||
|
||||
" \ v:version == 703 && has('patch289')
|
||||
let g:neocomplcache_enable_cursor_hold_i = 0
|
||||
let g:neocomplcache_cursor_hold_i_time = 300
|
||||
let g:neocomplcache_enable_insert_char_pre = 1
|
||||
let g:neocomplcache_enable_prefetch = 1
|
||||
let g:neocomplcache_skip_auto_completion_time = '0.6'
|
||||
|
||||
" For auto select.
|
||||
let g:neocomplcache_enable_auto_select = 1
|
||||
|
||||
let g:neocomplcache_enable_auto_delimiter = 1
|
||||
let g:neocomplcache_disable_auto_select_buffer_name_pattern =
|
||||
\ '\[Command Line\]'
|
||||
"let g:neocomplcache_disable_auto_complete = 0
|
||||
let g:neocomplcache_max_list = 100
|
||||
let g:neocomplcache_force_overwrite_completefunc = 1
|
||||
if !exists('g:neocomplcache_omni_patterns')
|
||||
let g:neocomplcache_omni_patterns = {}
|
||||
endif
|
||||
if !exists('g:neocomplcache_omni_functions')
|
||||
let g:neocomplcache_omni_functions = {}
|
||||
endif
|
||||
if !exists('g:neocomplcache_force_omni_patterns')
|
||||
let g:neocomplcache_force_omni_patterns = {}
|
||||
endif
|
||||
let g:neocomplcache_enable_auto_close_preview = 1
|
||||
" let g:neocomplcache_force_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'
|
||||
let g:neocomplcache_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'
|
||||
let g:neocomplcache_omni_patterns.java = '[^. *\t]\.\w*\|\h\w*::'
|
||||
let g:neocomplcache_force_omni_patterns.java = '[^. *\t]\.\w*\|\h\w*::'
|
||||
|
||||
" For clang_complete.
|
||||
let g:neocomplcache_force_overwrite_completefunc = 1
|
||||
let g:neocomplcache_force_omni_patterns.c =
|
||||
\ '[^.[:digit:] *\t]\%(\.\|->\)'
|
||||
let g:neocomplcache_force_omni_patterns.cpp =
|
||||
\ '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
|
||||
let g:clang_complete_auto = 0
|
||||
let g:clang_auto_select = 0
|
||||
let g:clang_use_library = 1
|
||||
|
||||
" Define keyword pattern.
|
||||
if !exists('g:neocomplcache_keyword_patterns')
|
||||
let g:neocomplcache_keyword_patterns = {}
|
||||
endif
|
||||
let g:neocomplcache_keyword_patterns['default'] = '[0-9a-zA-Z:#_]\+'
|
||||
let g:neocomplcache_keyword_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
|
||||
let g:neocomplete#enable_multibyte_completion = 1
|
||||
|
||||
let g:neocomplcache_vim_completefuncs = {
|
||||
\ 'Ref' : 'ref#complete',
|
||||
\ 'Unite' : 'unite#complete_source',
|
||||
\ 'VimShellExecute' :
|
||||
\ 'vimshell#vimshell_execute_complete',
|
||||
\ 'VimShellInteractive' :
|
||||
\ 'vimshell#vimshell_execute_complete',
|
||||
\ 'VimShellTerminal' :
|
||||
\ 'vimshell#vimshell_execute_complete',
|
||||
\ 'VimShell' : 'vimshell#complete',
|
||||
\ 'VimFiler' : 'vimfiler#complete',
|
||||
\ 'Vinarise' : 'vinarise#complete',
|
||||
\}
|
46
config/plugins/neocomplete.vim
Normal file
46
config/plugins/neocomplete.vim
Normal file
@ -0,0 +1,46 @@
|
||||
let g:neocomplete#data_directory='~/.cache/neocomplete'
|
||||
let g:acp_enableAtStartup = 0
|
||||
let g:neocomplete#enable_at_startup = 1
|
||||
" Use smartcase.
|
||||
let g:neocomplete#enable_smart_case = 1
|
||||
let g:neocomplete#enable_camel_case = 1
|
||||
"let g:neocomplete#enable_ignore_case = 1
|
||||
let g:neocomplete#enable_fuzzy_completion = 1
|
||||
" Set minimum syntax keyword length.
|
||||
let g:neocomplete#sources#syntax#min_keyword_length = 3
|
||||
let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
|
||||
|
||||
" Define dictionary.
|
||||
let g:neocomplete#sources#dictionary#dictionaries = {
|
||||
\ 'default' : '',
|
||||
\ 'vimshell' : $CACHE.'/vimshell/command-history',
|
||||
\ 'java' : '~/.vim/dict/java.dict',
|
||||
\ 'ruby' : '~/.vim/dict/ruby.dict',
|
||||
\ 'scala' : '~/.vim/dict/scala.dict',
|
||||
\ }
|
||||
|
||||
let g:neocomplete#enable_auto_delimiter = 1
|
||||
|
||||
" Define keyword.
|
||||
if !exists('g:neocomplete#keyword_patterns')
|
||||
let g:neocomplete#keyword_patterns = {}
|
||||
endif
|
||||
let g:neocomplete#keyword_patterns._ = '\h\k*(\?'
|
||||
|
||||
|
||||
" AutoComplPop like behavior.
|
||||
let g:neocomplete#enable_auto_select = 0
|
||||
|
||||
if !exists('g:neocomplete#sources#omni#input_patterns')
|
||||
let g:neocomplete#sources#omni#input_patterns = {}
|
||||
endif
|
||||
|
||||
let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
|
||||
let g:neocomplete#sources#omni#input_patterns.java ='[^. \t0-9]\.\w*'
|
||||
let g:neocomplete#force_omni_input_patterns = {}
|
||||
"let g:neocomplete#force_omni_input_patterns.java = '^\s*'
|
||||
" <C-h>, <BS>: close popup and delete backword char.
|
||||
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
|
||||
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
|
||||
inoremap <expr><C-y> neocomplete#close_popup()
|
||||
inoremap <expr><C-e> neocomplete#cancel_popup()
|
12
config/plugins/neomake.vim
Normal file
12
config/plugins/neomake.vim
Normal file
@ -0,0 +1,12 @@
|
||||
scriptencoding utf-8
|
||||
let g:neomake_open_list = 2 " 1 open list and move cursor 2 open list without move cursor
|
||||
let g:neomake_verbose = 0
|
||||
let g:neomake_java_javac_delete_output = 0
|
||||
let g:neomake_error_sign = {
|
||||
\ 'text': get(g:settings, 'error_symbol', '✖'),
|
||||
\ 'texthl': (g:settings.colorscheme ==# 'gruvbox' ? 'GruvboxRedSign' : 'error'),
|
||||
\ }
|
||||
let g:neomake_warning_sign = {
|
||||
\ 'text': get(g:settings, 'warning_symbol', '➤'),
|
||||
\ 'texthl': (g:settings.colorscheme ==# 'gruvbox' ? 'GruvboxYellowSign' : 'todo'),
|
||||
\ }
|
24
config/plugins/neosnippet.vim
Normal file
24
config/plugins/neosnippet.vim
Normal file
@ -0,0 +1,24 @@
|
||||
if isdirectory(expand('~/DotFiles/snippets/'))
|
||||
let g:neosnippet#snippets_directory = expand('~/DotFiles/snippets/')
|
||||
endif
|
||||
let g:neosnippet#enable_snipmate_compatibility=1
|
||||
let g:neosnippet#enable_complete_done = 1
|
||||
let g:neosnippet#completed_pairs= {}
|
||||
let g:neosnippet#completed_pairs.java = {'(' : ')'}
|
||||
if g:neosnippet#enable_complete_done
|
||||
let g:neopairs#enable = 0
|
||||
endif
|
||||
augroup neosnippet_complete_done
|
||||
autocmd!
|
||||
autocmd CompleteDone * call s:my_complete_done()
|
||||
augroup END
|
||||
function! s:my_complete_done() abort "{{{
|
||||
if !empty(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()
|
||||
call neosnippet#view#_insert(snippet, {}, cur_text, col)
|
||||
endif
|
||||
endfunction"}}}
|
31
config/plugins/open-brower.vim
Normal file
31
config/plugins/open-brower.vim
Normal file
@ -0,0 +1,31 @@
|
||||
"for open-browser {{{
|
||||
" This is my setting.
|
||||
let g:netrw_nogx = 1 " disable netrw's gx mapping.
|
||||
"nmap gx <Plug>(openbrowser-smart-search)
|
||||
"vmap gx <Plug>(openbrowser-smart-search)
|
||||
"" Open URI under cursor.
|
||||
nnoremap go <Plug>(openbrowser-open)
|
||||
"" Open selected URI.
|
||||
vnoremap go <Plug>(openbrowser-open)
|
||||
" Search word under cursor.
|
||||
nnoremap gs <Plug>(openbrowser-search)
|
||||
" Search selected word.
|
||||
vnoremap gs <Plug>(openbrowser-search)
|
||||
" If it looks like URI, Open URI under cursor.
|
||||
" Otherwise, Search word under cursor.
|
||||
nnoremap gx <Plug>(openbrowser-smart-search)
|
||||
" If it looks like URI, Open selected URI.
|
||||
" Otherwise, Search selected word.
|
||||
vnoremap gx <Plug>(openbrowser-smart-search)
|
||||
vnoremap gob :OpenBrowser http://www.baidu.com/s?wd=<C-R>=expand("<cword>")<cr><cr>
|
||||
nnoremap gob :OpenBrowser http://www.baidu.com/s?wd=<C-R>=expand("<cword>")<cr><cr>
|
||||
vnoremap gog :OpenBrowser http://www.google.com/?#newwindow=1&q=<C-R>=expand("<cword>")<cr><cr>
|
||||
nnoremap gog :OpenBrowser http://www.google.com/?#newwindow=1&q=<C-R>=expand("<cword>")<cr><cr>
|
||||
vnoremap goi :OpenBrowserSmartSearch http://www.iciba.com/<C-R>=expand("<cword>")<cr><cr>
|
||||
nnoremap goi :OpenBrowserSmartSearch http://www.iciba.com/<C-R>=expand("<cword>")<cr><cr>
|
||||
" In command-line
|
||||
":OpenBrowser http://google.com/
|
||||
":OpenBrowserSearch ggrks
|
||||
":OpenBrowserSmartSearch http://google.com/
|
||||
":OpenBrowserSmartSearch ggrks
|
||||
"}}}
|
0
config/plugins/phpcomplete-extended.vim
Normal file
0
config/plugins/phpcomplete-extended.vim
Normal file
12
config/plugins/syntastic.vim
Normal file
12
config/plugins/syntastic.vim
Normal file
@ -0,0 +1,12 @@
|
||||
scriptencoding utf-8
|
||||
if !filereadable('pom.xml') && !filereadable('build.gradle') && isdirectory('bin')
|
||||
let g:syntastic_java_javac_options = '-d bin'
|
||||
endif
|
||||
let g:syntastic_java_javac_config_file_enabled = 1
|
||||
let g:syntastic_java_javac_delete_output = 0
|
||||
let g:syntastic_always_populate_loc_list = 1
|
||||
let g:syntastic_auto_loc_list = 1
|
||||
let g:syntastic_check_on_open = 0
|
||||
let g:syntastic_check_on_wq = 0
|
||||
let g:syntastic_error_symbol = get(g:settings, 'error_symbol', '✖')
|
||||
let g:syntastic_warning_symbol = get(g:settings, 'warning_symbol', '➤')
|
2
config/plugins/tagbar.vim
Normal file
2
config/plugins/tagbar.vim
Normal file
@ -0,0 +1,2 @@
|
||||
let g:tagbar_width=30
|
||||
let g:tagbar_left = 1
|
11
config/plugins/taglist.vim
Normal file
11
config/plugins/taglist.vim
Normal file
@ -0,0 +1,11 @@
|
||||
scriptencoding utf-8
|
||||
if !executable('ctags')
|
||||
let g:Tlist_Ctags_Cmd = '/usr/bin/ctags' "设置ctags执行路径
|
||||
endif
|
||||
let g:Tlist_Auto_Update=1
|
||||
let g:Tlist_Auto_Open =0
|
||||
let g:Tlist_Use_Right_Window=1
|
||||
let g:Tlist_Show_One_File=0
|
||||
let g:Tlist_File_Fold_Auto_Close=1
|
||||
let g:Tlist_Exit_OnlyWindow=1
|
||||
let g:Tlist_Show_Menu=1
|
9
config/plugins/unite-gtags.vim
Normal file
9
config/plugins/unite-gtags.vim
Normal file
@ -0,0 +1,9 @@
|
||||
nnoremap <leader>gd :execute 'Unite -auto-preview -start-insert -no-split gtags/def:'.expand('<cword>')<CR>
|
||||
nnoremap <leader>gc :execute 'Unite -auto-preview -start-insert -no-split gtags/context'<CR>
|
||||
nnoremap <leader>gr :execute 'Unite -auto-preview -start-insert -no-split gtags/ref'<CR>
|
||||
nnoremap <leader>gg :execute 'Unite -auto-preview -start-insert -no-split gtags/grep'<CR>
|
||||
nnoremap <leader>gp :execute 'Unite -auto-preview -start-insert -no-split gtags/completion'<CR>
|
||||
vnoremap <leader>gd <ESC>:execute 'Unite -auto-preview -start-insert -no-split gtags/def:'.GetVisualSelection()<CR>
|
||||
let g:unite_source_gtags_project_config = {
|
||||
\ '_': { 'treelize': 0 }
|
||||
\ }
|
306
config/plugins/unite.vim
Normal file
306
config/plugins/unite.vim
Normal file
@ -0,0 +1,306 @@
|
||||
scriptencoding utf-8
|
||||
call unite#custom#source('codesearch', 'max_candidates', 30)
|
||||
call unite#filters#matcher_default#use(['matcher_fuzzy'])
|
||||
call unite#filters#sorter_default#use(['sorter_rank'])
|
||||
call unite#custom#profile('default', 'context', {
|
||||
\ 'safe': 0,
|
||||
\ 'start_insert': 1,
|
||||
\ 'ignorecase' : 1,
|
||||
\ 'short_source_names': 1,
|
||||
\ 'update_time': 200,
|
||||
\ 'direction': 'rightbelow',
|
||||
\ 'winwidth': 40,
|
||||
\ 'winheight': 15,
|
||||
\ 'max_candidates': 100,
|
||||
\ 'no_auto_resize': 1,
|
||||
\ 'vertical_preview': 1,
|
||||
\ 'cursor_line_time': '0.10',
|
||||
\ 'hide_icon': 0,
|
||||
\ 'candidate-icon': ' ',
|
||||
\ 'marked_icon': '✓',
|
||||
\ 'prompt' : '➭ '
|
||||
\ })
|
||||
call unite#custom#profile('source/neobundle/update', 'context', {
|
||||
\ 'start_insert' : 0,
|
||||
\ })
|
||||
let g:unite_source_codesearch_ignore_case = 1
|
||||
let g:unite_source_buffer_time_format = '(%m-%d-%Y %H:%M:%S) '
|
||||
let g:unite_source_file_mru_time_format = '(%m-%d-%Y %H:%M:%S) '
|
||||
let g:unite_source_directory_mru_time_format = '(%m-%d-%Y %H:%M:%S) '
|
||||
let g:unite_source_directory_mru_limit = 80
|
||||
let g:unite_source_file_rec_max_depth = 6
|
||||
let g:unite_enable_ignore_case = 1
|
||||
let g:unite_enable_smart_case = 1
|
||||
let g:unite_data_directory='~/.cache/unite'
|
||||
"let g:unite_enable_start_insert=1
|
||||
let g:unite_source_history_yank_enable=1
|
||||
let g:unite_split_rule = 'botright'
|
||||
let g:unite_winheight=25
|
||||
let g:unite_source_grep_default_opts = '-iRHn'
|
||||
\ . " --exclude='tags'"
|
||||
\ . " --exclude='cscope*'"
|
||||
\ . " --exclude='*.svn*'"
|
||||
\ . " --exclude='*.log*'"
|
||||
\ . " --exclude='*tmp*'"
|
||||
\ . " --exclude-dir='**/tmp'"
|
||||
\ . " --exclude-dir='CVS'"
|
||||
\ . " --exclude-dir='.svn'"
|
||||
\ . " --exclude-dir='.git'"
|
||||
\ . " --exclude-dir='node_modules'"
|
||||
let g:unite_launch_apps = [
|
||||
\ 'rake',
|
||||
\ 'make',
|
||||
\ 'git pull',
|
||||
\ 'git push']
|
||||
let g:unite_source_menu_menus = get(g:,'unite_source_menu_menus',{})
|
||||
let g:unite_source_menu_menus.git = {
|
||||
\ 'description' : ' gestionar repositorios git
|
||||
\ ⌘ [espacio]g',
|
||||
\}
|
||||
let g:unite_source_menu_menus.git.command_candidates = [
|
||||
\['▷ tig ⌘ ,gt',
|
||||
\'normal ,gt'],
|
||||
\['▷ git status (Fugitive) ⌘ ,gs',
|
||||
\'Gstatus'],
|
||||
\['▷ git diff (Fugitive) ⌘ ,gd',
|
||||
\'Gdiff'],
|
||||
\['▷ git commit (Fugitive) ⌘ ,gc',
|
||||
\'Gcommit'],
|
||||
\['▷ git log (Fugitive) ⌘ ,gl',
|
||||
\'exe "silent Glog | Unite quickfix"'],
|
||||
\['▷ git blame (Fugitive) ⌘ ,gb',
|
||||
\'Gblame'],
|
||||
\['▷ git stage (Fugitive) ⌘ ,gw',
|
||||
\'Gwrite'],
|
||||
\['▷ git checkout (Fugitive) ⌘ ,go',
|
||||
\'Gread'],
|
||||
\['▷ git rm (Fugitive) ⌘ ,gr',
|
||||
\'Gremove'],
|
||||
\['▷ git mv (Fugitive) ⌘ ,gm',
|
||||
\'exe "Gmove " input("destino: ")'],
|
||||
\['▷ git push (Fugitive, salida por buffer) ⌘ ,gp',
|
||||
\'Git! push'],
|
||||
\['▷ git pull (Fugitive, salida por buffer) ⌘ ,gP',
|
||||
\'Git! pull'],
|
||||
\['▷ git prompt (Fugitive, salida por buffer) ⌘ ,gi',
|
||||
\'exe "Git! " input("comando git: ")'],
|
||||
\['▷ git cd (Fugitive)',
|
||||
\'Gcd'],
|
||||
\]
|
||||
"===============================================================================
|
||||
" HTTP Status Code Definitions
|
||||
"===============================================================================
|
||||
let g:unite_source_menu_menus.StatusCodeDefinitions = {'description': 'HTTP status code definitions <leader>sc'}
|
||||
let g:unite_source_menu_menus.StatusCodeDefinitions.command_candidates = [
|
||||
\['➤ 100 Continue ', 'echo "Continue"'],
|
||||
\['➤ 101 Switching Protocols ', 'echo "Switching Protocols"'],
|
||||
\['➤ 200 OK ', 'echo "OK"'],
|
||||
\['➤ 201 Created ', 'echo "Created"'],
|
||||
\['➤ 202 Accepted ', 'echo "Accepted"'],
|
||||
\['➤ 203 Non-Authoritative Information ', 'echo "Non-Authoritative Information"'],
|
||||
\['➤ 204 No Content ', 'echo "No Content"'],
|
||||
\['➤ 205 Reset Content ', 'echo "Reset Content"'],
|
||||
\['➤ 206 Partial Content ', 'echo "Partial Content"'],
|
||||
\['➤ 300 Multiple Choices ', 'echo "Multiple Choices"'],
|
||||
\['➤ 301 Moved Permanently ', 'echo "Moved Permanently"'],
|
||||
\['➤ 302 Found ', 'echo "Found"'],
|
||||
\['➤ 303 See Other ', 'echo "See Other"'],
|
||||
\['➤ 304 Not Modified ', 'echo "Not Modified"'],
|
||||
\['➤ 305 Use Proxy ', 'echo "Use Proxy"'],
|
||||
\['➤ 307 Temporary Redirect ', 'echo "Temporary Redirect"'],
|
||||
\['➤ 400 Bad Request ', 'echo "Bad Request"'],
|
||||
\['➤ 401 Unauthorized ', 'echo "Unauthorized"'],
|
||||
\['➤ 402 Payment Required ', 'echo "Payment Required"'],
|
||||
\['➤ 403 Forbidden ', 'echo "Forbidden"'],
|
||||
\['➤ 404 Not Found ', 'echo "Not Found"'],
|
||||
\['➤ 405 Method Not Allowed ', 'echo "Method Not Allowed"'],
|
||||
\['➤ 406 Not Acceptable ', 'echo "Not Acceptable"'],
|
||||
\['➤ 407 Proxy Authentication Required ', 'echo "Proxy Authoritative Required"'],
|
||||
\['➤ 408 Request Timeout ', 'echo "Request Timeout"'],
|
||||
\['➤ 409 Conflict ', 'echo "Conflict"'],
|
||||
\['➤ 410 Gone ', 'echo "Gone"'],
|
||||
\['➤ 411 Length Required ', 'echo "Length Required"'],
|
||||
\['➤ 412 Precondition Failed ', 'echo "Precondition Failed"'],
|
||||
\['➤ 413 Request Entity Too Large ', 'echo "Request Entity Too Large"'],
|
||||
\['➤ 414 Request-URI Too Long ', 'echo "Request-URI Too Long"'],
|
||||
\['➤ 415 Unsupported Media Type ', 'echo "Unsupported Media Type"'],
|
||||
\['➤ 416 Requested Range Not Satisfiable ', 'echo "Requested Range Not Satisfiable"'],
|
||||
\['➤ 417 Expectation Failed ', 'echo "Expectation Failed"'],
|
||||
\['➤ 422 Unprocessable Entity ', 'echo "Unprocessable Entity"'],
|
||||
\['➤ 500 Internal Server Error ', 'echo "Internal Server Error"'],
|
||||
\['➤ 501 Not Implemented ', 'echo "Not Implemented"'],
|
||||
\['➤ 502 Bad Gateway ', 'echo "Bad Gateway"'],
|
||||
\['➤ 503 Service Unavailable ', 'echo "Service Unavailable"'],
|
||||
\['➤ 504 Gateway Timeout ', 'echo "Gateway Timeout"'],
|
||||
\['➤ 505 HTTP Version Not Supported ', 'echo "HTTP Version Not Supported"'],
|
||||
\]
|
||||
nnoremap <silent><leader>sc :Unite -silent -winheight=17 -start-insert menu:StatusCodeDefinitions<CR>
|
||||
let g:unite_source_grep_max_candidates = 200
|
||||
if executable('hw')
|
||||
" Use hw (highway)
|
||||
" https://github.com/tkengo/highway
|
||||
let g:unite_source_grep_command = 'hw'
|
||||
let g:unite_source_grep_default_opts = '--no-group --no-color'
|
||||
let g:unite_source_grep_recursive_opt = ''
|
||||
elseif executable('ag')
|
||||
" Use ag (the silver searcher)
|
||||
" https://github.com/ggreer/the_silver_searcher
|
||||
let g:unite_source_grep_command = 'ag'
|
||||
let g:unite_source_grep_default_opts =
|
||||
\ '-i --line-numbers --nocolor --nogroup --hidden --ignore ' .
|
||||
\ '''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr'''
|
||||
let g:unite_source_grep_recursive_opt = ''
|
||||
elseif executable('pt')
|
||||
" Use pt (the platinum searcher)
|
||||
" https://github.com/monochromegane/the_platinum_searcher
|
||||
let g:unite_source_grep_command = 'pt'
|
||||
let g:unite_source_grep_default_opts = '--nogroup --nocolor'
|
||||
let g:unite_source_grep_recursive_opt = ''
|
||||
elseif executable('ack-grep')
|
||||
" Use ack
|
||||
" http://beyondgrep.com/
|
||||
let g:unite_source_grep_command = 'ack-grep'
|
||||
let g:unite_source_grep_default_opts =
|
||||
\ '-i --no-heading --no-color -k -H'
|
||||
let g:unite_source_grep_recursive_opt = ''
|
||||
elseif executable('ack')
|
||||
let g:unite_source_grep_command = 'ack'
|
||||
let g:unite_source_grep_default_opts = '-i --no-heading --no-color -k -H'
|
||||
let g:unite_source_grep_recursive_opt = ''
|
||||
elseif executable('jvgrep')
|
||||
" Use jvgrep
|
||||
" https://github.com/mattn/jvgrep
|
||||
let g:unite_source_grep_command = 'jvgrep'
|
||||
let g:unite_source_grep_default_opts = '-i --exclude ''\.(git|svn|hg|bzr)'''
|
||||
let g:unite_source_grep_recursive_opt = '-R'
|
||||
endif
|
||||
let g:unite_source_rec_async_command =
|
||||
\ ['ag', '--follow', '--nocolor', '--nogroup',
|
||||
\ '--hidden', '-g', '']
|
||||
nnoremap <silent><leader>ufa :<C-u>Unite -no-split -buffer-name=Mixed -start-insert file file_mru file_rec buffer<cr>
|
||||
nnoremap <silent><leader>ufr :<C-u>Unite -buffer-name=files file_rec/async:!<cr>
|
||||
nnoremap <silent><leader>ufg :<C-u>Unite -buffer-name=git-repo file_rec/git<cr>
|
||||
call unite#custom#profile('file_rec/async,file_rec/git', 'context', {
|
||||
\ 'start_insert' : 1,
|
||||
\ 'quit' : 1,
|
||||
\ 'split' : 1,
|
||||
\ 'keep_focus' : 1,
|
||||
\ 'winheight' : 20,
|
||||
\ })
|
||||
call unite#custom#source('file_rec/async', 'ignore_globs',['*.png','.git/','*.ttf'])
|
||||
nnoremap <silent><leader>uf :<C-u>Unite -no-split -buffer-name=files -start-insert file<cr>
|
||||
nnoremap <silent><leader>ufm :<C-u>Unite -no-split -buffer-name=mru -start-insert file_mru<cr>
|
||||
nnoremap <silent><leader>ubf :<C-u>Unite -buffer-name=buffer buffer<cr>
|
||||
nnoremap <silent><leader>utb :<C-u>Unite -buffer-name=buffer_tab buffer_tab<cr>
|
||||
call unite#custom#profile('buffer,buffer_tab', 'context', {
|
||||
\ 'start_insert' : 0,
|
||||
\ 'quit' : 1,
|
||||
\ 'keep_focus' : 1,
|
||||
\ })
|
||||
nnoremap <silent><leader>um :<C-u>Unite -start-insert mapping<CR>
|
||||
nnoremap <C-h> :<C-u>Unite -start-insert help<CR>
|
||||
nnoremap <silent> g<C-h> :<C-u>UniteWithCursorWord help<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
|
||||
""" For searching the word in the cursor in the current directory
|
||||
nnoremap <silent><leader>v :Unite -auto-preview -no-split grep:.::<C-R><C-w><CR>
|
||||
nnoremap <space>/ :Unite -auto-preview grep:.<cr>
|
||||
""" For searching the word handin
|
||||
nnoremap <silent><leader>vs :Unite -auto-preview -no-split grep:.<CR>
|
||||
""" For searching the word in the cursor in the current buffer
|
||||
noremap <silent><leader>vf :Unite -auto-preview -no-split grep:%::<C-r><C-w><CR>
|
||||
""" For searching the word in the cursor in all opened buffer
|
||||
noremap <silent><leader>va :Unite -auto-preview -no-split grep:$buffers::<C-r><C-w><CR>
|
||||
nnoremap <silent><Leader>bl :<C-u>Unite -start-insert -buffer-name=buffer buffer<cr>
|
||||
"" outline
|
||||
nnoremap <silent><leader>o :<C-u>Unite -buffer-name=outline -start-insert -auto-preview -no-split outline<cr>
|
||||
"" Line search
|
||||
nnoremap <silent><leader>l :Unite line -start-insert -auto-preview -no-split<CR>
|
||||
"" Yank history
|
||||
nnoremap <silent><leader>y :<C-u>Unite -no-split -buffer-name=yank history/yank<cr>
|
||||
" search plugin
|
||||
" :Unite neobundle/search
|
||||
"for Unite menu{
|
||||
nnoremap <silent><leader>ug :Unite -silent -start-insert menu:git<CR>
|
||||
" The prefix key.
|
||||
nnoremap [unite] <Nop>
|
||||
nmap f [unite]
|
||||
nnoremap <silent> [unite]c :<C-u>UniteWithCurrentDir
|
||||
\ -buffer-name=files buffer bookmark file<CR>
|
||||
nnoremap <silent> [unite]b :<C-u>UniteWithBufferDir
|
||||
\ -buffer-name=files -prompt=%\ buffer bookmark file<CR>
|
||||
nnoremap <silent> [unite]r :<C-u>Unite
|
||||
\ -buffer-name=register register<CR>
|
||||
nnoremap <silent> [unite]o :<C-u>Unite -buffer-name=outline -start-insert -auto-preview -split outline<CR>
|
||||
nnoremap <silent> [unite]s :<C-u>Unite session<CR>
|
||||
nnoremap <silent> [unite]n :<C-u>Unite session/new<CR>
|
||||
nnoremap <silent> [unite]fr
|
||||
\ :<C-u>Unite -buffer-name=resume resume<CR>
|
||||
nnoremap <silent> [unite]ma
|
||||
\ :<C-u>Unite mapping<CR>
|
||||
nnoremap <silent> [unite]me
|
||||
\ :<C-u>Unite output:message<CR>
|
||||
nnoremap [unite]f :<C-u>Unite source<CR>
|
||||
nnoremap <silent> [unite]w
|
||||
\ :<C-u>Unite -buffer-name=files -no-split
|
||||
\ jump_point file_point buffer_tab
|
||||
\ file_rec:! file file/new<CR>
|
||||
nnoremap <silent>[unite]<Space> :Unite -silent -ignorecase -winheight=17 -start-insert menu:CustomKeyMaps<CR>
|
||||
nnoremap <silent><Leader>ls :Unite -silent -ignorecase -winheight=17 -start-insert menu:MyStarredrepos<CR>
|
||||
nnoremap <silent><Leader>lm :Unite -silent -ignorecase -winheight=17 -start-insert menu:MpvPlayer<CR>
|
||||
call zvim#util#loadMusics()
|
||||
augroup unite_buffer_feature
|
||||
autocmd FileType unite call s:unite_my_settings()
|
||||
augroup END
|
||||
function! s:unite_my_settings()
|
||||
" Overwrite settings.
|
||||
|
||||
" Play nice with supertab
|
||||
let b:SuperTabDisabled=1
|
||||
" Enable navigation with control-j and control-k in insert mode
|
||||
imap <buffer> <C-n> <Plug>(unite_select_next_line)
|
||||
nmap <buffer> <C-n> <Plug>(unite_select_next_line)
|
||||
imap <buffer> <C-p> <Plug>(unite_select_previous_line)
|
||||
nmap <buffer> <C-p> <Plug>(unite_select_previous_line)
|
||||
|
||||
|
||||
imap <buffer> jj <Plug>(unite_insert_leave)
|
||||
"imap <buffer> <C-w> <Plug>(unite_delete_backward_path)
|
||||
|
||||
imap <buffer><expr> j unite#smart_map('j', '')
|
||||
imap <buffer> <TAB> <Plug>(unite_select_next_line)
|
||||
imap <buffer> <C-w> <Plug>(unite_delete_backward_path)
|
||||
imap <buffer> ' <Plug>(unite_quick_match_default_action)
|
||||
nmap <buffer> ' <Plug>(unite_quick_match_default_action)
|
||||
imap <buffer><expr> x
|
||||
\ unite#smart_map('x', "\<Plug>(unite_quick_match_choose_action)")
|
||||
nmap <buffer> x <Plug>(unite_quick_match_choose_action)
|
||||
nmap <buffer> <C-z> <Plug>(unite_toggle_transpose_window)
|
||||
imap <buffer> <C-z> <Plug>(unite_toggle_transpose_window)
|
||||
imap <buffer> <C-y> <Plug>(unite_narrowing_path)
|
||||
nmap <buffer> <C-y> <Plug>(unite_narrowing_path)
|
||||
nmap <buffer> <C-e> <Plug>(unite_toggle_auto_preview)
|
||||
imap <buffer> <C-e> <Plug>(unite_toggle_auto_preview)
|
||||
nmap <buffer> <C-r> <Plug>(unite_narrowing_input_history)
|
||||
imap <buffer> <C-r> <Plug>(unite_narrowing_input_history)
|
||||
nnoremap <silent><buffer><expr> l
|
||||
\ unite#smart_map('l', unite#do_action('default'))
|
||||
|
||||
let unite = unite#get_current_unite()
|
||||
if unite.profile_name ==# 'search'
|
||||
nnoremap <silent><buffer><expr> r unite#do_action('replace')
|
||||
else
|
||||
nnoremap <silent><buffer><expr> r unite#do_action('rename')
|
||||
endif
|
||||
|
||||
nnoremap <silent><buffer><expr> cd unite#do_action('lcd')
|
||||
nnoremap <buffer><expr> S unite#mappings#set_current_filters(
|
||||
\ empty(unite#mappings#get_current_filters()) ?
|
||||
\ ['sorter_reverse'] : [])
|
||||
|
||||
" Runs "split" action by <C-s>.
|
||||
imap <silent><buffer><expr> <C-s> unite#do_action('split')
|
||||
endfunction
|
59
config/plugins/vim-airline.vim
Normal file
59
config/plugins/vim-airline.vim
Normal file
@ -0,0 +1,59 @@
|
||||
scriptencoding utf-8
|
||||
let g:airline_powerline_fonts=1
|
||||
let g:airline_skip_empty_sections = 1
|
||||
let g:airline#extensions#tabline#enabled = 1
|
||||
let g:airline#extensions#tmuxline#enabled = 1
|
||||
let g:Powerline_sybols = 'unicode'
|
||||
let g:airline#extensions#tabline#buffer_idx_mode = 1
|
||||
let g:airline#extensions#tabline#buffer_nr_show = 1
|
||||
let g:airline#extensions#tabline#buffer_nr_format = '%s:'
|
||||
let g:airline#extensions#tabline#fnamemod = ':t'
|
||||
let g:airline#extensions#tabline#fnamecollapse = 1
|
||||
let g:airline#extensions#tabline#fnametruncate = 0
|
||||
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
|
||||
nmap <leader>1 <Plug>AirlineSelectTab1
|
||||
nmap <leader>2 <Plug>AirlineSelectTab2
|
||||
nmap <leader>3 <Plug>AirlineSelectTab3
|
||||
nmap <leader>4 <Plug>AirlineSelectTab4
|
||||
nmap <leader>5 <Plug>AirlineSelectTab5
|
||||
nmap <leader>6 <Plug>AirlineSelectTab6
|
||||
nmap <leader>7 <Plug>AirlineSelectTab7
|
||||
nmap <leader>8 <Plug>AirlineSelectTab8
|
||||
nmap <leader>9 <Plug>AirlineSelectTab9
|
||||
nmap <leader>- <Plug>AirlineSelectPrevTab
|
||||
nmap <leader>+ <Plug>AirlineSelectNextTab
|
||||
if !exists('g:airline_symbols')
|
||||
let g:airline_symbols = {}
|
||||
endif
|
||||
|
||||
" unicode symbols
|
||||
let g:airline_left_sep = '»'
|
||||
let g:airline_left_sep = '▶'
|
||||
let g:airline_right_sep = '«'
|
||||
let g:airline_right_sep = '◀'
|
||||
let g:airline_symbols.crypt = '🔒'
|
||||
let g:airline_symbols.linenr = '␊'
|
||||
let g:airline_symbols.linenr = ''
|
||||
let g:airline_symbols.linenr = '¶'
|
||||
let g:airline_symbols.branch = '⎇'
|
||||
let g:airline_symbols.paste = 'ρ'
|
||||
let g:airline_symbols.paste = 'Þ'
|
||||
let g:airline_symbols.paste = '∥'
|
||||
let g:airline_symbols.notexists = '∄'
|
||||
let g:airline_symbols.whitespace = 'Ξ'
|
||||
|
||||
" powerline symbols
|
||||
let g:airline_left_sep = ''
|
||||
let g:airline_left_alt_sep = ''
|
||||
let g:airline_right_sep = ''
|
||||
let g:airline_right_alt_sep = ''
|
||||
let g:airline_symbols.branch = ''
|
||||
let g:airline_symbols.readonly = ''
|
||||
let g:airline_symbols.linenr = ''
|
||||
let g:airline_symbols.maxlinenr= ''
|
||||
|
||||
|
||||
augroup Fix_airline_with_unite
|
||||
autocmd FileType unite AirlineRefresh
|
||||
autocmd FileType vimfiler AirlineRefresh
|
||||
augroup END
|
0
config/plugins/vim-grepper.vim
Normal file
0
config/plugins/vim-grepper.vim
Normal file
34
config/plugins/vim-ref.vim
Normal file
34
config/plugins/vim-ref.vim
Normal file
@ -0,0 +1,34 @@
|
||||
let g:ref_source_webdict_sites = {
|
||||
\ 'je': {
|
||||
\ 'url': 'http://dictionary.infoseek.ne.jp/jeword/%s',
|
||||
\ },
|
||||
\ 'ej': {
|
||||
\ 'url': 'http://dictionary.infoseek.ne.jp/ejword/%s',
|
||||
\ },
|
||||
\ 'wiki': {
|
||||
\ 'url': 'http://ja.wikipedia.org/wiki/%s',
|
||||
\ },
|
||||
\ 'cn': {
|
||||
\ 'url': 'http://www.iciba.com/%s',
|
||||
\ },
|
||||
\ 'wikipedia:en':{'url': 'http://en.wikipedia.org/wiki/%s', },
|
||||
\ 'bing':{'url': 'http://cn.bing.com/search?q=%s', },
|
||||
\ }
|
||||
let g:ref_source_webdict_sites.default = 'cn'
|
||||
"let g:ref_source_webdict_cmd='lynx -dump -nonumbers %s'
|
||||
"let g:ref_source_webdict_cmd='w3m -dump %s'
|
||||
"The filter on the output. Remove the first few lines
|
||||
function! g:ref_source_webdict_sites.je.filter(output)
|
||||
return join(split(a:output, "\n")[15 :], "\n")
|
||||
endfunction
|
||||
function! g:ref_source_webdict_sites.ej.filter(output)
|
||||
return join(split(a:output, "\n")[15 :], "\n")
|
||||
endfunction
|
||||
function! g:ref_source_webdict_sites.wiki.filter(output)
|
||||
return join(split(a:output, "\n")[17 :], "\n")
|
||||
endfunction
|
||||
nnoremap <Leader>rj :<C-u>Ref webdict je<Space>
|
||||
nnoremap <Leader>re :<C-u>Ref webdict ej<Space>
|
||||
nnoremap <Leader>rc :<C-u>Ref webdict cn<Space>
|
||||
nnoremap <Leader>rw :<C-u>Ref webdict wikipedia:en<Space>
|
||||
nnoremap <Leader>rb :<C-u>Ref webdict bing<Space>
|
33
config/plugins/vim-startify.vim
Normal file
33
config/plugins/vim-startify.vim
Normal file
@ -0,0 +1,33 @@
|
||||
let g:startify_session_dir = $HOME . '/.data/' . ( has('nvim') ? 'nvim' : 'vim' ) . '/session'
|
||||
let g:startify_files_number = 6
|
||||
let g:startify_list_order = [
|
||||
\ [' My most recently used files in the current directory:'],
|
||||
\ 'dir',
|
||||
\ [' My most recently used files:'],
|
||||
\ 'files',
|
||||
\ [' These are my sessions:'],
|
||||
\ 'sessions',
|
||||
\ [' These are my bookmarks:'],
|
||||
\ 'bookmarks',
|
||||
\ ]
|
||||
"let g:startify_bookmarks = [ {'c': '~/.vimrc'}, '~/.zshrc' ]
|
||||
let g:startify_update_oldfiles = 1
|
||||
let g:startify_session_autoload = 1
|
||||
let g:startify_session_persistence = 1
|
||||
"let g:startify_session_delete_buffers = 0
|
||||
let g:startify_change_to_dir = 0
|
||||
"let g:startify_change_to_vcs_root = 0 " vim-rooter has same feature
|
||||
let g:startify_skiplist = [
|
||||
\ 'COMMIT_EDITMSG',
|
||||
\ escape(fnamemodify(resolve($VIMRUNTIME), ':p'), '\') .'doc',
|
||||
\ 'bundle/.*/doc',
|
||||
\ ]
|
||||
fu! <SID>startify_mapping()
|
||||
if getcwd() == $VIM || getcwd() == expand('~')
|
||||
nnoremap <silent><buffer> <c-p> :<c-u>CtrlP ~\DotFiles<cr>
|
||||
endif
|
||||
endf
|
||||
augroup startify_map
|
||||
autocmd FileType startify nnoremap <buffer><F2> <Nop>
|
||||
autocmd FileType startify call <SID>startify_mapping()
|
||||
augroup END
|
53
config/plugins/vimfiler.vim
Normal file
53
config/plugins/vimfiler.vim
Normal file
@ -0,0 +1,53 @@
|
||||
scriptencoding utf-8
|
||||
let g:vimfiler_as_default_explorer = 1
|
||||
let g:vimfiler_restore_alternate_file = 1
|
||||
let g:vimfiler_tree_indentation = 1
|
||||
let g:vimfiler_tree_leaf_icon = ''
|
||||
let g:vimfiler_tree_opened_icon = '▼'
|
||||
let g:vimfiler_tree_closed_icon = '▷'
|
||||
let g:vimfiler_file_icon = ''
|
||||
let g:vimfiler_readonly_file_icon = '*'
|
||||
let g:vimfiler_marked_file_icon = '√'
|
||||
"let g:vimfiler_preview_action = 'auto_preview'
|
||||
let g:vimfiler_ignore_pattern = [
|
||||
\ '^\.git$',
|
||||
\ '^\.DS_Store$',
|
||||
\ '^\.init\.vim-rplugin\~$',
|
||||
\ '^\.netrwhist$',
|
||||
\ '\.class$'
|
||||
\]
|
||||
|
||||
if has('mac')
|
||||
let g:vimfiler_quick_look_command =
|
||||
\ '/Applications//Sublime\ Text.app/Contents/MacOS/Sublime\ Text'
|
||||
else
|
||||
let g:vimfiler_quick_look_command = 'gloobus-preview'
|
||||
endif
|
||||
|
||||
call vimfiler#custom#profile('default', 'context', {
|
||||
\ 'explorer' : 1,
|
||||
\ 'winwidth' : 30,
|
||||
\ 'winminwidth' : 30,
|
||||
\ 'toggle' : 1,
|
||||
\ 'columns' : 'type',
|
||||
\ 'auto_expand': 1,
|
||||
\ 'direction' : 'rightbelow',
|
||||
\ 'parent': 0,
|
||||
\ 'explorer_columns' : 'type',
|
||||
\ 'status' : 1,
|
||||
\ 'safe' : 0,
|
||||
\ 'split' : 1,
|
||||
\ 'hidden': 1,
|
||||
\ 'no_quit' : 1,
|
||||
\ 'force_hide' : 0,
|
||||
\ })
|
||||
augroup vfinit
|
||||
autocmd FileType vimfiler call s:vimfilerinit()
|
||||
"autocmd VimEnter * if !argc() | VimFiler | endif
|
||||
autocmd BufEnter * if (winnr('$') == 1 && &filetype ==# 'vimfiler') |
|
||||
\ q | endif
|
||||
augroup END
|
||||
function! s:vimfilerinit()
|
||||
set nonumber
|
||||
set norelativenumber
|
||||
endf
|
Loading…
Reference in New Issue
Block a user