1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-03-23 01:09:56 +08:00

Merge branch 'core_layer' into dev

This commit is contained in:
wsdjeg 2017-03-07 22:12:08 +08:00
commit dcd6479e7c
50 changed files with 2176 additions and 1729 deletions

View File

@ -2,7 +2,7 @@
" SpaceVim.vim --- Initialization and core files for SpaceVim " SpaceVim.vim --- Initialization and core files for SpaceVim
" Copyright (c) 2016-2017 Shidong Wang & Contributors " Copyright (c) 2016-2017 Shidong Wang & Contributors
" Author: Shidong Wang < wsdjeg at 163.com > " Author: Shidong Wang < wsdjeg at 163.com >
" URL: https://github.com/syl20bnr/spacemacs " URL: https://spacevim.org
" License: MIT license " License: MIT license
"============================================================================= "=============================================================================
@ -72,7 +72,9 @@ let g:spacevim_vim_plug_installed = 0
" > " >
" let g:spacevim_plugin_bundle_dir = '~/.cache/vimplugs' " let g:spacevim_plugin_bundle_dir = '~/.cache/vimplugs'
" < " <
let g:spacevim_plugin_bundle_dir = $HOME. join(['', '.cache', 'vimfiles', ''], SpaceVim#api#import('file').separator) let g:spacevim_plugin_bundle_dir
\ = $HOME. join(['', '.cache', 'vimfiles', ''],
\ SpaceVim#api#import('file').separator)
"" ""
" Enable/Disable realtime leader guide. Default is 0. " Enable/Disable realtime leader guide. Default is 0.
" > " >
@ -160,7 +162,7 @@ let g:spacevim_filemanager = 'vimfiler'
"" ""
" The default plugin manager of SpaceVim. Default is 'dein'. " The default plugin manager of SpaceVim. Default is 'dein'.
" Options are dein, neobundle, or vim-plug. " Options are dein, neobundle, or vim-plug.
let g:spacevim_plugin_manager = 'dein' " neobundle or dein or vim-plug let g:spacevim_plugin_manager = 'dein'
"" ""
" Enable/Disable checkinstall on SpaceVim startup. Default is 1. " Enable/Disable checkinstall on SpaceVim startup. Default is 1.
" > " >
@ -249,101 +251,103 @@ let g:spacevim_src_root = 'E:\sources\'
"" ""
" The host file url. This option is for Chinese users who can not use " The host file url. This option is for Chinese users who can not use
" Google and Twitter. " Google and Twitter.
let g:spacevim_hosts_url = 'https://raw.githubusercontent.com/racaljk/hosts/master/hosts' let g:spacevim_hosts_url
let g:spacevim_wildignore = '*/tmp/*,*.so,*.swp,*.zip,*.class,tags,*.jpg, \ = 'https://raw.githubusercontent.com/racaljk/hosts/master/hosts'
\*.ttf,*.TTF,*.png,*/target/*, let g:spacevim_wildignore
\.git,.svn,.hg,.DS_Store' \ = '*/tmp/*,*.so,*.swp,*.zip,*.class,tags,*.jpg,
\*.ttf,*.TTF,*.png,*/target/*,
\.git,.svn,.hg,.DS_Store'
function! SpaceVim#loadCustomConfig() abort function! SpaceVim#loadCustomConfig() abort
let custom_confs_old = SpaceVim#util#globpath(getcwd(), '.local.vim') let custom_confs_old = SpaceVim#util#globpath(getcwd(), '.local.vim')
let custom_confs = SpaceVim#util#globpath(getcwd(), '.SpaceVim.d/init.vim') let custom_confs = SpaceVim#util#globpath(getcwd(), '.SpaceVim.d/init.vim')
let custom_glob_conf_old = expand('~/.local.vim') let custom_glob_conf_old = expand('~/.local.vim')
let custom_glob_conf = expand('~/.SpaceVim.d/init.vim') let custom_glob_conf = expand('~/.SpaceVim.d/init.vim')
" the old value will be remove " the old value will be remove
if filereadable(custom_glob_conf_old) if filereadable(custom_glob_conf_old)
exe 'source ' . custom_glob_conf_old exe 'source ' . custom_glob_conf_old
endif endif
if !empty(custom_confs_old) if !empty(custom_confs_old)
exe 'source ' . custom_confs_old[0] exe 'source ' . custom_confs_old[0]
endif endif
if !empty(custom_confs) if !empty(custom_confs)
if isdirectory('.SpaceVim.d') if isdirectory('.SpaceVim.d')
exe 'set rtp ^=' . expand('.SpaceVim.d') exe 'set rtp ^=' . expand('.SpaceVim.d')
endif
exe 'source ' . custom_confs[0]
if filereadable(custom_glob_conf) && g:spacevim_force_global_config
if isdirectory(expand('~/.SpaceVim.d/'))
set runtimepath^=~/.SpaceVim.d
endif
exe 'source ' . custom_glob_conf
endif
elseif filereadable(custom_glob_conf)
if isdirectory(expand('~/.SpaceVim.d/'))
set runtimepath^=~/.SpaceVim.d
endif
exe 'source ' . custom_glob_conf
endif endif
exe 'source ' . custom_confs[0]
if filereadable(custom_glob_conf) && g:spacevim_force_global_config
if isdirectory(expand('~/.SpaceVim.d/'))
set runtimepath^=~/.SpaceVim.d
endif
exe 'source ' . custom_glob_conf
endif
elseif filereadable(custom_glob_conf)
if isdirectory(expand('~/.SpaceVim.d/'))
set runtimepath^=~/.SpaceVim.d
endif
exe 'source ' . custom_glob_conf
endif
endfunction endfunction
function! SpaceVim#end() abort function! SpaceVim#end() abort
if !empty(g:spacevim_windows_leader) if !empty(g:spacevim_windows_leader)
call SpaceVim#mapping#leader#defindWindowsLeader(g:spacevim_windows_leader) call SpaceVim#mapping#leader#defindWindowsLeader(g:spacevim_windows_leader)
endif
if !empty(g:spacevim_unite_leader)
call SpaceVim#mapping#leader#defindUniteLeader(g:spacevim_unite_leader)
endif
call SpaceVim#mapping#leader#defindglobalMappings()
if g:spacevim_simple_mode
let g:spacevim_plugin_groups = ['core']
else
for s:group in g:spacevim_plugin_groups_exclude
let s:i = index(g:spacevim_plugin_groups, s:group)
if s:i != -1
call remove(g:spacevim_plugin_groups, s:i)
endif
endfor
if g:spacevim_vim_help_language ==# 'cn'
call add(g:spacevim_plugin_groups, 'chinese')
endif endif
if !empty(g:spacevim_unite_leader) if g:spacevim_use_colorscheme==1
call SpaceVim#mapping#leader#defindUniteLeader(g:spacevim_unite_leader) call add(g:spacevim_plugin_groups, 'colorscheme')
endif endif
call SpaceVim#mapping#leader#defindglobalMappings()
if g:spacevim_simple_mode if has('nvim')
let g:spacevim_plugin_groups = ['core'] let g:spacevim_autocomplete_method = 'deoplete'
elseif has('lua')
let g:spacevim_autocomplete_method = 'neocomplete'
else else
for s:group in g:spacevim_plugin_groups_exclude let g:spacevim_autocomplete_method = 'neocomplcache'
let s:i = index(g:spacevim_plugin_groups, s:group)
if s:i != -1
call remove(g:spacevim_plugin_groups, s:i)
endif
endfor
if g:spacevim_vim_help_language ==# 'cn'
call add(g:spacevim_plugin_groups, 'chinese')
endif
if g:spacevim_use_colorscheme==1
call add(g:spacevim_plugin_groups, 'colorscheme')
endif
if has('nvim')
let g:spacevim_autocomplete_method = 'deoplete'
elseif has('lua')
let g:spacevim_autocomplete_method = 'neocomplete'
else
let g:spacevim_autocomplete_method = 'neocomplcache'
endif
if g:spacevim_enable_ycm
let g:spacevim_autocomplete_method = 'ycm'
endif
if g:spacevim_enable_neocomplcache
let g:spacevim_autocomplete_method = 'neocomplcache'
endif
endif endif
"" if g:spacevim_enable_ycm
" generate tags for SpaceVim let g:spacevim_autocomplete_method = 'ycm'
let help = fnamemodify(g:Config_Main_Home, ':p:h:h') . '/doc'
exe 'helptags ' . help
""
" set language
if !empty(g:spacevim_language)
silent exec 'lan ' . g:spacevim_language
endif endif
if g:spacevim_enable_neocomplcache
let g:spacevim_autocomplete_method = 'neocomplcache'
endif
endif
""
" generate tags for SpaceVim
let help = fnamemodify(g:Config_Main_Home, ':p:h:h') . '/doc'
exe 'helptags ' . help
call SpaceVim#plugins#load() ""
" set language
if !empty(g:spacevim_language)
silent exec 'lan ' . g:spacevim_language
endif
call SpaceVim#plugins#load()
endfunction endfunction
function! SpaceVim#default() abort function! SpaceVim#default() abort
call SpaceVim#default#SetOptions() call SpaceVim#default#SetOptions()
call SpaceVim#default#SetPlugins() call SpaceVim#default#SetPlugins()
call SpaceVim#default#SetMappings() call SpaceVim#default#SetMappings()
endfunction endfunction
function! SpaceVim#defindFuncs() abort function! SpaceVim#defindFuncs() abort
@ -351,13 +355,13 @@ endfunction
function! SpaceVim#welcome() abort function! SpaceVim#welcome() abort
if exists(':VimFiler') == 2 && exists(':Startify') == 2 if exists(':VimFiler') == 2 && exists(':Startify') == 2
if g:spacevim_enable_vimfiler_welcome if g:spacevim_enable_vimfiler_welcome
VimFiler VimFiler
endif
wincmd p
Startify
endif endif
wincmd p
Startify
endif
endfunction endfunction
"" ""
@ -407,3 +411,7 @@ endfunction
" > " >
" Add `let mapleader = "\<space>"` to `~/.SpaceVim.d/init.vim` " Add `let mapleader = "\<space>"` to `~/.SpaceVim.d/init.vim`
" < " <
" vim:set et sw=2 cc=80:

View File

@ -1,8 +1,10 @@
function! SpaceVim#api#import(name) abort function! SpaceVim#api#import(name) abort
let p = {} let p = {}
try try
let p = SpaceVim#api#{a:name}#get() let p = SpaceVim#api#{a:name}#get()
catch /^Vim\%((\a\+)\)\=:E117/ catch /^Vim\%((\a\+)\)\=:E117/
endtry endtry
return p return p
endfunction endfunction
" vim:set fdm=marker sw=2 nowrap:

View File

@ -2,52 +2,52 @@ let s:json = {}
if exists('*json_decode') if exists('*json_decode')
let g:spacevim_api_json_true = v:true let g:spacevim_api_json_true = v:true
let g:spacevim_api_json_true = v:false let g:spacevim_api_json_true = v:false
let g:spacevim_api_json_true = v:null let g:spacevim_api_json_true = v:null
function! s:json_decode(json) abort function! s:json_decode(json) abort
if a:json ==# '' if a:json ==# ''
return [] return []
endif endif
return json_decode(a:json) return json_decode(a:json)
endfunction endfunction
else else
function! s:json_null() abort function! s:json_null() abort
endfunction endfunction
function! s:json_true() abort function! s:json_true() abort
endfunction endfunction
function! s:json_false() abort function! s:json_false() abort
endfunction endfunction
let g:spacevim_api_json_true = [function('s:json_true')] let g:spacevim_api_json_true = [function('s:json_true')]
let g:spacevim_api_json_false = [function('s:json_false')] let g:spacevim_api_json_false = [function('s:json_false')]
let g:spacevim_api_json_null = [function('s:json_null')] let g:spacevim_api_json_null = [function('s:json_null')]
" @vimlint(EVL102, 1, l:true) " @vimlint(EVL102, 1, l:true)
" @vimlint(EVL102, 1, l:false) " @vimlint(EVL102, 1, l:false)
" @vimlint(EVL102, 1, l:null) " @vimlint(EVL102, 1, l:null)
function! s:json_decode(json) abort function! s:json_decode(json) abort
let true = g:spacevim_api_json_true let true = g:spacevim_api_json_true
let false = g:spacevim_api_json_false let false = g:spacevim_api_json_false
let null = g:spacevim_api_json_null let null = g:spacevim_api_json_null
if substitute(a:json, '\v\"%(\\.|[^"\\])*\"|true|false|null|[+-]?\d+%(\.\d+%([Ee][+-]?\d+)?)?', '', 'g') !~# "[^,:{}[\\] \t]" if substitute(a:json, '\v\"%(\\.|[^"\\])*\"|true|false|null|[+-]?\d+%(\.\d+%([Ee][+-]?\d+)?)?', '', 'g') !~# "[^,:{}[\\] \t]"
try try
let object = eval(a:json) let object = eval(a:json)
catch catch
" malformed JSON " malformed JSON
let object = '' let object = ''
endtry endtry
else else
let object = '' let object = ''
endif endif
return object return object
endfunction endfunction
" @vimlint(EVL102, 0, l:true) " @vimlint(EVL102, 0, l:true)
" @vimlint(EVL102, 0, l:false) " @vimlint(EVL102, 0, l:false)
" @vimlint(EVL102, 0, l:null) " @vimlint(EVL102, 0, l:null)
endif endif
lockvar g:spacevim_api_json_true lockvar g:spacevim_api_json_true
@ -57,48 +57,50 @@ lockvar g:spacevim_api_json_null
let s:json['json_decode'] = function('s:json_decode') let s:json['json_decode'] = function('s:json_decode')
if exists('*json_encode') if exists('*json_encode')
function! s:json_encode(val) abort function! s:json_encode(val) abort
return json_encode(a:val) return json_encode(a:val)
endfunction endfunction
else else
function! s:json_encode(val) abort function! s:json_encode(val) abort
if type(a:val) == type(0) if type(a:val) == type(0)
return a:val return a:val
elseif type(a:val) == type('') elseif type(a:val) == type('')
let json = '"' . escape(a:val, '\"') . '"' let json = '"' . escape(a:val, '\"') . '"'
let json = substitute(json, "\r", '\\r', 'g') let json = substitute(json, "\r", '\\r', 'g')
let json = substitute(json, "\n", '\\n', 'g') let json = substitute(json, "\n", '\\n', 'g')
let json = substitute(json, "\t", '\\t', 'g') let json = substitute(json, "\t", '\\t', 'g')
let json = substitute(json, '\([[:cntrl:]]\)', '\=printf("\x%02d", char2nr(submatch(1)))', 'g') let json = substitute(json, '\([[:cntrl:]]\)', '\=printf("\x%02d", char2nr(submatch(1)))', 'g')
return iconv(json, &encoding, 'utf-8') return iconv(json, &encoding, 'utf-8')
elseif type(a:val) == 2 elseif type(a:val) == 2
let s = string(a:val) let s = string(a:val)
if s == string(g:spacevim_api_json_null) if s == string(g:spacevim_api_json_null)
return 'null' return 'null'
elseif s == string(g:spacevim_api_json_true) elseif s == string(g:spacevim_api_json_true)
return 'true' return 'true'
elseif s == string(g:spacevim_api_json_false) elseif s == string(g:spacevim_api_json_false)
return 'false' return 'false'
endif endif
elseif type(a:val) == type([]) elseif type(a:val) == type([])
if len(a:val) == 1 && a:val[0] == g:spacevim_api_json_false[0] if len(a:val) == 1 && a:val[0] == g:spacevim_api_json_false[0]
return 'false' return 'false'
elseif len(a:val) == 1 && a:val[0] == g:spacevim_api_json_true[0] elseif len(a:val) == 1 && a:val[0] == g:spacevim_api_json_true[0]
return 'true' return 'true'
elseif len(a:val) == 1 && a:val[0] == g:spacevim_api_json_null[0] elseif len(a:val) == 1 && a:val[0] == g:spacevim_api_json_null[0]
return 'null' return 'null'
endif endif
return '[' . join(map(copy(a:val), 's:json_encode(v:val)'), ',') . ']' return '[' . join(map(copy(a:val), 's:json_encode(v:val)'), ',') . ']'
elseif type(a:val) == 4 elseif type(a:val) == 4
return '{' . join(map(keys(a:val), "s:json_encode(v:val) . ':' . s:json_encode(a:val[v:val])"), ',') . '}' return '{' . join(map(keys(a:val), "s:json_encode(v:val) . ':' . s:json_encode(a:val[v:val])"), ',') . '}'
else else
return string(a:val) return string(a:val)
endif endif
endfunction endfunction
endif endif
let s:json['json_encode'] = function('s:json_encode') let s:json['json_encode'] = function('s:json_encode')
function! SpaceVim#api#data#json#get() abort function! SpaceVim#api#data#json#get() abort
return deepcopy(s:json) return deepcopy(s:json)
endfunction endfunction
" vim:set et sw=2:

View File

@ -1,46 +1,45 @@
let s:file = {} let s:file = {}
function! s:trim(str) abort function! s:trim(str) abort
let str = substitute(a:str, '\s*$', '', 'g') let str = substitute(a:str, '\s*$', '', 'g')
return substitute(str, '^\s*', '', 'g') return substitute(str, '^\s*', '', 'g')
endfunction endfunction
let s:file['trim'] = function('s:trim') let s:file['trim'] = function('s:trim')
function! s:fill(str, length) abort function! s:fill(str, length) abort
if strwidth(a:str) <= a:length if strwidth(a:str) <= a:length
return a:str . repeat(' ', a:length - strwidth(a:str)) return a:str . repeat(' ', a:length - strwidth(a:str))
else else
let l = 0 let l = 0
for i in range(strchars(a:str) - 1) for i in range(strchars(a:str) - 1)
if strwidth(strcharpart(a:str, 0, i)) > a:length if strwidth(strcharpart(a:str, 0, i)) > a:length
break break
else else
let l = i let l = i
endif endif
endfor endfor
let str = strcharpart(a:str, 0, l) let str = strcharpart(a:str, 0, l)
return str . repeat(' ', a:length - strwidth(str)) return str . repeat(' ', a:length - strwidth(str))
endif endif
endfunction endfunction
let s:file['fill'] = function('s:fill') let s:file['fill'] = function('s:fill')
function! s:trim_start(str) abort function! s:trim_start(str) abort
return substitute(a:str, '^\s*', '', 'g') return substitute(a:str, '^\s*', '', 'g')
endfunction endfunction
let s:file['trim_start'] = function('s:trim_start') let s:file['trim_start'] = function('s:trim_start')
function! s:trim_end(str) abort function! s:trim_end(str) abort
return substitute(a:str, '\s*$', '', 'g') return substitute(a:str, '\s*$', '', 'g')
endfunction endfunction
let s:file['trim_end'] = function('s:trim_end') let s:file['trim_end'] = function('s:trim_end')
function! SpaceVim#api#data#string#get() abort function! SpaceVim#api#data#string#get() abort
return deepcopy(s:file) return deepcopy(s:file)
endfunction endfunction
" vim:set et sw=2:

View File

@ -3,181 +3,180 @@ let s:file = {}
let s:system = SpaceVim#api#import('system') let s:system = SpaceVim#api#import('system')
if s:system.isWindows if s:system.isWindows
let s:file['separator'] = '\' let s:file['separator'] = '\'
let s:file['pathSeparator'] = ';' let s:file['pathSeparator'] = ';'
else else
let s:file['separator'] = '/' let s:file['separator'] = '/'
let s:file['pathSeparator'] = ':' let s:file['pathSeparator'] = ':'
endif endif
let s:file_node_extensions = { let s:file_node_extensions = {
\ 'styl' : '', \ 'styl' : '',
\ 'scss' : '', \ 'scss' : '',
\ 'htm' : '', \ 'htm' : '',
\ 'html' : '', \ 'html' : '',
\ 'erb' : '', \ 'erb' : '',
\ 'slim' : '', \ 'slim' : '',
\ 'ejs' : '', \ 'ejs' : '',
\ 'wxml' : '', \ 'wxml' : '',
\ 'css' : '', \ 'css' : '',
\ 'less' : '', \ 'less' : '',
\ 'wxss' : '', \ 'wxss' : '',
\ 'md' : '', \ 'md' : '',
\ 'markdown' : '', \ 'markdown' : '',
\ 'json' : '', \ 'json' : '',
\ 'js' : '', \ 'js' : '',
\ 'jsx' : '', \ 'jsx' : '',
\ 'rb' : '', \ 'rb' : '',
\ 'php' : '', \ 'php' : '',
\ 'py' : '', \ 'py' : '',
\ 'pyc' : '', \ 'pyc' : '',
\ 'pyo' : '', \ 'pyo' : '',
\ 'pyd' : '', \ 'pyd' : '',
\ 'coffee' : '', \ 'coffee' : '',
\ 'mustache' : '', \ 'mustache' : '',
\ 'hbs' : '', \ 'hbs' : '',
\ 'conf' : '', \ 'conf' : '',
\ 'ini' : '', \ 'ini' : '',
\ 'yml' : '', \ 'yml' : '',
\ 'bat' : '', \ 'bat' : '',
\ 'jpg' : '', \ 'jpg' : '',
\ 'jpeg' : '', \ 'jpeg' : '',
\ 'bmp' : '', \ 'bmp' : '',
\ 'png' : '', \ 'png' : '',
\ 'gif' : '', \ 'gif' : '',
\ 'ico' : '', \ 'ico' : '',
\ 'twig' : '', \ 'twig' : '',
\ 'cpp' : '', \ 'cpp' : '',
\ 'c++' : '', \ 'c++' : '',
\ 'cxx' : '', \ 'cxx' : '',
\ 'cc' : '', \ 'cc' : '',
\ 'cp' : '', \ 'cp' : '',
\ 'c' : '', \ 'c' : '',
\ 'hs' : '', \ 'hs' : '',
\ 'lhs' : '', \ 'lhs' : '',
\ 'lua' : '', \ 'lua' : '',
\ 'java' : '', \ 'java' : '',
\ 'sh' : '', \ 'sh' : '',
\ 'fish' : '', \ 'fish' : '',
\ 'ml' : 'λ', \ 'ml' : 'λ',
\ 'mli' : 'λ', \ 'mli' : 'λ',
\ 'diff' : '', \ 'diff' : '',
\ 'db' : '', \ 'db' : '',
\ 'sql' : '', \ 'sql' : '',
\ 'dump' : '', \ 'dump' : '',
\ 'clj' : '', \ 'clj' : '',
\ 'cljc' : '', \ 'cljc' : '',
\ 'cljs' : '', \ 'cljs' : '',
\ 'edn' : '', \ 'edn' : '',
\ 'scala' : '', \ 'scala' : '',
\ 'go' : '', \ 'go' : '',
\ 'dart' : '', \ 'dart' : '',
\ 'xul' : '', \ 'xul' : '',
\ 'sln' : '', \ 'sln' : '',
\ 'suo' : '', \ 'suo' : '',
\ 'pl' : '', \ 'pl' : '',
\ 'pm' : '', \ 'pm' : '',
\ 't' : '', \ 't' : '',
\ 'rss' : '', \ 'rss' : '',
\ 'f#' : '', \ 'f#' : '',
\ 'fsscript' : '', \ 'fsscript' : '',
\ 'fsx' : '', \ 'fsx' : '',
\ 'fs' : '', \ 'fs' : '',
\ 'fsi' : '', \ 'fsi' : '',
\ 'rs' : '', \ 'rs' : '',
\ 'rlib' : '', \ 'rlib' : '',
\ 'd' : '', \ 'd' : '',
\ 'erl' : '', \ 'erl' : '',
\ 'hrl' : '', \ 'hrl' : '',
\ 'vim' : '', \ 'vim' : '',
\ 'ai' : '', \ 'ai' : '',
\ 'psd' : '', \ 'psd' : '',
\ 'psb' : '', \ 'psb' : '',
\ 'ts' : '', \ 'ts' : '',
\ 'jl' : '' \ 'jl' : ''
\} \}
let s:file_node_exact_matches = { let s:file_node_exact_matches = {
\ 'exact-match-case-sensitive-1.txt' : 'X1', \ 'exact-match-case-sensitive-1.txt' : 'X1',
\ 'exact-match-case-sensitive-2' : 'X2', \ 'exact-match-case-sensitive-2' : 'X2',
\ 'gruntfile.coffee' : '', \ 'gruntfile.coffee' : '',
\ 'gruntfile.js' : '', \ 'gruntfile.js' : '',
\ 'gruntfile.ls' : '', \ 'gruntfile.ls' : '',
\ 'gulpfile.coffee' : '', \ 'gulpfile.coffee' : '',
\ 'gulpfile.js' : '', \ 'gulpfile.js' : '',
\ 'gulpfile.ls' : '', \ 'gulpfile.ls' : '',
\ 'dropbox' : '', \ 'dropbox' : '',
\ '.ds_store' : '', \ '.ds_store' : '',
\ '.gitconfig' : '', \ '.gitconfig' : '',
\ '.gitignore' : '', \ '.gitignore' : '',
\ '.bashrc' : '', \ '.bashrc' : '',
\ '.bashprofile' : '', \ '.bashprofile' : '',
\ 'favicon.ico' : '', \ 'favicon.ico' : '',
\ 'license' : '', \ 'license' : '',
\ 'node_modules' : '', \ 'node_modules' : '',
\ 'react.jsx' : '', \ 'react.jsx' : '',
\ 'Procfile' : '', \ 'Procfile' : '',
\ '.vimrc' : '', \ '.vimrc' : '',
\} \}
let s:file_node_pattern_matches = { let s:file_node_pattern_matches = {
\ '.*jquery.*\.js$' : '', \ '.*jquery.*\.js$' : '',
\ '.*angular.*\.js$' : '', \ '.*angular.*\.js$' : '',
\ '.*backbone.*\.js$' : '', \ '.*backbone.*\.js$' : '',
\ '.*require.*\.js$' : '', \ '.*require.*\.js$' : '',
\ '.*materialize.*\.js$' : '', \ '.*materialize.*\.js$' : '',
\ '.*materialize.*\.css$' : '', \ '.*materialize.*\.css$' : '',
\ '.*mootools.*\.js$' : '' \ '.*mootools.*\.js$' : ''
\} \}
function! s:filetypeIcon(path) abort function! s:filetypeIcon(path) abort
let file = fnamemodify(a:path, ':t') let file = fnamemodify(a:path, ':t')
if has_key(s:file_node_exact_matches, file) if has_key(s:file_node_exact_matches, file)
return s:file_node_exact_matches[file] return s:file_node_exact_matches[file]
endif
for [k, v] in items(s:file_node_pattern_matches)
if match(file, k) != -1
return v
endif endif
for [k, v] in items(s:file_node_pattern_matches) endfor
if match(file, k) != -1 let ext = fnamemodify(file, ':e')
return v if has_key(s:file_node_extensions, ext)
endif return s:file_node_extensions[ext]
endfor endif
let ext = fnamemodify(file, ':e') return ''
if has_key(s:file_node_extensions, ext)
return s:file_node_extensions[ext]
endif
return ''
endfunction endfunction
let s:file['fticon'] = function('s:filetypeIcon') let s:file['fticon'] = function('s:filetypeIcon')
function! s:write(msg, fname) abort function! s:write(msg, fname) abort
let flags = filewritable(a:fname) ? 'a' : '' let flags = filewritable(a:fname) ? 'a' : ''
call writefile([a:msg], a:fname, flags) call writefile([a:msg], a:fname, flags)
endfunction endfunction
let s:file['write'] = function('s:write') let s:file['write'] = function('s:write')
function! s:override(msg, fname) abort function! s:override(msg, fname) abort
let flags = filewritable(a:fname) ? 'b' : '' let flags = filewritable(a:fname) ? 'b' : ''
call writefile([a:msg], a:fname, flags) call writefile([a:msg], a:fname, flags)
endfunction endfunction
let s:file['override'] = function('s:override') let s:file['override'] = function('s:override')
function! s:read(fname) abort function! s:read(fname) abort
if filereadable(a:fname) if filereadable(a:fname)
return readfile(a:fname, '') return readfile(a:fname, '')
else else
return '' return ''
endif endif
endfunction endfunction
let s:file['read'] = function('s:read') let s:file['read'] = function('s:read')
function! SpaceVim#api#file#get() abort function! SpaceVim#api#file#get() abort
return deepcopy(s:file) return deepcopy(s:file)
endfunction endfunction
" vim:set et sw=2:

View File

@ -5,16 +5,16 @@ let s:chars = {}
" 1: 1 ➛ ➀ " 1: 1 ➛ ➀
" 2: 1 ➛ ⓵ " 2: 1 ➛ ⓵
function! s:bubble_num(num, type) abort function! s:bubble_num(num, type) abort
let list = [] let list = []
call add(list,['➊', '➋', '➌', '➍', '➎', '➏', '➐', '➑', '➒', '➓']) call add(list,['➊', '➋', '➌', '➍', '➎', '➏', '➐', '➑', '➒', '➓'])
call add(list,['➀', '➁', '➂', '➃', '➄', '➅', '➆', '➇', '➈', '➉']) call add(list,['➀', '➁', '➂', '➃', '➄', '➅', '➆', '➇', '➈', '➉'])
call add(list,['⓵', '⓶', '⓷', '⓸', '⓹', '⓺', '⓻', '⓼', '⓽', '⓾']) call add(list,['⓵', '⓶', '⓷', '⓸', '⓹', '⓺', '⓻', '⓼', '⓽', '⓾'])
let n = '' let n = ''
try try
let n = list[a:type][a:num-1] let n = list[a:type][a:num-1]
catch catch
endtry endtry
return n return n
endfunction endfunction
let s:chars['bubble_num'] = function('s:bubble_num') let s:chars['bubble_num'] = function('s:bubble_num')
@ -24,85 +24,86 @@ let s:chars['bubble_num'] = function('s:bubble_num')
" 1: 1 ➛ ➀ " 1: 1 ➛ ➀
" 2: 1 ➛ ⓵ " 2: 1 ➛ ⓵
function! s:circled_num(num, type) abort function! s:circled_num(num, type) abort
" http://www.unicode.org/charts/beta/nameslist/n_2460.html " http://www.unicode.org/charts/beta/nameslist/n_2460.html
if a:type == 0 if a:type == 0
if a:num == 0 if a:num == 0
return nr2char(9471) return nr2char(9471)
elseif index(range(1,10), a:num) != -1 elseif index(range(1,10), a:num) != -1
return nr2char(10102 + a:num - 1) return nr2char(10102 + a:num - 1)
elseif index(range(11, 20), a:num) elseif index(range(11, 20), a:num)
return nr2char(9451 + a:num - 11) return nr2char(9451 + a:num - 11)
else else
return '' return ''
endif
elseif a:type == 1
if index(range(20), a:num) != -1
if a:num == 0
return nr2char(9450)
else
return nr2char(9311 + a:num)
endif
else
return ''
endif
elseif a:type == 2
if index(range(1, 10), a:num) != -1
return nr2char(9461 + a:num - 1)
else
return ''
endif
endif endif
elseif a:type == 1
if index(range(20), a:num) != -1
if a:num == 0
return nr2char(9450)
else
return nr2char(9311 + a:num)
endif
else
return ''
endif
elseif a:type == 2
if index(range(1, 10), a:num) != -1
return nr2char(9461 + a:num - 1)
else
return ''
endif
endif
endfunction endfunction
let s:chars['circled_num'] = function('s:circled_num') let s:chars['circled_num'] = function('s:circled_num')
function! s:parenthesized_num(num) abort function! s:parenthesized_num(num) abort
" http://www.unicode.org/charts/beta/nameslist/n_2460.html " http://www.unicode.org/charts/beta/nameslist/n_2460.html
if index(range(1, 20), a:num) != -1 if index(range(1, 20), a:num) != -1
return nr2char(9331 + a:num) return nr2char(9331 + a:num)
else else
return '' return ''
endif endif
endfunction endfunction
let s:chars['parenthesized_num'] = function('s:parenthesized_num') let s:chars['parenthesized_num'] = function('s:parenthesized_num')
function! s:num_period(num) abort function! s:num_period(num) abort
" http://www.unicode.org/charts/beta/nameslist/n_2460.html " http://www.unicode.org/charts/beta/nameslist/n_2460.html
if index(range(1, 20), a:num) != -1 if index(range(1, 20), a:num) != -1
return nr2char(9351 + a:num) return nr2char(9351 + a:num)
else else
return '' return ''
endif endif
endfunction endfunction
let s:chars['num_period'] = function('s:num_period') let s:chars['num_period'] = function('s:num_period')
function! s:parenthesized_letter(letter) abort function! s:parenthesized_letter(letter) abort
" http://www.unicode.org/charts/beta/nameslist/n_2460.html " http://www.unicode.org/charts/beta/nameslist/n_2460.html
if index(range(1, 26), char2nr(a:letter) - 96) != -1 if index(range(1, 26), char2nr(a:letter) - 96) != -1
return nr2char(9371 + char2nr(a:letter) - 96) return nr2char(9371 + char2nr(a:letter) - 96)
else else
return '' return ''
endif endif
endfunction endfunction
let s:chars['parenthesized_letter'] = function('s:parenthesized_letter') let s:chars['parenthesized_letter'] = function('s:parenthesized_letter')
function! s:circled_letter(letter) abort function! s:circled_letter(letter) abort
" http://www.unicode.org/charts/beta/nameslist/n_2460.html " http://www.unicode.org/charts/beta/nameslist/n_2460.html
if index(range(1, 26), char2nr(a:letter) - 64) != -1 if index(range(1, 26), char2nr(a:letter) - 64) != -1
return nr2char(9397 + char2nr(a:letter) - 64) return nr2char(9397 + char2nr(a:letter) - 64)
elseif index(range(1, 26), char2nr(a:letter) - 96) != -1 elseif index(range(1, 26), char2nr(a:letter) - 96) != -1
return nr2char(9423 + char2nr(a:letter) - 96) return nr2char(9423 + char2nr(a:letter) - 96)
else else
return '' return ''
endif endif
endfunction endfunction
let s:chars['circled_letter'] = function('s:circled_letter') let s:chars['circled_letter'] = function('s:circled_letter')
function! SpaceVim#api#messletters#get() abort function! SpaceVim#api#messletters#get() abort
return deepcopy(s:chars) return deepcopy(s:chars)
endfunction endfunction
" vim:set et sw=2:

View File

@ -8,52 +8,54 @@ let s:system['isLinux'] = has('unix') && !has('macunix') && !has('win32unix')
let s:system['isOSX'] = has('macunix') let s:system['isOSX'] = has('macunix')
function! s:isDarwin() abort function! s:isDarwin() abort
if exists('s:is_darwin') if exists('s:is_darwin')
return s:is_darwin
endif
if has('macunix')
let s:is_darwin = 1
return s:is_darwin
endif
if ! has('unix')
let s:is_darwin = 0
return s:is_darwin
endif
if system('uname -s') ==# "Darwin\n"
let s:is_darwin = 1
else
let s:is_darwin = 0
endif
return s:is_darwin return s:is_darwin
endif
if has('macunix')
let s:is_darwin = 1
return s:is_darwin
endif
if ! has('unix')
let s:is_darwin = 0
return s:is_darwin
endif
if system('uname -s') ==# "Darwin\n"
let s:is_darwin = 1
else
let s:is_darwin = 0
endif
return s:is_darwin
endfunction endfunction
let s:system['isDarwin'] = function('s:isDarwin') let s:system['isDarwin'] = function('s:isDarwin')
function! s:fileformat() abort function! s:fileformat() abort
let fileformat = '' let fileformat = ''
if &fileformat ==? 'dos' if &fileformat ==? 'dos'
let fileformat = '' let fileformat = ''
elseif &fileformat ==? 'unix' elseif &fileformat ==? 'unix'
if s:isDarwin() if s:isDarwin()
let fileformat = '' let fileformat = ''
else else
let fileformat = '' let fileformat = ''
endif
elseif &fileformat ==? 'mac'
let fileformat = ''
endif endif
elseif &fileformat ==? 'mac'
let fileformat = ''
endif
return fileformat return fileformat
endfunction endfunction
let s:system['fileformat'] = function('s:fileformat') let s:system['fileformat'] = function('s:fileformat')
function! SpaceVim#api#system#get() abort function! SpaceVim#api#system#get() abort
return deepcopy(s:system) return deepcopy(s:system)
endfunction endfunction
" vim:set et sw=2:

View File

@ -7,75 +7,77 @@ scriptencoding utf-8
" json should be a list of items which have same keys " json should be a list of items which have same keys
function! s:drawing_table(json, ...) abort function! s:drawing_table(json, ...) abort
if empty(a:json) if empty(a:json)
return [] return []
endif endif
if &encoding ==# 'utf-8' if &encoding ==# 'utf-8'
let top_left_corner = '╭' let top_left_corner = '╭'
let top_right_corner = '╮' let top_right_corner = '╮'
let bottom_left_corner = '╰' let bottom_left_corner = '╰'
let bottom_right_corner = '╯' let bottom_right_corner = '╯'
let side = '│' let side = '│'
let top_bottom_side = '─' let top_bottom_side = '─'
let middle = '┼' let middle = '┼'
let top_middle = '┬' let top_middle = '┬'
let left_middle = '├' let left_middle = '├'
let right_middle = '┤' let right_middle = '┤'
let bottom_middle = '┴' let bottom_middle = '┴'
else else
let top_left_corner = '*' let top_left_corner = '*'
let top_right_corner = '*' let top_right_corner = '*'
let bottom_left_corner = '*' let bottom_left_corner = '*'
let bottom_right_corner = '*' let bottom_right_corner = '*'
let side = '|' let side = '|'
let top_bottom_side = '-' let top_bottom_side = '-'
let middle = '*' let middle = '*'
let top_middle = '*' let top_middle = '*'
let left_middle = '*' let left_middle = '*'
let right_middle = '*' let right_middle = '*'
let bottom_middle = '*' let bottom_middle = '*'
endif endif
let table = [] let table = []
let items = s:json.json_decode(a:json) let items = s:json.json_decode(a:json)
let col = len(keys(items[0])) let col = len(keys(items[0]))
let top_line = top_left_corner let top_line = top_left_corner
\ . repeat(repeat(top_bottom_side, 15) . top_middle, col - 1) \ . repeat(repeat(top_bottom_side, 15) . top_middle, col - 1)
\ . repeat(top_bottom_side, 15) \ . repeat(top_bottom_side, 15)
\ . top_right_corner \ . top_right_corner
let middle_line = left_middle let middle_line = left_middle
\ . repeat(repeat(top_bottom_side, 15) . middle, col - 1) \ . repeat(repeat(top_bottom_side, 15) . middle, col - 1)
\ . repeat(top_bottom_side, 15) \ . repeat(top_bottom_side, 15)
\ . right_middle \ . right_middle
let bottom_line = bottom_left_corner let bottom_line = bottom_left_corner
\ . repeat(repeat(top_bottom_side, 15) . bottom_middle, col - 1) \ . repeat(repeat(top_bottom_side, 15) . bottom_middle, col - 1)
\ . repeat(top_bottom_side, 15) \ . repeat(top_bottom_side, 15)
\ . bottom_right_corner \ . bottom_right_corner
call add(table, top_line) call add(table, top_line)
let tytle = side let tytle = side
if a:0 == 0 if a:0 == 0
let keys = keys(items[0]) let keys = keys(items[0])
else else
let keys = a:1 let keys = a:1
endif endif
for key in keys
let tytle .= s:string.fill(key , 15) . side
endfor
call add(table, tytle)
call add(table, middle_line)
for item in items
let value_line = side
for key in keys for key in keys
let tytle .= s:string.fill(key , 15) . side let value_line .= s:string.fill(item[key], 15) . side
endfor endfor
call add(table, tytle) call add(table, value_line)
call add(table, middle_line) call add(table, middle_line)
for item in items endfor
let value_line = side let table[-1] = bottom_line
for key in keys return table
let value_line .= s:string.fill(item[key], 15) . side
endfor
call add(table, value_line)
call add(table, middle_line)
endfor
let table[-1] = bottom_line
return table
endfunction endfunction
let s:box['drawing_table'] = function('s:drawing_table') let s:box['drawing_table'] = function('s:drawing_table')
function! SpaceVim#api#unicode#box#get() abort function! SpaceVim#api#unicode#box#get() abort
return deepcopy(s:box) return deepcopy(s:box)
endfunction endfunction
" vim:set et sw=2:

View File

@ -1,97 +1,99 @@
"autocmds "autocmds
function! SpaceVim#autocmds#init() abort function! SpaceVim#autocmds#init() abort
augroup My_autocmds augroup My_autocmds
au! au!
autocmd BufWinEnter quickfix nnoremap <silent> <buffer> autocmd BufWinEnter quickfix nnoremap <silent> <buffer>
\ q :cclose<cr>:lclose<cr> \ q :cclose<cr>:lclose<cr>
autocmd BufEnter * if (winnr('$') == 1 && &buftype ==# 'quickfix' ) | autocmd BufEnter * if (winnr('$') == 1 && &buftype ==# 'quickfix' ) |
\ bd| \ bd|
\ q | endif \ q | endif
autocmd FileType jsp call JspFileTypeInit() autocmd FileType jsp call JspFileTypeInit()
autocmd FileType html,css,jsp EmmetInstall autocmd FileType html,css,jsp EmmetInstall
autocmd BufRead,BufNewFile *.pp setfiletype puppet autocmd BufRead,BufNewFile *.pp setfiletype puppet
autocmd BufEnter,WinEnter,InsertLeave * set cursorline autocmd BufEnter,WinEnter,InsertLeave * set cursorline
autocmd BufLeave,WinLeave,InsertEnter * set nocursorline autocmd BufLeave,WinLeave,InsertEnter * set nocursorline
autocmd BufReadPost * autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") | \ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal! g`\"" | \ exe "normal! g`\"" |
\ endif \ 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 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 BufEnter * :syntax sync fromstart " ensure every file does syntax highlighting (full)
autocmd BufNewFile,BufRead *.avs set syntax=avs " for avs syntax file. 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 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,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 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 cs set comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,f:///,f://
autocmd FileType vim set comments=sO:\"\ -,mO:\"\ \ ,eO:\"\",f:\" autocmd FileType vim set comments=sO:\"\ -,mO:\"\ \ ,eO:\"\",f:\"
autocmd FileType lua set comments=f:-- autocmd FileType lua set comments=f:--
autocmd FileType vim setlocal foldmethod=marker autocmd FileType vim setlocal foldmethod=marker
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd Filetype html setlocal omnifunc=htmlcomplete#CompleteTags autocmd Filetype html setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType xml call XmlFileTypeInit() autocmd FileType xml call XmlFileTypeInit()
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd BufEnter * autocmd BufEnter *
\ if empty(&buftype) && has('nvim') && &filetype != 'help' \ if empty(&buftype) && has('nvim') && &filetype != 'help'
\| nnoremap <silent><buffer> <C-]> :call MyTagfunc()<CR> \| nnoremap <silent><buffer> <C-]> :call MyTagfunc()<CR>
\| nnoremap <silent><buffer> <C-[> :call MyTagfuncBack()<CR> \| nnoremap <silent><buffer> <C-[> :call MyTagfuncBack()<CR>
\| else \| else
\| nnoremap <silent><buffer> <leader>] :call MyTagfunc()<CR> \| nnoremap <silent><buffer> <leader>] :call MyTagfunc()<CR>
\| nnoremap <silent><buffer> <leader>[ :call MyTagfuncBack()<CR> \| nnoremap <silent><buffer> <leader>[ :call MyTagfuncBack()<CR>
\| endif \| endif
"}}} "}}}
autocmd FileType python,coffee call zvim#util#check_if_expand_tab() autocmd FileType python,coffee call zvim#util#check_if_expand_tab()
" Instead of reverting the cursor to the last position in the buffer, we " 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 " 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]) au FileType gitcommit au! BufEnter COMMIT_EDITMSG call setpos('.', [0, 1, 1, 0])
autocmd InsertEnter * call s:fixindentline() autocmd InsertEnter * call s:fixindentline()
if executable('synclient') if executable('synclient')
let s:touchpadoff = 0 let s:touchpadoff = 0
autocmd InsertEnter * call s:disable_touchpad() autocmd InsertEnter * call s:disable_touchpad()
autocmd InsertLeave * call s:enable_touchpad() autocmd InsertLeave * call s:enable_touchpad()
autocmd FocusLost * call system('synclient touchpadoff=0') autocmd FocusLost * call system('synclient touchpadoff=0')
autocmd FocusGained * call s:reload_touchpad_status() autocmd FocusGained * call s:reload_touchpad_status()
endif endif
autocmd BufWritePost *.vim call s:generate_doc() autocmd BufWritePost *.vim call s:generate_doc()
autocmd FileType * set scrolloff=7 autocmd FileType * set scrolloff=7
augroup END augroup END
augroup SpaceVimInit augroup SpaceVimInit
au! au!
autocmd VimEnter * if !argc() | call SpaceVim#welcome() | endif autocmd VimEnter * if !argc() | call SpaceVim#welcome() | endif
augroup END augroup END
endfunction endfunction
function! s:reload_touchpad_status() abort function! s:reload_touchpad_status() abort
if s:touchpadoff if s:touchpadoff
call s:disable_touchpad() call s:disable_touchpad()
endif endif
endf endf
function! s:disable_touchpad() abort function! s:disable_touchpad() abort
let s:touchpadoff = 1 let s:touchpadoff = 1
call system('synclient touchpadoff=1') call system('synclient touchpadoff=1')
endfunction endfunction
function! s:enable_touchpad() abort function! s:enable_touchpad() abort
let s:touchpadoff = 0 let s:touchpadoff = 0
call system('synclient touchpadoff=0') call system('synclient touchpadoff=0')
endfunction endfunction
function! s:fixindentline() abort function! s:fixindentline() abort
if !exists('s:done') if !exists('s:done')
if exists(':IndentLinesToggle') == 2 if exists(':IndentLinesToggle') == 2
IndentLinesToggle IndentLinesToggle
IndentLinesToggle IndentLinesToggle
else else
echohl WarningMsg echohl WarningMsg
echom 'plugin : indentLines has not been installed, echom 'plugin : indentLines has not been installed,
\ please use `:call dein#install(["indentLine"])` to install this plugin,' \ please use `:call dein#install(["indentLine"])` to install this plugin,'
echohl None echohl None
endif
let s:done = 1
endif endif
let s:done = 1
endif
endfunction endfunction
function! s:generate_doc() abort function! s:generate_doc() abort
if filereadable('./addon-info.json') && executable('vimdoc') if filereadable('./addon-info.json') && executable('vimdoc')
call system('vimdoc .') call system('vimdoc .')
endif endif
endfunction endfunction
" vim:set et sw=2:

View File

@ -1,338 +1,337 @@
scriptencoding utf-8 scriptencoding utf-8
function! SpaceVim#default#SetOptions() abort function! SpaceVim#default#SetOptions() abort
" basic vim settiing " basic vim settiing
if has('gui_running') if has('gui_running')
set guioptions-=m " Hide menu bar. set guioptions-=m " Hide menu bar.
set guioptions-=T " Hide toolbar set guioptions-=T " Hide toolbar
set guioptions-=L " Hide left-hand scrollbar set guioptions-=L " Hide left-hand scrollbar
set guioptions-=r " Hide right-hand scrollbar set guioptions-=r " Hide right-hand scrollbar
set guioptions-=b " Hide bottom scrollbar set guioptions-=b " Hide bottom scrollbar
set showtabline=0 " Hide tabline set showtabline=0 " Hide tabline
if WINDOWS() if WINDOWS()
" please install the font in 'Dotfiles\font' " please install the font in 'Dotfiles\font'
set guifont=DejaVu_Sans_Mono_for_Powerline:h11:cANSI:qDRAFT set guifont=DejaVu_Sans_Mono_for_Powerline:h11:cANSI:qDRAFT
elseif OSX() elseif OSX()
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline:h11 set guifont=DejaVu\ Sans\ Mono\ for\ Powerline:h11
else else
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 11 set guifont=DejaVu\ Sans\ Mono\ for\ Powerline\ 11
endif
endif endif
endif
" indent use backspace delete indent, eol use backspace delete line at " 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 " begining start delete the char you just typed in if you do not use set
" nocompatible ,you need this " nocompatible ,you need this
set backspace=indent,eol,start set backspace=indent,eol,start
" Shou number and relativenumber " Shou number and relativenumber
set relativenumber set relativenumber
set number set number
" set fillchar " set fillchar
hi VertSplit ctermbg=NONE guibg=NONE hi VertSplit ctermbg=NONE guibg=NONE
set fillchars+=vert:│ set fillchars+=vert:│
" hide cmd " hide cmd
set noshowcmd set noshowcmd
" indent " indent
set autoindent set autoindent
set smartindent set smartindent
set cindent set cindent
" show wildmenu " show wildmenu
set wildmenu set wildmenu
" do not break words. " do not break words.
set linebreak set linebreak
" tab options: " tab options:
set tabstop=4 set tabstop=4
set expandtab set expandtab
set softtabstop=4 set softtabstop=4
set shiftwidth=4 set shiftwidth=4
" autoread " autoread
set autoread set autoread
" backup " backup
set backup set backup
set undofile set undofile
set undolevels=1000 set undolevels=1000
let g:data_dir = $HOME . '/.data/' let g:data_dir = $HOME . '/.data/'
let g:backup_dir = g:data_dir . 'backup' let g:backup_dir = g:data_dir . 'backup'
let g:swap_dir = g:data_dir . 'swap' let g:swap_dir = g:data_dir . 'swap'
let g:undo_dir = g:data_dir . 'undofile' let g:undo_dir = g:data_dir . 'undofile'
if finddir(g:data_dir) ==# '' if finddir(g:data_dir) ==# ''
silent call mkdir(g:data_dir) silent call mkdir(g:data_dir)
endif endif
if finddir(g:backup_dir) ==# '' if finddir(g:backup_dir) ==# ''
silent call mkdir(g:backup_dir) silent call mkdir(g:backup_dir)
endif endif
if finddir(g:swap_dir) ==# '' if finddir(g:swap_dir) ==# ''
silent call mkdir(g:swap_dir) silent call mkdir(g:swap_dir)
endif endif
if finddir(g:undo_dir) ==# '' if finddir(g:undo_dir) ==# ''
silent call mkdir(g:undo_dir) silent call mkdir(g:undo_dir)
endif endif
unlet g:backup_dir unlet g:backup_dir
unlet g:swap_dir unlet g:swap_dir
unlet g:data_dir unlet g:data_dir
unlet g:undo_dir unlet g:undo_dir
set undodir=$HOME/.data/undofile set undodir=$HOME/.data/undofile
set backupdir=$HOME/.data/backup set backupdir=$HOME/.data/backup
set directory=$HOME/.data/swap set directory=$HOME/.data/swap
set nofoldenable " no fold enable
set nowritebackup " no fold enable
set matchtime=0 set nofoldenable
set ruler set nowritebackup
set showmatch set matchtime=0
set showmode set ruler
"menuone: show the pupmenu when only one match set showmatch
set completeopt=menu,menuone,longest " disable preview scratch window, set showmode
set complete=.,w,b,u,t " h: 'complete' "menuone: show the pupmenu when only one match
set pumheight=15 " limit completion menu height " disable preview scratch window,
set scrolloff=7 set completeopt=menu,menuone,longest
set incsearch " h: 'complete'
set hlsearch set complete=.,w,b,u,t
set laststatus=2 " limit completion menu height
set completeopt=longest,menu set pumheight=15
set wildignorecase set scrolloff=7
set mouse= set incsearch
set hidden set hlsearch
set ttimeout set laststatus=2
set ttimeoutlen=50 set wildignorecase
set background=dark set mouse=
set hidden
set ttimeout
set ttimeoutlen=50
set background=dark
endfunction endfunction
function! SpaceVim#default#SetPlugins() abort function! SpaceVim#default#SetPlugins() abort
call add(g:spacevim_plugin_groups, 'web') call add(g:spacevim_plugin_groups, 'web')
call add(g:spacevim_plugin_groups, 'lang') call add(g:spacevim_plugin_groups, 'lang')
call add(g:spacevim_plugin_groups, 'edit') call add(g:spacevim_plugin_groups, 'edit')
call add(g:spacevim_plugin_groups, 'ui') call add(g:spacevim_plugin_groups, 'ui')
call add(g:spacevim_plugin_groups, 'tools') call add(g:spacevim_plugin_groups, 'tools')
call add(g:spacevim_plugin_groups, 'checkers') call add(g:spacevim_plugin_groups, 'checkers')
call add(g:spacevim_plugin_groups, 'format') call add(g:spacevim_plugin_groups, 'format')
call add(g:spacevim_plugin_groups, 'chat') call add(g:spacevim_plugin_groups, 'chat')
call add(g:spacevim_plugin_groups, 'git') call add(g:spacevim_plugin_groups, 'git')
call add(g:spacevim_plugin_groups, 'javascript') call add(g:spacevim_plugin_groups, 'javascript')
call add(g:spacevim_plugin_groups, 'ruby') call add(g:spacevim_plugin_groups, 'ruby')
call add(g:spacevim_plugin_groups, 'python') call add(g:spacevim_plugin_groups, 'python')
call add(g:spacevim_plugin_groups, 'scala') call add(g:spacevim_plugin_groups, 'scala')
call add(g:spacevim_plugin_groups, 'lang#go') call add(g:spacevim_plugin_groups, 'lang#go')
call add(g:spacevim_plugin_groups, 'lang#markdown') call add(g:spacevim_plugin_groups, 'lang#markdown')
call add(g:spacevim_plugin_groups, 'scm') call add(g:spacevim_plugin_groups, 'scm')
call add(g:spacevim_plugin_groups, 'editing') call add(g:spacevim_plugin_groups, 'editing')
call add(g:spacevim_plugin_groups, 'indents') call add(g:spacevim_plugin_groups, 'indents')
call add(g:spacevim_plugin_groups, 'navigation') call add(g:spacevim_plugin_groups, 'navigation')
call add(g:spacevim_plugin_groups, 'misc') call add(g:spacevim_plugin_groups, 'misc')
call add(g:spacevim_plugin_groups, 'core') call add(g:spacevim_plugin_groups, 'core')
call add(g:spacevim_plugin_groups, 'unite') call add(g:spacevim_plugin_groups, 'unite')
call add(g:spacevim_plugin_groups, 'github') call add(g:spacevim_plugin_groups, 'github')
if has('python3') if has('python3')
call add(g:spacevim_plugin_groups, 'denite') call add(g:spacevim_plugin_groups, 'denite')
endif endif
call add(g:spacevim_plugin_groups, 'ctrlp') call add(g:spacevim_plugin_groups, 'ctrlp')
call add(g:spacevim_plugin_groups, 'autocomplete') call add(g:spacevim_plugin_groups, 'autocomplete')
if ! has('nvim') if ! has('nvim')
call add(g:spacevim_plugin_groups, 'vim') call add(g:spacevim_plugin_groups, 'vim')
else else
call add(g:spacevim_plugin_groups, 'nvim') call add(g:spacevim_plugin_groups, 'nvim')
endif endif
if OSX() if OSX()
call add(g:spacevim_plugin_groups, 'osx') call add(g:spacevim_plugin_groups, 'osx')
endif endif
if WINDOWS() if WINDOWS()
call add(g:spacevim_plugin_groups, 'windows') call add(g:spacevim_plugin_groups, 'windows')
endif endif
if LINUX() if LINUX()
call add(g:spacevim_plugin_groups, 'linux') call add(g:spacevim_plugin_groups, 'linux')
endif endif
endfunction endfunction
function! SpaceVim#default#SetMappings() abort function! SpaceVim#default#SetMappings() abort
"mapping "mapping
"全局映射 imap <silent><expr><TAB> SpaceVim#mapping#tab()
"也可以通过'za'打开或者关闭折叠 smap <expr><TAB> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
imap <silent><expr><TAB> SpaceVim#mapping#tab() inoremap <silent><expr><CR> SpaceVim#mapping#enter()
smap <expr><TAB> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>" inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
inoremap <silent><expr><CR> SpaceVim#mapping#enter() inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
inoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>" inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>"
inoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>" inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>"
inoremap <expr> <PageDown> pumvisible() ? "\<PageDown>\<C-p>\<C-n>" : "\<PageDown>" imap <expr><S-TAB> pumvisible() ? "\<C-p>" : ""
inoremap <expr> <PageUp> pumvisible() ? "\<PageUp>\<C-p>\<C-n>" : "\<PageUp>" smap <expr><S-TAB> pumvisible() ? "\<C-p>" : ""
imap <expr><S-TAB> pumvisible() ? "\<C-p>" : "" " Save a file with sudo
smap <expr><S-TAB> pumvisible() ? "\<C-p>" : "" " http://forrst.com/posts/Use_w_to_sudo_write_a_file_with_Vim-uAN
"Super paste it does not work cnoremap w!! %!sudo tee > /dev/null %
"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+上下左右来切换窗口 " Use Ctrl+* to jump between windows
nnoremap <silent><C-Right> :<C-u>wincmd l<CR> nnoremap <silent><C-Right> :<C-u>wincmd l<CR>
nnoremap <silent><C-Left> :<C-u>wincmd h<CR> nnoremap <silent><C-Left> :<C-u>wincmd h<CR>
nnoremap <silent><C-Up> :<C-u>wincmd k<CR> nnoremap <silent><C-Up> :<C-u>wincmd k<CR>
nnoremap <silent><C-Down> :<C-u>wincmd j<CR> nnoremap <silent><C-Down> :<C-u>wincmd j<CR>
if has('nvim') if has('nvim')
exe 'tnoremap <silent><C-Right> <C-\><C-n>:<C-u>wincmd l<CR>' 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-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-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><C-Down> <C-\><C-n>:<C-u>wincmd j<CR>'
exe 'tnoremap <silent><M-Left> <C-\><C-n>:<C-u>bprev<CR>' exe 'tnoremap <silent><M-Left> <C-\><C-n>:<C-u>bprev<CR>'
exe 'tnoremap <silent><M-Right> <C-\><C-n>:<C-u>bnext<CR>' exe 'tnoremap <silent><M-Right> <C-\><C-n>:<C-u>bnext<CR>'
exe 'tnoremap <silent><esc> <C-\><C-n>' exe 'tnoremap <silent><esc> <C-\><C-n>'
endif endif
"Quickly add empty lines "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>
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 "Use jk switch to normal mode
inoremap jk <esc> inoremap jk <esc>
"]e or [e move current line ,count can be useed "]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 -1-'. v:count1<cr>
nnoremap <silent>]e :<c-u>execute 'move +'. 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 "]<End> or ]<Home> move current line to the end or the begin of current buffer
nnoremap <silent>]<End> ddGp`` nnoremap <silent>]<End> ddGp``
nnoremap <silent>]<Home> ddggP`` nnoremap <silent>]<Home> ddggP``
vnoremap <silent>]<End> dGp`` vnoremap <silent>]<End> dGp``
vnoremap <silent>]<Home> dggP`` vnoremap <silent>]<Home> dggP``
"Ctrl+Shift+上下移动当前行 "Ctrl+Shift+Up/Down to move up and down
nnoremap <silent><C-S-Down> :m .+1<CR>== nnoremap <silent><C-S-Down> :m .+1<CR>==
nnoremap <silent><C-S-Up> :m .-2<CR>== nnoremap <silent><C-S-Up> :m .-2<CR>==
inoremap <silent><C-S-Down> <Esc>:m .+1<CR>==gi inoremap <silent><C-S-Down> <Esc>:m .+1<CR>==gi
inoremap <silent><C-S-Up> <Esc>:m .-2<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-Down> :m '>+1<CR>gv=gv vnoremap <silent><C-S-Up> :m '<-2<CR>gv=gv
vnoremap <silent><C-S-Up> :m '<-2<CR>gv=gv " download gvimfullscreen.dll from github, copy gvimfullscreen.dll to
" download gvimfullscreen.dll from github, copy gvimfullscreen.dll to " the directory that has gvim.exe
" the directory that has gvim.exe nnoremap <F11> :call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)<cr>
nnoremap <F11> :call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)<cr>
" Start new line " Start new line
inoremap <S-Return> <C-o>o inoremap <S-Return> <C-o>o
" Improve scroll, credits: https://github.com/Shougo " Improve scroll, credits: https://github.com/Shougo
nnoremap <expr> zz (winline() == (winheight(0)+1) / 2) ? nnoremap <expr> zz (winline() == (winheight(0)+1) / 2) ?
\ 'zt' : (winline() == 1) ? 'zb' : 'zz' \ 'zt' : (winline() == 1) ? 'zb' : 'zz'
noremap <expr> <C-f> max([winheight(0) - 2, 1]) noremap <expr> <C-f> max([winheight(0) - 2, 1])
\ ."\<C-d>".(line('w$') >= line('$') ? "L" : "H") \ ."\<C-d>".(line('w$') >= line('$') ? "L" : "H")
noremap <expr> <C-b> max([winheight(0) - 2, 1]) noremap <expr> <C-b> max([winheight(0) - 2, 1])
\ ."\<C-u>".(line('w0') <= 1 ? "H" : "L") \ ."\<C-u>".(line('w0') <= 1 ? "H" : "L")
noremap <expr> <C-e> (line("w$") >= line('$') ? "j" : "3\<C-e>") noremap <expr> <C-e> (line("w$") >= line('$') ? "j" : "3\<C-e>")
noremap <expr> <C-y> (line("w0") <= 1 ? "k" : "3\<C-y>") noremap <expr> <C-y> (line("w0") <= 1 ? "k" : "3\<C-y>")
" Select blocks after indenting " Select blocks after indenting
xnoremap < <gv xnoremap < <gv
xnoremap > >gv| xnoremap > >gv|
" Use tab for indenting in visual mode " Use tab for indenting in visual mode
xnoremap <Tab> >gv| xnoremap <Tab> >gv|
xnoremap <S-Tab> <gv xnoremap <S-Tab> <gv
nnoremap > >>_ nnoremap > >>_
nnoremap < <<_ nnoremap < <<_
" smart up and down " smart up and down
nnoremap <silent><Down> gj nnoremap <silent><Down> gj
nnoremap <silent><Up> gk nnoremap <silent><Up> gk
" Select last paste " Select last paste
nnoremap <silent><expr> gp '`['.strpart(getregtype(), 0, 1).'`]' nnoremap <silent><expr> gp '`['.strpart(getregtype(), 0, 1).'`]'
" Use Q format lines " Use Q format lines
map Q gq map Q gq
" Navigate window " Navigate window
nnoremap <silent><C-q> <C-w> nnoremap <silent><C-q> <C-w>
nnoremap <silent><C-x> <C-w>x nnoremap <silent><C-x> <C-w>x
" Navigation in command line " Navigation in command line
cnoremap <C-a> <Home> cnoremap <C-a> <Home>
cnoremap <C-b> <Left> cnoremap <C-b> <Left>
cnoremap <C-f> <Right> cnoremap <C-f> <Right>
" Fast saving " Fast saving
nnoremap <C-s> :<C-u>w<CR> nnoremap <C-s> :<C-u>w<CR>
vnoremap <C-s> :<C-u>w<CR> vnoremap <C-s> :<C-u>w<CR>
cnoremap <C-s> <C-u>w<CR> cnoremap <C-s> <C-u>w<CR>
" Tabs " Tabs
nnoremap <silent>g0 :<C-u>tabfirst<CR> nnoremap <silent>g0 :<C-u>tabfirst<CR>
nnoremap <silent>g$ :<C-u>tablast<CR> nnoremap <silent>g$ :<C-u>tablast<CR>
nnoremap <silent>gr :<C-u>tabprevious<CR> nnoremap <silent>gr :<C-u>tabprevious<CR>
" Remove spaces at the end of lines " Remove spaces at the end of lines
nnoremap <silent> ,<Space> :<C-u>silent! keeppatterns %substitute/\s\+$//e<CR> nnoremap <silent> ,<Space> :<C-u>silent! keeppatterns %substitute/\s\+$//e<CR>
" C-r: Easier search and replace " C-r: Easier search and replace
xnoremap <C-r> :<C-u>call <SID>VSetSearch()<CR>:,$s/<C-R>=@/<CR>//gc<left><left><left> xnoremap <C-r> :<C-u>call <SID>VSetSearch()<CR>:,$s/<C-R>=@/<CR>//gc<left><left><left>
function! s:VSetSearch() abort function! s:VSetSearch() abort
let temp = @s let temp = @s
norm! gv"sy norm! gv"sy
let @/ = '\V' . substitute(escape(@s, '/\'), '\n', '\\n', 'g') let @/ = '\V' . substitute(escape(@s, '/\'), '\n', '\\n', 'g')
let @s = temp let @s = temp
endfunction endfunction
"irssi like hot key "irssi like hot key
nnoremap <silent><M-1> :<C-u>call <SID>tobur(1)<CR> 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-2> :<C-u>call <SID>tobur(2)<CR>
nnoremap <silent><M-3> :<C-u>call <SID>tobur(3)<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-4> :<C-u>call <SID>tobur(4)<CR>
nnoremap <silent><M-5> :<C-u>call <SID>tobur(5)<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-Right> :<C-U>call <SID>tobur("bnext")<CR>
nnoremap <silent><M-Left> :<C-U>call <SID>tobur("bprev")<CR> nnoremap <silent><M-Left> :<C-U>call <SID>tobur("bprev")<CR>
call SpaceVim#mapping#def('nnoremap <silent>','<M-x>',':call chat#qq#OpenMsgWin()<cr>', call SpaceVim#mapping#def('nnoremap <silent>','<M-x>',':call chat#qq#OpenMsgWin()<cr>',
\ 'Open qq chatting room','call chat#chatting#OpenMsgWin()') \ 'Open qq chatting room','call chat#chatting#OpenMsgWin()')
call SpaceVim#mapping#def('nnoremap <silent>','<M-w>',':call chat#weixin#OpenMsgWin()<cr>', call SpaceVim#mapping#def('nnoremap <silent>','<M-w>',':call chat#weixin#OpenMsgWin()<cr>',
\ 'Open weixin chatting room','call chat#chatting#OpenMsgWin()') \ 'Open weixin chatting room','call chat#chatting#OpenMsgWin()')
call SpaceVim#mapping#def('nnoremap <silent>','<M-c>',':call chat#chatting#OpenMsgWin()<cr>', call SpaceVim#mapping#def('nnoremap <silent>','<M-c>',':call chat#chatting#OpenMsgWin()<cr>',
\ 'Open chatting room','call chat#chatting#OpenMsgWin()') \ 'Open chatting room','call chat#chatting#OpenMsgWin()')
call SpaceVim#mapping#def('nnoremap <silent>','g=',':call zvim#format()<cr>','format current buffer','call zvim#format') call SpaceVim#mapping#def('nnoremap <silent>','g=',':call zvim#format()<cr>','format current buffer','call zvim#format')
call SpaceVim#mapping#def('nnoremap <silent>', '<C-c>', ':<c-u>call zvim#util#CopyToClipboard()<cr>', call SpaceVim#mapping#def('nnoremap <silent>', '<C-c>', ':<c-u>call zvim#util#CopyToClipboard()<cr>',
\ 'Copy buffer absolute path to X11 clipboard','call zvim#util#CopyToClipboard()') \ 'Copy buffer absolute path to X11 clipboard','call zvim#util#CopyToClipboard()')
call SpaceVim#mapping#def('nnoremap <silent>', '<Tab>', ':wincmd w<CR>', 'Switch to next window or tab','wincmd w') call SpaceVim#mapping#def('nnoremap <silent>', '<Tab>', ':wincmd w<CR>', 'Switch to next window or tab','wincmd w')
call SpaceVim#mapping#def('nnoremap <silent>', '<S-Tab>', ':wincmd p<CR>', 'Switch to previous window or tab','wincmd p') call SpaceVim#mapping#def('nnoremap <silent>', '<S-Tab>', ':wincmd p<CR>', 'Switch to previous window or tab','wincmd p')
call SpaceVim#mapping#def('nnoremap <silent>', 'q', ':<C-u>call zvim#util#SmartClose()<cr>', call SpaceVim#mapping#def('nnoremap <silent>', 'q', ':<C-u>call zvim#util#SmartClose()<cr>',
\ 'Smart close windows', \ 'Smart close windows',
\ 'call zvim#util#SmartClose()') \ 'call zvim#util#SmartClose()')
call SpaceVim#mapping#def('nnoremap <silent>', 'gf', ':call zvim#gf()<CR>', 'Jump to a file under cursor', '') call SpaceVim#mapping#def('nnoremap <silent>', 'gf', ':call zvim#gf()<CR>', 'Jump to a file under cursor', '')
call SpaceVim#mapping#def('nnoremap <silent>', 'gd', ':call SpaceVim#mapping#gd()<CR>', 'Goto declaration', '') call SpaceVim#mapping#def('nnoremap <silent>', 'gd', ':call SpaceVim#mapping#gd()<CR>', 'Goto declaration', '')
endfunction endfunction
fu! s:tobur(num) abort fu! s:tobur(num) abort
if index(get(g:,'spacevim_altmoveignoreft',[]), &filetype) == -1 if index(get(g:,'spacevim_altmoveignoreft',[]), &filetype) == -1
if a:num ==# 'bnext' if a:num ==# 'bnext'
bnext bnext
elseif a:num ==# 'bprev' elseif a:num ==# 'bprev'
bprev bprev
else else
let ls = split(execute(':ls'), "\n") let ls = split(execute(':ls'), "\n")
let buffers = [] let buffers = []
for b in ls for b in ls
let nr = matchstr(b, '\d\+') let nr = matchstr(b, '\d\+')
call add(buffers, nr) call add(buffers, nr)
endfor endfor
if len(buffers) >= a:num if len(buffers) >= a:num
exec 'buffer ' . buffers[a:num - 1] exec 'buffer ' . buffers[a:num - 1]
endif endif
endif
endif endif
endif
endf endf
function! SpaceVim#default#UseSimpleMode() abort function! SpaceVim#default#UseSimpleMode() abort
endfunction endfunction
" vim:set et sw=2:

View File

@ -1,18 +1,20 @@
function! SpaceVim#health#report() abort function! SpaceVim#health#report() abort
let items = map(SpaceVim#util#globpath(&rtp,'autoload/SpaceVim/health/*'), "fnamemodify(v:val,':t:r')") let items = map(SpaceVim#util#globpath(&rtp,'autoload/SpaceVim/health/*'), "fnamemodify(v:val,':t:r')")
let report = [] let report = []
for item in items for item in items
try try
let result = SpaceVim#health#{item}#check() let result = SpaceVim#health#{item}#check()
call extend(report,result) call extend(report,result)
catch /^Vim\%((\a\+)\)\=:E117/ catch /^Vim\%((\a\+)\)\=:E117/
call extend(report,[ call extend(report,[
\ '', \ '',
\ 'SpaceVim Health Error:', \ 'SpaceVim Health Error:',
\ ' There is no function: SpaceVim#health#' . item . '#check()', \ ' There is no function: SpaceVim#health#' . item . '#check()',
\ '', \ '',
\ ]) \ ])
endtry endtry
endfor endfor
return join(report, "\n") return join(report, "\n")
endfunction endfunction
" vim:set et sw=2:

View File

@ -1,24 +1,26 @@
function! SpaceVim#health#clipboard#check() abort function! SpaceVim#health#clipboard#check() abort
let result = ['SpaceVim clipboard support check report:'] let result = ['SpaceVim clipboard support check report:']
call add(result, 'Checking +clipboard:') call add(result, 'Checking +clipboard:')
if has('nvim') if has('nvim')
if has('clipboard') if has('clipboard')
call add(result, ' SUCCEED!') call add(result, ' SUCCEED!')
else
call add(result, ' Failed : to support +clipboard, you need has one of following clipboard tools in your $PATH:')
call add(result, ' 1. xclip')
call add(result, ' 2. xsel')
call add(result, ' 3. pbcopy/pbpaste (Mac OS X)')
call add(result, ' 4. lemonade (for SSH) https://github.com/pocke/lemonade')
call add(result, ' 5. doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/')
endif
else else
if has('clipboard') call add(result, ' Failed : to support +clipboard, you need has one of following clipboard tools in your $PATH:')
call add(result, ' SUCCEED!') call add(result, ' 1. xclip')
else call add(result, ' 2. xsel')
call add(result, ' Failed : to support +clipboard, you need recompile your vim with +clipboard support.') call add(result, ' 3. pbcopy/pbpaste (Mac OS X)')
endif call add(result, ' 4. lemonade (for SSH) https://github.com/pocke/lemonade')
call add(result, ' 5. doitclient (for SSH) http://www.chiark.greenend.org.uk/~sgtatham/doit/')
endif endif
else
if has('clipboard')
call add(result, ' SUCCEED!')
else
call add(result, ' Failed : to support +clipboard, you need recompile your vim with +clipboard support.')
endif
endif
return result return result
endfunction endfunction
" vim:set et sw=2:

View File

@ -1,18 +1,20 @@
function! SpaceVim#health#lua#check() abort function! SpaceVim#health#lua#check() abort
let result = ['SpaceVim lua support check report:'] let result = ['SpaceVim lua support check report:']
call add(result, 'Checking +lua:') call add(result, 'Checking +lua:')
if has('nvim') if has('nvim')
if has('lua') if has('lua')
call add(result, ' SUCCEED!') call add(result, ' SUCCEED!')
else
call add(result, ' Failed : Known issue, neovim do not support lua now.')
endif
else else
if has('lua') call add(result, ' Failed : Known issue, neovim do not support lua now.')
call add(result, ' SUCCEED!')
else
call add(result, ' Failed : to support +lua, you need recompile your vim with +lua support.')
endif
endif endif
return result else
if has('lua')
call add(result, ' SUCCEED!')
else
call add(result, ' Failed : to support +lua, you need recompile your vim with +lua support.')
endif
endif
return result
endfunction endfunction
" vim:set et sw=2:

View File

@ -1,41 +1,43 @@
function! SpaceVim#health#python#check() abort function! SpaceVim#health#python#check() abort
let result = ['SpaceVim python support check report:'] let result = ['SpaceVim python support check report:']
if has('nvim') if has('nvim')
call add(result, 'Checking +python3:') call add(result, 'Checking +python3:')
if has('python3') if has('python3')
call add(result, ' SUCCEED!') call add(result, ' SUCCEED!')
else
call add(result, ' Failed : to support +python3, you need run `pip3 install neovim`')
endif
call add(result, 'Checking +python:')
if has('python')
call add(result, ' SUCCEED!')
else
call add(result, ' Failed : to support +python, you need run `pip2 install neovim`')
endif
else else
call add(result, 'Checking +python3:') call add(result, ' Failed : to support +python3, you need run `pip3 install neovim`')
if has('python3')
call add(result, ' SUCCEED!')
else
if !WINDOWS()
call add(result, ' Failed : to support +python3, Please install vim-gik, or build from sources.')
else
call add(result, ' Failed : to support +python3, install vim from https://github.com/vim/vim-win32-installer/releases')
call add(result, ' install python3, make sure you have `python` in your path.')
endif
endif
call add(result, 'Checking +python:')
if has('python')
call add(result, ' SUCCEED!')
else
if !WINDOWS()
call add(result, ' Failed : to support +python, Please install vim-gik, or build from sources.')
else
call add(result, ' Failed : to support +python3, install vim from https://github.com/vim/vim-win32-installer/releases')
call add(result, ' install python3, make sure you have `python` in your path.')
endif
endif
endif endif
return result call add(result, 'Checking +python:')
if has('python')
call add(result, ' SUCCEED!')
else
call add(result, ' Failed : to support +python, you need run `pip2 install neovim`')
endif
else
call add(result, 'Checking +python3:')
if has('python3')
call add(result, ' SUCCEED!')
else
if !WINDOWS()
call add(result, ' Failed : to support +python3, Please install vim-gik, or build from sources.')
else
call add(result, ' Failed : to support +python3, install vim from https://github.com/vim/vim-win32-installer/releases')
call add(result, ' install python3, make sure you have `python` in your path.')
endif
endif
call add(result, 'Checking +python:')
if has('python')
call add(result, ' SUCCEED!')
else
if !WINDOWS()
call add(result, ' Failed : to support +python, Please install vim-gik, or build from sources.')
else
call add(result, ' Failed : to support +python3, install vim from https://github.com/vim/vim-win32-installer/releases')
call add(result, ' install python3, make sure you have `python` in your path.')
endif
endif
endif
return result
endfunction endfunction
" vim:set et sw=2:

View File

@ -6,7 +6,9 @@
"" ""
" Load the {layer} you want. For all the layers SpaceVim supports, see @section(layers). " Load the {layer} you want. For all the layers SpaceVim supports, see @section(layers).
function! SpaceVim#layers#load(layer) abort function! SpaceVim#layers#load(layer) abort
if index(g:spacevim_plugin_groups, a:layer) == -1 if index(g:spacevim_plugin_groups, a:layer) == -1
call add(g:spacevim_plugin_groups, a:layer) call add(g:spacevim_plugin_groups, a:layer)
endif endif
endfunction endfunction
" vim:set et sw=2:

View File

View File

@ -0,0 +1,41 @@
let g:spacevim_statusline_mode_format = {
\ 'n' : 'NORMAL',
\ 'i' : 'INSERT',
\ 'v' : 'VISUAL',
\ }
"""""""""""""""""""""""""""""""""
function! s:mode() abort
let mt = g:spacevim_statusline_mode_format
let m = mode()
return mt[m]
endfunction
function! s:filetype() abort
return &filetype
endfunction
function! s:encoding() abort
return &encoding
endfunction
function! s:tabname() abort
return '1'
endfunction
function! SpaceVim#layers#core#statusline#get() abort
return join([
\ s:mode(),
\ s:tabname(),
\ s:encoding(),
\ s:filetype()
\ ], ' ')
return s:mode() . s:tabname()
endfunction
function! s:refresh() abort
endfunction
set statusline=%!SpaceVim#layers#core#statusline#get()

View File

@ -0,0 +1,59 @@
"=============================================================================
" tabline.vim --- core#tabline Layer file for SpaceVim
" Copyright (c) 2012-2016 Shidong Wang & Contributors
" Author: Shidong Wang < wsdjeg at 163.com >
" URL: https://spacevim.org
" License: MIT license
"=============================================================================
""
" @section core#tabline, layer-core-tabline
" @parentsection layers
" This layer provides default tabline for SpaceVim
let s:messletters = SpaceVim#api#import('messletters')
let s:file = SpaceVim#api#import('file')
function! s:tabname(id) abort
let id = s:messletters.bubble_num(a:id, g:spacevim_buffer_index_type) . ' '
let fn = fnamemodify(bufname(a:id), ':t')
if g:spacevim_enable_tabline_filetype_icon
let icon = s:file.fticon(fn)
if !empty(icon)
let fn = icon . ' ' . fn
endif
endif
if empty(fn)
return 'No Name'
else
return id . fn
endif
endfunction
function! SpaceVim#layers#core#tabline#get() abort
let t = ' '
let nr = tabpagenr()
" if nr > 1
for i in range(1, nr)
let buflist = tabpagebuflist(i)
let winnr = tabpagewinnr(i)
let name = fnamemodify(bufname(buflist[winnr - 1]), ':t')
let id = s:messletters.bubble_num(i, g:spacevim_buffer_index_type)
let icon = s:file.fticon(name)
if !empty(icon)
let name = icon . ' ' . name
endif
let t .= id . ' ' . name
if i == nr
let t .= '%#TabLineSel#'
else
let t .= '%#TabLine# | '
endif
endfor
let t .= '%#TabLineFill#%T'
return t
endfunction
function! SpaceVim#layers#core#tabline#config() abort
set tabline=%!SpaceVim#layers#core#tabline#get()
endfunction

View File

@ -13,80 +13,87 @@ let s:log_temp = []
" "
" 3 : log error messages only " 3 : log error messages only
function! SpaceVim#logger#setLevel(level) abort function! SpaceVim#logger#setLevel(level) abort
let s:logger_level = a:level let s:logger_level = a:level
endfunction endfunction
function! SpaceVim#logger#info(msg) abort function! SpaceVim#logger#info(msg) abort
if g:spacevim_enable_debug && s:logger_level <= 1 if g:spacevim_enable_debug && s:logger_level <= 1
call s:wite(s:warpMsg(a:msg, 1)) call s:wite(s:warpMsg(a:msg, 1))
else else
call add(s:log_temp,s:warpMsg(a:msg,1)) call add(s:log_temp,s:warpMsg(a:msg,1))
endif endif
endfunction endfunction
function! SpaceVim#logger#warn(msg) abort function! SpaceVim#logger#warn(msg) abort
if g:spacevim_enable_debug && s:logger_level <= 2 if g:spacevim_enable_debug && s:logger_level <= 2
call s:wite(s:warpMsg(a:msg, 2)) call s:wite(s:warpMsg(a:msg, 2))
else else
call add(s:log_temp,s:warpMsg(a:msg,2)) call add(s:log_temp,s:warpMsg(a:msg,2))
endif endif
endfunction endfunction
function! SpaceVim#logger#error(msg) abort function! SpaceVim#logger#error(msg) abort
if g:spacevim_enable_debug && s:logger_level <= 3 if g:spacevim_enable_debug && s:logger_level <= 3
call s:wite(s:warpMsg(a:msg, 3)) call s:wite(s:warpMsg(a:msg, 3))
else else
call add(s:log_temp,s:warpMsg(a:msg,3)) call add(s:log_temp,s:warpMsg(a:msg,3))
endif endif
endfunction endfunction
function! s:wite(msg) abort function! s:wite(msg) abort
let flags = filewritable(s:logger_file) ? 'a' : '' let flags = filewritable(s:logger_file) ? 'a' : ''
call writefile([a:msg], s:logger_file, flags) call writefile([a:msg], s:logger_file, flags)
endfunction endfunction
function! SpaceVim#logger#viewLog(...) abort function! SpaceVim#logger#viewLog(...) abort
let info = "### SpaceVim Options :\n\n" let info = "### SpaceVim Options :\n\n"
let info .= "```viml\n" let info .= "```viml\n"
let info .= join(SpaceVim#options#list(), "\n") let info .= join(SpaceVim#options#list(), "\n")
let info .= "\n```\n" let info .= "\n```\n"
let info .= "\n\n" let info .= "\n\n"
let info .= "### SpaceVim Health checking :\n\n" let info .= "### SpaceVim Health checking :\n\n"
let info .= SpaceVim#health#report() let info .= SpaceVim#health#report()
let info .= "\n\n" let info .= "\n\n"
let info .= "### SpaceVim runtime log :\n\n" let info .= "### SpaceVim runtime log :\n\n"
let info .= "```log\n" let info .= "```log\n"
let l = a:0 > 0 ? a:1 : 1 let l = a:0 > 0 ? a:1 : 1
if filereadable(s:logger_file) if filereadable(s:logger_file)
let logs = readfile(s:logger_file, '') let logs = readfile(s:logger_file, '')
let info .= join(filter(logs, "v:val =~# '\[ SpaceVim \] \[\d\d\:\d\d\:\d\d\] \[" . s:levels[l] . "\]'"), "\n") let info .= join(filter(logs,
else \ "v:val =~# '\[ SpaceVim \] \[\d\d\:\d\d\:\d\d\] \["
let info .= '[ SpaceVim ] : logger file ' . s:logger_file . ' does not exists, only log for current process will be shown!' \ . s:levels[l] . "\]'"), "\n")
let info .= join(filter(s:log_temp, "v:val =~# '\[ SpaceVim \] \[\d\d\:\d\d\:\d\d\] \[" . s:levels[l] . "\]'"), "\n") else
endif let info .= '[ SpaceVim ] : logger file ' . s:logger_file
let info .= "\n```\n" \ . ' does not exists, only log for current process will be shown!'
return info let info .= join(filter(s:log_temp,
\ "v:val =~# '\[ SpaceVim \] \[\d\d\:\d\d\:\d\d\] \["
\ . s:levels[l] . "\]'"), "\n")
endif
let info .= "\n```\n"
return info
endfunction endfunction
"" ""
" @public " @public
" Set the log output file of SpaceVim. Default is `~/.SpaceVim/.SpaceVim.log`. " Set the log output file of SpaceVim. Default is `~/.SpaceVim/.SpaceVim.log`.
function! SpaceVim#logger#setOutput(file) abort function! SpaceVim#logger#setOutput(file) abort
let s:logger_file = a:file let s:logger_file = a:file
endfunction endfunction
function! s:warpMsg(msg,l) abort function! s:warpMsg(msg,l) abort
let time = strftime('%H:%M:%S') let time = strftime('%H:%M:%S')
let log = '[ SpaceVim ] [' . time . '] [' . s:levels[a:l - 1] . '] ' . a:msg let log = '[ SpaceVim ] [' . time . '] [' . s:levels[a:l - 1] . '] ' . a:msg
return log return log
endfunction endfunction
function! SpaceVim#logger#echoWarn(msg) abort function! SpaceVim#logger#echoWarn(msg) abort
echohl WarningMsg echohl WarningMsg
echom s:warpMsg(a:msg, 1) echom s:warpMsg(a:msg, 1)
echohl None echohl None
endfunction endfunction
" vim:set et sw=2 cc=80:

View File

@ -1,98 +1,100 @@
scriptencoding utf-8 scriptencoding utf-8
let g:unite_source_menu_menus = let g:unite_source_menu_menus =
\ get(g:,'unite_source_menu_menus',{}) \ get(g:,'unite_source_menu_menus',{})
let g:unite_source_menu_menus.CustomKeyMaps = {'description': let g:unite_source_menu_menus.CustomKeyMaps = {'description':
\ 'Custom mapped keyboard shortcuts [unite]<SPACE>'} \ 'Custom mapped keyboard shortcuts [unite]<SPACE>'}
let g:unite_source_menu_menus.CustomKeyMaps.command_candidates = let g:unite_source_menu_menus.CustomKeyMaps.command_candidates =
\ get(g:unite_source_menu_menus.CustomKeyMaps,'command_candidates', []) \ get(g:unite_source_menu_menus.CustomKeyMaps,'command_candidates', [])
function! SpaceVim#mapping#def(type,key,value,desc,...) abort function! SpaceVim#mapping#def(type,key,value,desc,...) abort
exec a:type . ' ' . a:key . ' ' . a:value exec a:type . ' ' . a:key . ' ' . a:value
let description = '➤ ' let description = '➤ '
\. a:desc \. a:desc
\. repeat(' ', 80 - len(a:desc) - len(a:key)) \. repeat(' ', 80 - len(a:desc) - len(a:key))
\. a:key \. a:key
let cmd = len(a:000) > 0 ? a:000[0] : a:value let cmd = len(a:000) > 0 ? a:000[0] : a:value
call add(g:unite_source_menu_menus.CustomKeyMaps.command_candidates, [description,cmd]) call add(g:unite_source_menu_menus.CustomKeyMaps.command_candidates, [description,cmd])
endfunction endfunction
function! SpaceVim#mapping#tab() abort function! SpaceVim#mapping#tab() abort
if getline('.')[col('.')-2] ==# '{'&& pumvisible() if getline('.')[col('.')-2] ==# '{'&& pumvisible()
return "\<C-n>" return "\<C-n>"
endif endif
if index(g:spacevim_plugin_groups, 'autocomplete') != -1 if index(g:spacevim_plugin_groups, 'autocomplete') != -1
if neosnippet#expandable() && getline('.')[col('.')-2] ==# '(' && !pumvisible() if neosnippet#expandable() && getline('.')[col('.')-2] ==# '(' && !pumvisible()
return "\<Plug>(neosnippet_expand)" return "\<Plug>(neosnippet_expand)"
elseif neosnippet#jumpable() elseif neosnippet#jumpable()
\ && getline('.')[col('.')-2] ==# '(' && !pumvisible() \ && getline('.')[col('.')-2] ==# '(' && !pumvisible()
\ && !neosnippet#expandable() \ && !neosnippet#expandable()
return "\<plug>(neosnippet_jump)" return "\<plug>(neosnippet_jump)"
elseif neosnippet#expandable_or_jumpable() && getline('.')[col('.')-2] !=#'(' elseif neosnippet#expandable_or_jumpable() && getline('.')[col('.')-2] !=#'('
return "\<plug>(neosnippet_expand_or_jump)" return "\<plug>(neosnippet_expand_or_jump)"
elseif pumvisible()
return "\<C-n>"
else
return "\<tab>"
endif
elseif pumvisible() elseif pumvisible()
return "\<C-n>" return "\<C-n>"
else else
return "\<tab>" return "\<tab>"
endif endif
elseif pumvisible()
return "\<C-n>"
else
return "\<tab>"
endif
endfunction endfunction
function! SpaceVim#mapping#enter() abort function! SpaceVim#mapping#enter() abort
if pumvisible() if pumvisible()
if getline('.')[col('.') - 2]==# '{' if getline('.')[col('.') - 2]==# '{'
return "\<Enter>" return "\<Enter>"
elseif g:spacevim_autocomplete_method ==# 'neocomplete'||g:spacevim_autocomplete_method ==# 'deoplete' elseif g:spacevim_autocomplete_method ==# 'neocomplete'||g:spacevim_autocomplete_method ==# 'deoplete'
return "\<C-y>" return "\<C-y>"
else
return "\<esc>a"
endif
elseif getline('.')[col('.') - 2]==#'{'&&getline('.')[col('.')-1]==#'}'
return "\<Enter>\<esc>ko"
else else
return "\<Enter>" return "\<esc>a"
endif endif
elseif getline('.')[col('.') - 2]==#'{'&&getline('.')[col('.')-1]==#'}'
return "\<Enter>\<esc>ko"
else
return "\<Enter>"
endif
endfunction endfunction
function! SpaceVim#mapping#gd() abort function! SpaceVim#mapping#gd() abort
if !empty(SpaceVim#mapping#gd#get()) if !empty(SpaceVim#mapping#gd#get())
call call(SpaceVim#mapping#gd#get(), []) call call(SpaceVim#mapping#gd#get(), [])
else else
normal! gd normal! gd
endif endif
endfunction endfunction
function! SpaceVim#mapping#clearBuffers() abort function! SpaceVim#mapping#clearBuffers() abort
for i in range(1,bufnr('$')) for i in range(1,bufnr('$'))
if i != bufnr('%') if i != bufnr('%')
try try
exe 'bw ' . i exe 'bw ' . i
catch catch
endtry endtry
endif endif
endfor endfor
endfunction endfunction
function! SpaceVim#mapping#split_previous_buffer() abort function! SpaceVim#mapping#split_previous_buffer() abort
if bufnr('#') == -1 if bufnr('#') == -1
call SpaceVim#util#echoWarn('There is no previous buffer') call SpaceVim#util#echoWarn('There is no previous buffer')
else else
split split
wincmd w wincmd w
e# e#
endif endif
endfunction endfunction
function! SpaceVim#mapping#vertical_split_previous_buffer() abort function! SpaceVim#mapping#vertical_split_previous_buffer() abort
if bufnr('#') == -1 if bufnr('#') == -1
call SpaceVim#util#echoWarn('There is no previous buffer') call SpaceVim#util#echoWarn('There is no previous buffer')
else else
vsplit vsplit
wincmd w wincmd w
e# e#
endif endif
endfunction endfunction
" vim:set et sw=2:

View File

@ -1,16 +1,16 @@
function! SpaceVim#options#list() abort function! SpaceVim#options#list() abort
let list = [] let list = []
if has('patch-7.4.2010') && 0 if has('patch-7.4.2010') && 0
for var in getcompletion('g:spacevim_','var') for var in getcompletion('g:spacevim_','var')
call add(list, var . ' = ' . string(get(g:, var[2:] , ''))) call add(list, var . ' = ' . string(get(g:, var[2:] , '')))
endfor endfor
else else
redraw redraw
for var in filter(map(s:execute('let g:'), "matchstr(v:val, '\\S\\+')"), "v:val =~# '^spacevim_'") for var in filter(map(s:execute('let g:'), "matchstr(v:val, '\\S\\+')"), "v:val =~# '^spacevim_'")
call add(list,'g:' . var . ' = ' . string(get(g:, var , ''))) call add(list,'g:' . var . ' = ' . string(get(g:, var , '')))
endfor endfor
endif endif
return list return list
endfunction endfunction
function! s:execute(cmd) abort function! s:execute(cmd) abort
@ -23,3 +23,5 @@ function! s:execute(cmd) abort
redir END redir END
return split(output, "\n") return split(output, "\n")
endfunction endfunction
" vim:set et sw=2:

View File

@ -1,64 +1,65 @@
scriptencoding utf-8 scriptencoding utf-8
function! SpaceVim#plugins#load() abort function! SpaceVim#plugins#load() abort
if zvim#plug#enable_plug() if zvim#plug#enable_plug()
call zvim#plug#begin(g:spacevim_plugin_bundle_dir) call zvim#plug#begin(g:spacevim_plugin_bundle_dir)
call zvim#plug#fetch() call zvim#plug#fetch()
call s:load_plugins() call s:load_plugins()
call s:disable_plugins(g:spacevim_disabled_plugins) call s:disable_plugins(g:spacevim_disabled_plugins)
call zvim#plug#end() call zvim#plug#end()
endif endif
endfunction endfunction
function! s:load_plugins() abort function! s:load_plugins() abort
for group in g:spacevim_plugin_groups for group in g:spacevim_plugin_groups
for plugin in s:getLayerPlugins(group) for plugin in s:getLayerPlugins(group)
if len(plugin) == 2 if len(plugin) == 2
call zvim#plug#add(plugin[0], plugin[1]) call zvim#plug#add(plugin[0], plugin[1])
if zvim#plug#tap(split(plugin[0], '/')[-1]) && get(plugin[1], 'loadconf', 0 ) if zvim#plug#tap(split(plugin[0], '/')[-1]) && get(plugin[1], 'loadconf', 0 )
call zvim#plug#defind_hooks(split(plugin[0], '/')[-1]) call zvim#plug#defind_hooks(split(plugin[0], '/')[-1])
if get(plugin[1], 'loadconf_before', 0 ) if get(plugin[1], 'loadconf_before', 0 )
call zvim#plug#loadPluginBefore(split(plugin[0], '/')[-1]) call zvim#plug#loadPluginBefore(split(plugin[0], '/')[-1])
endif endif
endif
else
call zvim#plug#add(plugin[0])
endif
endfor
call s:loadLayerConfig(group)
endfor
for plugin in g:spacevim_custom_plugins
if len(plugin) == 2
call zvim#plug#add(plugin[0], plugin[1])
else
call zvim#plug#add(plugin[0])
endif endif
else
call zvim#plug#add(plugin[0])
endif
endfor endfor
call s:loadLayerConfig(group)
endfor
for plugin in g:spacevim_custom_plugins
if len(plugin) == 2
call zvim#plug#add(plugin[0], plugin[1])
else
call zvim#plug#add(plugin[0])
endif
endfor
endfunction endfunction
function! s:getLayerPlugins(layer) abort function! s:getLayerPlugins(layer) abort
let p = [] let p = []
try try
let p = SpaceVim#layers#{a:layer}#plugins() let p = SpaceVim#layers#{a:layer}#plugins()
catch /^Vim\%((\a\+)\)\=:E117/ catch /^Vim\%((\a\+)\)\=:E117/
endtry endtry
return p return p
endfunction endfunction
function! s:loadLayerConfig(layer) abort function! s:loadLayerConfig(layer) abort
try try
call SpaceVim#layers#{a:layer}#config() call SpaceVim#layers#{a:layer}#config()
catch /^Vim\%((\a\+)\)\=:E117/ catch /^Vim\%((\a\+)\)\=:E117/
endtry endtry
endfunction endfunction
function! s:disable_plugins(plugin_list) abort function! s:disable_plugins(plugin_list) abort
for name in a:plugin_list for name in a:plugin_list
call dein#disable(name) call dein#disable(name)
endfor endfor
endfunction endfunction
function! SpaceVim#plugins#get(...) abort function! SpaceVim#plugins#get(...) abort
endfunction endfunction
" vim:set et sw=2:

View File

@ -1,13 +1,15 @@
function! SpaceVim#util#globpath(path, expr) abort function! SpaceVim#util#globpath(path, expr) abort
if has('patch-7.4.279') if has('patch-7.4.279')
return globpath(a:path, a:expr, 1, 1) return globpath(a:path, a:expr, 1, 1)
else else
return split(globpath(a:path, a:expr), '\n') return split(globpath(a:path, a:expr), '\n')
endif endif
endfunction endfunction
function! SpaceVim#util#echoWarn(msg) abort function! SpaceVim#util#echoWarn(msg) abort
echohl WarningMsg echohl WarningMsg
echo a:msg echo a:msg
echohl None echohl None
endfunction endfunction
" vim:set et sw=2 cc=80:

View File

@ -1,19 +1,22 @@
" @vimlint(EVL103, 1, a:buffers) " @vimlint(EVL103, 1, a:buffers)
function! airline#extensions#tabline#formatters#spacevim#format(bufnr, buffers) abort function! airline#extensions#tabline#formatters#spacevim#format(bufnr, buffers) abort
let id = SpaceVim#api#messletters#get().bubble_num(a:bufnr, g:spacevim_buffer_index_type) . ' ' let id = SpaceVim#api#messletters#get().bubble_num(a:bufnr, g:spacevim_buffer_index_type) . ' '
let fn = fnamemodify(bufname(a:bufnr), ':t') let fn = fnamemodify(bufname(a:bufnr), ':t')
if g:spacevim_enable_tabline_filetype_icon if g:spacevim_enable_tabline_filetype_icon
let icon = SpaceVim#api#import('file').fticon(fn) let icon = SpaceVim#api#import('file').fticon(fn)
if !empty(icon) if !empty(icon)
let fn = icon . ' ' . fn let fn = icon . ' ' . fn
endif
endif
if empty(fn)
return 'No Name'
elseif !g:airline#extensions#tabline#buffer_idx_mode
return id . fn
else
return fn
endif endif
endif
if empty(fn)
return 'No Name'
elseif !g:airline#extensions#tabline#buffer_idx_mode
return id . fn
else
return fn
endif
endfunction endfunction
" @vimlint(EVL103, 0, a:buffers) " @vimlint(EVL103, 0, a:buffers)
" vim:set et sw=2:

View File

@ -5,134 +5,134 @@ scriptencoding utf-8
let s:fish = &shell =~# 'fish' let s:fish = &shell =~# 'fish'
function! vimfiler#columns#gitstatus#define() abort function! vimfiler#columns#gitstatus#define() abort
return s:column return s:column
endfunction"}}} endfunction"}}}
let s:column = { let s:column = {
\ 'name' : 'gitstatus', \ 'name' : 'gitstatus',
\ 'description' : 'plugin for vimfiler that provides git status support', \ 'description' : 'plugin for vimfiler that provides git status support',
\ 'syntax' : 'vimfilerColumn__Git', \ 'syntax' : 'vimfilerColumn__Git',
\ } \ }
" @vimlint(EVL103, 1, a:files) " @vimlint(EVL103, 1, a:files)
" @vimlint(EVL103, 1, a:context) " @vimlint(EVL103, 1, a:context)
function! s:column.length(files, context) abort function! s:column.length(files, context) abort
return 3 return 3
endfunction endfunction
" @vimlint(EVL103, 0, a:files) " @vimlint(EVL103, 0, a:files)
" @vimlint(EVL103, 0, a:context) " @vimlint(EVL103, 0, a:context)
if !exists('g:VimFilerGitIndicatorMap') if !exists('g:VimFilerGitIndicatorMap')
let g:VimFilerGitIndicatorMap = { let g:VimFilerGitIndicatorMap = {
\ 'Modified' : '✹', \ 'Modified' : '✹',
\ 'Staged' : '✚', \ 'Staged' : '✚',
\ 'Untracked' : '✭', \ 'Untracked' : '✭',
\ 'Renamed' : '➜', \ 'Renamed' : '➜',
\ 'Unmerged' : '═', \ 'Unmerged' : '═',
\ 'Deleted' : '✖', \ 'Deleted' : '✖',
\ 'Dirty' : '✗', \ 'Dirty' : '✗',
\ 'Clean' : '✔︎', \ 'Clean' : '✔︎',
\ 'Ignored' : '☒', \ 'Ignored' : '☒',
\ 'Unknown' : '?' \ 'Unknown' : '?'
\ } \ }
endif endif
" @vimlint(EVL103, 1, a:context) " @vimlint(EVL103, 1, a:context)
function! s:column.define_syntax(context) abort function! s:column.define_syntax(context) abort
for name in keys(g:VimFilerGitIndicatorMap) for name in keys(g:VimFilerGitIndicatorMap)
exe 'syntax match vimfilerColumn__Git' . name exe 'syntax match vimfilerColumn__Git' . name
\ . " '\[" . g:VimFilerGitIndicatorMap[name] \ . " '\[" . g:VimFilerGitIndicatorMap[name]
\ . "\]' contained containedin=vimfilerColumn__Git" \ . "\]' contained containedin=vimfilerColumn__Git"
endfor endfor
highlight def link vimfilerColumn__GitModified Special highlight def link vimfilerColumn__GitModified Special
highlight def link vimfilerColumn__GitStaged Function highlight def link vimfilerColumn__GitStaged Function
highlight def link vimfilerColumn__GitUnstaged Text highlight def link vimfilerColumn__GitUnstaged Text
highlight def link vimfilerColumn__GitRenamed Title highlight def link vimfilerColumn__GitRenamed Title
highlight def link vimfilerColumn__GitUnmerged Label highlight def link vimfilerColumn__GitUnmerged Label
highlight def link vimfilerColumn__GitDeleted Text highlight def link vimfilerColumn__GitDeleted Text
highlight def link vimfilerColumn__GitDirty Tag highlight def link vimfilerColumn__GitDirty Tag
highlight def link vimfilerColumn__GitClean DiffAdd highlight def link vimfilerColumn__GitClean DiffAdd
highlight def link vimfilerColumn__GitUnknown Text highlight def link vimfilerColumn__GitUnknown Text
endfunction endfunction
" @vimlint(EVL103, 0, a:context) " @vimlint(EVL103, 0, a:context)
function! s:directory_of_file(file) abort function! s:directory_of_file(file) abort
return fnamemodify(a:file, ':h') return fnamemodify(a:file, ':h')
endfunction endfunction
function! s:system(cmd, ...) abort function! s:system(cmd, ...) abort
silent let output = (a:0 == 0) ? system(a:cmd) : system(a:cmd, a:1) silent let output = (a:0 == 0) ? system(a:cmd) : system(a:cmd, a:1)
return output return output
endfunction endfunction
function! s:git_shellescape(arg) abort function! s:git_shellescape(arg) abort
if a:arg =~# '^[A-Za-z0-9_/.-]\+$' if a:arg =~# '^[A-Za-z0-9_/.-]\+$'
return a:arg return a:arg
elseif &shell =~# 'cmd' || gitgutter#utility#using_xolox_shell() elseif &shell =~# 'cmd' || gitgutter#utility#using_xolox_shell()
return '"' . substitute(substitute(a:arg, '"', '""', 'g'), '%', '"%"', 'g') . '"' return '"' . substitute(substitute(a:arg, '"', '""', 'g'), '%', '"%"', 'g') . '"'
else else
return shellescape(a:arg) return shellescape(a:arg)
endif endif
endfunction endfunction
function! s:cmd_in_directory_of_file(file, cmd) abort function! s:cmd_in_directory_of_file(file, cmd) abort
return 'cd '.s:git_shellescape(s:directory_of_file(a:file)) . (s:fish ? '; and ' : ' && ') . a:cmd return 'cd '.s:git_shellescape(s:directory_of_file(a:file)) . (s:fish ? '; and ' : ' && ') . a:cmd
endfunction endfunction
function! s:git_state_to_name(symb) abort function! s:git_state_to_name(symb) abort
if a:symb ==# '?' if a:symb ==# '?'
return 'Untracked' return 'Untracked'
elseif a:symb ==# ' ' elseif a:symb ==# ' '
return 'Modified' return 'Modified'
elseif a:symb =~# '[MAC]' elseif a:symb =~# '[MAC]'
return 'Staged' return 'Staged'
elseif a:symb ==# 'R' elseif a:symb ==# 'R'
return 'Renamed' return 'Renamed'
elseif a:symb ==# 'U' || a:symb ==# 'A' || a:symb ==# 'D' elseif a:symb ==# 'U' || a:symb ==# 'A' || a:symb ==# 'D'
return 'Unmerged' return 'Unmerged'
elseif a:symb ==# '!' elseif a:symb ==# '!'
return 'Ignored' return 'Ignored'
else else
return 'Unknown' return 'Unknown'
endif endif
endfunction endfunction
function! s:git_state_to_symbol(s) abort function! s:git_state_to_symbol(s) abort
let name = s:git_state_to_name(a:s) let name = s:git_state_to_name(a:s)
return g:VimFilerGitIndicatorMap[name] return g:VimFilerGitIndicatorMap[name]
endfunction endfunction
let g:wsd = [] let g:wsd = []
" @vimlint(EVL103, 1, a:context) " @vimlint(EVL103, 1, a:context)
function! s:column.get(file, context) abort function! s:column.get(file, context) abort
let cmd = 'git -c color.status=false status -s ' . fnamemodify(a:file.action__path, ':.') let cmd = 'git -c color.status=false status -s ' . fnamemodify(a:file.action__path, ':.')
let output = systemlist(cmd) let output = systemlist(cmd)
if v:shell_error if v:shell_error
return ' ' return ' '
endif endif
if a:file.vimfiler__is_directory if a:file.vimfiler__is_directory
if !empty(output) if !empty(output)
return '[' . g:VimFilerGitIndicatorMap['Dirty'] . ']' return '[' . g:VimFilerGitIndicatorMap['Dirty'] . ']'
else
return ' '
endif
else else
if !empty(output) return ' '
let symb = split(output[0])[0]
return '[' . g:VimFilerGitIndicatorMap[s:git_state_to_name(symb)] . ']'
else
return ' '
endif
endif endif
else
if !empty(output)
let symb = split(output[0])[0]
return '[' . g:VimFilerGitIndicatorMap[s:git_state_to_name(symb)] . ']'
else
return ' '
endif
endif
endfunction endfunction
" @vimlint(EVL103, 0, a:context) " @vimlint(EVL103, 0, a:context)
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim: foldmethod=marker " vim:set et sw=2:

View File

@ -1,40 +1,40 @@
function! zvim#tab() abort function! zvim#tab() abort
if getline('.')[col('.')-2] ==# '{'&& pumvisible() if getline('.')[col('.')-2] ==# '{'&& pumvisible()
return "\<C-n>" return "\<C-n>"
endif endif
if neosnippet#expandable() && getline('.')[col('.')-2] ==# '(' && !pumvisible() if neosnippet#expandable() && getline('.')[col('.')-2] ==# '(' && !pumvisible()
return "\<Plug>(neosnippet_expand)" return "\<Plug>(neosnippet_expand)"
elseif neosnippet#jumpable() && getline('.')[col('.')-2] ==# '(' && !pumvisible() && !neosnippet#expandable() elseif neosnippet#jumpable() && getline('.')[col('.')-2] ==# '(' && !pumvisible() && !neosnippet#expandable()
return "\<plug>(neosnippet_jump)" return "\<plug>(neosnippet_jump)"
elseif neosnippet#expandable_or_jumpable() && getline('.')[col('.')-2] !=#'(' elseif neosnippet#expandable_or_jumpable() && getline('.')[col('.')-2] !=#'('
return "\<plug>(neosnippet_expand_or_jump)" return "\<plug>(neosnippet_expand_or_jump)"
elseif pumvisible() elseif pumvisible()
return "\<C-n>" return "\<C-n>"
else else
return "\<tab>" return "\<tab>"
endif endif
endfunction endfunction
function! zvim#enter() abort function! zvim#enter() abort
if pumvisible() if pumvisible()
if getline('.')[col('.') - 2]==# '{' if getline('.')[col('.') - 2]==# '{'
return "\<Enter>" return "\<Enter>"
elseif g:spacevim_autocomplete_method ==# 'neocomplete'||g:spacevim_autocomplete_method ==# 'deoplete' elseif g:spacevim_autocomplete_method ==# 'neocomplete'||g:spacevim_autocomplete_method ==# 'deoplete'
return "\<C-y>" return "\<C-y>"
else
return "\<esc>a"
endif
elseif getline('.')[col('.') - 2]==#'{'&&getline('.')[col('.')-1]==#'}'
return "\<Enter>\<esc>ko"
else else
return "\<Enter>" return "\<esc>a"
endif endif
elseif getline('.')[col('.') - 2]==#'{'&&getline('.')[col('.')-1]==#'}'
return "\<Enter>\<esc>ko"
else
return "\<Enter>"
endif
endfunction endfunction
function! zvim#format() abort function! zvim#format() abort
let save_cursor = getcurpos() let save_cursor = getcurpos()
normal! gg=G normal! gg=G
call setpos('.', save_cursor) call setpos('.', save_cursor)
endfunction endfunction
function! zvim#gf() abort function! zvim#gf() abort
@ -58,10 +58,10 @@ function! zvim#gf() abort
endfor endfor
endif endif
if !empty(path) if !empty(path)
let line = s:search_line(path, matchstr(line[start :], '\k\+')) let line = s:search_line(path, matchstr(line[start :], '\k\+'))
let col = start let col = start
exe 'e ' . path exe 'e ' . path
call cursor(line, col) call cursor(line, col)
endif endif
finally finally
let &l:iskeyword = isk let &l:iskeyword = isk
@ -105,3 +105,5 @@ function! s:search_line(path, term) abort "{{{
endif endif
return 0 return 0
endfunction "}}} endfunction "}}}
" vim:set et sw=2:

View File

@ -12,15 +12,15 @@ let g:ctrlp_cache_dir = $HOME.'/.cache/ctrlp'
"let g:ctrlp_open_multiple_files = 'v' "let g:ctrlp_open_multiple_files = 'v'
"if you have install ag, the g:ctrlp_custom_ignore will not work "if you have install ag, the g:ctrlp_custom_ignore will not work
let g:ctrlp_custom_ignore = { let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$|target', \ 'dir': '\v[\/]\.(git|hg|svn)$|target',
\ 'file': '\v\.(exe|so|dll|ttf|png)$|\-rplugin\~', \ 'file': '\v\.(exe|so|dll|ttf|png)$|\-rplugin\~',
\ 'link': 'some_bad_symbolic_links', \ 'link': 'some_bad_symbolic_links',
\ } \ }
if executable('rg') if executable('rg')
let g:ctrlp_user_command = 'rg %s --no-ignore --hidden --files -g "" ' let g:ctrlp_user_command = 'rg %s --no-ignore --hidden --files -g "" '
\ . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'rg')) \ . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'rg'))
elseif executable('ag') elseif executable('ag')
let g:ctrlp_user_command = 'ag %s --hidden -i -g "" ' . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'ag')) let g:ctrlp_user_command = 'ag %s --hidden -i -g "" ' . join(zvim#util#Generate_ignore(g:spacevim_wildignore,'ag'))
endif endif
let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' } let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
"nnoremap <Leader>kk :CtrlPMixed<Cr> "nnoremap <Leader>kk :CtrlPMixed<Cr>
@ -48,7 +48,9 @@ nnoremap <Leader>pl :<c-u>CtrlPLauncher<cr>
""}}} ""}}}
augroup Fix_command_in_help_buffer augroup Fix_command_in_help_buffer
au! au!
autocmd FileType help exec 'nnoremap <buffer><silent><c-p> :<c-u>CtrlP ' . getcwd() .'<cr>' autocmd FileType help exec 'nnoremap <buffer><silent><c-p> :<c-u>CtrlP ' . getcwd() .'<cr>'
au FileType help exec "nnoremap <silent><buffer> q :q<CR>" au FileType help exec "nnoremap <silent><buffer> q :q<CR>"
augroup END augroup END
" vim:set et sw=2:

View File

@ -1,4 +1,6 @@
let g:deoplete#sources#clang#libclang_path = let g:deoplete#sources#clang#libclang_path =
\ get(g:, 'deoplete#sources#clang#libclang_path', '/usr/lib/libclang.so') \ get(g:, 'deoplete#sources#clang#libclang_path', '/usr/lib/libclang.so')
let g:deoplete#sources#clang#clang_header = let g:deoplete#sources#clang#clang_header =
\ get(g:, 'deoplete#sources#clang#clang_header', '/usr/lib/clang/') \ get(g:, 'deoplete#sources#clang#clang_header', '/usr/lib/clang/')
" vim:set et sw=2:

View File

@ -13,17 +13,17 @@ let g:deoplete#omni_patterns = get(g:, 'deoplete#omni_patterns', {})
" java && jsp " java && jsp
let g:deoplete#omni#input_patterns.java = [ let g:deoplete#omni#input_patterns.java = [
\'[^. \t0-9]\.\w*', \'[^. \t0-9]\.\w*',
\'[^. \t0-9]\->\w*', \'[^. \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 = ['[^. \t0-9]\.\w*']
if g:spacevim_enable_javacomplete2_py if g:spacevim_enable_javacomplete2_py
let g:deoplete#ignore_sources.java = ['omni'] let g:deoplete#ignore_sources.java = ['omni']
call deoplete#custom#set('javacomplete2', 'mark', '') call deoplete#custom#set('javacomplete2', 'mark', '')
else else
let g:deoplete#ignore_sources.java = ['javacomplete2'] let g:deoplete#ignore_sources.java = ['javacomplete2']
call deoplete#custom#set('omni', 'mark', '') call deoplete#custom#set('omni', 'mark', '')
endif endif
" go " go
@ -33,20 +33,20 @@ call deoplete#custom#set('go', 'rank', 9999)
" perl " perl
let g:deoplete#omni#input_patterns.perl = [ let g:deoplete#omni#input_patterns.perl = [
\'[^. \t0-9]\.\w*', \'[^. \t0-9]\.\w*',
\'[^. \t0-9]\->\w*', \'[^. \t0-9]\->\w*',
\'[^. \t0-9]\::\w*', \'[^. \t0-9]\::\w*',
\] \]
" javascript " javascript
let g:deoplete#omni#input_patterns.javascript = ['[^. \t0-9]\.\w*'] let g:deoplete#omni#input_patterns.javascript = ['[^. \t0-9]\.\w*']
" php " php
let g:deoplete#omni#input_patterns.php = [ let g:deoplete#omni#input_patterns.php = [
\'[^. \t0-9]\.\w*', \'[^. \t0-9]\.\w*',
\'[^. \t0-9]\->\w*', \'[^. \t0-9]\->\w*',
\'[^. \t0-9]\::\w*', \'[^. \t0-9]\::\w*',
\] \]
let g:deoplete#ignore_sources.php = ['omni', 'around', 'member'] let g:deoplete#ignore_sources.php = ['omni', 'around', 'member']
call deoplete#custom#set('phpcd', 'mark', '') call deoplete#custom#set('phpcd', 'mark', '')
call deoplete#custom#set('phpcd', 'input_pattern', '\w*|[^. \t]->\w*|\w*::\w*') call deoplete#custom#set('phpcd', 'input_pattern', '\w*|[^. \t]->\w*|\w*::\w*')
@ -68,3 +68,5 @@ let g:deoplete#ignore_sources._ = ['around']
inoremap <expr><C-h> deoplete#mappings#smart_close_popup()."\<C-h>" inoremap <expr><C-h> deoplete#mappings#smart_close_popup()."\<C-h>"
inoremap <expr><BS> deoplete#mappings#smart_close_popup()."\<C-h>" inoremap <expr><BS> deoplete#mappings#smart_close_popup()."\<C-h>"
set isfname-== set isfname-==
" vim:set et sw=2:

View File

@ -1,26 +1,28 @@
let s:save_option = {} let s:save_option = {}
function! s:goyo_enter() function! s:goyo_enter()
let s:save_option['showmode'] = &showmode let s:save_option['showmode'] = &showmode
let s:save_option['showcmd'] = &showcmd let s:save_option['showcmd'] = &showcmd
let s:save_option['scrolloff'] = &scrolloff let s:save_option['scrolloff'] = &scrolloff
set noshowmode set noshowmode
set noshowcmd set noshowcmd
set scrolloff=999 set scrolloff=999
if exists(':Limelight') == 2 if exists(':Limelight') == 2
Limelight Limelight
let s:save_option['limelight'] = 1 let s:save_option['limelight'] = 1
endif endif
endfunction endfunction
function! s:goyo_leave() function! s:goyo_leave()
let &showmode = s:save_option['showmode'] let &showmode = s:save_option['showmode']
let &showcmd = s:save_option['showcmd'] let &showcmd = s:save_option['showcmd']
let &scrolloff = s:save_option['scrolloff'] let &scrolloff = s:save_option['scrolloff']
if get(s:save_option,'limelight', 0) if get(s:save_option,'limelight', 0)
execute 'Limelight!' execute 'Limelight!'
endif endif
endfunction endfunction
augroup goyo_map augroup goyo_map
autocmd! User GoyoEnter nested call <SID>goyo_enter() autocmd! User GoyoEnter nested call <SID>goyo_enter()
autocmd! User GoyoLeave nested call <SID>goyo_leave() autocmd! User GoyoLeave nested call <SID>goyo_leave()
augroup END augroup END
" vim:set et sw=2:

View File

@ -1,19 +1,21 @@
let g:java_getset_disable_map = 1 let g:java_getset_disable_map = 1
let g:javagetset_setterTemplate = let g:javagetset_setterTemplate =
\ "/**\n" . \ "/**\n" .
\ " * Set %varname%.\n" . \ " * Set %varname%.\n" .
\ " *\n" . \ " *\n" .
\ " * @param %varname% the value to set.\n" . \ " * @param %varname% the value to set.\n" .
\ " */\n" . \ " */\n" .
\ "%modifiers% void %funcname%(%type% %varname%){\n" . \ "%modifiers% void %funcname%(%type% %varname%){\n" .
\ " this.%varname% = %varname%;\n" . \ " this.%varname% = %varname%;\n" .
\ "}" \ "}"
let g:javagetset_getterTemplate = let g:javagetset_getterTemplate =
\ "/**\n" . \ "/**\n" .
\ " * Get %varname%.\n" . \ " * Get %varname%.\n" .
\ " *\n" . \ " *\n" .
\ " * @return %varname% as %type%.\n" . \ " * @return %varname% as %type%.\n" .
\ " */\n" . \ " */\n" .
\ "%modifiers% %type% %funcname%(){\n" . \ "%modifiers% %type% %funcname%(){\n" .
\ " return %varname%;\n" . \ " return %varname%;\n" .
\ "}" \ "}"
" vim:set et sw=2:

View File

@ -32,18 +32,18 @@ let g:neocomplcache_enable_auto_select = 0
let g:neocomplcache_enable_auto_delimiter = 1 let g:neocomplcache_enable_auto_delimiter = 1
let g:neocomplcache_disable_auto_select_buffer_name_pattern = let g:neocomplcache_disable_auto_select_buffer_name_pattern =
\ '\[Command Line\]' \ '\[Command Line\]'
"let g:neocomplcache_disable_auto_complete = 0 "let g:neocomplcache_disable_auto_complete = 0
let g:neocomplcache_max_list = 100 let g:neocomplcache_max_list = 100
let g:neocomplcache_force_overwrite_completefunc = 1 let g:neocomplcache_force_overwrite_completefunc = 1
if !exists('g:neocomplcache_omni_patterns') if !exists('g:neocomplcache_omni_patterns')
let g:neocomplcache_omni_patterns = {} let g:neocomplcache_omni_patterns = {}
endif endif
if !exists('g:neocomplcache_omni_functions') if !exists('g:neocomplcache_omni_functions')
let g:neocomplcache_omni_functions = {} let g:neocomplcache_omni_functions = {}
endif endif
if !exists('g:neocomplcache_force_omni_patterns') if !exists('g:neocomplcache_force_omni_patterns')
let g:neocomplcache_force_omni_patterns = {} let g:neocomplcache_force_omni_patterns = {}
endif endif
let g:neocomplcache_enable_auto_close_preview = 1 let g:neocomplcache_enable_auto_close_preview = 1
" let g:neocomplcache_force_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::' " let g:neocomplcache_force_omni_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'
@ -54,31 +54,33 @@ let g:neocomplcache_force_omni_patterns.java = '[^. *\t]\.\w*\|\h\w*::'
" For clang_complete. " For clang_complete.
let g:neocomplcache_force_overwrite_completefunc = 1 let g:neocomplcache_force_overwrite_completefunc = 1
let g:neocomplcache_force_omni_patterns.c = let g:neocomplcache_force_omni_patterns.c =
\ '[^.[:digit:] *\t]\%(\.\|->\)' \ '[^.[:digit:] *\t]\%(\.\|->\)'
let g:neocomplcache_force_omni_patterns.cpp = let g:neocomplcache_force_omni_patterns.cpp =
\ '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::' \ '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
let g:clang_complete_auto = 0 let g:clang_complete_auto = 0
let g:clang_auto_select = 0 let g:clang_auto_select = 0
let g:clang_use_library = 1 let g:clang_use_library = 1
" Define keyword pattern. " Define keyword pattern.
if !exists('g:neocomplcache_keyword_patterns') if !exists('g:neocomplcache_keyword_patterns')
let g:neocomplcache_keyword_patterns = {} let g:neocomplcache_keyword_patterns = {}
endif endif
let g:neocomplcache_keyword_patterns['default'] = '[0-9a-zA-Z:#_]\+' let g:neocomplcache_keyword_patterns['default'] = '[0-9a-zA-Z:#_]\+'
let g:neocomplcache_keyword_patterns.perl = '\h\w*->\h\w*\|\h\w*::' 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 = 1
let g:neocomplcache_vim_completefuncs = { let g:neocomplcache_vim_completefuncs = {
\ 'Ref' : 'ref#complete', \ 'Ref' : 'ref#complete',
\ 'Unite' : 'unite#complete_source', \ 'Unite' : 'unite#complete_source',
\ 'VimShellExecute' : \ 'VimShellExecute' :
\ 'vimshell#vimshell_execute_complete', \ 'vimshell#vimshell_execute_complete',
\ 'VimShellInteractive' : \ 'VimShellInteractive' :
\ 'vimshell#vimshell_execute_complete', \ 'vimshell#vimshell_execute_complete',
\ 'VimShellTerminal' : \ 'VimShellTerminal' :
\ 'vimshell#vimshell_execute_complete', \ 'vimshell#vimshell_execute_complete',
\ 'VimShell' : 'vimshell#complete', \ 'VimShell' : 'vimshell#complete',
\ 'VimFiler' : 'vimfiler#complete', \ 'VimFiler' : 'vimfiler#complete',
\ 'Vinarise' : 'vinarise#complete', \ 'Vinarise' : 'vinarise#complete',
\} \}
" vim:set et sw=2:

View File

@ -12,18 +12,18 @@ let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
" Define dictionary. " Define dictionary.
let g:neocomplete#sources#dictionary#dictionaries = { let g:neocomplete#sources#dictionary#dictionaries = {
\ 'default' : '', \ 'default' : '',
\ 'vimshell' : $CACHE.'/vimshell/command-history', \ 'vimshell' : $CACHE.'/vimshell/command-history',
\ 'java' : '~/.vim/dict/java.dict', \ 'java' : '~/.vim/dict/java.dict',
\ 'ruby' : '~/.vim/dict/ruby.dict', \ 'ruby' : '~/.vim/dict/ruby.dict',
\ 'scala' : '~/.vim/dict/scala.dict', \ 'scala' : '~/.vim/dict/scala.dict',
\ } \ }
let g:neocomplete#enable_auto_delimiter = 1 let g:neocomplete#enable_auto_delimiter = 1
" Define keyword. " Define keyword.
if !exists('g:neocomplete#keyword_patterns') if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {} let g:neocomplete#keyword_patterns = {}
endif endif
let g:neocomplete#keyword_patterns._ = '\h\k*(\?' let g:neocomplete#keyword_patterns._ = '\h\k*(\?'
@ -32,7 +32,7 @@ let g:neocomplete#keyword_patterns._ = '\h\k*(\?'
let g:neocomplete#enable_auto_select = 0 let g:neocomplete#enable_auto_select = 0
if !exists('g:neocomplete#sources#omni#input_patterns') if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns = {} let g:neocomplete#sources#omni#input_patterns = {}
endif endif
let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::' let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
@ -45,3 +45,5 @@ inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> 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-y> neocomplete#close_popup()
inoremap <expr><C-e> neocomplete#cancel_popup() inoremap <expr><C-e> neocomplete#cancel_popup()
" vim:set et sw=2:

