diff --git a/README.md b/README.md index b29dbfb3d..129ff057b 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,11 @@ If you are new to vim, you should learning about Vim in general, read [vim-galor [conventions](http://spacevim.org/development/). - **Neovim centric:** Dark powered mode of SpaceVim +This is the Unite centric work-flow: + +![unite](https://cloud.githubusercontent.com/assets/13142418/23955542/26fd5348-09d5-11e7-8253-1f43991439b0.png) + + ## Documentation ### Quick start guide @@ -142,10 +147,19 @@ Try these Neovim hangouts for any questions, problems or comments. ### Linux/Mac +**Install SpaceVim with the command below** + ```bash curl -sLf https://spacevim.org/install.sh | bash ``` -with this command, SpaceVim will be installed. all the plugins will be install automatically when first time run vim/nvim. Please wait for the end of the installation process. + +**After SpaceVim is installed, launch `vim` and SpaceVim will automatically install plugins** + +Once plugins start installing, at the bottom of the vim window, you will see +`[dein] Install started: (YYYY/MM/DD HH:MM:SS)` + +Please wait for all the plugins to complete installing before using vim. Once the plugin installation completes, you will see +`[dein] Done: (YYYY/MM/DD HH:MM:SS) `. At this point you can start using vim. SpaceVim required Vim7.4 above or neovim, here is the installation of neovim/vim with python support: diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index 3820e56bf..895d04134 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -27,7 +27,7 @@ "" " Version of SpaceVim , this value can not be changed. scriptencoding utf-8 -let g:spacevim_version = '0.2.0-dev' +let g:spacevim_version = '0.3.0-dev' lockvar g:spacevim_version "" " Change the default indentation of SpaceVim. Default is 2. @@ -128,6 +128,18 @@ let g:spacevim_error_symbol = '✖' " let g:spacevim_warning_symbol = '!' " < let g:spacevim_warning_symbol = '⚠' +"" +" Set the SpaceVim cursor shape in the terminal. Set to 0 to prevent Nvim from +" changing the cursor shape. Set to 1 to enable non-blinking mode-sensitive +" cursor (this is the default). Set to 2 to enable blinking mode-sensitive +" cursor. Host terminal must support the DECSCUSR CSI escape sequence. +" +" Depending on the terminal emulator, using this option with nvim under +" tmux might require adding the following to ~/.tmux.conf: +" > +" set -ga terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q' +" < +let g:spacevim_terminal_cursor_shape = 2 let g:spacevim_use_colorscheme = 1 "" " Set the help language of vim. Default is 'en'. @@ -170,7 +182,7 @@ let g:spacevim_plugin_manager = 'dein' "" " Enable/Disable checkinstall on SpaceVim startup. Default is 1. " > -" let g:spacevim_checkinstall = 0 +" let g:spacevim_checkinstall = 1 " < let g:spacevim_checkinstall = 1 "" diff --git a/autoload/SpaceVim/api/job.vim b/autoload/SpaceVim/api/job.vim new file mode 100644 index 000000000..d21092a38 --- /dev/null +++ b/autoload/SpaceVim/api/job.vim @@ -0,0 +1,164 @@ + +function! SpaceVim#api#data#list#get() abort + return map({'start' : '', + \ 'stop' : '', + \ 'send' : '', + \ 'status' : '', + \ 'list' : '', + \ 'info' : '' + \ }, + \ "function('s:' . v:key)" + \ ) +endfunction + +" make vim and neovim use same job func. +let s:jobs = {} +let s:nvim_job = has('nvim') +let s:vim_job = !has('nvim') && has('job') && has('patch-7.4.1590') +function! s:warn(...) abort + if len(a:000) == 0 + echohl WarningMsg | echom 'Current version do not support job feature!' | echohl None + elseif len(a:000) == 1 && type(a:1) == type('') + echohl WarningMsg | echom a:1| echohl None + else + endif +endfunction +function! s:warp(argv, opts) abort + let obj = {} + let obj._argv = a:argv + let obj._opts = a:opts + + function! obj._out_cb(job_id, data) abort + if has_key(self._opts, 'on_stdout') + call self._opts.on_stdout(a:job_id, [a:data], 'stdout') + endif + endfunction + + function! obj._err_cb(job_id, data) abort + if has_key(self._opts, 'on_stderr') + call self._opts.on_stderr(a:job_id, [a:data], 'stderr') + endif + endfunction + + function! obj._exit_cb(job_id, data) abort + if has_key(self._opts, 'on_exit') + call self._opts.on_exit(a:job_id, [a:data], 'exit') + endif + endfunction + + let obj = { + \ 'argv': a:argv, + \ 'opts': { + \ 'mode': 'nl', + \ 'out_cb': obj._out_cb, + \ 'err_cb': obj._err_cb, + \ 'exit_cb': obj._exit_cb, + \ } + \ } + + return obj +endfunction + +" start a job, and return the job_id. +function! s:start(argv, ...) abort + if s:nvim_job + if len(a:000) > 0 + let job = jobstart(a:argv, a:1) + else + let job = jobstart(a:argv) + endi + let msg = ['process '. jobpid(job), ' run'] + call extend(s:jobs, {job : msg}) + return job + elseif s:vim_job + if len(a:000) > 0 + let opts = a:1 + else + let opts = {} + endif + let wrapped = s:warp(a:argv, opts) + let job = job_start(wrapped.argv, wrapped.opts) + let id = len(s:jobs) + 1 + call extend(s:jobs, {id : job}) + return id + else + call s:warn() + endif +endfunction + +function! s:stop(id) abort + if s:nvim_job + if has_key(s:jobs, a:id) + call jobstop(a:id) + call remove(s:jobs, a:id) + else + call s:warn('No job with such id') + endif + elseif s:vim_job + if has_key(s:jobs, a:id) + call job_stop(get(s:jobs, a:id)) + call remove(s:jobs, a:id) + endif + else + call s:warn() + endif +endfunction + +function! s:send(id, data) abort + if s:nvim_job + if has_key(s:jobs, a:id) + if type(a:data) == type('') + call jobsend(a:id, [a:data, '']) + else + call jobsend(a:id, a:data) + endif + else + call s:warn('No job with such id') + endif + elseif s:vim_job + if has_key(s:jobs, a:id) + let job = get(s:jobs, a:id) + let chanel = job_getchannel(job) + call ch_sendraw(chanel, a:data . "\n") + else + call s:warn('No job with such id') + endif + else + call s:warn() + endif +endfunction + +function! s:status(id) abort + if s:nvim_job + if has_key(s:jobs, a:id) + return get(s:jobs, a:id)[1] + endif + elseif s:vim_job + if has_key(s:jobs, a:id) + return job_status(get(s:jobs, a:id)) + endif + else + call s:warn('No job with such id!') + endif +endfunction + +function! s:list() abort + return copy(s:jobs) +endfunction + +function! s:info(id) abort + let info = {} + if s:nvim_job + let info.status = s:status(a:id) + let info.job_id = a:id + return info + elseif s:vim_job + if has_key(s:jobs, a:id) + return job_info(get(s:jobs, a:id)) + else + call s:warn('No job with such id!') + endif + else + call s:warn() + endif +endfunction diff --git a/autoload/SpaceVim/layers/edit.vim b/autoload/SpaceVim/layers/edit.vim index 6ebd4c5a9..873e2f239 100644 --- a/autoload/SpaceVim/layers/edit.vim +++ b/autoload/SpaceVim/layers/edit.vim @@ -32,5 +32,7 @@ function! SpaceVim#layers#edit#config() abort "noremap (wildfire-fuel) vnoremap (wildfire-water) let g:wildfire_objects = ["i'", 'i"', 'i)', 'i]', 'i}', 'ip', 'it'] - map (easymotion-prefix) + if empty(maparg('', '')) + map (easymotion-prefix) + endif endfunction diff --git a/autoload/SpaceVim/layers/lang.vim b/autoload/SpaceVim/layers/lang.vim index 86787c82b..97b06256c 100644 --- a/autoload/SpaceVim/layers/lang.vim +++ b/autoload/SpaceVim/layers/lang.vim @@ -6,7 +6,7 @@ function! SpaceVim#layers#lang#plugins() abort \ ['hail2u/vim-css3-syntax', { 'on_ft' : ['css','scss','sass']}], \ ['ap/vim-css-color', { 'on_ft' : ['css','scss','sass','less','styl']}], \ ['othree/html5.vim', { 'on_ft' : ['html']}], - \ ['wavded/vim-stylus', { 'on_ft' : ['styl']}], + \ ['wavded/vim-stylus', { 'on_ft' : ['stylus']}], \ ['digitaltoad/vim-jade', { 'on_ft' : ['jade']}], \ ['juvenn/mustache.vim', { 'on_ft' : ['mustache']}], \ ['leafgarland/typescript-vim', { 'on_ft' : ['typescript']}], diff --git a/autoload/SpaceVim/layers/lang/crystal.vim b/autoload/SpaceVim/layers/lang/crystal.vim new file mode 100644 index 000000000..49c7a6039 --- /dev/null +++ b/autoload/SpaceVim/layers/lang/crystal.vim @@ -0,0 +1,12 @@ +"" +" @section lang#crystal, layer-lang-crystal +" @parentsection layers +" @subsection Intro +" The lang#crystal layer provides crystal filetype detection and syntax highlight, +" crystal tool and crystal spec integration. + +function! SpaceVim#layers#lang#crystal#plugins() abort + let plugins = [] + call add(plugins, ['rhysd/vim-crystal', {'on_ft' : 'crystal'}]) + return plugins +endfunction diff --git a/autoload/SpaceVim/layers/tools.vim b/autoload/SpaceVim/layers/tools.vim index 330b2449a..fa6825f6f 100644 --- a/autoload/SpaceVim/layers/tools.vim +++ b/autoload/SpaceVim/layers/tools.vim @@ -1,6 +1,7 @@ function! SpaceVim#layers#tools#plugins() abort return [ \ ['tpope/vim-scriptease'], + \ ['SpaceVim/cscope.vim'], \ ['wsdjeg/vim-cheat', { 'on_cmd' : 'Cheat'}], \ ['wsdjeg/SourceCounter.vim', { 'on_cmd' : 'SourceCounter'}], \ ['junegunn/goyo.vim', { 'on_cmd' : 'Goyo', @@ -60,8 +61,12 @@ function! SpaceVim#layers#tools#config() abort " List of colors that you do not want. ANSI code or #RRGGBB let g:rainbow#blacklist = [233, 234] nnoremap fz :FZF - vnoremap :Ydv - nnoremap :Ydc + if maparg('', 'v') ==# '' + vnoremap :Ydv + endif + if maparg('', 'n') ==# '' + nnoremap :Ydc + endif map td TaskList noremap :TlistToggle function! OpenOrCloseNERDTree() abort diff --git a/autoload/SpaceVim/mapping.vim b/autoload/SpaceVim/mapping.vim index 72e033404..e5753013c 100644 --- a/autoload/SpaceVim/mapping.vim +++ b/autoload/SpaceVim/mapping.vim @@ -181,4 +181,30 @@ function! SpaceVim#mapping#close_current_buffer() abort endif endfunction +function! SpaceVim#mapping#close_term_buffer(...) abort + let buffers = g:_spacevim_list_buffers + let abuf = str2nr(g:_spacevim_termclose_abuf) + let index = index(buffers, abuf) + let g:wsd = [index, abuf, buffers] + if index != -1 + if index == 0 + if len(buffers) > 1 + exe 'b' . buffers[1] + exe 'bd!' . abuf + else + exe 'bd! ' . abuf + endif + elseif index > 0 + if index + 1 == len(buffers) + exe 'b' . buffers[index - 1] + exe 'bd!' . abuf + else + exe 'b' . buffers[index + 1] + exe 'bd!' . abuf + endif + endif + endif + +endfunction + " vim:set et sw=2 cc=80: diff --git a/autoload/SpaceVim/mapping/leader.vim b/autoload/SpaceVim/mapping/leader.vim index 694897657..711dd7914 100644 --- a/autoload/SpaceVim/mapping/leader.vim +++ b/autoload/SpaceVim/mapping/leader.vim @@ -258,8 +258,8 @@ function! SpaceVim#mapping#leader#defindUniteLeader(key) abort nnoremap [unite]n :Unite session/new let g:_spacevim_mappings_unite.n = ['Unite session/new', \ 'unite session/new'] - nnoremap [unite]/ :Unite -auto-preview grep:. - let g:_spacevim_mappings_unite['/'] = ['Unite -auto-preview grep:.', + nnoremap [unite]/ :Unite grep:. + let g:_spacevim_mappings_unite['/'] = ['Unite grep:.', \ 'unite grep with preview'] nnoremap [unite]w \ :Unite -buffer-name=files -no-split diff --git a/config/general.vim b/config/general.vim index d2884bb15..1b9605e40 100644 --- a/config/general.vim +++ b/config/general.vim @@ -26,6 +26,10 @@ if !empty(g:spacevim_guifont) exe 'set guifont=' . g:spacevim_guifont endif if g:spacevim_enable_guicolors == 1 + if !has('nvim') && has('patch-7.4.1770') + let &t_8f = "\[38;2;%lu;%lu;%lum" + let &t_8b = "\[48;2;%lu;%lu;%lum" + endif if exists('+termguicolors') set termguicolors elseif exists('+guicolors') diff --git a/config/neovim.vim b/config/neovim.vim index a1253467f..deadc1b9d 100644 --- a/config/neovim.vim +++ b/config/neovim.vim @@ -16,8 +16,7 @@ endfunction 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=2 +let $NVIM_TUI_ENABLE_CURSOR_SHAPE = g:spacevim_terminal_cursor_shape "silent! let &t_SI = "\]50;CursorShape=1\x7" "silent! let &t_SR = "\]50;CursorShape=2\x7" "silent! let &t_EI = "\]50;CursorShape=0\x7" @@ -56,7 +55,7 @@ augroup Terminal au! au TermOpen * let g:last_terminal_job_id = b:terminal_job_id | IndentLinesDisable au BufWinEnter term://* startinsert | IndentLinesDisable - au TermClose * exe expand('').'bd!' + au TermClose * let g:_spacevim_termclose_abuf = expand('') | call SpaceVim#mapping#close_term_buffer() augroup END augroup nvimrc_aucmd autocmd! diff --git a/config/plugins/LeaderF.vim b/config/plugins/LeaderF.vim index 5c5d3ead1..ef4ce8619 100644 --- a/config/plugins/LeaderF.vim +++ b/config/plugins/LeaderF.vim @@ -1,3 +1,3 @@ scriptencoding utf-8 -let g:Lf_StlSeparator = { 'left': '', 'right': '' } -let g:Lf_StlColorscheme = 'spacevim' +let g:Lf_StlSeparator = get(g:, 'Lf_StlSeparator', { 'left': '', 'right': '' }) +let g:Lf_StlColorscheme = get(g:, 'Lf_StlColorscheme', 'spacevim') diff --git a/config/plugins/ag.vim b/config/plugins/ag.vim index 3d2acd902..d553df052 100644 --- a/config/plugins/ag.vim +++ b/config/plugins/ag.vim @@ -1,2 +1,2 @@ -let g:ag_prg='ag --vimgrep' -let g:ag_working_path_mode='r' +let g:ag_prg= get(g:, 'ag_prg', 'ag --vimgrep') +let g:ag_working_path_mode= get(g:, 'ag_working_path_mode', 'r') diff --git a/config/plugins/ctrlp.vim b/config/plugins/ctrlp.vim index 081980143..d94dec7ac 100644 --- a/config/plugins/ctrlp.vim +++ b/config/plugins/ctrlp.vim @@ -1,37 +1,39 @@ let g:ctrlp_map = get(g:,'ctrlp_map', '') -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 +let g:ctrlp_cmd = get(g:, 'ctrlp_cmd', 'CtrlP') +let g:ctrlp_working_path_mode = get(g:, 'ctrlp_working_path_mode', 'ra') +let g:ctrlp_root_markers = get(g:, 'ctrlp_root_markers', 'pom.xml') +let g:ctrlp_match_window = get(g:, 'ctrlp_match_window', 'bottom,order:btt,min:1,max:15,results:15') +let g:ctrlp_show_hidden = get(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_use_caching = get(g:, 'ctrlp_use_caching', 500) +let g:ctrlp_clear_cache_on_exit = get(g:, 'ctrlp_clear_cache_on_exit', 1) +let g:ctrlp_cache_dir = get(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\~', +let g:ctrlp_custom_ignore = get(g:, 'ctrlp_custom_ignore', { + \ 'dir': '\v[\/]\.(git|hg|svn)$|target|node_modules|te?mp$|logs?$|public$|dist$', + \ 'file': '\v\.(exe|so|dll|ttf|png|gif|jpe?g|bpm)$|\-rplugin\~', \ 'link': 'some_bad_symbolic_links', - \ } -if executable('rg') + \ }) +if executable('rg') && !exists('g:ctrlp_user_command') let g:ctrlp_user_command = 'rg %s --no-ignore --hidden --files -g "" ' \ . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'rg')) -elseif executable('ag') +elseif executable('ag') && !exists('g:ctrlp_user_command') let g:ctrlp_user_command = 'ag %s --hidden -i -g "" ' . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'ag')) endif -let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' } +if !exists('g:ctrlp_match_func') && (has('python') || has('python3')) + let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' } +endif "nnoremap kk :CtrlPMixed " comment for ctrlp-funky {{{ nnoremap fu :CtrlPFunky " narrow the list down with a word under cursor nnoremap fU :execute 'CtrlPFunky ' . expand('') -let g:ctrlp_funky_syntax_highlight = 1 +let g:ctrlp_funky_syntax_highlight = get(g:, 'ctrlp_funky_syntax_highlight', 1) " }}} "for ctrlp_nerdtree {{{ -let g:ctrlp_nerdtree_show_hidden = 1 +let g:ctrlp_nerdtree_show_hidden = get(g:, 'ctrlp_nerdtree_show_hidden', 1) "}}} "for ctrlp_sessions{{{ let g:ctrlp_extensions = ['funky', 'sessions' , 'k' , 'tag', 'mixed', 'quickfix', 'undo', 'line', 'changes', 'cmdline', 'menu'] diff --git a/config/plugins/denite.vim b/config/plugins/denite.vim index 11ed09bb8..dd033cfd0 100644 --- a/config/plugins/denite.vim +++ b/config/plugins/denite.vim @@ -4,7 +4,8 @@ let s:sys = SpaceVim#api#import('system') " denite option -let s:denite_options = {'default' : { +let s:denite_options = { + \ 'default' : { \ 'winheight' : 15, \ 'mode' : 'insert', \ 'quit' : 'true', diff --git a/config/plugins/deoplete.vim b/config/plugins/deoplete.vim index b3d5a76f6..46941fd05 100644 --- a/config/plugins/deoplete.vim +++ b/config/plugins/deoplete.vim @@ -1,70 +1,70 @@ " deoplete options -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#enable_at_startup = get(g:, 'deoplete#enable_at_startup', 1) +let g:deoplete#enable_ignore_case = get(g:, 'deoplete#enable_ignore_case', 1) +let g:deoplete#enable_smart_case = get(g:, 'deoplete#enable_smart_case', 1) +let g:deoplete#enable_camel_case = get(g:, 'deoplete#enable_camel_case', 1) +let g:deoplete#enable_refresh_always = get(g:, 'deoplete#enable_refresh_always', 1) +let g:deoplete#max_abbr_width = get(g:, 'deoplete#max_abbr_width', 0) +let g:deoplete#max_menu_width = get(g:, 'deoplete#max_menu_width', 0) " init deoplet option dict let g:deoplete#ignore_sources = get(g:,'deoplete#ignore_sources',{}) let g:deoplete#omni#input_patterns = get(g:,'deoplete#omni#input_patterns',{}) let g:deoplete#omni_patterns = get(g:, 'deoplete#omni_patterns', {}) " java && jsp -let g:deoplete#omni#input_patterns.java = [ +let g:deoplete#omni#input_patterns.java = get(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.jsp = get(g:deoplete#omni#input_patterns, 'jsp', ['[^. \t0-9]\.\w*']) if g:spacevim_enable_javacomplete2_py - let g:deoplete#ignore_sources.java = ['omni'] + let g:deoplete#ignore_sources.java = get(g:deoplete#ignore_sources, 'java', ['omni']) call deoplete#custom#set('javacomplete2', 'mark', '') else - let g:deoplete#ignore_sources.java = ['javacomplete2'] + let g:deoplete#ignore_sources.java = get(g:deoplete#ignore_sources, 'java', ['javacomplete2']) call deoplete#custom#set('omni', 'mark', '') endif " go -let g:deoplete#ignore_sources.go = ['omni'] +let g:deoplete#ignore_sources.go = get(g:deoplete#ignore_sources, 'go', ['omni']) call deoplete#custom#set('go', 'mark', '') call deoplete#custom#set('go', 'rank', 9999) " perl -let g:deoplete#omni#input_patterns.perl = [ +let g:deoplete#omni#input_patterns.perl = get(g:deoplete#omni#input_patterns, 'perl', [ \'[^. \t0-9]\.\w*', \'[^. \t0-9]\->\w*', \'[^. \t0-9]\::\w*', - \] + \]) " javascript -let g:deoplete#omni#input_patterns.javascript = ['[^. \t0-9]\.\w*'] +let g:deoplete#omni#input_patterns.javascript = get(g:deoplete#omni#input_patterns, 'javascript', ['[^. \t0-9]\.\w*']) " php -let g:deoplete#omni#input_patterns.php = [ +let g:deoplete#omni#input_patterns.php = get(g:deoplete#omni#input_patterns, 'php', [ \'[^. \t0-9]\.\w*', \'[^. \t0-9]\->\w*', \'[^. \t0-9]\::\w*', - \] -let g:deoplete#ignore_sources.php = ['omni', 'around', 'member'] + \]) +let g:deoplete#ignore_sources.php = get(g:deoplete#ignore_sources, 'php', ['omni', 'around', 'member']) call deoplete#custom#set('phpcd', 'mark', '') call deoplete#custom#set('phpcd', 'input_pattern', '\w*|[^. \t]->\w*|\w*::\w*') " lua -let g:deoplete#omni_patterns.lua = '.' +let g:deoplete#omni_patterns.lua = get(g:deoplete#omni_patterns, 'lua', '.') " c c++ call deoplete#custom#set('clang2', 'mark', '') -let g:deoplete#ignore_sources.c = ['omni'] +let g:deoplete#ignore_sources.c = get(g:deoplete#ignore_sources, 'c', ['omni']) " rust -let g:deoplete#ignore_sources.rust = ['omni'] +let g:deoplete#ignore_sources.rust = get(g:deoplete#ignore_sources, 'rust', ['omni']) call deoplete#custom#set('racer', 'mark', '') " public settings call deoplete#custom#set('_', 'matchers', ['matcher_full_fuzzy']) -let g:deoplete#ignore_sources._ = ['around'] +let g:deoplete#ignore_sources._ = get(g:deoplete#ignore_sources, '_', ['around']) inoremap deoplete#mappings#smart_close_popup()."\" inoremap deoplete#mappings#smart_close_popup()."\" set isfname-== diff --git a/config/plugins/gruvbox.vim b/config/plugins/gruvbox.vim index 90bf52df2..e94235348 100644 --- a/config/plugins/gruvbox.vim +++ b/config/plugins/gruvbox.vim @@ -1 +1 @@ -let g:gruvbox_italic = 0 +let g:gruvbox_italic = get(g:, 'gruvbox_italic', 0) diff --git a/config/plugins/java_getset.vim b/config/plugins/java_getset.vim index e938d5fe4..082013f13 100644 --- a/config/plugins/java_getset.vim +++ b/config/plugins/java_getset.vim @@ -1,5 +1,5 @@ -let g:java_getset_disable_map = 1 -let g:javagetset_setterTemplate = +let g:java_getset_disable_map = get(g:, 'java_getset_disable_map', 1) +let g:javagetset_setterTemplate = get(g:, 'javagetset_setterTemplate', \ "/**\n" . \ " * Set %varname%.\n" . \ " *\n" . @@ -7,8 +7,8 @@ let g:javagetset_setterTemplate = \ " */\n" . \ "%modifiers% void %funcname%(%type% %varname%){\n" . \ " this.%varname% = %varname%;\n" . - \ "}" -let g:javagetset_getterTemplate = + \ "}") +let g:javagetset_getterTemplate = get(g:, 'javagetset_getterTemplate', \ "/**\n" . \ " * Get %varname%.\n" . \ " *\n" . @@ -16,6 +16,6 @@ let g:javagetset_getterTemplate = \ " */\n" . \ "%modifiers% %type% %funcname%(){\n" . \ " return %varname%;\n" . - \ "}" + \ "}") " vim:set et sw=2: diff --git a/config/plugins/neocomplcache.vim b/config/plugins/neocomplcache.vim index 810c641ec..721d3b99d 100644 --- a/config/plugins/neocomplcache.vim +++ b/config/plugins/neocomplcache.vim @@ -1,41 +1,41 @@ "--------------------------------------------------------------------------- " neocomplache.vim " -let g:neocomplcache_enable_at_startup = 1 +let g:neocomplcache_enable_at_startup = get(g:, 'neocomplcache_enable_at_startup', 1) " Use smartcase -let g:neocomplcache_enable_smart_case = 1 +let g:neocomplcache_enable_smart_case = get(g:, 'neocomplcache_enable_smart_case', 1) " Use camel case completion. -let g:neocomplcache_enable_camel_case_completion = 1 +let g:neocomplcache_enable_camel_case_completion = get(g:, 'neocomplcache_enable_camel_case_completion', 1) " Use underbar completion. -let g:neocomplcache_enable_underbar_completion = 1 +let g:neocomplcache_enable_underbar_completion = get(g:, 'neocomplcache_enable_underbar_completion', 1) " Use fuzzy completion. -let g:neocomplcache_enable_fuzzy_completion = 1 +let g:neocomplcache_enable_fuzzy_completion = get(g:, 'neocomplcache_enable_fuzzy_completion', 1) " Set minimum syntax keyword length. -let g:neocomplcache_min_syntax_length = 3 +let g:neocomplcache_min_syntax_length = get(g:, 'neocomplcache_min_syntax_length', 3) " Set auto completion length. -let g:neocomplcache_auto_completion_start_length = 2 +let g:neocomplcache_auto_completion_start_length = get(g:, 'neocomplcache_auto_completion_start_length', 2) " Set manual completion length. -let g:neocomplcache_manual_completion_start_length = 0 +let g:neocomplcache_manual_completion_start_length = get(g:, 'neocomplcache_manual_completion_start_length', 0) " Set minimum keyword length. -let g:neocomplcache_min_keyword_length = 3 +let g:neocomplcache_min_keyword_length = get(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' +let g:neocomplcache_enable_cursor_hold_i = get(g:, 'neocomplcache_enable_cursor_hold_i', 0) +let g:neocomplcache_cursor_hold_i_time = get(g:, 'neocomplcache_cursor_hold_i_time', 300) +let g:neocomplcache_enable_insert_char_pre = get(g:, 'neocomplcache_enable_insert_char_pre', 1) +let g:neocomplcache_enable_prefetch = get(g:, 'neocomplcache_enable_prefetch', 1) +let g:neocomplcache_skip_auto_completion_time = get(g:, 'neocomplcache_skip_auto_completion_time', '0.6') " For auto select. -let g:neocomplcache_enable_auto_select = 0 +let g:neocomplcache_enable_auto_select = get(g:, 'neocomplcache_enable_auto_select', 0) -let g:neocomplcache_enable_auto_delimiter = 1 -let g:neocomplcache_disable_auto_select_buffer_name_pattern = - \ '\[Command Line\]' +let g:neocomplcache_enable_auto_delimiter = get(g:, 'neocomplcache_enable_auto_delimiter', 1) +let g:neocomplcache_disable_auto_select_buffer_name_pattern = get(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 +let g:neocomplcache_max_list = get(g:, 'neocomplcache_max_list', 100) +let g:neocomplcache_force_overwrite_completefunc = get(g:, 'neocomplcache_force_overwrite_completefunc', 1) if !exists('g:neocomplcache_omni_patterns') let g:neocomplcache_omni_patterns = {} endif @@ -45,21 +45,24 @@ 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*::' +let g:neocomplcache_enable_auto_close_preview = get(g:, 'neocomplcache_enable_auto_close_preview', 1) +" let g:neocomplcache_force_omni_patterns.ruby = get(g:, ': ,[^. *\t]\.\w*\|\h\w*::') +let g:neocomplcache_omni_patterns.ruby = get(g:neocomplcache_omni_patterns, 'ruby', + \ '[^. *\t]\.\w*\|\h\w*::') +let g:neocomplcache_omni_patterns.java = get(g:neocomplcache_omni_patterns, 'java', + \ '[^. *\t]\.\w*\|\h\w*::') +let g:neocomplcache_force_omni_patterns.java = get(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 +let g:neocomplcache_force_overwrite_completefunc = get(g:, 'neocomplcache_force_overwrite_completefunc', 1) +let g:neocomplcache_force_omni_patterns.c = get(g:neocomplcache_force_omni_patterns, 'c', + \ '[^.[:digit:] *\t]\%(\.\|->\)') +let g:neocomplcache_force_omni_patterns.cpp = get(g:neocomplcache_force_omni_patterns, 'cpp', + \ '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::') +let g:clang_complete_auto = get(g:, 'clang_complete_auto', 0) +let g:clang_auto_select = get(g:, 'clang_auto_select', 0) +let g:clang_use_library = get(g:, 'clang_use_library', 1) " Define keyword pattern. if !exists('g:neocomplcache_keyword_patterns') @@ -67,9 +70,9 @@ if !exists('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:neocomplete#enable_multibyte_completion = get(g:, 'neocomplete#enable_multibyte_completion', 1) -let g:neocomplcache_vim_completefuncs = { +let g:neocomplcache_vim_completefuncs = get(g:, 'neocomplcache_vim_completefuncs', { \ 'Ref' : 'ref#complete', \ 'Unite' : 'unite#complete_source', \ 'VimShellExecute' : @@ -81,6 +84,6 @@ let g:neocomplcache_vim_completefuncs = { \ 'VimShell' : 'vimshell#complete', \ 'VimFiler' : 'vimfiler#complete', \ 'Vinarise' : 'vinarise#complete', - \} + \}) " vim:set et sw=2: diff --git a/config/plugins/neocomplete.vim b/config/plugins/neocomplete.vim index 391ba4a1d..7c6296b35 100644 --- a/config/plugins/neocomplete.vim +++ b/config/plugins/neocomplete.vim @@ -1,32 +1,31 @@ -let g:neocomplete#data_directory='~/.cache/neocomplete' -let g:acp_enableAtStartup = 0 -let g:neocomplete#enable_at_startup = 1 +let g:neocomplete#data_directory= get(g:, 'neocomplete#data_directory', '~/.cache/neocomplete') +let g:acp_enableAtStartup = get(g:, 'acp_enableAtStartup', 0) +let g:neocomplete#enable_at_startup = get(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_smart_case = get(g:, 'neocomplete#enable_smart_case', 1) +let g:neocomplete#enable_camel_case = get(g:, 'neocomplete#enable_camel_case', 1) "let g:neocomplete#enable_ignore_case = 1 -let g:neocomplete#enable_fuzzy_completion = 1 +let g:neocomplete#enable_fuzzy_completion = get(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\*' +let g:neocomplete#sources#syntax#min_keyword_length = get(g:, 'neocomplete#sources#syntax#min_keyword_length', 3) +let g:neocomplete#lock_buffer_name_pattern = get(g:, 'neocomplete#lock_buffer_name_pattern', '\*ku\*') " Define dictionary. -let g:neocomplete#sources#dictionary#dictionaries = { +let g:neocomplete#sources#dictionary#dictionaries = get(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 +let g:neocomplete#enable_auto_delimiter = get(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*(\?' - +let g:neocomplete#keyword_patterns._ = get(g:neocomplete#keyword_pattern, '_', '\h\k*(\?') " AutoComplPop like behavior. let g:neocomplete#enable_auto_select = 0 @@ -35,10 +34,12 @@ 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#sources#omni#input_patterns.lua ='[^. \t0-9]\.\w*' -let g:neocomplete#force_omni_input_patterns = {} +let g:neocomplete#sources#omni#input_patterns.perl = get(g:neocomplete#sources#omni#input_patterns, 'perl', '\h\w*->\h\w*\|\h\w*::') +let g:neocomplete#sources#omni#input_patterns.java = get(g:neocomplete#sources#omni#input_patterns, 'java','[^. \t0-9]\.\w*') +let g:neocomplete#sources#omni#input_patterns.lua = get(g:neocomplete#sources#omni#input_patterns, 'lua','[^. \t0-9]\.\w*') +if !exists('g:neocomplete#force_omni_input_patterns') + let g:neocomplete#force_omni_input_patterns = {} +endif "let g:neocomplete#force_omni_input_patterns.java = '^\s*' " , : close popup and delete backword char. inoremap neocomplete#smart_close_popup()."\" diff --git a/config/plugins/neomake.vim b/config/plugins/neomake.vim index c951d2982..8a5ab9592 100644 --- a/config/plugins/neomake.vim +++ b/config/plugins/neomake.vim @@ -3,12 +3,12 @@ scriptencoding utf-8 let g:neomake_open_list = get(g:, 'neomake_open_list', 2) let g:neomake_verbose = get(g:, 'neomake_verbose', 0) let g:neomake_java_javac_delete_output = get(g:, 'neomake_java_javac_delete_output', 0) -let g:neomake_error_sign = { +let g:neomake_error_sign = get(g:, 'neomake_error_sign', { \ 'text': get(g:, 'spacevim_error_symbol', '✖'), \ 'texthl': (g:spacevim_colorscheme ==# 'gruvbox' ? 'GruvboxRedSign' : 'error'), - \ } -let g:neomake_warning_sign = { + \ }) +let g:neomake_warning_sign = get(g:, 'neomake_warning_sign', { \ 'text': get(g:,'spacevim_warning_symbol', '➤'), \ 'texthl': (g:spacevim_colorscheme ==# 'gruvbox' ? 'GruvboxYellowSign' : 'todo'), - \ } + \ }) " vim:set et sw=2: diff --git a/config/plugins/neosnippet.vim b/config/plugins/neosnippet.vim index bd90d701d..a191075fd 100644 --- a/config/plugins/neosnippet.vim +++ b/config/plugins/neosnippet.vim @@ -10,9 +10,12 @@ endif if g:spacevim_force_global_config == 0 let g:neosnippet#snippets_directory = [getcwd() . '/.Spacevim.d/snippets'] + g:neosnippet#snippets_directory endif -let g:neosnippet#enable_snipmate_compatibility=1 -let g:neosnippet#enable_complete_done = 1 -let g:neosnippet#completed_pairs= {} +let g:neosnippet#enable_snipmate_compatibility = get(g:, 'neosnippet#enable_snipmate_compatibility', 1) +let g:neosnippet#enable_complete_done = get(g:, 'neosnippet#enable_complete_done', 1) + +if !exists('g:neosnippet#completed_pairs') + let g:neosnippet#completed_pairs = {} +endif let g:neosnippet#completed_pairs.java = {'(' : ')'} if g:neosnippet#enable_complete_done let g:neopairs#enable = 0 diff --git a/config/plugins/open-brower.vim b/config/plugins/open-brower.vim index e8eca5454..d465a0dcc 100644 --- a/config/plugins/open-brower.vim +++ b/config/plugins/open-brower.vim @@ -1,6 +1,6 @@ "for open-browser {{{ " This is my setting. -let g:netrw_nogx = 1 " disable netrw's gx mapping. +let g:netrw_nogx = get(g:, 'netrw_nogx', 1) " disable netrw's gx mapping. "nmap gx (openbrowser-smart-search) "vmap gx (openbrowser-smart-search) "" Open URI under cursor. diff --git a/config/plugins/syntastic.vim b/config/plugins/syntastic.vim index 4b205fecf..565001b6f 100644 --- a/config/plugins/syntastic.vim +++ b/config/plugins/syntastic.vim @@ -2,19 +2,19 @@ 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_java_javac_config_file_enabled = get(g:, 'syntastic_java_javac_config_file_enabled', 1) +let g:syntastic_java_javac_delete_output = get(g:, 'syntastic_java_javac_delete_output', 0) +let g:syntastic_always_populate_loc_list = get(g:, 'syntastic_always_populate_loc_list', 1) +let g:syntastic_auto_loc_list = get(g:, 'syntastic_auto_loc_list', 1) +let g:syntastic_check_on_open = get(g:, 'syntastic_check_on_open', 0) +let g:syntastic_check_on_wq = get(g:, 'syntastic_check_on_wq', 0) let g:syntastic_error_symbol = get(g:, 'spacevim_error_symbol', '✖') let g:syntastic_warning_symbol = get(g:, 'spacevim_warning_symbol', '➤') -let g:syntastic_vimlint_options = { +let g:syntastic_vimlint_options = get(g:, 'syntastic_vimlint_options', { \'EVL102': 1 , \'EVL103': 1 , \'EVL205': 1 , \'EVL105': 1 , - \} + \}) " vim:set et sw=2: diff --git a/config/plugins/tagbar.vim b/config/plugins/tagbar.vim index 8721bc171..e6847c340 100644 --- a/config/plugins/tagbar.vim +++ b/config/plugins/tagbar.vim @@ -1,4 +1,4 @@ -let g:tagbar_width = g:spacevim_sidebar_width -let g:tagbar_left = 1 -let g:tagbar_sort = 0 -let g:tagbar_compact = 1 +let g:tagbar_width = get(g:, 'tagbar_width', g:spacevim_sidebar_width) +let g:tagbar_left = get(g:, 'tagbar_left', 1) +let g:tagbar_sort = get(g:, 'tagbar_sort', 0) +let g:tagbar_compact = get(g:, 'tagbar_compact', 1) diff --git a/config/plugins/taglist.vim b/config/plugins/taglist.vim index 06e1bb22c..48ff918ac 100644 --- a/config/plugins/taglist.vim +++ b/config/plugins/taglist.vim @@ -1,13 +1,13 @@ scriptencoding utf-8 if !executable('ctags') - let g:Tlist_Ctags_Cmd = '/usr/bin/ctags' "设置ctags执行路径 + let g:Tlist_Ctags_Cmd = get(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 +let g:Tlist_Auto_Update = get(g:, 'Tlist_Auto_Update', 1) +let g:Tlist_Auto_Open = get(g:, 'Tlist_Auto_Open', 0) +let g:Tlist_Use_Right_Window = get(g:, 'Tlist_Use_Right_Window', 1) +let g:Tlist_Show_One_File = get(g:, 'Tlist_Show_One_File', 0) +let g:Tlist_File_Fold_Auto_Close = get(g:, 'Tlist_File_Fold_Auto_Close', 1) +let g:Tlist_Exit_OnlyWindow = get(g:, 'Tlist_Exit_OnlyWindow', 1) +let g:Tlist_Show_Menu = get(g:, 'Tlist_Show_Menu', 1) " vim:set et sw=2: diff --git a/config/plugins/unite-gtags.vim b/config/plugins/unite-gtags.vim index ede3598e6..727780912 100644 --- a/config/plugins/unite-gtags.vim +++ b/config/plugins/unite-gtags.vim @@ -4,8 +4,8 @@ nnoremap gr :execute 'Unite -auto-preview -start-insert -no-split gtags nnoremap gg :execute 'Unite -auto-preview -start-insert -no-split gtags/grep' "nnoremap gp :execute 'Unite -auto-preview -start-insert -no-split gtags/completion' vnoremap gd :execute 'Unite -auto-preview -start-insert -no-split gtags/def:'.GetVisualSelection() -let g:unite_source_gtags_project_config = { +let g:unite_source_gtags_project_config = get(g:, 'unite_source_gtags_project_config', { \ '_': { 'treelize': 0 } - \ } + \ }) " vim:set et sw=2: diff --git a/config/plugins/unite-radio.vim b/config/plugins/unite-radio.vim index 136021cf2..830cf17fd 100644 --- a/config/plugins/unite-radio.vim +++ b/config/plugins/unite-radio.vim @@ -1 +1 @@ -let g:unite_source_radio_play_cmd='mpv' +let g:unite_source_radio_play_cmd= get(g:, 'unite_source_radio_play_cmd', 'mpv') diff --git a/config/plugins/unite.vim b/config/plugins/unite.vim index eb2d1472d..487ec380d 100644 --- a/config/plugins/unite.vim +++ b/config/plugins/unite.vim @@ -23,20 +23,29 @@ call unite#custom#profile('default', 'context', { 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_source_codesearch_ignore_case = get(g:, + \ 'unite_source_codesearch_ignore_case', 1) +let g:unite_source_buffer_time_format = get(g:, + \ 'unite_source_buffer_time_format', '(%m-%d-%Y %H:%M:%S) ') +let g:unite_source_file_mru_time_format = get(g:, + \ 'unite_source_file_mru_time_format', '(%m-%d-%Y %H:%M:%S) ') +let g:unite_source_directory_mru_time_format = get(g:, + \ 'unite_source_directory_mru_time_format', '(%m-%d-%Y %H:%M:%S) ') +let g:unite_source_directory_mru_limit = get(g:, + \ 'unite_source_directory_mru_limit', 80) +let g:unite_source_file_rec_max_depth = get(g:, + \ 'unite_source_file_rec_max_depth', 6) +let g:unite_enable_ignore_case = get(g:, 'unite_enable_ignore_case', 1) +let g:unite_enable_smart_case = get(g:, 'unite_enable_smart_case', 1) +let g:unite_data_directory = get(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' +let g:unite_source_history_yank_enable = get(g:, + \ 'unite_source_history_yank_enable', 1) +let g:unite_split_rule = get(g:, 'unite_split_rule', 'botright') +let g:unite_winheight = get(g:, 'unite_winheight', 25) +let g:unite_source_grep_default_opts = get(g:, + \ 'unite_source_grep_default_opts', + \ '-iRHn' \ . " --exclude='tags'" \ . " --exclude='cscope*'" \ . " --exclude='*.svn*'" @@ -46,13 +55,13 @@ let g:unite_source_grep_default_opts = '-iRHn' \ . " --exclude-dir='CVS'" \ . " --exclude-dir='.svn'" \ . " --exclude-dir='.git'" - \ . " --exclude-dir='node_modules'" -let g:unite_launch_apps = [ + \ . " --exclude-dir='node_modules'") +let g:unite_launch_apps = get(g:, 'unite_launch_apps', [ \ 'rake', \ 'make', \ 'git pull', - \ 'git push'] -let g:unite_source_menu_menus = get(g:,'unite_source_menu_menus',{}) + \ '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', @@ -90,52 +99,96 @@ let g:unite_source_menu_menus.git.command_candidates = [ "=============================================================================== " HTTP Status Code Definitions "=============================================================================== -let g:unite_source_menu_menus.StatusCodeDefinitions = {'description': 'HTTP status code definitions sc'} +let g:unite_source_menu_menus.StatusCodeDefinitions = {'description': + \ 'HTTP status code definitions 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"'], + \['➤ 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 sc :Unite -silent -winheight=17 -start-insert menu:StatusCodeDefinitions -let g:unite_source_grep_max_candidates = 200 +nnoremap sc :Unite -silent -winheight=17 + \ -start-insert menu:StatusCodeDefinitions +let g:unite_source_grep_max_candidates = get(g:, + \ 'unite_source_grep_max_candidates', 200) if executable('hw') " Use hw (highway) " https://github.com/tkengo/highway @@ -146,9 +199,8 @@ 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_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) @@ -160,8 +212,7 @@ 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_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' @@ -178,12 +229,16 @@ elseif executable('beagrep') " https://github.com/baohaojun/beagrep let g:unite_source_grep_command = 'beagrep' endif -let g:unite_source_rec_async_command = +let g:unite_source_rec_async_command = get(g:, + \ 'unite_source_rec_async_command', \ ['ag', '--follow', '--nocolor', '--nogroup', - \ '--hidden', '-g', ''] -nnoremap ufa :Unite -no-split -buffer-name=Mixed -start-insert file file_mru file_rec buffer -nnoremap ufr :Unite -buffer-name=files file_rec/async:! -nnoremap ufg :Unite -buffer-name=git-repo file_rec/git + \ '--hidden', '-g', '']) +nnoremap ufa :Unite -no-split + \ -buffer-name=Mixed -start-insert file file_mru file_rec buffer +nnoremap ufr :Unite + \ -buffer-name=files file_rec/async:! +nnoremap ufg :Unite + \ -buffer-name=git-repo file_rec/git call unite#custom#profile('file_rec/async,file_rec/git', 'context', { \ 'start_insert' : 1, \ 'quit' : 1, @@ -191,11 +246,16 @@ call unite#custom#profile('file_rec/async,file_rec/git', 'context', { \ 'keep_focus' : 1, \ 'winheight' : 20, \ }) -call unite#custom#source('file_rec/async', 'ignore_globs',['*.png','.git/','*.ttf']) -nnoremap uf :Unite -no-split -buffer-name=files -start-insert file -nnoremap ufm :Unite -no-split -buffer-name=mru -start-insert file_mru -nnoremap ubf :Unite -buffer-name=buffer buffer -nnoremap utb :Unite -buffer-name=buffer_tab buffer_tab +call unite#custom#source('file_rec/async', 'ignore_globs', + \ ['*.png','.git/','*.ttf']) +nnoremap uf :Unite + \ -no-split -buffer-name=files -start-insert file +nnoremap ufm :Unite + \ -no-split -buffer-name=mru -start-insert file_mru +nnoremap ubf :Unite + \ -buffer-name=buffer buffer +nnoremap utb :Unite + \ -buffer-name=buffer_tab buffer_tab call unite#custom#profile('buffer,buffer_tab', 'context', { \ 'start_insert' : 0, \ 'quit' : 1, @@ -208,14 +268,18 @@ nnoremap f :Unite tag/include: nnoremap ff :Unite tag/include -start-insert "" grep dictionay """ For searching the word in the cursor in the current directory -nnoremap v :Unite -auto-preview -no-split grep:.:: +nnoremap v :Unite + \ -auto-preview -no-split grep:.:: """ For searching the word handin nnoremap vs :Unite -auto-preview -no-split grep:. """ For searching the word in the cursor in the current buffer -noremap vf :Unite -auto-preview -no-split grep:%:: +noremap vf :Unite + \ -auto-preview -no-split grep:%:: """ For searching the word in the cursor in all opened buffer -noremap va :Unite -auto-preview -no-split grep:$buffers:: -nnoremap bl :Unite -start-insert -buffer-name=buffer buffer +noremap va :Unite + \ -auto-preview -no-split grep:$buffers:: +nnoremap bl :Unite + \ -start-insert -buffer-name=buffer buffer nnoremap ta :Unite -start-insert -buffer-name=tag tag " search plugin " :Unite neobundle/search @@ -223,8 +287,11 @@ nnoremap ta :Unite -start-insert -buffer-name=tag tag nnoremap ugg :Unite -silent -start-insert menu:git nnoremap ugf :UniteWithCursorWord file_rec/async nnoremap ugt :UniteWithCursorWord tag -nnoremap ls :Unite -silent -ignorecase -winheight=17 -start-insert menu:MyStarredrepos -nnoremap lm :Unite -silent -ignorecase -winheight=17 -start-insert menu:MpvPlayer +nnoremap ls :Unite + \ -silent -ignorecase -winheight=17 + \ -start-insert menu:MyStarredrepos +nnoremap lm :Unite + \ -silent -ignorecase -winheight=17 -start-insert menu:MpvPlayer call zvim#util#loadMusics() augroup unite_buffer_feature autocmd FileType unite call s:unite_my_settings() @@ -279,4 +346,4 @@ function! s:unite_my_settings() imap unite#do_action('split') endfunction -" vim:set et sw=2: +" vim:set et sw=2 cc=80: diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 6374f5a5d..4a4538588 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -31,18 +31,19 @@ CONTENTS *SpaceVim-contents* 8. incsearch..................................|SpaceVim-layer-incsearch| 9. indentmove................................|SpaceVim-layer-indentmove| 10. lang#c.......................................|SpaceVim-layer-lang-c| - 11. lang#elixir.............................|SpaceVim-layer-lang-elixir| - 12. lang#go.....................................|SpaceVim-layer-lang-go| - 13. lang#java.................................|SpaceVim-layer-lang-java| - 14. lang#ocaml...............................|SpaceVim-layer-lang-ocaml| - 15. lang#php...................................|SpaceVim-layer-lang-php| - 16. lang#puppet.............................|SpaceVim-layer-lang-puppet| - 17. lang#python.............................|SpaceVim-layer-lang-python| - 18. lang#rust.................................|SpaceVim-layer-lang-rust| - 19. lang#xml...................................|SpaceVim-layer-lang-xml| - 20. operator...................................|SpaceVim-layer-operator| - 21. shell.........................................|SpaceVim-layer-shell| - 22. tmux...........................................|SpaceVim-layer-tmux| + 11. lang#crystal...........................|SpaceVim-layer-lang-crystal| + 12. lang#elixir.............................|SpaceVim-layer-lang-elixir| + 13. lang#go.....................................|SpaceVim-layer-lang-go| + 14. lang#java.................................|SpaceVim-layer-lang-java| + 15. lang#ocaml...............................|SpaceVim-layer-lang-ocaml| + 16. lang#php...................................|SpaceVim-layer-lang-php| + 17. lang#puppet.............................|SpaceVim-layer-lang-puppet| + 18. lang#python.............................|SpaceVim-layer-lang-python| + 19. lang#rust.................................|SpaceVim-layer-lang-rust| + 20. lang#xml...................................|SpaceVim-layer-lang-xml| + 21. operator...................................|SpaceVim-layer-operator| + 22. shell.........................................|SpaceVim-layer-shell| + 23. tmux...........................................|SpaceVim-layer-tmux| 6. API........................................................|SpaceVim-api| 1. cmdlinemenu................................|SpaceVim-api-cmdlinemenu| 7. FAQ........................................................|SpaceVim-faq| @@ -155,6 +156,18 @@ Set the warning symbol for SpaceVim's syntax maker. Default is '⚠'. let g:spacevim_warning_symbol = '!' < + *g:spacevim_terminal_cursor_shape* +Set the SpaceVim cursor shape in the terminal. Set to 0 to prevent Nvim from +changing the cursor shape. Set to 1 to enable non-blinking mode-sensitive +cursor (this is the default). Set to 2 to enable blinking mode-sensitive +cursor. Host terminal must support the DECSCUSR CSI escape sequence. + +Depending on the terminal emulator, using this option with nvim under tmux +might require adding the following to ~/.tmux.conf: +> + set -ga terminal-overrides ',*:Ss=\E[%p1%d q:Se=\E[2 q' +< + *g:spacevim_vim_help_language* Set the help language of vim. Default is 'en'. You can change it to Chinese. > @@ -195,7 +208,7 @@ neobundle, or vim-plug. *g:spacevim_checkinstall* Enable/Disable checkinstall on SpaceVim startup. Default is 1. > - let g:spacevim_checkinstall = 0 + let g:spacevim_checkinstall = 1 < *g:spacevim_enable_debug* @@ -605,6 +618,13 @@ Configuration for `tweekmonster/deoplete-clang2`: 50, setting it to 0 disables this feature. +============================================================================== +LANG#CRYSTAL *SpaceVim-layer-lang-crystal* + +INTRO +The lang#crystal layer provides crystal filetype detection and syntax +highlight, crystal tool and crystal spec integration. + ============================================================================== LANG#ELIXIR *SpaceVim-layer-lang-elixir*