View File

@ -3,10 +3,11 @@ let g:neomake_open_list = 2 " 1 open list and move cursor 2 open list without m
let g:neomake_verbose = 0 let g:neomake_verbose = 0
let g:neomake_java_javac_delete_output = 0 let g:neomake_java_javac_delete_output = 0
let g:neomake_error_sign = { let g:neomake_error_sign = {
\ 'text': get(g:, 'spacevim_error_symbol', '✖'), \ 'text': get(g:, 'spacevim_error_symbol', '✖'),
\ 'texthl': (g:spacevim_colorscheme ==# 'gruvbox' ? 'GruvboxRedSign' : 'error'), \ 'texthl': (g:spacevim_colorscheme ==# 'gruvbox' ? 'GruvboxRedSign' : 'error'),
\ } \ }
let g:neomake_warning_sign = { let g:neomake_warning_sign = {
\ 'text': get(g:,'spacevim_warning_symbol', '➤'), \ 'text': get(g:,'spacevim_warning_symbol', '➤'),
\ 'texthl': (g:spacevim_colorscheme ==# 'gruvbox' ? 'GruvboxYellowSign' : 'todo'), \ 'texthl': (g:spacevim_colorscheme ==# 'gruvbox' ? 'GruvboxYellowSign' : 'todo'),
\ } \ }
" vim:set et sw=2:

View File

@ -1,33 +1,35 @@
let g:neosnippet#snippets_directory = get(g:,'neosnippet#snippets_directory', '') let g:neosnippet#snippets_directory = get(g:,'neosnippet#snippets_directory', '')
if empty(g:neosnippet#snippets_directory) if empty(g:neosnippet#snippets_directory)
let g:neosnippet#snippets_directory = [expand('~/.SpaceVim/snippets/'), expand('~/.SpaceVim.d/snippets/')] let g:neosnippet#snippets_directory = [expand('~/.SpaceVim/snippets/'), expand('~/.SpaceVim.d/snippets/')]
elseif type(g:spacevim_force_global_config) == type('') elseif type(g:spacevim_force_global_config) == type('')
let g:neosnippet#snippets_directory = [expand('~/.SpaceVim/snippets/'), expand('~/.SpaceVim.d/snippets/')] + [g:neosnippet#snippets_directory] let g:neosnippet#snippets_directory = [expand('~/.SpaceVim/snippets/'), expand('~/.SpaceVim.d/snippets/')] + [g:neosnippet#snippets_directory]
elseif type(g:spacevim_force_global_config) == type([]) elseif type(g:spacevim_force_global_config) == type([])
let g:neosnippet#snippets_directory = [expand('~/.SpaceVim/snippets/'), expand('~/.SpaceVim.d/snippets/')] + g:neosnippet#snippets_directory let g:neosnippet#snippets_directory = [expand('~/.SpaceVim/snippets/'), expand('~/.SpaceVim.d/snippets/')] + g:neosnippet#snippets_directory
endif endif
if g:spacevim_force_global_config == 0 if g:spacevim_force_global_config == 0
let g:neosnippet#snippets_directory = [getcwd() . '/.Spacevim.d/snippets'] + g:neosnippet#snippets_directory let g:neosnippet#snippets_directory = [getcwd() . '/.Spacevim.d/snippets'] + g:neosnippet#snippets_directory
endif endif
let g:neosnippet#enable_snipmate_compatibility=1 let g:neosnippet#enable_snipmate_compatibility=1
let g:neosnippet#enable_complete_done = 1 let g:neosnippet#enable_complete_done = 1
let g:neosnippet#completed_pairs= {} let g:neosnippet#completed_pairs= {}
let g:neosnippet#completed_pairs.java = {'(' : ')'} let g:neosnippet#completed_pairs.java = {'(' : ')'}
if g:neosnippet#enable_complete_done if g:neosnippet#enable_complete_done
let g:neopairs#enable = 0 let g:neopairs#enable = 0
endif endif
augroup neosnippet_complete_done augroup neosnippet_complete_done
autocmd! autocmd!
autocmd CompleteDone * call s:my_complete_done() autocmd CompleteDone * call s:my_complete_done()
augroup END augroup END
function! s:my_complete_done() abort "{{{ function! s:my_complete_done() abort "{{{
if !empty(get(v:,'completed_item','')) if !empty(get(v:,'completed_item',''))
let snippet = neosnippet#parser#_get_completed_snippet(v:completed_item,neosnippet#util#get_cur_text(), neosnippet#util#get_next_text()) let snippet = neosnippet#parser#_get_completed_snippet(v:completed_item,neosnippet#util#get_cur_text(), neosnippet#util#get_next_text())
if snippet ==# '' if snippet ==# ''
return return
endif
let [cur_text, col] = neosnippet#mappings#_pre_trigger()[0:1]
call neosnippet#view#_insert(snippet, {}, cur_text, col)
endif endif
let [cur_text, col] = neosnippet#mappings#_pre_trigger()[0:1]
call neosnippet#view#_insert(snippet, {}, cur_text, col)
endif
endfunction"}}} endfunction"}}}
" vim:set et sw=2:

View File

@ -1,6 +1,6 @@
scriptencoding utf-8 scriptencoding utf-8
if !filereadable('pom.xml') && !filereadable('build.gradle') && isdirectory('bin') if !filereadable('pom.xml') && !filereadable('build.gradle') && isdirectory('bin')
let g:syntastic_java_javac_options = '-d bin' let g:syntastic_java_javac_options = '-d bin'
endif endif
let g:syntastic_java_javac_config_file_enabled = 1 let g:syntastic_java_javac_config_file_enabled = 1
let g:syntastic_java_javac_delete_output = 0 let g:syntastic_java_javac_delete_output = 0
@ -11,8 +11,10 @@ let g:syntastic_check_on_wq = 0
let g:syntastic_error_symbol = get(g:, 'spacevim_error_symbol', '✖') let g:syntastic_error_symbol = get(g:, 'spacevim_error_symbol', '✖')
let g:syntastic_warning_symbol = get(g:, 'spacevim_warning_symbol', '➤') let g:syntastic_warning_symbol = get(g:, 'spacevim_warning_symbol', '➤')
let g:syntastic_vimlint_options = { let g:syntastic_vimlint_options = {
\'EVL102': 1 , \'EVL102': 1 ,
\'EVL103': 1 , \'EVL103': 1 ,
\'EVL205': 1 , \'EVL205': 1 ,
\'EVL105': 1 , \'EVL105': 1 ,
\} \}
" vim:set et sw=2:

View File

@ -1,6 +1,6 @@
scriptencoding utf-8 scriptencoding utf-8
if !executable('ctags') if !executable('ctags')
let g:Tlist_Ctags_Cmd = '/usr/bin/ctags' "设置ctags执行路径 let g:Tlist_Ctags_Cmd = '/usr/bin/ctags' "设置ctags执行路径
endif endif
let g:Tlist_Auto_Update=1 let g:Tlist_Auto_Update=1
let g:Tlist_Auto_Open =0 let g:Tlist_Auto_Open =0
@ -9,3 +9,5 @@ let g:Tlist_Show_One_File=0
let g:Tlist_File_Fold_Auto_Close=1 let g:Tlist_File_Fold_Auto_Close=1
let g:Tlist_Exit_OnlyWindow=1 let g:Tlist_Exit_OnlyWindow=1
let g:Tlist_Show_Menu=1 let g:Tlist_Show_Menu=1
" vim:set et sw=2:

View File

@ -5,5 +5,7 @@ nnoremap <leader>gg :execute 'Unite -auto-preview -start-insert -no-split gtags
"nnoremap <leader>gp :execute 'Unite -auto-preview -start-insert -no-split gtags/completion'<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> vnoremap <leader>gd <ESC>:execute 'Unite -auto-preview -start-insert -no-split gtags/def:'.GetVisualSelection()<CR>
let g:unite_source_gtags_project_config = { let g:unite_source_gtags_project_config = {
\ '_': { 'treelize': 0 } \ '_': { 'treelize': 0 }
\ } \ }
" vim:set et sw=2:

View File

@ -3,26 +3,26 @@ call unite#custom#source('codesearch', 'max_candidates', 30)
call unite#filters#matcher_default#use(['matcher_fuzzy']) call unite#filters#matcher_default#use(['matcher_fuzzy'])
call unite#filters#sorter_default#use(['sorter_rank']) call unite#filters#sorter_default#use(['sorter_rank'])
call unite#custom#profile('default', 'context', { call unite#custom#profile('default', 'context', {
\ 'safe': 0, \ 'safe': 0,
\ 'start_insert': 1, \ 'start_insert': 1,
\ 'ignorecase' : 1, \ 'ignorecase' : 1,
\ 'short_source_names': 1, \ 'short_source_names': 1,
\ 'update_time': 200, \ 'update_time': 200,
\ 'direction': 'rightbelow', \ 'direction': 'rightbelow',
\ 'winwidth': 40, \ 'winwidth': 40,
\ 'winheight': 15, \ 'winheight': 15,
\ 'max_candidates': 100, \ 'max_candidates': 100,
\ 'no_auto_resize': 1, \ 'no_auto_resize': 1,
\ 'vertical_preview': 1, \ 'vertical_preview': 1,
\ 'cursor_line_time': '0.10', \ 'cursor_line_time': '0.10',
\ 'hide_icon': 0, \ 'hide_icon': 0,
\ 'candidate-icon': ' ', \ 'candidate-icon': ' ',
\ 'marked_icon': '✓', \ 'marked_icon': '✓',
\ 'prompt' : '➭ ' \ 'prompt' : '➭ '
\ }) \ })
call unite#custom#profile('source/neobundle/update', 'context', { call unite#custom#profile('source/neobundle/update', 'context', {
\ 'start_insert' : 0, \ 'start_insert' : 0,
\ }) \ })
let g:unite_source_codesearch_ignore_case = 1 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_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_file_mru_time_format = '(%m-%d-%Y %H:%M:%S) '
@ -37,170 +37,170 @@ let g:unite_source_history_yank_enable=1
let g:unite_split_rule = 'botright' let g:unite_split_rule = 'botright'
let g:unite_winheight=25 let g:unite_winheight=25
let g:unite_source_grep_default_opts = '-iRHn' let g:unite_source_grep_default_opts = '-iRHn'
\ . " --exclude='tags'" \ . " --exclude='tags'"
\ . " --exclude='cscope*'" \ . " --exclude='cscope*'"
\ . " --exclude='*.svn*'" \ . " --exclude='*.svn*'"
\ . " --exclude='*.log*'" \ . " --exclude='*.log*'"
\ . " --exclude='*tmp*'" \ . " --exclude='*tmp*'"
\ . " --exclude-dir='**/tmp'" \ . " --exclude-dir='**/tmp'"
\ . " --exclude-dir='CVS'" \ . " --exclude-dir='CVS'"
\ . " --exclude-dir='.svn'" \ . " --exclude-dir='.svn'"
\ . " --exclude-dir='.git'" \ . " --exclude-dir='.git'"
\ . " --exclude-dir='node_modules'" \ . " --exclude-dir='node_modules'"
let g:unite_launch_apps = [ let g:unite_launch_apps = [
\ 'rake', \ 'rake',
\ 'make', \ 'make',
\ 'git pull', \ 'git pull',
\ 'git push'] \ 'git push']
let g:unite_source_menu_menus = get(g:,'unite_source_menu_menus',{}) let g:unite_source_menu_menus = get(g:,'unite_source_menu_menus',{})
let g:unite_source_menu_menus.git = { let g:unite_source_menu_menus.git = {
\ 'description' : ' gestionar repositorios git \ 'description' : ' gestionar repositorios git
\ ⌘ [espacio]g', \ ⌘ [espacio]g',
\} \}
let g:unite_source_menu_menus.git.command_candidates = [ let g:unite_source_menu_menus.git.command_candidates = [
\['▷ tig ⌘ ,gt', \['▷ tig ⌘ ,gt',
\'normal ,gt'], \'normal ,gt'],
\['▷ git status (Fugitive) ⌘ ,gs', \['▷ git status (Fugitive) ⌘ ,gs',
\'Gstatus'], \'Gstatus'],
\['▷ git diff (Fugitive) ⌘ ,gd', \['▷ git diff (Fugitive) ⌘ ,gd',
\'Gdiff'], \'Gdiff'],
\['▷ git commit (Fugitive) ⌘ ,gc', \['▷ git commit (Fugitive) ⌘ ,gc',
\'Gcommit'], \'Gcommit'],
\['▷ git log (Fugitive) ⌘ ,gl', \['▷ git log (Fugitive) ⌘ ,gl',
\'exe "silent Glog | Unite quickfix"'], \'exe "silent Glog | Unite quickfix"'],
\['▷ git blame (Fugitive) ⌘ ,gb', \['▷ git blame (Fugitive) ⌘ ,gb',
\'Gblame'], \'Gblame'],
\['▷ git stage (Fugitive) ⌘ ,gw', \['▷ git stage (Fugitive) ⌘ ,gw',
\'Gwrite'], \'Gwrite'],
\['▷ git checkout (Fugitive) ⌘ ,go', \['▷ git checkout (Fugitive) ⌘ ,go',
\'Gread'], \'Gread'],
\['▷ git rm (Fugitive) ⌘ ,gr', \['▷ git rm (Fugitive) ⌘ ,gr',
\'Gremove'], \'Gremove'],
\['▷ git mv (Fugitive) ⌘ ,gm', \['▷ git mv (Fugitive) ⌘ ,gm',
\'exe "Gmove " input("destino: ")'], \'exe "Gmove " input("destino: ")'],
\['▷ git push (Fugitive, salida por buffer) ⌘ ,gp', \['▷ git push (Fugitive, salida por buffer) ⌘ ,gp',
\'Git! push'], \'Git! push'],
\['▷ git pull (Fugitive, salida por buffer) ⌘ ,gP', \['▷ git pull (Fugitive, salida por buffer) ⌘ ,gP',
\'Git! pull'], \'Git! pull'],
\['▷ git prompt (Fugitive, salida por buffer) ⌘ ,gi', \['▷ git prompt (Fugitive, salida por buffer) ⌘ ,gi',
\'exe "Git! " input("comando git: ")'], \'exe "Git! " input("comando git: ")'],
\['▷ git cd (Fugitive)', \['▷ git cd (Fugitive)',
\'Gcd'], \'Gcd'],
\] \]
"=============================================================================== "===============================================================================
" HTTP Status Code Definitions " 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 = {'description': 'HTTP status code definitions <leader>sc'}
let g:unite_source_menu_menus.StatusCodeDefinitions.command_candidates = [ let g:unite_source_menu_menus.StatusCodeDefinitions.command_candidates = [
\['➤ 100 Continue ', 'echo "Continue"'], \['➤ 100 Continue ', 'echo "Continue"'],
\['➤ 101 Switching Protocols ', 'echo "Switching Protocols"'], \['➤ 101 Switching Protocols ', 'echo "Switching Protocols"'],
\['➤ 200 OK ', 'echo "OK"'], \['➤ 200 OK ', 'echo "OK"'],
\['➤ 201 Created ', 'echo "Created"'], \['➤ 201 Created ', 'echo "Created"'],
\['➤ 202 Accepted ', 'echo "Accepted"'], \['➤ 202 Accepted ', 'echo "Accepted"'],
\['➤ 203 Non-Authoritative Information ', 'echo "Non-Authoritative Information"'], \['➤ 203 Non-Authoritative Information ', 'echo "Non-Authoritative Information"'],
\['➤ 204 No Content ', 'echo "No Content"'], \['➤ 204 No Content ', 'echo "No Content"'],
\['➤ 205 Reset Content ', 'echo "Reset Content"'], \['➤ 205 Reset Content ', 'echo "Reset Content"'],
\['➤ 206 Partial Content ', 'echo "Partial Content"'], \['➤ 206 Partial Content ', 'echo "Partial Content"'],
\['➤ 300 Multiple Choices ', 'echo "Multiple Choices"'], \['➤ 300 Multiple Choices ', 'echo "Multiple Choices"'],
\['➤ 301 Moved Permanently ', 'echo "Moved Permanently"'], \['➤ 301 Moved Permanently ', 'echo "Moved Permanently"'],
\['➤ 302 Found ', 'echo "Found"'], \['➤ 302 Found ', 'echo "Found"'],
\['➤ 303 See Other ', 'echo "See Other"'], \['➤ 303 See Other ', 'echo "See Other"'],
\['➤ 304 Not Modified ', 'echo "Not Modified"'], \['➤ 304 Not Modified ', 'echo "Not Modified"'],
\['➤ 305 Use Proxy ', 'echo "Use Proxy"'], \['➤ 305 Use Proxy ', 'echo "Use Proxy"'],
\['➤ 307 Temporary Redirect ', 'echo "Temporary Redirect"'], \['➤ 307 Temporary Redirect ', 'echo "Temporary Redirect"'],
\['➤ 400 Bad Request ', 'echo "Bad Request"'], \['➤ 400 Bad Request ', 'echo "Bad Request"'],
\['➤ 401 Unauthorized ', 'echo "Unauthorized"'], \['➤ 401 Unauthorized ', 'echo "Unauthorized"'],
\['➤ 402 Payment Required ', 'echo "Payment Required"'], \['➤ 402 Payment Required ', 'echo "Payment Required"'],
\['➤ 403 Forbidden ', 'echo "Forbidden"'], \['➤ 403 Forbidden ', 'echo "Forbidden"'],
\['➤ 404 Not Found ', 'echo "Not Found"'], \['➤ 404 Not Found ', 'echo "Not Found"'],
\['➤ 405 Method Not Allowed ', 'echo "Method Not Allowed"'], \['➤ 405 Method Not Allowed ', 'echo "Method Not Allowed"'],
\['➤ 406 Not Acceptable ', 'echo "Not Acceptable"'], \['➤ 406 Not Acceptable ', 'echo "Not Acceptable"'],
\['➤ 407 Proxy Authentication Required ', 'echo "Proxy Authoritative Required"'], \['➤ 407 Proxy Authentication Required ', 'echo "Proxy Authoritative Required"'],
\['➤ 408 Request Timeout ', 'echo "Request Timeout"'], \['➤ 408 Request Timeout ', 'echo "Request Timeout"'],
\['➤ 409 Conflict ', 'echo "Conflict"'], \['➤ 409 Conflict ', 'echo "Conflict"'],
\['➤ 410 Gone ', 'echo "Gone"'], \['➤ 410 Gone ', 'echo "Gone"'],
\['➤ 411 Length Required ', 'echo "Length Required"'], \['➤ 411 Length Required ', 'echo "Length Required"'],
\['➤ 412 Precondition Failed ', 'echo "Precondition Failed"'], \['➤ 412 Precondition Failed ', 'echo "Precondition Failed"'],
\['➤ 413 Request Entity Too Large ', 'echo "Request Entity Too Large"'], \['➤ 413 Request Entity Too Large ', 'echo "Request Entity Too Large"'],
\['➤ 414 Request-URI Too Long ', 'echo "Request-URI Too Long"'], \['➤ 414 Request-URI Too Long ', 'echo "Request-URI Too Long"'],
\['➤ 415 Unsupported Media Type ', 'echo "Unsupported Media Type"'], \['➤ 415 Unsupported Media Type ', 'echo "Unsupported Media Type"'],
\['➤ 416 Requested Range Not Satisfiable ', 'echo "Requested Range Not Satisfiable"'], \['➤ 416 Requested Range Not Satisfiable ', 'echo "Requested Range Not Satisfiable"'],
\['➤ 417 Expectation Failed ', 'echo "Expectation Failed"'], \['➤ 417 Expectation Failed ', 'echo "Expectation Failed"'],
\['➤ 422 Unprocessable Entity ', 'echo "Unprocessable Entity"'], \['➤ 422 Unprocessable Entity ', 'echo "Unprocessable Entity"'],
\['➤ 500 Internal Server Error ', 'echo "Internal Server Error"'], \['➤ 500 Internal Server Error ', 'echo "Internal Server Error"'],
\['➤ 501 Not Implemented ', 'echo "Not Implemented"'], \['➤ 501 Not Implemented ', 'echo "Not Implemented"'],
\['➤ 502 Bad Gateway ', 'echo "Bad Gateway"'], \['➤ 502 Bad Gateway ', 'echo "Bad Gateway"'],
\['➤ 503 Service Unavailable ', 'echo "Service Unavailable"'], \['➤ 503 Service Unavailable ', 'echo "Service Unavailable"'],
\['➤ 504 Gateway Timeout ', 'echo "Gateway Timeout"'], \['➤ 504 Gateway Timeout ', 'echo "Gateway Timeout"'],
\['➤ 505 HTTP Version Not Supported ', 'echo "HTTP Version Not Supported"'], \['➤ 505 HTTP Version Not Supported ', 'echo "HTTP Version Not Supported"'],
\] \]
nnoremap <silent><leader>sc :Unite -silent -winheight=17 -start-insert menu:StatusCodeDefinitions<CR> nnoremap <silent><leader>sc :Unite -silent -winheight=17 -start-insert menu:StatusCodeDefinitions<CR>
let g:unite_source_grep_max_candidates = 200 let g:unite_source_grep_max_candidates = 200
if executable('hw') if executable('hw')
" Use hw (highway) " Use hw (highway)
" https://github.com/tkengo/highway " https://github.com/tkengo/highway
let g:unite_source_grep_command = 'hw' let g:unite_source_grep_command = 'hw'
let g:unite_source_grep_default_opts = '--no-group --no-color' let g:unite_source_grep_default_opts = '--no-group --no-color'
let g:unite_source_grep_recursive_opt = '' let g:unite_source_grep_recursive_opt = ''
elseif executable('ag') elseif executable('ag')
" Use ag (the silver searcher) " Use ag (the silver searcher)
" https://github.com/ggreer/the_silver_searcher " https://github.com/ggreer/the_silver_searcher
let g:unite_source_grep_command = 'ag' let g:unite_source_grep_command = 'ag'
let g:unite_source_grep_default_opts = let g:unite_source_grep_default_opts =
\ '-i --line-numbers --nocolor --nogroup --hidden --ignore ' . \ '-i --line-numbers --nocolor --nogroup --hidden --ignore ' .
\ '''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr''' \ '''.hg'' --ignore ''.svn'' --ignore ''.git'' --ignore ''.bzr'''
let g:unite_source_grep_recursive_opt = '' let g:unite_source_grep_recursive_opt = ''
elseif executable('pt') elseif executable('pt')
" Use pt (the platinum searcher) " Use pt (the platinum searcher)
" https://github.com/monochromegane/the_platinum_searcher " https://github.com/monochromegane/the_platinum_searcher
let g:unite_source_grep_command = 'pt' let g:unite_source_grep_command = 'pt'
let g:unite_source_grep_default_opts = '--nogroup --nocolor' let g:unite_source_grep_default_opts = '--nogroup --nocolor'
let g:unite_source_grep_recursive_opt = '' let g:unite_source_grep_recursive_opt = ''
elseif executable('ack-grep') elseif executable('ack-grep')
" Use ack " Use ack
" http://beyondgrep.com/ " http://beyondgrep.com/
let g:unite_source_grep_command = 'ack-grep' let g:unite_source_grep_command = 'ack-grep'
let g:unite_source_grep_default_opts = let g:unite_source_grep_default_opts =
\ '-i --no-heading --no-color -k -H' \ '-i --no-heading --no-color -k -H'
let g:unite_source_grep_recursive_opt = '' let g:unite_source_grep_recursive_opt = ''
elseif executable('ack') elseif executable('ack')
let g:unite_source_grep_command = '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_default_opts = '-i --no-heading --no-color -k -H'
let g:unite_source_grep_recursive_opt = '' let g:unite_source_grep_recursive_opt = ''
elseif executable('jvgrep') elseif executable('jvgrep')
" Use jvgrep " Use jvgrep
" https://github.com/mattn/jvgrep " https://github.com/mattn/jvgrep
let g:unite_source_grep_command = '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_default_opts = '-i --exclude ''\.(git|svn|hg|bzr)'''
let g:unite_source_grep_recursive_opt = '-R' let g:unite_source_grep_recursive_opt = '-R'
elseif executable('beagrep') elseif executable('beagrep')
" Use beagrep " Use beagrep
" https://github.com/baohaojun/beagrep " https://github.com/baohaojun/beagrep
let g:unite_source_grep_command = 'beagrep' let g:unite_source_grep_command = 'beagrep'
endif endif
let g:unite_source_rec_async_command = let g:unite_source_rec_async_command =
\ ['ag', '--follow', '--nocolor', '--nogroup', \ ['ag', '--follow', '--nocolor', '--nogroup',
\ '--hidden', '-g', ''] \ '--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>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>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> 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', { call unite#custom#profile('file_rec/async,file_rec/git', 'context', {
\ 'start_insert' : 1, \ 'start_insert' : 1,
\ 'quit' : 1, \ 'quit' : 1,
\ 'split' : 1, \ 'split' : 1,
\ 'keep_focus' : 1, \ 'keep_focus' : 1,
\ 'winheight' : 20, \ 'winheight' : 20,
\ }) \ })
call unite#custom#source('file_rec/async', 'ignore_globs',['*.png','.git/','*.ttf']) 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>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>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>ubf :<C-u>Unite -buffer-name=buffer buffer<cr>
nnoremap <silent><leader>utb :<C-u>Unite -buffer-name=buffer_tab buffer_tab<cr> nnoremap <silent><leader>utb :<C-u>Unite -buffer-name=buffer_tab buffer_tab<cr>
call unite#custom#profile('buffer,buffer_tab', 'context', { call unite#custom#profile('buffer,buffer_tab', 'context', {
\ 'start_insert' : 0, \ 'start_insert' : 0,
\ 'quit' : 1, \ 'quit' : 1,
\ 'keep_focus' : 1, \ 'keep_focus' : 1,
\ }) \ })
nnoremap <silent><leader>um :<C-u>Unite -start-insert mapping<CR> nnoremap <silent><leader>um :<C-u>Unite -start-insert mapping<CR>
nnoremap <C-h> :<C-u>Unite -start-insert help<CR> nnoremap <C-h> :<C-u>Unite -start-insert help<CR>
nnoremap <silent> g<C-h> :<C-u>UniteWithCursorWord help<CR> nnoremap <silent> g<C-h> :<C-u>UniteWithCursorWord help<CR>
@ -235,54 +235,56 @@ nnoremap <silent><Leader>ls :Unite -silent -ignorecase -winheight=17 -start-inse
nnoremap <silent><Leader>lm :Unite -silent -ignorecase -winheight=17 -start-insert menu:MpvPlayer<CR> nnoremap <silent><Leader>lm :Unite -silent -ignorecase -winheight=17 -start-insert menu:MpvPlayer<CR>
call zvim#util#loadMusics() call zvim#util#loadMusics()
augroup unite_buffer_feature augroup unite_buffer_feature
autocmd FileType unite call s:unite_my_settings() autocmd FileType unite call s:unite_my_settings()
augroup END augroup END
function! s:unite_my_settings() function! s:unite_my_settings()
" Overwrite settings. " Overwrite settings.
" Play nice with supertab " Play nice with supertab
let b:SuperTabDisabled=1 let b:SuperTabDisabled=1
" Enable navigation with control-j and control-k in insert mode " Enable navigation with control-j and control-k in insert mode
imap <buffer> <C-n> <Plug>(unite_select_next_line) imap <buffer> <C-n> <Plug>(unite_select_next_line)
nmap <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) imap <buffer> <C-p> <Plug>(unite_select_previous_line)
nmap <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> jj <Plug>(unite_insert_leave)
"imap <buffer> <C-w> <Plug>(unite_delete_backward_path) "imap <buffer> <C-w> <Plug>(unite_delete_backward_path)
imap <buffer><expr> j unite#smart_map('j', '') imap <buffer><expr> j unite#smart_map('j', '')
imap <buffer> <TAB> <Plug>(unite_select_next_line) imap <buffer> <TAB> <Plug>(unite_select_next_line)
imap <buffer> <C-w> <Plug>(unite_delete_backward_path) imap <buffer> <C-w> <Plug>(unite_delete_backward_path)
imap <buffer> ' <Plug>(unite_quick_match_default_action) imap <buffer> ' <Plug>(unite_quick_match_default_action)
nmap <buffer> ' <Plug>(unite_quick_match_default_action) nmap <buffer> ' <Plug>(unite_quick_match_default_action)
imap <buffer><expr> x imap <buffer><expr> x
\ unite#smart_map('x', "\<Plug>(unite_quick_match_choose_action)") \ unite#smart_map('x', "\<Plug>(unite_quick_match_choose_action)")
nmap <buffer> 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) nmap <buffer> <C-z> <Plug>(unite_toggle_transpose_window)
imap <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) imap <buffer> <C-y> <Plug>(unite_narrowing_path)
nmap <buffer> <C-y> <Plug>(unite_narrowing_path) nmap <buffer> <C-y> <Plug>(unite_narrowing_path)
nmap <buffer> <C-e> <Plug>(unite_toggle_auto_preview) nmap <buffer> <C-e> <Plug>(unite_toggle_auto_preview)
imap <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) nmap <buffer> <C-r> <Plug>(unite_narrowing_input_history)
imap <buffer> <C-r> <Plug>(unite_narrowing_input_history) imap <buffer> <C-r> <Plug>(unite_narrowing_input_history)
nnoremap <silent><buffer><expr> l nnoremap <silent><buffer><expr> l
\ unite#smart_map('l', unite#do_action('default')) \ unite#smart_map('l', unite#do_action('default'))
let unite = unite#get_current_unite() let unite = unite#get_current_unite()
if unite.profile_name ==# 'search' if unite.profile_name ==# 'search'
nnoremap <silent><buffer><expr> r unite#do_action('replace') nnoremap <silent><buffer><expr> r unite#do_action('replace')
else else
nnoremap <silent><buffer><expr> r unite#do_action('rename') nnoremap <silent><buffer><expr> r unite#do_action('rename')
endif endif
nnoremap <silent><buffer><expr> cd unite#do_action('lcd') nnoremap <silent><buffer><expr> cd unite#do_action('lcd')
nnoremap <buffer><expr> S unite#mappings#set_current_filters( nnoremap <buffer><expr> S unite#mappings#set_current_filters(
\ empty(unite#mappings#get_current_filters()) ? \ empty(unite#mappings#get_current_filters()) ?
\ ['sorter_reverse'] : []) \ ['sorter_reverse'] : [])
" Runs "split" action by <C-s>. " Runs "split" action by <C-s>.
imap <silent><buffer><expr> <C-s> unite#do_action('split') imap <silent><buffer><expr> <C-s> unite#do_action('split')
endfunction endfunction
" vim:set et sw=2:

View File

@ -5,30 +5,30 @@ let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tmuxline#enabled = 1 let g:airline#extensions#tmuxline#enabled = 1
let g:Powerline_sybols = 'unicode' let g:Powerline_sybols = 'unicode'
if g:spacevim_buffer_index_type < 3 if g:spacevim_buffer_index_type < 3
let g:airline#extensions#tabline#buffer_idx_mode = 1 let g:airline#extensions#tabline#buffer_idx_mode = 1
let g:airline#extensions#tabline#buffer_idx_format = {} let g:airline#extensions#tabline#buffer_idx_format = {}
for s:i in range(9) for s:i in range(9)
call extend(g:airline#extensions#tabline#buffer_idx_format, call extend(g:airline#extensions#tabline#buffer_idx_format,
\ {s:i : SpaceVim#api#import('messletters').bubble_num(s:i, \ {s:i : SpaceVim#api#import('messletters').bubble_num(s:i,
\ g:spacevim_buffer_index_type). ' '}) \ g:spacevim_buffer_index_type). ' '})
endfor endfor
unlet s:i unlet s:i
elseif g:spacevim_buffer_index_type == 3 elseif g:spacevim_buffer_index_type == 3
let g:airline#extensions#tabline#buffer_idx_mode = 1 let g:airline#extensions#tabline#buffer_idx_mode = 1
elseif g:spacevim_buffer_index_type == 4 elseif g:spacevim_buffer_index_type == 4
let g:airline#extensions#tabline#buffer_idx_mode = 1 let g:airline#extensions#tabline#buffer_idx_mode = 1
let g:airline#extensions#tabline#buffer_idx_format = { let g:airline#extensions#tabline#buffer_idx_format = {
\ '0': '0 ', \ '0': '0 ',
\ '1': '1 ', \ '1': '1 ',
\ '2': '2 ', \ '2': '2 ',
\ '3': '3 ', \ '3': '3 ',
\ '4': '4 ', \ '4': '4 ',
\ '5': '5 ', \ '5': '5 ',
\ '6': '6 ', \ '6': '6 ',
\ '7': '7 ', \ '7': '7 ',
\ '8': '8 ', \ '8': '8 ',
\ '9': '9 ' \ '9': '9 '
\} \}
endif endif
let g:airline#extensions#tabline#formatter = 'spacevim' let g:airline#extensions#tabline#formatter = 'spacevim'
@ -50,7 +50,7 @@ nmap <leader>9 <Plug>AirlineSelectTab9
nmap <leader>- <Plug>AirlineSelectPrevTab nmap <leader>- <Plug>AirlineSelectPrevTab
nmap <leader>+ <Plug>AirlineSelectNextTab nmap <leader>+ <Plug>AirlineSelectNextTab
if !exists('g:airline_symbols') if !exists('g:airline_symbols')
let g:airline_symbols = {} let g:airline_symbols = {}
endif endif
" unicode symbols " unicode symbols
@ -65,14 +65,14 @@ let g:airline_symbols.whitespace = 'Ξ'
" powerline symbols " powerline symbols
if get(g:, 'airline_powerline_fonts', 0) if get(g:, 'airline_powerline_fonts', 0)
let g:airline_left_sep = '' let g:airline_left_sep = ''
let g:airline_left_alt_sep = '' let g:airline_left_alt_sep = ''
let g:airline_right_sep = '' let g:airline_right_sep = ''
let g:airline_right_alt_sep = '' let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = '' let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = '' let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = '' let g:airline_symbols.linenr = ''
let g:airline_symbols.maxlinenr= '' let g:airline_symbols.maxlinenr= ''
endif endif
let g:airline#extensions#tabline#show_tab_nr = 1 let g:airline#extensions#tabline#show_tab_nr = 1
let g:airline#extensions#tabline#tab_nr_type= 2 let g:airline#extensions#tabline#tab_nr_type= 2
@ -80,6 +80,8 @@ let g:airline#extensions#tabline#show_tab_type = 1
let g:airline#extensions#tabline#buffers_label = 'BUFFERS' let g:airline#extensions#tabline#buffers_label = 'BUFFERS'
let g:airline#extensions#tabline#tabs_label = 'TABS' let g:airline#extensions#tabline#tabs_label = 'TABS'
if g:spacevim_enable_os_fileformat_icon if g:spacevim_enable_os_fileformat_icon
let s:sys = SpaceVim#api#import('system') let s:sys = SpaceVim#api#import('system')
let g:airline_section_y = " %{&fenc . ' ' . SpaceVim#api#import('system').fileformat()} " let g:airline_section_y = " %{&fenc . ' ' . SpaceVim#api#import('system').fileformat()} "
endif endif
" vim:set et sw=2:

View File

@ -1,34 +1,36 @@
let g:ref_source_webdict_sites = { let g:ref_source_webdict_sites = {
\ 'je': { \ 'je': {
\ 'url': 'http://dictionary.infoseek.ne.jp/jeword/%s', \ 'url': 'http://dictionary.infoseek.ne.jp/jeword/%s',
\ }, \ },
\ 'ej': { \ 'ej': {
\ 'url': 'http://dictionary.infoseek.ne.jp/ejword/%s', \ 'url': 'http://dictionary.infoseek.ne.jp/ejword/%s',
\ }, \ },
\ 'wiki': { \ 'wiki': {
\ 'url': 'http://ja.wikipedia.org/wiki/%s', \ 'url': 'http://ja.wikipedia.org/wiki/%s',
\ }, \ },
\ 'cn': { \ 'cn': {
\ 'url': 'http://www.iciba.com/%s', \ 'url': 'http://www.iciba.com/%s',
\ }, \ },
\ 'wikipedia:en':{'url': 'http://en.wikipedia.org/wiki/%s', }, \ 'wikipedia:en':{'url': 'http://en.wikipedia.org/wiki/%s', },
\ 'bing':{'url': 'http://cn.bing.com/search?q=%s', }, \ 'bing':{'url': 'http://cn.bing.com/search?q=%s', },
\ } \ }
let g:ref_source_webdict_sites.default = 'cn' let g:ref_source_webdict_sites.default = 'cn'
"let g:ref_source_webdict_cmd='lynx -dump -nonumbers %s' "let g:ref_source_webdict_cmd='lynx -dump -nonumbers %s'
"let g:ref_source_webdict_cmd='w3m -dump %s' "let g:ref_source_webdict_cmd='w3m -dump %s'
"The filter on the output. Remove the first few lines "The filter on the output. Remove the first few lines
function! g:ref_source_webdict_sites.je.filter(output) function! g:ref_source_webdict_sites.je.filter(output)
return join(split(a:output, "\n")[15 :], "\n") return join(split(a:output, "\n")[15 :], "\n")
endfunction endfunction
function! g:ref_source_webdict_sites.ej.filter(output) function! g:ref_source_webdict_sites.ej.filter(output)
return join(split(a:output, "\n")[15 :], "\n") return join(split(a:output, "\n")[15 :], "\n")
endfunction endfunction
function! g:ref_source_webdict_sites.wiki.filter(output) function! g:ref_source_webdict_sites.wiki.filter(output)
return join(split(a:output, "\n")[17 :], "\n") return join(split(a:output, "\n")[17 :], "\n")
endfunction endfunction
nnoremap <Leader>rj :<C-u>Ref webdict je<Space> nnoremap <Leader>rj :<C-u>Ref webdict je<Space>
nnoremap <Leader>re :<C-u>Ref webdict ej<Space> nnoremap <Leader>re :<C-u>Ref webdict ej<Space>
nnoremap <Leader>rc :<C-u>Ref webdict cn<Space> nnoremap <Leader>rc :<C-u>Ref webdict cn<Space>
nnoremap <Leader>rw :<C-u>Ref webdict wikipedia:en<Space> nnoremap <Leader>rw :<C-u>Ref webdict wikipedia:en<Space>
nnoremap <Leader>rb :<C-u>Ref webdict bing<Space> nnoremap <Leader>rb :<C-u>Ref webdict bing<Space>
" vim:set et sw=2:

View File

@ -1,32 +1,32 @@
let g:startify_custom_header = get(g:, 'startify_custom_header', [ let g:startify_custom_header = get(g:, 'startify_custom_header', [
\'', \'',
\'', \'',
\' /###### /## /##/## ', \' /###### /## /##/## ',
\' /##__ ## | ## | #|__/ ', \' /##__ ## | ## | #|__/ ',
\' | ## \__/ /###### /###### /####### /######| ## | ##/##/######/#### ', \' | ## \__/ /###### /###### /####### /######| ## | ##/##/######/#### ',
\' | ###### /##__ ##|____ ##/##_____//##__ #| ## / ##| #| ##_ ##_ ##', \' | ###### /##__ ##|____ ##/##_____//##__ #| ## / ##| #| ##_ ##_ ##',
\' \____ #| ## \ ## /######| ## | ########\ ## ##/| #| ## \ ## \ ##', \' \____ #| ## \ ## /######| ## | ########\ ## ##/| #| ## \ ## \ ##',
\' /## \ #| ## | ##/##__ #| ## | ##_____/ \ ###/ | #| ## | ## | ##', \' /## \ #| ## | ##/##__ #| ## | ##_____/ \ ###/ | #| ## | ## | ##',
\' | ######| #######| ######| ######| ####### \ #/ | #| ## | ## | ##', \' | ######| #######| ######| ######| ####### \ #/ | #| ## | ## | ##',
\' \______/| ##____/ \_______/\_______/\_______/ \_/ |__|__/ |__/ |__/', \' \______/| ##____/ \_______/\_______/\_______/ \_/ |__|__/ |__/ |__/',
\' | ## ', \' | ## ',
\' | ## ', \' | ## ',
\' |__/ ', \' |__/ ',
\' version : ' . g:spacevim_version . ' by : spacevim.org', \' version : ' . g:spacevim_version . ' by : spacevim.org',
\'', \'',
\ ]) \ ])
let g:startify_session_dir = $HOME . '/.data/' . ( has('nvim') ? 'nvim' : 'vim' ) . '/session' let g:startify_session_dir = $HOME . '/.data/' . ( has('nvim') ? 'nvim' : 'vim' ) . '/session'
let g:startify_files_number = 6 let g:startify_files_number = 6
let g:startify_list_order = [ let g:startify_list_order = [
\ [' My most recently used files in the current directory:'], \ [' My most recently used files in the current directory:'],
\ 'dir', \ 'dir',
\ [' My most recently used files:'], \ [' My most recently used files:'],
\ 'files', \ 'files',
\ [' These are my sessions:'], \ [' These are my sessions:'],
\ 'sessions', \ 'sessions',
\ [' These are my bookmarks:'], \ [' These are my bookmarks:'],
\ 'bookmarks', \ 'bookmarks',
\ ] \ ]
"let g:startify_bookmarks = [ {'c': '~/.vimrc'}, '~/.zshrc' ] "let g:startify_bookmarks = [ {'c': '~/.vimrc'}, '~/.zshrc' ]
let g:startify_update_oldfiles = 1 let g:startify_update_oldfiles = 1
let g:startify_disable_at_vimenter = 1 let g:startify_disable_at_vimenter = 1
@ -36,18 +36,20 @@ let g:startify_session_persistence = 1
let g:startify_change_to_dir = 0 let g:startify_change_to_dir = 0
"let g:startify_change_to_vcs_root = 0 " vim-rooter has same feature "let g:startify_change_to_vcs_root = 0 " vim-rooter has same feature
let g:startify_skiplist = [ let g:startify_skiplist = [
\ 'COMMIT_EDITMSG', \ 'COMMIT_EDITMSG',
\ escape(fnamemodify(resolve($VIMRUNTIME), ':p'), '\') .'doc', \ escape(fnamemodify(resolve($VIMRUNTIME), ':p'), '\') .'doc',
\ 'bundle/.*/doc', \ 'bundle/.*/doc',
\ ] \ ]
fu! <SID>startify_mapping() fu! <SID>startify_mapping()
if getcwd() == $VIM || getcwd() == expand('~') if getcwd() == $VIM || getcwd() == expand('~')
nnoremap <silent><buffer> <c-p> :<c-u>CtrlP ~\DotFiles<cr> nnoremap <silent><buffer> <c-p> :<c-u>CtrlP ~\DotFiles<cr>
endif endif
endf endf
augroup startify_map augroup startify_map
au! au!
autocmd FileType startify nnoremap <buffer><F2> <Nop> autocmd FileType startify nnoremap <buffer><F2> <Nop>
autocmd FileType startify call <SID>startify_mapping() autocmd FileType startify call <SID>startify_mapping()
autocmd FileType startify set scrolloff=0 autocmd FileType startify set scrolloff=0
augroup END augroup END
" vim:set et sw=2:

View File

@ -10,69 +10,71 @@ let g:vimfiler_readonly_file_icon = '*'
let g:vimfiler_marked_file_icon = '√' let g:vimfiler_marked_file_icon = '√'
"let g:vimfiler_preview_action = 'auto_preview' "let g:vimfiler_preview_action = 'auto_preview'
let g:vimfiler_ignore_pattern = [ let g:vimfiler_ignore_pattern = [
\ '^\.git$', \ '^\.git$',
\ '^\.DS_Store$', \ '^\.DS_Store$',
\ '^\.init\.vim-rplugin\~$', \ '^\.init\.vim-rplugin\~$',
\ '^\.netrwhist$', \ '^\.netrwhist$',
\ '\.class$' \ '\.class$'
\] \]
if has('mac') if has('mac')
let g:vimfiler_quick_look_command = let g:vimfiler_quick_look_command =
\ '/Applications//Sublime\ Text.app/Contents/MacOS/Sublime\ Text' \ '/Applications//Sublime\ Text.app/Contents/MacOS/Sublime\ Text'
else else
let g:vimfiler_quick_look_command = 'gloobus-preview' let g:vimfiler_quick_look_command = 'gloobus-preview'
endif endif
try try
call vimfiler#custom#profile('default', 'context', { call vimfiler#custom#profile('default', 'context', {
\ 'explorer' : 1, \ 'explorer' : 1,
\ 'winwidth' : g:spacevim_sidebar_width, \ 'winwidth' : g:spacevim_sidebar_width,
\ 'winminwidth' : 30, \ 'winminwidth' : 30,
\ 'toggle' : 1, \ 'toggle' : 1,
\ 'auto_expand': 1, \ 'auto_expand': 1,
\ 'direction' : 'rightbelow', \ 'direction' : 'rightbelow',
\ 'parent': 0, \ 'parent': 0,
\ 'explorer_columns' : 'gitstatus', \ 'explorer_columns' : 'gitstatus',
\ 'status' : 1, \ 'status' : 1,
\ 'safe' : 0, \ 'safe' : 0,
\ 'split' : 1, \ 'split' : 1,
\ 'hidden': 1, \ 'hidden': 1,
\ 'no_quit' : 1, \ 'no_quit' : 1,
\ 'force_hide' : 0, \ 'force_hide' : 0,
\ }) \ })
catch catch
endtry endtry
augroup vfinit augroup vfinit
au! au!
autocmd FileType vimfiler call s:vimfilerinit() autocmd FileType vimfiler call s:vimfilerinit()
autocmd BufEnter * if (winnr('$') == 1 && &filetype ==# 'vimfiler') | autocmd BufEnter * if (winnr('$') == 1 && &filetype ==# 'vimfiler') |
\ q | endif \ q | endif
augroup END augroup END
function! s:vimfilerinit() function! s:vimfilerinit()
set nonumber set nonumber
set norelativenumber set norelativenumber
silent! nunmap <buffer> <Space> silent! nunmap <buffer> <Space>
silent! nunmap <buffer> <C-l> silent! nunmap <buffer> <C-l>
silent! nunmap <buffer> <C-j> silent! nunmap <buffer> <C-j>
silent! nunmap <buffer> E silent! nunmap <buffer> E
silent! nunmap <buffer> gr silent! nunmap <buffer> gr
silent! nunmap <buffer> gf silent! nunmap <buffer> gf
silent! nunmap <buffer> - silent! nunmap <buffer> -
silent! nunmap <buffer> s silent! nunmap <buffer> s
nnoremap <silent><buffer> gr :<C-u>Denite grep:<C-R>=<SID>selected()<CR> -buffer-name=grep<CR> nnoremap <silent><buffer> gr :<C-u>Denite grep:<C-R>=<SID>selected()<CR> -buffer-name=grep<CR>
nnoremap <silent><buffer> gf :<C-u>Denite file_rec:<C-R>=<SID>selected()<CR><CR> nnoremap <silent><buffer> gf :<C-u>Denite file_rec:<C-R>=<SID>selected()<CR><CR>
nnoremap <silent><buffer> gd :<C-u>call <SID>change_vim_current_dir()<CR> nnoremap <silent><buffer> gd :<C-u>call <SID>change_vim_current_dir()<CR>
nnoremap <silent><buffer><expr> sg vimfiler#do_action('vsplit') nnoremap <silent><buffer><expr> sg vimfiler#do_action('vsplit')
nnoremap <silent><buffer><expr> sv vimfiler#do_action('split') nnoremap <silent><buffer><expr> sv vimfiler#do_action('split')
nnoremap <silent><buffer><expr> st vimfiler#do_action('tabswitch') nnoremap <silent><buffer><expr> st vimfiler#do_action('tabswitch')
nmap <buffer> gx <Plug>(vimfiler_execute_vimfiler_associated) nmap <buffer> gx <Plug>(vimfiler_execute_vimfiler_associated)
nmap <buffer> ' <Plug>(vimfiler_toggle_mark_current_line) nmap <buffer> ' <Plug>(vimfiler_toggle_mark_current_line)
nmap <buffer> v <Plug>(vimfiler_quick_look) nmap <buffer> v <Plug>(vimfiler_quick_look)
nmap <buffer> p <Plug>(vimfiler_preview_file) nmap <buffer> p <Plug>(vimfiler_preview_file)
nmap <buffer> V <Plug>(vimfiler_clear_mark_all_lines) nmap <buffer> V <Plug>(vimfiler_clear_mark_all_lines)
nmap <buffer> i <Plug>(vimfiler_switch_to_history_directory) nmap <buffer> i <Plug>(vimfiler_switch_to_history_directory)
nmap <buffer> <Tab> <Plug>(vimfiler_switch_to_other_window) nmap <buffer> <Tab> <Plug>(vimfiler_switch_to_other_window)
nmap <buffer> <C-r> <Plug>(vimfiler_redraw_screen) nmap <buffer> <C-r> <Plug>(vimfiler_redraw_screen)
endf endf
" vim:set et sw=2:

View File

@ -24,22 +24,23 @@ CONTENTS *SpaceVim-contents*
2. autocomplete..................................|SpaceVim-autocomplete| 2. autocomplete..................................|SpaceVim-autocomplete|
3. checkers....................................|SpaceVim-layer-checkers| 3. checkers....................................|SpaceVim-layer-checkers|
4. colorscheme....................................|SpaceVim-colorscheme| 4. colorscheme....................................|SpaceVim-colorscheme|
5. exprfold....................................|SpaceVim-layer-exprfold| 5. core#tabline............................|SpaceVim-layer-core-tabline|
6. incsearch..................................|SpaceVim-layer-incsearch| 6. exprfold....................................|SpaceVim-layer-exprfold|
7. indentmove................................|SpaceVim-layer-indentmove| 7. incsearch..................................|SpaceVim-layer-incsearch|
8. lang#c........................................|SpaceVim-layer-lang-c| 8. indentmove................................|SpaceVim-layer-indentmove|
9. lang#elixir..............................|SpaceVim-layer-lang-elixir| 9. lang#c........................................|SpaceVim-layer-lang-c|
10. lang#go.....................................|SpaceVim-layer-lang-go| 10. lang#elixir.............................|SpaceVim-layer-lang-elixir|
11. lang#java.................................|SpaceVim-layer-lang-java| 11. lang#go.....................................|SpaceVim-layer-lang-go|
12. lang#ocaml...............................|SpaceVim-layer-lang-ocaml| 12. lang#java.................................|SpaceVim-layer-lang-java|
13. lang#php...................................|SpaceVim-layer-lang-php| 13. lang#ocaml...............................|SpaceVim-layer-lang-ocaml|
14. lang#puppet.............................|SpaceVim-layer-lang-puppet| 14. lang#php...................................|SpaceVim-layer-lang-php|
15. lang#python.............................|SpaceVim-layer-lang-python| 15. lang#puppet.............................|SpaceVim-layer-lang-puppet|
16. lang#rust.................................|SpaceVim-layer-lang-rust| 16. lang#python.............................|SpaceVim-layer-lang-python|
17. lang#xml...................................|SpaceVim-layer-lang-xml| 17. lang#rust.................................|SpaceVim-layer-lang-rust|
18. operator...................................|SpaceVim-layer-operator| 18. lang#xml...................................|SpaceVim-layer-lang-xml|
19. shell.........................................|SpaceVim-layer-shell| 19. operator...................................|SpaceVim-layer-operator|
20. tmux...........................................|SpaceVim-layer-tmux| 20. shell.........................................|SpaceVim-layer-shell|
21. tmux...........................................|SpaceVim-layer-tmux|
5. FAQ........................................................|SpaceVim-faq| 5. FAQ........................................................|SpaceVim-faq|
============================================================================== ==============================================================================
@ -458,6 +459,11 @@ https://github.com/SpaceVim/SpaceVim/issues/209#issuecomment-280545818
zellner zellner
< <
==============================================================================
CORE#TABLINE *SpaceVim-layer-core-tabline*
This layer provides default tabline for SpaceVim
============================================================================== ==============================================================================
EXPRFOLD *SpaceVim-layer-exprfold* EXPRFOLD *SpaceVim-layer-exprfold*

View File

@ -0,0 +1,227 @@
---
title: "Conventions"
permalink: "/conventions"
---
# Conventions
## Content
- [viml coding style guild](#viml-coding-style-guide)
## Viml coding style guide
### Portability
Vim is highly configurable. Users can change many of the default settings, including the case sensitivity, the regular expression rules, the substitution rules, and more. In order for your vimscript to work for all users, follow these guidelines:
#### Strings
**Prefer single quoted strings**
Double quoted strings are semantically different in vimscript, and you probably don't want them (they break regexes).
Use double quoted strings when you need an escape sequence (such as "\n") or if you know it doesn't matter and you need to embed single quotes.
#### Matching Strings
**Use the =~# or =~? operator families over the =~ family.**
The matching behavior depends upon the user's ignorecase and smartcase settings and on whether you compare them with the =~, =~#, or =~? family of operators. Use the =~# and =~? operator families explicitly when comparing strings unless you explicitly need to honor the user's case sensitivity settings.
#### Regular Expressions
**Prefix all regexes with one of \m, \v, \M, or \V.**
In addition to the case sensitivity settings, regex behavior depends upon the user's nomagic setting. To make regexes act like nomagic and noignorecase are set, prepend all regexes with one of \m, \v, \M, or \V.
You are welcome to use other magic levels (\v) and case sensitivities (\c) so long as they are intentional and explicit.
#### Dangerous commands
**Avoid commands with unintended side effects.**
Avoid using :s[ubstitute] as it moves the cursor and prints error messages. Prefer functions (such as search()) better suited to scripts.
The meaning of the g flag depends upon the gdefault setting. If you do use :substitute you must save gdefault, set it to 0 or 1, perform the substitution, and then restore it.
For many vim commands, functions exist that do the same thing with fewer side effects. See :help functions() for a list of built-in functions.
#### Fragile commands
**Avoid commands that rely on user settings.**
Always use normal! instead of normal. The latter depends upon the user's key mappings and could do anything.
Avoid :s[ubstitute], as its behavior depends upon a number of local settings.
The same applies to other commands not listed here.
#### Catching Exceptions
**Match error codes, not error text.**
Error text may be locale dependant.
### General Guidelines
#### Messaging
**Message the user infrequently.**
Loud scripts are annoying. Message the user only when:
- A long-running process has kicked off.
- An error has occurred.
#### Type checking
**Use strict and explicit checks where possible.**
Vimscript has unsafe, unintuitive behavior when dealing with some types. For instance, 0 == 'foo' evaluates to true.
Use strict comparison operators where possible. When comparing against a string literal, use the is# operator. Otherwise, prefer maktaba#value#IsEqual or check type() explicitly.
Check variable types explicitly before using them. Use functions from maktaba#ensure, or check maktaba#value or type() and throw your own errors.
Use :unlet for variables that may change types, particularly those assigned inside loops.
#### Python
**Use sparingly.**
Use python only when it provides critical functionality, for example when writing threaded code.
#### Other Languages
**Use vimscript instead.**
Avoid using other scripting languages such as ruby and lua. We can not guarantee that the end user's vim has been compiled with support for non-vimscript languages.
#### Plugin layout
**Organize functionality into modular plugins**
Group your functionality as a plugin, unified in one directory (or code repository) which shares your plugin's name (with a "vim-" prefix or ".vim" suffix if desired). It should be split into plugin/, autoload/, etc. subdirectories as necessary, and it should declare metadata in the addon-info.json format (see the VAM documentation for details).
#### Functions
**In the autoload/ directory, defined with [!] and [abort].**
Autoloading allows functions to be loaded on demand, which makes startuptime faster and enforces function namespacing.
Script-local functions are welcome, but should also live in autoload/ and be called by autoloaded functions.
Non-library plugins should expose commands instead of functions. Command logic should be extracted into functions and autoloaded.
[!] allows developers to reload their functions without complaint.
[abort] forces the function to halt when it encounters an error.
#### Commands
**In the plugin/commands.vim or under the ftplugin/ directory, defined without [!].**
General commands go in plugin/commands.vim. Filetype-specific commands go in ftplugin/.
Excluding [!] prevents your plugin from silently clobbering existing commands. Command conflicts should be resolved by the user.
#### Autocommands
**Place them in plugin/autocmds.vim, within augroups.**
Place all autocommands in augroups.
The augroup name should be unique. It should either be, or be prefixed with, the plugin name.
Clear the augroup with autocmd! before defining new autocommands in the augroup. This makes your plugin re-entrable.
#### Mappings
**Place them in plugin/mappings.vim, using maktaba#plugin#MapPrefix to get a prefix.**
All key mappings should be defined in plugin/mappings.vim.
Partial mappings (see :help using-<Plug>.) should be defined in plugin/plugs.vim.
**Always use the noremap family of commands.**
Your plugins generally shouldn't introduce mappings, but if they do, the map command respects the users existing mappings and could do anything.
#### Errors
When using catch, match the error code rather than the error text.
#### Settings
**Change settings locally**
Use :setlocal and &l: instead of :set and & unless you have explicit reason to do otherwise.
### Style
Follow google style conventions. When in doubt, treat vimscript style like python style.
#### Whitespace
**Similar to python.**
- Use two spaces for indents
- Do not use tabs
- Use spaces around operators
This does not apply to arguments to commands.
let s:variable = "concatenated " . "strings"
command -range=% MyCommand
- Do not introduce trailing whitespace
You need not go out of your way to remove it.
Trailing whitespace is allowed in mappings which prep commands for user input, such as "noremap <leader>gf :grep -f ".
- Restrict lines to 80 columns wide
- Indent continued lines by four spaces
- Do not align arguments of commands
```diff
+command -bang MyCommand call myplugin#foo()
+command MyCommand2 call myplugin#bar()
-command -bang MyCommand call myplugin#foo()
-command MyCommand2 call myplugin#bar()
```
#### Line Continuations
- Prefer line continuations on semantic boundaries.
```diff
+command SomeLongCommand
+ \ call some#function()
-command SomeLongCommand call
- \ some#function()
```
- Place one space after the backslash denoting a line continuation.
When continuing a multi-line command a pipe can be substituted for this space as necessary, as follows:
```viml
autocommand BufEnter <buffer>
\ if !empty(s:var)
\| call some#function()
\|else
\| call some#function(s:var)
\|endif
```
- Do not continue multi-line commands when you can avoid it. Prefer function calls.
#### Naming
In general, use plugin-names-like-this, FunctionNamesLikeThis, CommandNamesLikeThis, augroup_names_like_this, variable_names_like_this.
Always prefix variables with their scope.
- plugin-names-like-this
Keep them short and sweet.
- FunctionNamesLikeThis
- Prefix script-local functions with s:
- Autoloaded functions may not have a scope prefix.
- Do not create global functions. Use autoloaded functions instead.
- CommandNamesLikeThis
Prefer succinct command names over common command prefixes.
- variable_names_like_this
Augroup names count as variables for naming purposes.
- Prefix all variables with their scope.
- Global variables with g:
- Script-local variables with s:
- Function arguments with a:
- Function-local variables with l:
- Vim-predefined variables with v:
- Buffer-local variables with b:
- g:, s:, and a: must always be used.
- b: changes the variable semantics; use it when you want buffer-local semantics.
- l: and v: should be used for consistency, future proofing, and to avoid subtle bugs. They are not strictly required. Add them in new code but dont go out of your way to add them elsewhere.
## Thanks:
- link : https://google.github.io/styleguide/vimscriptguide.xml
- link : https://google.github.io/styleguide/vimscriptfull.xml
- link : https://github.com/noahfrederick/vim-scripting-style-guide/blob/master/doc/scripting-style.txt

View File

@ -483,23 +483,55 @@ in the root of your project. `.SpaceVim.d/` will also be added into runtimepath.
here is an example config file for SpaceVim: here is an example config file for SpaceVim:
```viml ```vim
" set the options of SpaceVim " Here are some basic customizations, please refer to the ~/.SpaceVim.d/init.vim
let g:spacevim_colorscheme = 'solarized' " file for all possible options:
let g:spacevim_default_indent = 3
let g:spacevim_max_column = 80
" setting layers, load 'lang#java' layer. " Change the default directory where all miscellaneous persistent files go.
call SpaceVim#layers#load('lang#java') " By default it is ~/.cache/vimfiles.
let g:spacevim_plugin_bundle_dir = '~/.cache/vimfiles'
" add custom plugins. " set SpaceVim colorscheme
let g:spacevim_colorscheme = 'jellybeans'
" Set plugin manager, you want to use, default is dein.vim
let g:spacevim_plugin_manager = 'dein' " neobundle or dein or vim-plug
" use space as `<Leader>`
let mapleader = "\<space>"
" Set windows shortcut leader [Window], default is `s`
let g:spacevim_windows_leader = 's'
" Set unite work flow shortcut leader [Unite], default is `f`
let g:spacevim_unite_leader = 'f'
" By default, language specific plugins are not loaded. This can be changed
" with the following, then the plugins for go development will be loaded.
call SpaceVim#layers#load('lang#go')
" loaded ui layer
call SpaceVim#layers#load('ui')
" If there is a particular plugin you don't like, you can define this
" variable to disable them entirely:
let g:spacevim_disabled_plugins=[
\ ['junegunn/fzf.vim'],
\ ]
" If you want to add some custom plugins, use these options:
let g:spacevim_custom_plugins = [ let g:spacevim_custom_plugins = [
\ ['plasticboy/vim-markdown', {'on_ft' : 'markdown'}], \ ['plasticboy/vim-markdown', {'on_ft' : 'markdown'}],
\ ['wsdjeg/GitHub.vim'], \ ['wsdjeg/GitHub.vim'],
\ ] \ ]
" custom mappings: " set the guifont
nnoremap <c-l> :Ydc<cr> let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11'
``` ```
Comprehensive documentation is available for each layer by <kbd>:h SpaceVim</kbd>.
<!-- plublic links --> <!-- plublic links -->
[dein.vim]: https://github.com/Shougo/dein.vim [dein.vim]: https://github.com/Shougo/dein.vim

View File

@ -0,0 +1 @@
" vim:set et sw=2

View File

@ -1,4 +1,6 @@
if exists("g:GuiLoaded") if exists('g:GuiLoaded')
exe 'Guifont! DejaVu Sans Mono for Powerline:h11:cANSI:qDRAFT' exe 'Guifont! DejaVu Sans Mono for Powerline:h11:cANSI:qDRAFT'
endif endif
" vim:set et sw=2:

3
vimrc
View File

@ -1,4 +1,5 @@
" Note: Skip initialization for vim-tiny or vim-small. " Note: Skip initialization for vim-tiny or vim-small.
if 1 if 1
execute 'source' fnamemodify(expand('<sfile>'), ':h').'/config/main.vim' execute 'source' fnamemodify(expand('<sfile>'), ':h').'/config/main.vim'
endif endif
" vim:set et sw=2