diff --git a/.SpaceVim.d/autoload/SpaceVim/dev/releases.vim b/.SpaceVim.d/autoload/SpaceVim/dev/releases.vim index ea17c2afb..591f1c491 100644 --- a/.SpaceVim.d/autoload/SpaceVim/dev/releases.vim +++ b/.SpaceVim.d/autoload/SpaceVim/dev/releases.vim @@ -32,7 +32,7 @@ function! s:get_list_of_PRs() abort let prs = [] for i in range(1, 10) let issues = List('SpaceVim','SpaceVim', i) - call extend(prs, filter(issues, 'v:val["number"] > 768 && v:val["number"] < 966')) + call extend(prs, filter(issues, 'v:val["number"] > 966 && v:val["number"] < 1203')) endfor return filter(prs, 'has_key(v:val, "pull_request")') endfunction diff --git a/.gitignore b/.gitignore index 5bcf5a417..87f8e67b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ doc/tags +.ropeproject/ wiki/.git *.class .floo diff --git a/README.md b/README.md index 61dfd80de..6f5b0cc66 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [](https://travis-ci.org/SpaceVim/SpaceVim) [](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/dev) [](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev) - + [](LICENSE) [](doc/SpaceVim.txt) [](http://isitmaintained.com/project/SpaceVim/SpaceVim "Average time to resolve an issue") diff --git a/appveyor.yml b/appveyor.yml index 4e57523d4..16b6d6480 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 0.6.0-dev.{build} +version: 0.7.0-dev.{build} pull_requests: do_not_increment_build_number: true skip_tags: true diff --git a/autoload/SpaceVim.vim b/autoload/SpaceVim.vim index ec9dc33f0..91110e2c5 100644 --- a/autoload/SpaceVim.vim +++ b/autoload/SpaceVim.vim @@ -27,7 +27,7 @@ "" " Version of SpaceVim , this value can not be changed. scriptencoding utf-8 -let g:spacevim_version = '0.6.0-dev' +let g:spacevim_version = '0.7.0-dev' lockvar g:spacevim_version "" " Change the default indentation of SpaceVim. Default is 2. @@ -207,6 +207,10 @@ let g:spacevim_statusline_right_sections = ['fileformat', 'cursorpos', 'percenta " Enable/Disable unicode symbols in statusline let g:spacevim_statusline_unicode_symbols = 1 "" +" Enable/Disable language specific leader, by default you can use `,` ket +" instead of `SPC` `l`. +let g:spacevim_enable_language_specific_leader = 1 +"" " Enable/Disable display mode. Default is 0, mode will be " displayed in statusline. To enable this feature: " > @@ -252,7 +256,7 @@ let g:spacevim_warning_symbol = 'โ ' " > " let g:spacevim_info_symbol = 'i' " < -let g:spacevim_info_symbol = '๐' +let g:spacevim_info_symbol = SpaceVim#api#import('messletters').circled_letter('i') "" " Set the SpaceVim cursor shape in the terminal. " > @@ -602,11 +606,11 @@ function! SpaceVim#end() abort if !empty(g:spacevim_denite_leader) call SpaceVim#mapping#leader#defindDeniteLeader(g:spacevim_denite_leader) endif + call SpaceVim#mapping#g#init() + call SpaceVim#mapping#z#init() call SpaceVim#mapping#leader#defindglobalMappings() call SpaceVim#mapping#leader#defindKEYs() call SpaceVim#mapping#space#init() - call SpaceVim#mapping#g#init() - call SpaceVim#mapping#z#init() if !SpaceVim#mapping#guide#has_configuration() let g:leaderGuide_map = {} call SpaceVim#mapping#guide#register_prefix_descriptions('', 'g:leaderGuide_map') diff --git a/autoload/SpaceVim/api/data/base64.vim b/autoload/SpaceVim/api/data/base64.vim index d333cab75..1eb3815e3 100644 --- a/autoload/SpaceVim/api/data/base64.vim +++ b/autoload/SpaceVim/api/data/base64.vim @@ -1,7 +1,8 @@ let s:self = {} +let s:CMP = SpaceVim#api#import('vim#compatible') -if has('python') +if s:CMP.has('python') " @vimlint(EVL103, 1, a:text) function! s:self.encode(text) abort py import vim @@ -116,7 +117,7 @@ endif -function! SpaceVim#api#data#base64#get() +function! SpaceVim#api#data#base64#get() abort return deepcopy(s:self) diff --git a/autoload/SpaceVim/api/file.vim b/autoload/SpaceVim/api/file.vim index 688a9b7e3..06940c88b 100644 --- a/autoload/SpaceVim/api/file.vim +++ b/autoload/SpaceVim/api/file.vim @@ -15,20 +15,20 @@ let s:file_node_extensions = { \ 'styl' : '๎', \ 'scss' : '๎', \ 'htm' : '๎', - \ 'html' : '๎', + \ 'html' : '๎ถ', \ 'erb' : '๎', \ 'slim' : '๎', \ 'ejs' : '๎', \ 'wxml' : '๎', - \ 'css' : '๎', + \ 'css' : '๎', \ 'less' : '๎', \ 'wxss' : '๎', - \ 'md' : '๎', - \ 'markdown' : '๎', + \ 'md' : '๏', + \ 'markdown' : '๏', \ 'json' : '๎', - \ 'js' : '๎', + \ 'js' : '๎', \ 'jsx' : '๎', - \ 'rb' : '๎', + \ 'rb' : '๎', \ 'php' : '๎', \ 'py' : '๎', \ 'pyc' : '๎', @@ -64,7 +64,7 @@ let s:file_node_extensions = { \ 'mli' : 'ฮป', \ 'diff' : '๎จ', \ 'db' : '๎', - \ 'sql' : '๎', + \ 'sql' : '๏ฒ', \ 'dump' : '๎', \ 'clj' : '๎จ', \ 'cljc' : '๎จ', @@ -95,6 +95,7 @@ let s:file_node_extensions = { \ 'psd' : '๎ธ', \ 'psb' : '๎ธ', \ 'ts' : '๎จ', + \ 'tsx' : '๎จ', \ 'jl' : '๎ค' \} diff --git a/autoload/SpaceVim/api/vim/compatible.vim b/autoload/SpaceVim/api/vim/compatible.vim index b18e1c760..619c2716a 100644 --- a/autoload/SpaceVim/api/vim/compatible.vim +++ b/autoload/SpaceVim/api/vim/compatible.vim @@ -3,6 +3,8 @@ function! SpaceVim#api#vim#compatible#get() abort \ 'execute' : '', \ 'system' : '', \ 'systemlist' : '', + \ 'version' : '', + \ 'has' : '', \ 'globpath' : '', \ }, \ "function('s:' . v:key)" @@ -86,4 +88,56 @@ else endfunction endif +if has('nvim') + function! s:version() abort + let v = api_info().version + return v.major . '.' . v.minor . '.' . v.patch + endfunction +else + function! s:version() abort + redir => l:msg + silent! execute ':version' + redir END + return s:parser(matchstr(l:msg,'\(Included\ patches:\ \)\@<=[^\n]*')) + endfunction + function! s:parser(version) abort + let v_list = split(a:version, ',') + if len(v_list) == 1 + let patch = split(v_list[0], '-')[1] + let v = v:version[0:0] . '.' . v:version[2:2] . '.' . patch + else + let v = v:version[0:0] . '.' . v:version[2:2] . '(' . a:version . ')' + endif + return v + endfunction +endif + + +function! s:has(feature) abort + if a:feature ==# 'python' + try + py import vim + return 1 + catch + return 0 + endtry + elseif a:feature ==# 'python3' + try + py3 import vim + return 1 + catch + return 0 + endtry + elseif a:feature ==# 'pythonx' + try + pyx import vim + return 1 + catch + return 0 + endtry + else + return has(a:feature) + endif +endfunction + " vim:set et sw=2 cc=80: diff --git a/autoload/SpaceVim/api/vim/tab.vim b/autoload/SpaceVim/api/vim/tab.vim index 886522ef1..2df7352cf 100644 --- a/autoload/SpaceVim/api/vim/tab.vim +++ b/autoload/SpaceVim/api/vim/tab.vim @@ -4,6 +4,7 @@ let s:self._tree = {} function! s:self._update() abort let tabnr = tabpagenr('$') + let self._tree = {} for i in range(1, tabnr) let buffers = tabpagebuflist(i) let self._tree[i] = buffers diff --git a/autoload/SpaceVim/autocmds.vim b/autoload/SpaceVim/autocmds.vim index 83cd75770..09b1e1159 100644 --- a/autoload/SpaceVim/autocmds.vim +++ b/autoload/SpaceVim/autocmds.vim @@ -77,6 +77,7 @@ function! SpaceVim#autocmds#init() abort autocmd FocusGained * call s:reload_touchpad_status() endif autocmd BufWritePost *.vim call s:generate_doc() + autocmd ColorScheme * call SpaceVim#api#import('vim#highlight').hide_in_normal('EndOfBuffer') autocmd ColorScheme gruvbox call s:fix_gruvbox() autocmd VimEnter * call SpaceVim#autocmds#VimEnter() autocmd User RooterChDir call SpaceVim#plugins#projectmanager#RootchandgeCallback() diff --git a/autoload/SpaceVim/issue.vim b/autoload/SpaceVim/issue.vim index 812afbcf0..5e7bfd32d 100644 --- a/autoload/SpaceVim/issue.vim +++ b/autoload/SpaceVim/issue.vim @@ -1,3 +1,5 @@ +let s:CMP = SpaceVim#api#import('vim#compatible') + function! SpaceVim#issue#report() abort call s:open() endfunction @@ -18,8 +20,8 @@ function! s:template() abort \ '## Environment Information', \ '', \ '- OS:' . SpaceVim#api#import('system').name(), - \ '- vim version:' . (has('nvim') ? '' : v:version), - \ '- neovim version:' . (has('nvim') ? v:version : ''), + \ '- vim version:' . (has('nvim') ? '' : s:CMP.version()), + \ '- neovim version:' . (has('nvim') ? s:CMP.version() : ''), \ '', \ '## The reproduce ways from Vim starting (Required!)', \ '', diff --git a/autoload/SpaceVim/layers/checkers.vim b/autoload/SpaceVim/layers/checkers.vim index f3692d07b..de0b9e15e 100644 --- a/autoload/SpaceVim/layers/checkers.vim +++ b/autoload/SpaceVim/layers/checkers.vim @@ -5,6 +5,7 @@ let s:SIG = SpaceVim#api#import('vim#signatures') let s:STRING = SpaceVim#api#import('data#string') + function! SpaceVim#layers#checkers#plugins() abort let plugins = [] @@ -19,6 +20,14 @@ function! SpaceVim#layers#checkers#plugins() abort return plugins endfunction +let s:last_echoed_error = has('timers') + +function! SpaceVim#layers#checkers#set_variable(var) abort + + let s:show_cursor_error = get(a:var, 'show_cursor_error', 1) + +endfunction + function! SpaceVim#layers#checkers#config() abort let g:neomake_cursormoved_delay = get(g:, 'neomake_cursormoved_delay', 300) @@ -40,25 +49,28 @@ function! SpaceVim#layers#checkers#config() abort call SpaceVim#mapping#space#def('nnoremap', ['e', '.'], 'call call(' \ . string(s:_function('s:error_transient_state')) . ', [])', \ 'error-transient-state', 1) - + call SpaceVim#mapping#space#def('nnoremap', ['t', 's'], 'call call(' + \ . string(s:_function('s:toggle_syntax_checker')) . ', [])', + \ 'toggle syntax checker', 1) augroup SpaceVim_layer_checker autocmd! if g:spacevim_enable_neomake autocmd User NeomakeFinished nested \ let &l:statusline = SpaceVim#layers#core#statusline#get(1) + if s:last_echoed_error + " when move cursor, the error message will be shown below current line + " after a delay + autocmd CursorMoved * call <SID>neomake_cursor_move_delay() - " when move cursor, the error message will be shown below current line - " after a delay - autocmd CursorMoved * call <SID>neomake_cursor_move_delay() - - " when switch to Insert mode, stop timer and clear the signature - if exists('##CmdLineEnter') - autocmd InsertEnter,WinLeave,CmdLineEnter * - \ call <SID>neomake_signatures_clear() - autocmd CmdLineEnter * - \ call <SID>neomake_signatures_clear() | redraw - else - autocmd InsertEnter,WinLeave * call <SID>neomake_signatures_clear() + " when switch to Insert mode, stop timer and clear the signature + if exists('##CmdLineEnter') + autocmd InsertEnter,WinLeave,CmdLineEnter * + \ call <SID>neomake_signatures_clear() + autocmd CmdLineEnter * + \ call <SID>neomake_signatures_clear() | redraw + else + autocmd InsertEnter,WinLeave * call <SID>neomake_signatures_clear() + endif endif elseif g:spacevim_enable_ale autocmd User ALELint @@ -117,6 +129,12 @@ function! s:verify_syntax_setup() abort endif endfunction +function! s:toggle_syntax_checker() abort + call SpaceVim#layers#core#statusline#toggle_section('syntax checking') + call SpaceVim#layers#core#statusline#toggle_mode('syntax-checking') + verbose NeomakeToggle +endfunction + function! s:error_transient_state() abort if g:spacevim_enable_neomake let num_errors = neomake#statusline#LoclistCounts() diff --git a/autoload/SpaceVim/layers/core/banner.vim b/autoload/SpaceVim/layers/core/banner.vim index 007495140..3975a78c1 100644 --- a/autoload/SpaceVim/layers/core/banner.vim +++ b/autoload/SpaceVim/layers/core/banner.vim @@ -2,21 +2,21 @@ scriptencoding utf-8 function! SpaceVim#layers#core#banner#config() abort let g:_spacevim_welcome_banners = [ \ [ - \'', - \'', - \' /###### /## /##/## ', - \' /##__ ## | ## | #|__/ ', - \' | ## \__/ /###### /###### /####### /######| ## | ##/##/######/#### ', - \' | ###### /##__ ##|____ ##/##_____//##__ #| ## / ##| #| ##_ ##_ ##', - \' \____ #| ## \ ## /######| ## | ########\ ## ##/| #| ## \ ## \ ##', - \' /## \ #| ## | ##/##__ #| ## | ##_____/ \ ###/ | #| ## | ## | ##', - \' | ######| #######| ######| ######| ####### \ #/ | #| ## | ## | ##', - \' \______/| ##____/ \_______/\_______/\_______/ \_/ |__|__/ |__/ |__/', - \' | ## ', - \' | ## ', - \' |__/ ', - \' version : ' . g:spacevim_version . ' by : spacevim.org', - \'', + \ '', + \ '', + \ ' /###### /## /##/## ', + \ ' /##__ ## | ## | #|__/ ', + \ ' | ## \__/ /###### /###### /####### /######| ## | ##/##/######/#### ', + \ ' | ###### /##__ ##|____ ##/##_____//##__ #| ## / ##| #| ##_ ##_ ##', + \ ' \____ #| ## \ ## /######| ## | ########\ ## ##/| #| ## \ ## \ ##', + \ ' /## \ #| ## | ##/##__ #| ## | ##_____/ \ ###/ | #| ## | ## | ##', + \ ' | ######| #######| ######| ######| ####### \ #/ | #| ## | ## | ##', + \ ' \______/| ##____/ \_______/\_______/\_______/ \_/ |__|__/ |__/ |__/', + \ ' | ## ', + \ ' | ## ', + \ ' |__/ ', + \ ' version : ' . g:spacevim_version . ' by : spacevim.org', + \ '', \ ], \ [ \ ' โโโโโ', @@ -27,7 +27,7 @@ function! SpaceVim#layers#core#banner#config() abort \ ' โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโปโปโ', \ ' โโโโโโโโโโโ', \ ' โโโโโโโโโโโ', - \' version : ' . g:spacevim_version . ' by : spacevim.org', + \ ' version : ' . g:spacevim_version . ' by : spacevim.org', \ ], \ [ \ '', @@ -93,8 +93,7 @@ function! SpaceVim#layers#core#banner#config() abort \ ' โโโโโโโโโโโ โ โ โ โโโโโโโโโโโ โโโโโโโโโโโ โ โโโโโโโโโโโ โ โ ', \ ' ', \ ' version : ' . g:spacevim_version . ' by : spacevim.org', - \ '', - \ ], + \ '', ], \ [ \ '', \ '', @@ -249,6 +248,140 @@ function! SpaceVim#layers#core#banner#config() abort \ ' version : ' . g:spacevim_version . ' by : spacevim.org', \ '', \ ], + \ [ + \ '', + \ '', + \ ' _____ __ ___ ', + \ ' / ____| \ \ / (_) ', + \ ' | (___ _ __ __ _ ___ __\ \ / / _ _ __ ___ ', + \ ' \___ \| \`_ \ / _` |/ __/ _ \ \/ / | | `_ ` _ \ ', + \ ' ____) | |_) | (_| | (_| __/\ / | | | | | | | ', + \ ' |_____/| .__/ \__,_|\___\___| \/ |_|_| |_| |_| ', + \ ' | | ', + \ ' |_| ', + \ '', + \ ' version : ' . g:spacevim_version . ' by : spacevim.org', + \ '', + \ ], + \ [ + \ '', + \ '', + \ ' # # ### # # ### ##### ###### ####### ##### ####### ', + \ ' # # # ## ## # # # # # # # # # ', + \ ' # # # # # # # # # # # # # # ', + \ ' # # # # # # # ##### ###### ##### ##### # ', + \ ' # # # # # # # # # # # # ', + \ ' # # # # # # # # # # # # # # ', + \ ' # ### # # ### ##### ###### ####### ##### # ', + \ '', + \ ' version : ' . g:spacevim_version . ' by : spacevim.org', + \ '', + \ ], + \ [ + \ '', + \ '', + \ ' VVVVVVVV VVVVVVVVIIIIIIIIIIMMMMMMMM MMMMMMMM ', + \ ' V::::::V V::::::VI::::::::IM:::::::M M:::::::M ', + \ ' V::::::V V::::::VI::::::::IM::::::::M M::::::::M ', + \ ' V::::::V V::::::VII::::::IIM:::::::::M M:::::::::M ', + \ ' V:::::V V:::::V I::::I M::::::::::M M::::::::::M ', + \ ' V:::::V V:::::V I::::I M:::::::::::M M:::::::::::M ', + \ ' V:::::V V:::::V I::::I M:::::::M::::M M::::M:::::::M ', + \ ' V:::::V V:::::V I::::I M::::::M M::::M M::::M M::::::M ', + \ ' V:::::V V:::::V I::::I M::::::M M::::M::::M M::::::M ', + \ ' V:::::V V:::::V I::::I M::::::M M:::::::M M::::::M ', + \ ' V:::::V:::::V I::::I M::::::M M:::::M M::::::M ', + \ ' V:::::::::V I::::I M::::::M MMMMM M::::::M ', + \ ' V:::::::V II::::::IIM::::::M M::::::M ', + \ ' V:::::V I::::::::IM::::::M M::::::M ', + \ ' V:::V I::::::::IM::::::M M::::::M ', + \ ' VVV IIIIIIIIIIMMMMMMMM MMMMMMMM ', + \ '', + \ ' version : ' . g:spacevim_version . ' by : spacevim.org', + \ '', + \ ], + \ [ + \ '', + \ '', + \ ' _ _ _____ ______ _____ _ ______ _______ _ _______ ', + \ ' | | | (_____) ___ \ (_____) | | (____ \(_______) | | (_______) ', + \ ' | | | | _ | | _ | | _ \ \ ____) )_____ \ \ _ ', + \ ' \ \/ / | | | || || | | | \ \ | __ (| ___) \ \| | ', + \ ' \ / _| |_| || || | _| |_ _____) ) | |__) ) |_____ _____) ) |_____ ', + \ ' \/ (_____)_||_||_| (_____|______/ |______/|_______|______/ \______) ', + \ '', + \ ' version : ' . g:spacevim_version . ' by : spacevim.org', + \ '', + \ ], + \ [ + \ '', + \ '', + \ ' .##.....##.####.........########.##.....##.########.########..########...#### ', + \ ' .##.....##..##.............##....##.....##.##.......##.....##.##.........#### ', + \ ' .##.....##..##.............##....##.....##.##.......##.....##.##.........#### ', + \ ' .#########..##...####......##....#########.######...########..######......##. ', + \ ' .##.....##..##...####......##....##.....##.##.......##...##...##............. ', + \ ' .##.....##..##....##.......##....##.....##.##.......##....##..##.........#### ', + \ ' .##.....##.####..##........##....##.....##.########.##.....##.########...#### ', + \ '', + \ ' version : ' . g:spacevim_version . ' by : spacevim.org', + \ '', + \ ], + \ [ + \ '', + \ '', + \ ' __ __ __ __ __ __ __ __ ________ ', + \ ' / | / |/ | / |/ |/ | / \ / |/ | ', + \ ' $$ | $$ |$$/ _____ ____ $$ |$$/ $$ | __ ______ _______ $$ \ /$$ |$$$$$$$$/ ', + \ ' $$ | $$ |/ |/ \/ \ $$ |/ |$$ | / | / \ / | $$$ \ /$$$ |$$ |__ ', + \ ' $$ \ /$$/ $$ |$$$$$$ $$$$ | $$ |$$ |$$ |_/$$/ /$$$$$$ |/$$$$$$$/ $$$$ /$$$$ |$$ | ', + \ ' $$ /$$/ $$ |$$ | $$ | $$ | $$ |$$ |$$ $$< $$ $$ |$$ \ $$ $$ $$/$$ |$$$$$/ ', + \ ' $$ $$/ $$ |$$ | $$ | $$ | $$ |$$ |$$$$$$ \ $$$$$$$$/ $$$$$$ | $$ |$$$/ $$ |$$ |_____ ', + \ ' $$$/ $$ |$$ | $$ | $$ | $$ |$$ |$$ | $$ |$$ |/ $$/ $$ | $/ $$ |$$ | ', + \ ' $/ $$/ $$/ $$/ $$/ $$/ $$/ $$/ $$/ $$$$$$$/ $$$$$$$/ $$/ $$/ $$$$$$$$/ ', + \ '', + \ ' version : ' . g:spacevim_version . ' by : spacevim.org', + \ '', + \ ], + \ [ + \ '', + \ '', + \ ' _____ __ __ ___ __ __ ___ ___ ___ __ __ ___ __ __ ____ __ __ ____ ___ ___ ', + \ ' / ___/| | | / \ | |__| | | | | / _] | | | / \ | | || \ | | || || | | ', + \ ' ( \_ | | || || | | | | _ _ | / [_ | | || || | || D ) | | | | | | _ _ | ', + \ ' \__ || _ || O || | | | | \_/ || _] | ~ || O || | || / | | | | | | \_/ | ', + \ ' / \ || | || || ` ` | | | || [_ |___, || || : || \ | : | | | | | | ', + \ ' \ || | || | \ / | | || | | || || || . \ \ / | | | | | ', + \ ' \___||__|__| \___/ \_/\_/ |___|___||_____| |____/ \___/ \__,_||__|\_| \_/ |____||___|___| ', + \ '', + \ ' version : ' . g:spacevim_version . ' by : spacevim.org', + \ '', + \ ], + \ [ + \ '', + \ '', + \ ' โโโโโโโโโโโ โโโ โโโโโโโ โโโ โโโ โโโโ โโโโโโโโโโโโ โโโ โโโ โโโโโโโ โโโ โโโโโโโโโโ โโโ โโโโโโโโโโ โโโโ ', + \ ' โโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโ โโโโโ โโโโโโโโโโโโโ โโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโ โโโ โโโโโโโโโโโ โโโโโ ', + \ ' โโโโโโโโโโโโโโโโโโโ โโโโโโ โโ โโโ โโโโโโโโโโโโโโโโโ โโโโโโโ โโโ โโโโโโ โโโโโโโโโโโ โโโ โโโโโโโโโโโโโโโโโ ', + \ ' โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โโโโโ โโโ โโโโโโ โโโโโโโโโโโ โโโโ โโโโโโโโโโโโโโโโโโ ', + \ ' โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโ โโโ โโโ โโโโโโโโโโโ โโโ โโโโโโโโโโโโโโโโโโโโโ โโโ โโโโโโโ โโโโโโ โโโ โโโ ', + \ ' โโโโโโโโโโโ โโโ โโโโโโโ โโโโโโโโ โโโ โโโโโโโโโโโ โโโ โโโโโโโ โโโโโโโ โโโ โโโ โโโโโ โโโโโโ โโโ ', + \ '', + \ ' version : ' . g:spacevim_version . ' by : spacevim.org', + \ '', + \ ], + \ [ + \ '', + \ '', + \ ' . .--.--. . .--. --.--.---..---. . ..---. ', + \ ' \ / | |\ /| | ) | | | |\ /|| ', + \ ' \ / | | \/ | o |--: | | |--- | \/ ||--- ', + \ ' \ / | | | | ) | | | | || ', + \ ' ` --`--` ` o `--` --`-- ` `---` ` ``---` ', + \ '', + \ ' version : ' . g:spacevim_version . ' by : spacevim.org', + \ '', + \ ], \ ] endfunction diff --git a/autoload/SpaceVim/layers/core/statusline.vim b/autoload/SpaceVim/layers/core/statusline.vim index 0ce9d7d5d..6e31c89d2 100644 --- a/autoload/SpaceVim/layers/core/statusline.vim +++ b/autoload/SpaceVim/layers/core/statusline.vim @@ -32,7 +32,13 @@ let s:i_separators = { \ 'bar' : ["|", "|"], \ 'nil' : ['', ''], \ } -let s:loaded_modes = ['syntax-checking'] +let s:loaded_modes = [] +if index(g:spacevim_plugin_groups, 'checkers') != -1 + call add(s:loaded_modes, 'syntax-checking') +endif +if &cc ==# '80' + call add(s:loaded_modes, 'fill-column-indicator') +endif let s:modes = { \ 'center-cursor': { \ 'icon' : 'โ', diff --git a/autoload/SpaceVim/layers/core/tabline.vim b/autoload/SpaceVim/layers/core/tabline.vim index eaa056889..03bda4353 100644 --- a/autoload/SpaceVim/layers/core/tabline.vim +++ b/autoload/SpaceVim/layers/core/tabline.vim @@ -48,7 +48,7 @@ function! s:tabname(id) abort if g:spacevim_enable_tabline_filetype_icon let icon = s:file.fticon(fn) if !empty(icon) - let fn = icon . ' ' . fn + let fn = fn . ' ' . icon endif endif if empty(fn) @@ -109,7 +109,7 @@ function! SpaceVim#layers#core#tabline#get() abort if g:spacevim_enable_tabline_filetype_icon let icon = s:file.fticon(name) if !empty(icon) - let name = icon . ' ' . name + let name = name . ' ' . icon endif endif let t .= id . ' ' . name @@ -174,7 +174,7 @@ function! SpaceVim#layers#core#tabline#get() abort if g:spacevim_enable_tabline_filetype_icon let icon = s:file.fticon(name) if !empty(icon) - let name = icon . ' ' . name + let name = name . ' ' . icon endif endif let t .= id . ' ' . name diff --git a/autoload/SpaceVim/layers/cscope.vim b/autoload/SpaceVim/layers/cscope.vim new file mode 100644 index 000000000..aaf014dc9 --- /dev/null +++ b/autoload/SpaceVim/layers/cscope.vim @@ -0,0 +1,21 @@ +function! SpaceVim#layers#cscope#plugins() abort + let plugins = [ + \ ['SpaceVim/cscope.vim'], + \ ] + return plugins +endfunction + + +function! SpaceVim#layers#cscope#config() abort + let g:_spacevim_mappings_space.m.c = {'name' : '+cscope'} + call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'c'], 'Unite cscope/functions_called_by', 'find functions called by this function', 1) + call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'C'], 'Unite cscope/functions_calling', 'find functions calling this function', 1) + call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'd'], 'Unite cscope/global_definition', 'find global definition of a symbol', 1) + call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'r'], 'Unite cscope/find_this_symbol', 'find references of a symbol', 1) + call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'f'], 'Unite cscope/find_file', 'find files', 1) + call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'F'], 'Unite cscope/including_this_file', 'find files including this file', 1) + call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'e'], 'Unite cscope/egrep_pattern', 'Find this egrep pattern', 1) + call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 't'], 'Unite cscope/text_string', 'find this text string', 1) + call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', '='], 'Unite cscope/assignments_to_symbol', 'find assignments to this symbol', 1) + call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'i'], 'call CscopeUpdateDB()', 'create cscope index', 1) +endfunction diff --git a/autoload/SpaceVim/layers/default.vim b/autoload/SpaceVim/layers/default.vim index ccd118f1f..e031937a8 100644 --- a/autoload/SpaceVim/layers/default.vim +++ b/autoload/SpaceVim/layers/default.vim @@ -119,10 +119,10 @@ function! SpaceVim#layers#default#config() abort call SpaceVim#mapping#space#def('nnoremap', ['b', '.'], 'call call(' \ . string(s:_function('s:buffer_transient_state')) . ', [])', \ 'buffer transient state', 1) - call SpaceVim#mapping#space#def('nnoremap', ['b', 'd'], 'call SpaceVim#mapping#close_current_buffer()', 'kill-this-buffer', 1) + call SpaceVim#mapping#space#def('nnoremap', ['b', 'd'], 'call SpaceVim#mapping#close_current_buffer()', 'kill this buffer', 1) call SpaceVim#mapping#space#def('nnoremap', ['b', 'D'], \ 'call SpaceVim#mapping#kill_visible_buffer_choosewin()', - \ 'kill-this-buffer', 1) + \ 'kill the buffer by selecting', 1) call SpaceVim#mapping#space#def('nnoremap', ['b', '<C-d>'], 'call SpaceVim#mapping#clearBuffers()', 'kill-other-buffers', 1) call SpaceVim#mapping#space#def('nnoremap', ['b', 'c'], 'call SpaceVim#mapping#clear_saved_buffers()', 'clear all saved buffers', 1) call SpaceVim#mapping#space#def('nnoremap', ['b', 'e'], 'call call(' diff --git a/autoload/SpaceVim/layers/lang/c.vim b/autoload/SpaceVim/layers/lang/c.vim index c589c30b4..a290b2b7d 100644 --- a/autoload/SpaceVim/layers/lang/c.vim +++ b/autoload/SpaceVim/layers/lang/c.vim @@ -45,19 +45,21 @@ let s:clang_executable = 'clang' let s:SYSTEM = SpaceVim#api#import('system') function! SpaceVim#layers#lang#c#plugins() abort let plugins = [] - if g:spacevim_autocomplete_method ==# 'deoplete' - if s:use_libclang - call add(plugins, ['zchee/deoplete-clang']) + if !SpaceVim#layers#lsp#check_filetype('c') && !SpaceVim#layers#lsp#check_filetype('cpp') + if g:spacevim_autocomplete_method ==# 'deoplete' + if s:use_libclang + call add(plugins, ['zchee/deoplete-clang']) + else + call add(plugins, ['SpaceVim/deoplete-clang2']) + endif + elseif g:spacevim_autocomplete_method ==# 'ycm' + " no need extra plugins + elseif g:spacevim_autocomplete_method ==# 'completor' + " no need extra plugins + elseif g:spacevim_autocomplete_method ==# 'asyncomplete' else - call add(plugins, ['SpaceVim/deoplete-clang2']) + call add(plugins, ['Rip-Rip/clang_complete']) endif - elseif g:spacevim_autocomplete_method ==# 'ycm' - " no need extra plugins - elseif g:spacevim_autocomplete_method ==# 'completor' - " no need extra plugins - elseif g:spacevim_autocomplete_method ==# 'asyncomplete' - else - call add(plugins, ['Rip-Rip/clang_complete']) endif if has('nvim') if has('python3') @@ -100,6 +102,11 @@ function! SpaceVim#layers#lang#c#set_variable(var) abort let g:neomake_cpp_enabled_makers = ['clang'] let s:clang_executable = a:var.clang_executable endif + + if has_key(a:var, 'libclang_path') + let g:deoplete#sources#clang#libclang_path = a:var.libclang_path + let g:chromatica#libclang_path = a:var.libclang_path + endif endfunction function! s:language_specified_mappings() abort diff --git a/autoload/SpaceVim/layers/lang/dart.vim b/autoload/SpaceVim/layers/lang/dart.vim new file mode 100644 index 000000000..112b799f7 --- /dev/null +++ b/autoload/SpaceVim/layers/lang/dart.vim @@ -0,0 +1,42 @@ +function! SpaceVim#layers#lang#dart#plugins() abort + let plugins = [] + call add(plugins, ['dart-lang/dart-vim-plugin', {'merged' : 0}]) + if !SpaceVim#layers#lsp#check_filetype('dart') + call add(plugins, ['SpaceVim/deoplete-dart', {'merged' : 0}]) + endif + return plugins +endfunction + + +function! SpaceVim#layers#lang#dart#config() abort + call SpaceVim#plugins#runner#reg_runner('dart', 'dart %s') + call SpaceVim#mapping#space#regesit_lang_mappings('dart', funcref('s:language_specified_mappings')) + call SpaceVim#plugins#repl#reg('dart', ['pub', 'global', 'run', 'dart_repl']) +endfunction + +function! s:language_specified_mappings() abort + call SpaceVim#mapping#space#langSPC('nmap', ['l','r'], + \ 'call SpaceVim#plugins#runner#open()', + \ 'execute current file', 1) + let g:_spacevim_mappings_space.l.s = {'name' : '+Send'} + call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'i'], + \ 'call SpaceVim#plugins#repl#start("dart")', + \ 'start REPL process', 1) + call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'l'], + \ 'call SpaceVim#plugins#repl#send("line")', + \ 'send line and keep code buffer focused', 1) + call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 'b'], + \ 'call SpaceVim#plugins#repl#send("buffer")', + \ 'send buffer and keep code buffer focused', 1) + call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 's'], + \ 'call SpaceVim#plugins#repl#send("selection")', + \ 'send selection and keep code buffer focused', 1) + if SpaceVim#layers#lsp#check_filetype('dart') + nnoremap <silent><buffer> K :call SpaceVim#lsp#show_doc()<CR> + + call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'd'], + \ 'call SpaceVim#lsp#show_doc()', 'show_document', 1) + call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'], + \ 'call SpaceVim#lsp#rename()', 'rename symbol', 1) + endif +endfunction diff --git a/autoload/SpaceVim/layers/lang/markdown.vim b/autoload/SpaceVim/layers/lang/markdown.vim index 0b2a09fee..cd35647fa 100644 --- a/autoload/SpaceVim/layers/lang/markdown.vim +++ b/autoload/SpaceVim/layers/lang/markdown.vim @@ -11,44 +11,44 @@ let s:md_enableWcwidth = 0 let s:md_listItemChar = '-' let g:vmt_list_indent_text = ' ' function! SpaceVim#layers#lang#markdown#set_variable(var) abort - let s:md_listItemIndent = get(a:var, 'listItemIndent', s:md_listItemIndent) - let s:md_enableWcwidth = get(a:var, 'enableWcwidth', s:md_enableWcwidth) - let s:md_listItemChar = get(a:var, 'listItemChar', s:md_listItemChar) - let g:vmt_list_item_char = s:md_listItemChar + let s:md_listItemIndent = get(a:var, 'listItemIndent', s:md_listItemIndent) + let s:md_enableWcwidth = get(a:var, 'enableWcwidth', s:md_enableWcwidth) + let s:md_listItemChar = get(a:var, 'listItemChar', s:md_listItemChar) endfunction function! SpaceVim#layers#lang#markdown#plugins() abort - let plugins = [] - call add(plugins, ['SpaceVim/vim-markdown',{ 'on_ft' : 'markdown'}]) - call add(plugins, ['joker1007/vim-markdown-quote-syntax',{ 'on_ft' : 'markdown'}]) - call add(plugins, ['mzlogin/vim-markdown-toc',{ 'on_ft' : 'markdown'}]) - call add(plugins, ['iamcco/mathjax-support-for-mkdp',{ 'on_ft' : 'markdown'}]) - call add(plugins, ['iamcco/markdown-preview.vim', { 'depends' : 'open-browser.vim', 'on_ft' : 'markdown' }]) - return plugins + let plugins = [] + call add(plugins, ['SpaceVim/vim-markdown',{ 'on_ft' : 'markdown'}]) + call add(plugins, ['joker1007/vim-markdown-quote-syntax',{ 'on_ft' : 'markdown'}]) + call add(plugins, ['mzlogin/vim-markdown-toc',{ 'on_ft' : 'markdown'}]) + call add(plugins, ['iamcco/mathjax-support-for-mkdp',{ 'on_ft' : 'markdown'}]) + call add(plugins, ['iamcco/markdown-preview.vim', { 'depends' : 'open-browser.vim', 'on_ft' : 'markdown' }]) + return plugins endfunction function! SpaceVim#layers#lang#markdown#config() abort - let g:markdown_minlines = 100 - let g:markdown_syntax_conceal = 0 - let g:markdown_enable_mappings = 0 - let g:markdown_enable_insert_mode_leader_mappings = 0 - let g:markdown_enable_spell_checking = 0 - let g:markdown_quote_syntax_filetypes = { - \ "vim" : { - \ "start" : "\\%(vim\\|viml\\)", - \}, - \} - augroup SpaceVim_lang_markdown - au! - autocmd BufEnter *.md call s:mappings() - augroup END - let remarkrc = s:generate_remarkrc() - let g:neoformat_enabled_markdown = ['remark'] - let g:neoformat_markdown_remark = { - \ 'exe': 'remark', - \ 'args': ['--no-color', '--silent'] + (empty(remarkrc) ? [] : ['-r', remarkrc]), - \ 'stdin': 1, - \ } + let g:vmt_list_item_char = s:md_listItemChar + let g:markdown_minlines = 100 + let g:markdown_syntax_conceal = 0 + let g:markdown_enable_mappings = 0 + let g:markdown_enable_insert_mode_leader_mappings = 0 + let g:markdown_enable_spell_checking = 0 + let g:markdown_quote_syntax_filetypes = { + \ "vim" : { + \ "start" : "\\%(vim\\|viml\\)", + \}, + \} + augroup SpaceVim_lang_markdown + au! + autocmd BufEnter *.md call s:mappings() + augroup END + let remarkrc = s:generate_remarkrc() + let g:neoformat_enabled_markdown = ['remark'] + let g:neoformat_markdown_remark = { + \ 'exe': 'remark', + \ 'args': ['--no-color', '--silent'] + (empty(remarkrc) ? [] : ['-r', remarkrc]), + \ 'stdin': 1, + \ } " iamcco/markdown-preview.vim {{{ let g:mkdp_browserfunc = 'openbrowser#open' @@ -56,33 +56,33 @@ function! SpaceVim#layers#lang#markdown#config() abort endfunction function! s:mappings() abort - if !exists('g:_spacevim_mappings_space') - let g:_spacevim_mappings_space = {} - endif - let g:_spacevim_mappings_space.l = {'name' : '+Language Specified'} - call SpaceVim#mapping#space#langSPC('nmap', ['l','ft'], "Tabularize /|", 'Format table under cursor', 1) - call SpaceVim#mapping#space#langSPC('nmap', ['l','p'], "MarkdownPreview", 'Real-time markdown preview', 1) + if !exists('g:_spacevim_mappings_space') + let g:_spacevim_mappings_space = {} + endif + let g:_spacevim_mappings_space.l = {'name' : '+Language Specified'} + call SpaceVim#mapping#space#langSPC('nmap', ['l','ft'], "Tabularize /|", 'Format table under cursor', 1) + call SpaceVim#mapping#space#langSPC('nmap', ['l','p'], "MarkdownPreview", 'Real-time markdown preview', 1) endfunction function! s:generate_remarkrc() abort - let conf = [ - \ 'module.exports = {', - \ ' settings: {', - \ ] - " TODO add settings - call add(conf, " listItemIndent: '" . s:md_listItemIndent . "',") - if s:md_enableWcwidth - call add(conf, " stringLength: require('wcwidth'),") - endif - call add(conf, ' },') - call add(conf, ' plugins: [') - " TODO add plugins - call add(conf, " require('remark-frontmatter'),") - call add(conf, ' ]') - call add(conf, '};') - let f = tempname() . '.js' - call writefile(conf, f) - return f + let conf = [ + \ 'module.exports = {', + \ ' settings: {', + \ ] + " TODO add settings + call add(conf, " listItemIndent: '" . s:md_listItemIndent . "',") + if s:md_enableWcwidth + call add(conf, " stringLength: require('wcwidth'),") + endif + call add(conf, ' },') + call add(conf, ' plugins: [') + " TODO add plugins + call add(conf, " require('remark-frontmatter'),") + call add(conf, ' ]') + call add(conf, '};') + let f = tempname() . '.js' + call writefile(conf, f) + return f endfunction diff --git a/autoload/SpaceVim/layers/lsp.vim b/autoload/SpaceVim/layers/lsp.vim index 963687e34..e36c948b4 100644 --- a/autoload/SpaceVim/layers/lsp.vim +++ b/autoload/SpaceVim/layers/lsp.vim @@ -78,6 +78,7 @@ let s:lsp_servers = { \ 'cpp' : ['clangd'], \ 'objc' : ['clangd'], \ 'objcpp' : ['clangd'], + \ 'dart' : ['dart_language_server'], \ 'go' : ['go-langserver', '-mode', 'stdio'], \ 'rust' : ['rustup', 'run', 'nightly', 'rls'], \ 'python' : ['pyls'], diff --git a/autoload/SpaceVim/layers/tools.vim b/autoload/SpaceVim/layers/tools.vim index e1fc1cd39..3dfcf9f60 100644 --- a/autoload/SpaceVim/layers/tools.vim +++ b/autoload/SpaceVim/layers/tools.vim @@ -2,7 +2,6 @@ function! SpaceVim#layers#tools#plugins() abort return [ \ ['tpope/vim-scriptease'], \ ['mbbill/fencview', { 'on_cmd' : 'FencAutoDetect'}], - \ ['SpaceVim/cscope.vim'], \ ['wsdjeg/vim-cheat', { 'on_cmd' : 'Cheat'}], \ ['wsdjeg/SourceCounter.vim', { 'on_cmd' : 'SourceCounter'}], \ ['junegunn/goyo.vim', { 'on_cmd' : 'Goyo', diff --git a/autoload/SpaceVim/layers/ui.vim b/autoload/SpaceVim/layers/ui.vim index a53599feb..1a50650e1 100644 --- a/autoload/SpaceVim/layers/ui.vim +++ b/autoload/SpaceVim/layers/ui.vim @@ -1,222 +1,217 @@ scriptencoding utf-8 function! SpaceVim#layers#ui#plugins() abort - let plugins = [ - \ ['Yggdroot/indentLine'], - \ ['majutsushi/tagbar', {'loadconf' : 1}], - \ ['tenfyzhong/tagbar-makefile.vim', {'merged': 0}], - \ ['tenfyzhong/tagbar-proto.vim', {'merged': 0}], - \ ['lvht/tagbar-markdown',{'merged' : 0}], - \ ['t9md/vim-choosewin', {'merged' : 0}], - \ ['mhinz/vim-startify', {'loadconf' : 1}], - \ ['blueyed/vim-diminactive', {'merged' : 0}], - \ ] - if get(g:, '_spacevim_statusline_loaded', 0) == 0 - call add(plugins, ['vim-airline/vim-airline', { 'merged' : 0, - \ 'loadconf' : 1}]) - call add(plugins, ['vim-airline/vim-airline-themes', { 'merged' : 0}]) - endif + let plugins = [ + \ ['Yggdroot/indentLine'], + \ ['majutsushi/tagbar', {'loadconf' : 1}], + \ ['tenfyzhong/tagbar-makefile.vim', {'merged': 0}], + \ ['tenfyzhong/tagbar-proto.vim', {'merged': 0}], + \ ['lvht/tagbar-markdown',{'merged' : 0}], + \ ['t9md/vim-choosewin', {'merged' : 0}], + \ ['mhinz/vim-startify', {'loadconf' : 1}], + \ ['blueyed/vim-diminactive', {'merged' : 0}], + \ ] + if get(g:, '_spacevim_statusline_loaded', 0) == 0 + call add(plugins, ['vim-airline/vim-airline', { 'merged' : 0, + \ 'loadconf' : 1}]) + call add(plugins, ['vim-airline/vim-airline-themes', { 'merged' : 0}]) + endif - return plugins + return plugins endfunction function! SpaceVim#layers#ui#config() abort - let g:indentLine_color_term = get(g:, 'indentLine_color_term', 239) - let g:indentLine_color_gui = get(g:, 'indentLine_color_gui', '#09AA08') - let g:indentLine_char = get(g:, 'indentLine_char', 'ยฆ') - let g:indentLine_concealcursor = 'niv' - let g:indentLine_conceallevel = 2 - let g:indentLine_fileTypeExclude = ['help', 'man', 'startify', 'vimfiler'] - let g:signify_disable_by_default = 0 - let g:signify_line_highlight = 0 - noremap <silent> <F2> :silent TagbarToggle<CR> - " Ui toggles - call SpaceVim#mapping#space#def('nnoremap', ['t', '8'], 'call call(' - \ . string(s:_function('s:toggle_fill_column')) . ', [])', - \ 'toggle-colorcolumn', 1) - call SpaceVim#mapping#space#def('nnoremap', ['t', 'b'], 'call ToggleBG()', - \ 'toggle background', 1) - call SpaceVim#mapping#space#def('nnoremap', ['t', 't'], 'call SpaceVim#plugins#tabmanager#open()', - \ 'Open tabs manager', 1) - call SpaceVim#mapping#space#def('nnoremap', ['t', 'f'], 'call call(' - \ . string(s:_function('s:toggle_colorcolumn')) . ', [])', - \ 'toggle-colorcolumn', 1) - call SpaceVim#mapping#space#def('nnoremap', ['t', 'h', 'h'], 'set cursorline!', - \ 'toggle highlight of the current line', 1) - call SpaceVim#mapping#space#def('nnoremap', ['t', 'h', 'i'], 'call call(' - \ . string(s:_function('s:toggle_indentline')) . ', [])', - \ ['toggle highlight indentation levels', - \ [ - \ 'SPC t h i is to running :IndentLinesToggle which is definded in indentLine' - \ ] - \ ], 1) - call SpaceVim#mapping#space#def('nnoremap', ['t', 'h', 'c'], 'set cursorcolumn!', - \ 'toggle highlight indentation current column', 1) - call SpaceVim#mapping#space#def('nnoremap', ['t', 'h', 's'], 'call call(' - \ . string(s:_function('s:toggle_syntax_hi')) . ', [])', - \ 'toggle syntax highlighting', 1) + let g:indentLine_color_term = get(g:, 'indentLine_color_term', 239) + let g:indentLine_color_gui = get(g:, 'indentLine_color_gui', '#09AA08') + let g:indentLine_char = get(g:, 'indentLine_char', 'ยฆ') + let g:indentLine_concealcursor = 'niv' + let g:indentLine_conceallevel = 2 + let g:indentLine_fileTypeExclude = ['help', 'man', 'startify', 'vimfiler'] + let g:signify_disable_by_default = 0 + let g:signify_line_highlight = 0 + noremap <silent> <F2> :silent TagbarToggle<CR> + " Ui toggles + call SpaceVim#mapping#space#def('nnoremap', ['t', '8'], 'call call(' + \ . string(s:_function('s:toggle_fill_column')) . ', [])', + \ 'toggle-colorcolumn', 1) + call SpaceVim#mapping#space#def('nnoremap', ['t', 'b'], 'call ToggleBG()', + \ 'toggle background', 1) + call SpaceVim#mapping#space#def('nnoremap', ['t', 't'], 'call SpaceVim#plugins#tabmanager#open()', + \ 'Open tabs manager', 1) + call SpaceVim#mapping#space#def('nnoremap', ['t', 'f'], 'call call(' + \ . string(s:_function('s:toggle_colorcolumn')) . ', [])', + \ 'toggle-colorcolumn', 1) + call SpaceVim#mapping#space#def('nnoremap', ['t', 'h', 'h'], 'set cursorline!', + \ 'toggle highlight of the current line', 1) + call SpaceVim#mapping#space#def('nnoremap', ['t', 'h', 'i'], 'call call(' + \ . string(s:_function('s:toggle_indentline')) . ', [])', + \ ['toggle highlight indentation levels', + \ [ + \ 'SPC t h i is to running :IndentLinesToggle which is definded in indentLine' + \ ] + \ ], 1) + call SpaceVim#mapping#space#def('nnoremap', ['t', 'h', 'c'], 'set cursorcolumn!', + \ 'toggle highlight indentation current column', 1) + call SpaceVim#mapping#space#def('nnoremap', ['t', 'h', 's'], 'call call(' + \ . string(s:_function('s:toggle_syntax_hi')) . ', [])', + \ 'toggle syntax highlighting', 1) - call SpaceVim#mapping#space#def('nnoremap', ['T', 'F'], '<F11>', - \ 'fullscreen-frame', 0) - call SpaceVim#mapping#space#def('nnoremap', ['T', 'm'], 'call call(' - \ . string(s:_function('s:toggle_menu_bar')) . ', [])', - \ 'toggle-menu-bar', 1) - call SpaceVim#mapping#space#def('nnoremap', ['T', 'f'], 'call call(' - \ . string(s:_function('s:toggle_win_fringe')) . ', [])', - \ 'toggle-win-fringe', 1) - call SpaceVim#mapping#space#def('nnoremap', ['T', 't'], 'call call(' - \ . string(s:_function('s:toggle_tool_bar')) . ', [])', - \ 'toggle-tool-bar', 1) - call SpaceVim#mapping#space#def('nnoremap', ['T', '~'], 'call call(' - \ . string(s:_function('s:toggle_end_of_buffer')) . ', [])', - \ 'display ~ in the fringe on empty lines', 1) - call SpaceVim#mapping#space#def('nnoremap', ['t', 's'], 'call call(' - \ . string(s:_function('s:toggle_syntax_checker')) . ', [])', - \ 'toggle syntax checker', 1) - call SpaceVim#mapping#space#def('nnoremap', ['t', 'S'], 'call call(' - \ . string(s:_function('s:toggle_spell_check')) . ', [])', - \ 'toggle spell checker', 1) - call SpaceVim#mapping#space#def('nnoremap', ['t', 'w'], 'call call(' - \ . string(s:_function('s:toggle_whitespace')) . ', [])', - \ 'toggle the whitespace', 1) + call SpaceVim#mapping#space#def('nnoremap', ['T', 'F'], '<F11>', + \ 'fullscreen-frame', 0) + call SpaceVim#mapping#space#def('nnoremap', ['T', 'm'], 'call call(' + \ . string(s:_function('s:toggle_menu_bar')) . ', [])', + \ 'toggle-menu-bar', 1) + call SpaceVim#mapping#space#def('nnoremap', ['T', 'f'], 'call call(' + \ . string(s:_function('s:toggle_win_fringe')) . ', [])', + \ 'toggle-win-fringe', 1) + call SpaceVim#mapping#space#def('nnoremap', ['T', 't'], 'call call(' + \ . string(s:_function('s:toggle_tool_bar')) . ', [])', + \ 'toggle-tool-bar', 1) + call SpaceVim#mapping#space#def('nnoremap', ['T', '~'], 'call call(' + \ . string(s:_function('s:toggle_end_of_buffer')) . ', [])', + \ 'display ~ in the fringe on empty lines', 1) + call SpaceVim#mapping#space#def('nnoremap', ['t', 'S'], 'call call(' + \ . string(s:_function('s:toggle_spell_check')) . ', [])', + \ 'toggle spell checker', 1) + call SpaceVim#mapping#space#def('nnoremap', ['t', 'w'], 'call call(' + \ . string(s:_function('s:toggle_whitespace')) . ', [])', + \ 'toggle the whitespace', 1) endfunction " function() wrapper if v:version > 703 || v:version == 703 && has('patch1170') - function! s:_function(fstr) abort - return function(a:fstr) - endfunction + function! s:_function(fstr) abort + return function(a:fstr) + endfunction else - function! s:_SID() abort - return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$') - endfunction - let s:_s = '<SNR>' . s:_SID() . '_' - function! s:_function(fstr) abort - return function(substitute(a:fstr, 's:', s:_s, 'g')) - endfunction + function! s:_SID() abort + return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze__SID$') + endfunction + let s:_s = '<SNR>' . s:_SID() . '_' + function! s:_function(fstr) abort + return function(substitute(a:fstr, 's:', s:_s, 'g')) + endfunction endif let s:tmflag = 0 function! s:toggle_menu_bar() abort - if !s:tmflag - set go+=m - let s:tmflag = 1 - else - set go-=m - let s:tmflag = 0 - endif + if !s:tmflag + set go+=m + let s:tmflag = 1 + else + set go-=m + let s:tmflag = 0 + endif endfunction let s:ttflag = 0 function! s:toggle_tool_bar() abort - if !s:ttflag - set go+=T - let s:ttflag = 1 - else - set go-=T - let s:ttflag = 0 - endif + if !s:ttflag + set go+=T + let s:ttflag = 1 + else + set go-=T + let s:ttflag = 0 + endif endfunction -let s:ccflag = 0 +if &cc ==# '80' + let s:ccflag = 1 +else + let s:ccflag = 0 +endif function! s:toggle_colorcolumn() abort - if !s:ccflag - set cc=80 - let s:ccflag = 1 - else - set cc= - let s:ccflag = 0 - endif - call SpaceVim#layers#core#statusline#toggle_mode('fill-column-indicator') + if !s:ccflag + set cc=80 + let s:ccflag = 1 + else + set cc= + let s:ccflag = 0 + endif + call SpaceVim#layers#core#statusline#toggle_mode('fill-column-indicator') endfunction let s:fcflag = 0 function! s:toggle_fill_column() abort - if !s:fcflag - let &colorcolumn=join(range(80,999),',') - let s:fcflag = 1 - else - set cc= - let s:fcflag = 0 - endif - call SpaceVim#layers#core#statusline#toggle_mode('hi-characters-for-long-lines') + if !s:fcflag + let &colorcolumn=join(range(80,999),',') + let s:fcflag = 1 + else + set cc= + let s:fcflag = 0 + endif + call SpaceVim#layers#core#statusline#toggle_mode('hi-characters-for-long-lines') endfunction let s:idflag = 0 function! s:toggle_indentline() abort - if !s:idflag - IndentLinesDisable - let s:idflag = 1 - else - IndentLinesEnable - let s:idflag = 0 - endif + if !s:idflag + IndentLinesDisable + let s:idflag = 1 + else + IndentLinesEnable + let s:idflag = 0 + endif endfunction let s:shflag = 0 function! s:toggle_syntax_hi() abort - if !s:shflag - syntax off - let s:shflag = 1 - else - syntax on - let s:shflag = 0 - endif + if !s:shflag + syntax off + let s:shflag = 1 + else + syntax on + let s:shflag = 0 + endif endfunction let s:ebflag = 0 let s:HI = SpaceVim#api#import('vim#highlight') function! s:toggle_end_of_buffer() abort - if !s:ebflag - if &background ==# 'dark' - hi EndOfBuffer guifg=white - else - hi EndOfBuffer guifg=gray - endif - let s:ebflag = 1 + if !s:ebflag + if &background ==# 'dark' + hi EndOfBuffer guifg=white else - if (exists('+termguicolors') && &termguicolors) || has('gui_running') - let normalbg = s:HI.group2dict('Normal').guibg - else - let normalbg = s:HI.group2dict('Normal').ctermbg - endif - exe 'hi! EndOfBuffer guifg=' . normalbg . ' guibg=' . normalbg - let s:ebflag = 0 + hi EndOfBuffer guifg=gray endif + let s:ebflag = 1 + else + if (exists('+termguicolors') && &termguicolors) || has('gui_running') + let normalbg = s:HI.group2dict('Normal').guibg + else + let normalbg = s:HI.group2dict('Normal').ctermbg + endif + exe 'hi! EndOfBuffer guifg=' . normalbg . ' guibg=' . normalbg + let s:ebflag = 0 + endif endfunction let s:tfflag = 0 function! s:toggle_win_fringe() abort - if !s:tfflag - set guioptions+=L - set guioptions+=r - let s:tfflag = 1 - else - set guioptions-=L - set guioptions-=r - let s:tfflag = 0 - endif -endfunction - -function! s:toggle_syntax_checker() abort - call SpaceVim#layers#core#statusline#toggle_section('syntax checking') - call SpaceVim#layers#core#statusline#toggle_mode('syntax-checking') - verbose NeomakeToggle + if !s:tfflag + set guioptions+=L + set guioptions+=r + let s:tfflag = 1 + else + set guioptions-=L + set guioptions-=r + let s:tfflag = 0 + endif endfunction function! s:toggle_spell_check() abort - if &l:spell - let &l:spell = 0 - else - let &l:spell = 1 - endif - call SpaceVim#layers#core#statusline#toggle_mode('spell-checking') - if &l:spell == 1 - echo 'spell-checking enabled.' - else - echo 'spell-checking disabled.' - endif + if &l:spell + let &l:spell = 0 + else + let &l:spell = 1 + endif + call SpaceVim#layers#core#statusline#toggle_mode('spell-checking') + if &l:spell == 1 + echo 'spell-checking enabled.' + else + echo 'spell-checking disabled.' + endif endfunction function! s:toggle_whitespace() abort - call SpaceVim#layers#core#statusline#toggle_section('whitespace') - call SpaceVim#layers#core#statusline#toggle_mode('whitespace') + call SpaceVim#layers#core#statusline#toggle_section('whitespace') + call SpaceVim#layers#core#statusline#toggle_mode('whitespace') endfunction diff --git a/autoload/SpaceVim/mapping/guide.vim b/autoload/SpaceVim/mapping/guide.vim index 275cbd7b6..f4759eb62 100644 --- a/autoload/SpaceVim/mapping/guide.vim +++ b/autoload/SpaceVim/mapping/guide.vim @@ -432,11 +432,13 @@ function! s:updateStatusline() abort let gname = ' - ' . gname[1:] let gname = substitute(gname,' ', '\\ ', 'g') endif + let keys = get(s:, 'prefix_key_inp', '') + let keys = substitute(keys, '\', '\\\', 'g') exe 'setlocal statusline=%#LeaderGuiderPrompt#\ Guide:\ ' . \ '%#LeaderGuiderSep1#' . s:lsep . \ '%#LeaderGuiderName#\ ' . \ SpaceVim#mapping#leader#getName(s:prefix_key) - \ . get(s:, 'prefix_key_inp', '') . gname + \ . keys . gname \ . '\ %#LeaderGuiderSep2#' . s:lsep . '%#LeaderGuiderFill#' \ . s:guide_help_msg() endfunction @@ -595,6 +597,7 @@ if get(g:, 'mapleader', '\') == ' ' else call SpaceVim#mapping#guide#register_prefix_descriptions('\', \ 'g:_spacevim_mappings') + call SpaceVim#plugins#help#regist_root({'<leader>' : g:_spacevim_mappings}) call SpaceVim#mapping#guide#register_prefix_descriptions(' ', \ 'g:_spacevim_mappings_space') call SpaceVim#plugins#help#regist_root({'SPC' : g:_spacevim_mappings_space}) @@ -602,18 +605,27 @@ endif call SpaceVim#mapping#guide#register_prefix_descriptions( \ g:spacevim_unite_leader, \ 'g:_spacevim_mappings_unite') +call SpaceVim#plugins#help#regist_root({'[unite]' : g:_spacevim_mappings_unite}) + call SpaceVim#mapping#guide#register_prefix_descriptions( \ g:spacevim_denite_leader, \ 'g:_spacevim_mappings_denite') +call SpaceVim#plugins#help#regist_root({'[denite]' : g:_spacevim_mappings_denite}) +call SpaceVim#mapping#guide#register_prefix_descriptions( + \ g:spacevim_windows_leader, + \ 'g:_spacevim_mappings_windows') +call SpaceVim#plugins#help#regist_root({'[WIN]' : g:_spacevim_mappings_windows}) call SpaceVim#mapping#guide#register_prefix_descriptions( \ '[KEYs]', \ 'g:_spacevim_mappings_prefixs') call SpaceVim#mapping#guide#register_prefix_descriptions( \ 'g', \ 'g:_spacevim_mappings_g') +call SpaceVim#plugins#help#regist_root({'[g]' : g:_spacevim_mappings_g}) call SpaceVim#mapping#guide#register_prefix_descriptions( \ 'z', \ 'g:_spacevim_mappings_z') +call SpaceVim#plugins#help#regist_root({'[z]' : g:_spacevim_mappings_z}) let [s:lsep, s:rsep] = SpaceVim#layers#core#statusline#rsep() let &cpo = s:save_cpo unlet s:save_cpo diff --git a/autoload/SpaceVim/mapping/leader.vim b/autoload/SpaceVim/mapping/leader.vim index de1cf21f9..ee07fe3e1 100644 --- a/autoload/SpaceVim/mapping/leader.vim +++ b/autoload/SpaceVim/mapping/leader.vim @@ -6,6 +6,8 @@ " License: MIT license "============================================================================= +let s:file = expand('<sfile>:~') + function! SpaceVim#mapping#leader#defindglobalMappings() abort if g:spacevim_enable_insert_leader inoremap <silent> <Leader><Tab> <C-r>=MyLeaderTabfunc()<CR> @@ -119,44 +121,129 @@ function! SpaceVim#mapping#leader#defindglobalMappings() abort \ 'call SpaceVim#mapping#vertical_split_previous_buffer()') endfunction +let s:lnum = expand('<slnum>') + 3 function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort if !empty(a:key) - call zvim#util#defineMap('nnoremap', '[Window]', '<Nop>', - \ 'Defind window prefix', 'normal [Window]') - call zvim#util#defineMap('nmap' , a:key, '[Window]', - \ 'Use ' . a:key . ' as window prefix', 'normal ' . a:key) - - call zvim#util#defineMap('nnoremap <silent>', '[Window]p', - \ ':<C-u>vsplit<CR>:wincmd w<CR>', - \ 'vsplit vertically,switch to next window','vsplit | wincmd w') - call zvim#util#defineMap('nnoremap <silent>', '[Window]v', - \ ':<C-u>split<CR>', 'split window', 'split') - call zvim#util#defineMap('nnoremap <silent>', '[Window]g', - \ ':<C-u>vsplit<CR>', 'vsplit window', 'vsplit') - call zvim#util#defineMap('nnoremap <silent>', '[Window]t', - \ ':<C-u>tabnew<CR>', 'Create new tab', 'tabnew') - call zvim#util#defineMap('nnoremap <silent>', '[Window]o', - \ ':<C-u>only<CR>', 'Close other windows', 'only') - call zvim#util#defineMap('nnoremap <silent>', '[Window]x', - \ ':<C-u>call zvim#util#BufferEmpty()<CR>', - \ 'Empty current buffer', 'call zvim#util#BufferEmpty()') - call zvim#util#defineMap('nnoremap <silent>', '[Window]\', - \ ':<C-u>b#<CR>', 'Switch to the last buffer','b#') - call zvim#util#defineMap('nnoremap <silent>', '[Window]q', - \ ':<C-u>close<CR>', 'Close current windows','close') - call zvim#util#defineMap('nnoremap <silent>', '[Window]Q', - \ ':<C-u>call SpaceVim#mapping#close_current_buffer()<CR>', + exe 'nnoremap <silent><nowait> [Window] :<c-u>LeaderGuide "' . + \ a:key . '"<CR>' + exe 'nmap ' .a:key . ' [Window]' + let g:_spacevim_mappings_windows = {} + nnoremap <silent> [Window]p + \ :<C-u>vsplit<CR>:wincmd w<CR> + let lnum = expand('<slnum>') + s:lnum - 4 + let g:_spacevim_mappings_windows.p = ['vsplit | wincmd w', + \ 'vsplit vertically,switch to next window', + \ [ + \ '[WIN p ] is to split windows vertically, switch to the new window', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [Window]v + \ :<C-u>split<CR> + let lnum = expand('<slnum>') + s:lnum - 4 + let g:_spacevim_mappings_windows.v = ['split', + \ 'split window', + \ [ + \ '[WIN v] is to split windows, switch to the new window', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [Window]g + \ :<C-u>vsplit<CR> + let lnum = expand('<slnum>') + s:lnum - 4 + let g:_spacevim_mappings_windows.g = ['vsplit', + \ 'vsplit window', + \ [ + \ '[WIN g] is to split windows vertically, switch to the new window', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [Window]t + \ :<C-u>tabnew<CR> + let lnum = expand('<slnum>') + s:lnum - 4 + let g:_spacevim_mappings_windows.t = ['tabnew', + \ 'create new tab', + \ [ + \ '[WIN t] is to create new tab', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [Window]o + \ :<C-u>only<CR> + let lnum = expand('<slnum>') + s:lnum - 4 + let g:_spacevim_mappings_windows.o = ['only', + \ 'Close other windows', + \ [ + \ '[WIN o] is to close all other windows', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [Window]x + \ :<C-u>call zvim#util#BufferEmpty()<CR> + let lnum = expand('<slnum>') + s:lnum - 4 + let g:_spacevim_mappings_windows.x = ['call zvim#util#BufferEmpty()', + \ 'Empty current buffer', + \ [ + \ '[WIN x] is to empty current buffer', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [Window]\ + \ :<C-u>b#<CR> + let lnum = expand('<slnum>') + s:lnum - 4 + let g:_spacevim_mappings_windows['\'] = ['b#', + \ 'Switch to the last buffer', + \ [ + \ '[WIN \] is to switch to the last buffer', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [Window]Q + \ :<C-u>close<CR> + let lnum = expand('<slnum>') + s:lnum - 4 + let g:_spacevim_mappings_windows.Q = ['close', + \ 'Close current windows', + \ [ + \ '[WIN Q] is to close current windows', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [Window]q + \ :<C-u>call SpaceVim#mapping#close_current_buffer()<CR> + let lnum = expand('<slnum>') + s:lnum - 4 + let g:_spacevim_mappings_windows.q = ['call SpaceVim#mapping#close_current_buffer()', \ 'delete current windows', - \ 'call SpaceVim#mapping#close_current_buffer()') - call zvim#util#defineMap('nnoremap <silent>', '[Window]c', - \ ':<C-u>call SpaceVim#mapping#clearBuffers()<CR>', - \ 'Clear all the buffers', 'call SpaceVim#mapping#clearBuffers()') + \ [ + \ '[WIN q] is to delete current windows', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [Window]c + \ :<C-u>call SpaceVim#mapping#clearBuffers()<CR> + let lnum = expand('<slnum>') + s:lnum - 4 + let g:_spacevim_mappings_windows.c = ['call SpaceVim#mapping#clearBuffers()', + \ 'Clear all the buffers', + \ [ + \ '[WIN c] is to clear all the buffers', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] endif endfunction function! SpaceVim#mapping#leader#defindDeniteLeader(key) abort if !empty(a:key) - if a:key == 'F' + if a:key ==# 'F' nnoremap <leader>F F endif exe 'nnoremap <silent><nowait> [denite] :<c-u>LeaderGuide "' . @@ -197,9 +284,10 @@ function! SpaceVim#mapping#leader#defindDeniteLeader(key) abort endif endfunction +let s:unite_lnum = expand('<slnum>') + 3 function! SpaceVim#mapping#leader#defindUniteLeader(key) abort if !empty(a:key) - if a:key == 'f' + if a:key ==# 'f' nnoremap <leader>f f endif " The prefix key. @@ -209,87 +297,282 @@ function! SpaceVim#mapping#leader#defindUniteLeader(key) abort let g:_spacevim_mappings_unite = {} nnoremap <silent> [unite]r \ :<C-u>Unite -buffer-name=resume resume<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 4 let g:_spacevim_mappings_unite.r = ['Unite -buffer-name=resume resume', - \ 'resume unite window'] + \ 'resume unite window', + \ [ + \ '[UNITE r ] is to resume unite window', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] if has('nvim') - nnoremap <silent> [unite]f :<C-u>Unite file_rec/neovim<cr> - let g:_spacevim_mappings_unite.f = ['Unite file_rec/neovim', 'file_rec'] + nnoremap <silent> [unite]f + \ :<C-u>Unite file_rec/neovim<cr> + let lnum = expand('<slnum>') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.f = ['Unite file_rec/neovim', + \ 'file_rec', + \ [ + \ '[UNITE f ] is to open unite file_rec source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] else - nnoremap <silent> [unite]f :<C-u>Unite file_rec/async<cr> - let g:_spacevim_mappings_unite.f = ['Unite file_rec/async', 'file_rec'] + nnoremap <silent> [unite]f + \ :<C-u>Unite file_rec/async<cr> + let lnum = expand('<slnum>') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.f = ['Unite file_rec/async', + \ 'file_rec', + \ [ + \ '[UNITE f ] is to open unite file_rec source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] endif - nnoremap <silent> [unite]i :<C-u>Unite file_rec/git<cr> - let g:_spacevim_mappings_unite.i = ['Unite file_rec/git', 'git files'] - nnoremap <silent> [unite]g :<C-u>Unite grep<cr> - let g:_spacevim_mappings_unite.g = ['Unite grep', 'unite grep'] - nnoremap <silent> [unite]u :<C-u>Unite source<CR> - let g:_spacevim_mappings_unite.u = ['Unite source', 'unite source'] - nnoremap <silent> [unite]t :<C-u>Unite tag<CR> - let g:_spacevim_mappings_unite.t = ['Unite tag', 'unite tag'] - nnoremap <silent> [unite]T :<C-u>Unite tag/include<CR> + nnoremap <silent> [unite]i + \ :<C-u>Unite file_rec/git<cr> + let lnum = expand('<slnum>') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.i = ['Unite file_rec/git', + \ 'git files', + \ [ + \ '[UNITE f ] is to open unite file_rec source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [unite]g + \ :<C-u>Unite grep<cr> + let lnum = expand('<slnum>') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.g = ['Unite grep', + \ 'unite grep', + \ [ + \ '[UNITE g ] is to open unite grep source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [unite]u + \ :<C-u>Unite source<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.u = ['Unite source', + \ 'unite source', + \ [ + \ '[UNITE u ] is to open unite source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [unite]t + \ :<C-u>Unite tag<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.t = ['Unite tag', + \ 'unite tag', + \ [ + \ '[UNITE t ] is to open unite tag source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [unite]T + \ :<C-u>Unite tag/include<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 4 let g:_spacevim_mappings_unite.T = ['Unite tag/include', - \ 'unite tag/include'] - nnoremap <silent> [unite]l :<C-u>Unite locationlist<CR> + \ 'unite tag/include', + \ [ + \ '[UNITE T ] is to open unite tag/include source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [unite]l + \ :<C-u>Unite locationlist<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 4 let g:_spacevim_mappings_unite.l = ['Unite locationlist', - \ 'unite locationlist'] - nnoremap <silent> [unite]q :<C-u>Unite quickfix<CR> - let g:_spacevim_mappings_unite.q = ['Unite quickfix', 'unite quickfix'] + \ 'unite locationlist', + \ [ + \ '[UNITE l ] is to open unite locationlist source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [unite]q + \ :<C-u>Unite quickfix<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.q = ['Unite quickfix', + \ 'unite quickfix', + \ [ + \ '[UNITE q ] is to open unite quickfix source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] nnoremap <silent> [unite]e :<C-u>Unite \ -buffer-name=register register<CR> - let g:_spacevim_mappings_unite.e = ['Unite register', 'unite register'] - nnoremap <silent> [unite]j :<C-u>Unite jump<CR> - let g:_spacevim_mappings_unite.j = ['Unite jump', 'unite jump'] - nnoremap <silent> [unite]h :<C-u>Unite history/yank<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.e = ['Unite register', + \ 'unite register', + \ [ + \ '[UNITE l ] is to open unite locationlist source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [unite]j + \ :<C-u>Unite jump<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.j = ['Unite jump', + \ 'unite jump', + \ [ + \ '[UNITE j ] is to open unite jump source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [unite]h + \ :<C-u>Unite history/yank<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 4 let g:_spacevim_mappings_unite.h = ['Unite history/yank', - \ 'unite history/yank'] - nnoremap <silent> [unite]<C-h> :<C-u>UniteWithCursorWord help<CR> + \ 'unite history/yank', + \ [ + \ '[UNITE h ] is to open unite history/yank source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [unite]<C-h> + \ :<C-u>UniteWithCursorWord help<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 4 let g:_spacevim_mappings_unite['<C-h>'] = ['UniteWithCursorWord help', - \ 'unite with cursor word help'] - nnoremap <silent> [unite]s :<C-u>Unite session<CR> - let g:_spacevim_mappings_unite.s = ['Unite session', 'unite session'] + \ 'unite with cursor word help', + \ [ + \ '[UNITE <c-h> ] is to open unite help source for cursor word', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [unite]s + \ :<C-u>Unite session<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.s = ['Unite session', + \ 'unite session', + \ [ + \ '[UNITE s ] is to open unite session source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] nnoremap <silent> [unite]o :<C-u>Unite -buffer-name=outline \ -start-insert -auto-preview -split outline<CR> - let g:_spacevim_mappings_unite.o = ['Unite outline', 'unite outline'] + let lnum = expand('<slnum>') + s:unite_lnum - 4 + let g:_spacevim_mappings_unite.o = ['Unite outline', + \ 'unite outline', + \ [ + \ '[UNITE o ] is to open unite outline source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] " menu nnoremap <silent> [unite]ma \ :<C-u>Unite mapping<CR> nnoremap <silent> [unite]me \ :<C-u>Unite output:message<CR> - let g:_spacevim_mappings_unite.m = {'name' : 'unite menus', - \ 'a' : ['Unite mapping', 'unite mappings'], - \ 'e' : ['Unite output:message', 'unite messages'] + let lnum = expand('<slnum>') + s:unite_lnum - 6 + let g:_spacevim_mappings_unite.m = {'name' : '+Menus', + \ 'a' : ['Unite mapping', 'unite mappings', + \ [ + \ '[UNITE m a ] is to open unite mapping menu', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ], + \ 'e' : ['Unite output:message', 'unite messages', + \ [ + \ '[UNITE o ] is to open unite message menu', + \ '', + \ 'Definition: ' . s:file . ':' . (lnum + 2), + \ ] + \ ] \ } nnoremap <silent> [unite]c :<C-u>UniteWithCurrentDir \ -buffer-name=files buffer bookmark file<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 4 let g:_spacevim_mappings_unite.c = \ ['UniteWithCurrentDir -buffer-name=files buffer bookmark file', - \ 'unite files in current dir'] + \ 'unite files in current dir', + \ [ + \ '[UNITE c ] is to open unite outline source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] nnoremap <silent> [unite]b :<C-u>UniteWithBufferDir \ -buffer-name=files -prompt=%\ buffer bookmark file<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 4 let g:_spacevim_mappings_unite.b = \ ['UniteWithBufferDir -buffer-name=files' . \ ' buffer bookmark file', - \ 'unite files in current dir'] - nnoremap <silent> [unite]n :<C-u>Unite session/new<CR> + \ 'unite files in current dir', + \ [ + \ '[UNITE b ] is to open unite buffer and bookmark source with cursor', + \ 'word', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [unite]n + \ :<C-u>Unite session/new<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 4 let g:_spacevim_mappings_unite.n = ['Unite session/new', - \ 'unite session/new'] - nnoremap <silent> [unite]/ :Unite grep:.<cr> + \ 'unite session/new', + \ [ + \ '[UNITE n ] is to create new vim session', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] + nnoremap <silent> [unite]/ + \ :Unite grep:.<cr> + let lnum = expand('<slnum>') + s:unite_lnum - 4 let g:_spacevim_mappings_unite['/'] = ['Unite grep:.', - \ 'unite grep with preview'] + \ 'unite grep with preview', + \ [ + \ '[UNITE / ] is to open unite grep source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] nnoremap <silent> [unite]w \ :<C-u>Unite -buffer-name=files -no-split \ jump_point file_point buffer_tab \ file_rec:! file file/new<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 6 let g:_spacevim_mappings_unite.w= ['Unite -buffer-name=files -no-split' . \ ' jump_point file_point buffer_tab file_rec:! file file/new', - \ 'unite all file and jump'] + \ 'unite all file and jump', + \ [ + \ '[UNITE w ] is to open unite jump_point file_point and buffer_tab', + \ 'source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] nnoremap <silent>[unite]<Space> :Unite -silent -ignorecase -winheight=17 \ -start-insert menu:CustomKeyMaps<CR> + let lnum = expand('<slnum>') + s:unite_lnum - 4 let g:_spacevim_mappings_unite['[SPC]'] = ['Unite -silent -ignorecase' . \ ' -winheight=17 -start-insert menu:CustomKeyMaps', - \ 'unite customkeymaps'] + \ 'unite customkeymaps', + \ [ + \ '[UNITE o ] is to open unite outline source', + \ '', + \ 'Definition: ' . s:file . ':' . lnum, + \ ] + \ ] endif endfunction @@ -304,8 +587,12 @@ function! SpaceVim#mapping#leader#getName(key) abort return '[g]' elseif a:key == 'z' return '[z]' - else + elseif a:key == g:spacevim_windows_leader + return '[WIN]' + elseif a:key ==# '\' return '<leader>' + else + return '' endif endfunction @@ -315,6 +602,15 @@ function! SpaceVim#mapping#leader#defindKEYs() abort call extend(g:_spacevim_mappings_prefixs[g:spacevim_unite_leader], g:_spacevim_mappings_unite) let g:_spacevim_mappings_prefixs[g:spacevim_denite_leader] = {'name' : '+Denite prefix'} call extend(g:_spacevim_mappings_prefixs[g:spacevim_denite_leader], g:_spacevim_mappings_denite) + let g:_spacevim_mappings_prefixs[g:spacevim_windows_leader] = {'name' : '+Window prefix'} + call extend(g:_spacevim_mappings_prefixs[g:spacevim_windows_leader], g:_spacevim_mappings_windows) + let g:_spacevim_mappings_prefixs['g'] = {'name' : '+g prefix'} + call extend(g:_spacevim_mappings_prefixs['g'], g:_spacevim_mappings_g) + let g:_spacevim_mappings_prefixs['z'] = {'name' : '+z prefix'} + call extend(g:_spacevim_mappings_prefixs['z'], g:_spacevim_mappings_z) + let leader = get(g:, 'mapleader', '\') + let g:_spacevim_mappings_prefixs[leader] = {'name' : '+Leader prefix'} + call extend(g:_spacevim_mappings_prefixs[leader], g:_spacevim_mappings) endfunction diff --git a/autoload/SpaceVim/mapping/space.vim b/autoload/SpaceVim/mapping/space.vim index d5731284d..71bc1404d 100644 --- a/autoload/SpaceVim/mapping/space.vim +++ b/autoload/SpaceVim/mapping/space.vim @@ -30,6 +30,10 @@ function! SpaceVim#mapping#space#init() abort vnoremap <silent><nowait> [SPC] :<c-u>LeaderGuideVisual " "<CR> nmap <Space> [SPC] vmap <Space> [SPC] + if g:spacevim_enable_language_specific_leader + nmap , [SPC]l + vmap , [SPC]l + endif " Windows for i in range(1, 9) exe "call SpaceVim#mapping#space#def('nnoremap', [" @@ -272,6 +276,8 @@ function! SpaceVim#mapping#space#init() abort call SpaceVim#mapping#space#def('nnoremap', ['s', 'g', 'G'], 'call SpaceVim#plugins#flygrep#open()', \ 'grep on the fly', 1) + call SpaceVim#mapping#space#def('nnoremap', ['s', '/'], 'call SpaceVim#plugins#flygrep#open()', + \ 'grep on the fly', 1) call SpaceVim#mapping#space#def('nnoremap', ['s', 'c'], 'noh', \ 'clear search highlight', 1) diff --git a/autoload/SpaceVim/plugins/flygrep.vim b/autoload/SpaceVim/plugins/flygrep.vim index accb8af13..c4a6fc044 100644 --- a/autoload/SpaceVim/plugins/flygrep.vim +++ b/autoload/SpaceVim/plugins/flygrep.vim @@ -2,7 +2,7 @@ let s:MPT = SpaceVim#api#import('prompt') let s:JOB = SpaceVim#api#import('job') let s:SYS = SpaceVim#api#import('system') let s:grepid = 0 - +let s:MPT._prompt.mpt = 'โญ ' function! SpaceVim#plugins#flygrep#open() abort rightbelow split __flygrep__ diff --git a/autoload/SpaceVim/plugins/help.vim b/autoload/SpaceVim/plugins/help.vim index db5d690d2..35e6a7da5 100644 --- a/autoload/SpaceVim/plugins/help.vim +++ b/autoload/SpaceVim/plugins/help.vim @@ -5,68 +5,96 @@ function! SpaceVim#plugins#help#describe_bindings() endfunction function! SpaceVim#plugins#help#regist_root(dict) - let keys = keys(a:dict) - if type(a:dict) == 4 && len(keys) == 1 - call extend(s:key_describ, a:dict) - endif + let keys = keys(a:dict) + if type(a:dict) == 4 && len(keys) == 1 + call extend(s:key_describ, a:dict) + endif endfunction function! SpaceVim#plugins#help#describe_key() - let definded = 1 - let root = s:key_describ - let prompt = 'Describe key:' - let keys = [] - call s:build_mpt(prompt) - while definded - let key = getchar() - let name = s:KEY.nr2name(key) - call add(keys, name) - if has_key(root, name) - let root = root[name] - if type(root) == 3 - if len(root) == 3 - redraw! - call s:open_describe_buffer(root[-1]) - else - call s:build_mpt(['can not find describe for ', join(keys, ' - ')]) - endif - let definded = 0 - else - call s:build_mpt([prompt, join(keys + [''], ' - ')]) - endif + let defined = 1 + let root = s:key_describ + let prompt = 'Describe key:' + let keys = [] + call s:build_mpt(prompt) + let key = getchar() + let char = s:KEY.nr2name(key) + if index(keys(g:_spacevim_mappings_prefixs), char) != -1 + let name = SpaceVim#mapping#leader#getName(nr2char(key)) + else + let name = char + endif + call add(keys, name) + if has_key(root, name) + let root = root[name] + if type(root) == 3 + if len(root) == 3 + redraw! + call s:open_describe_buffer(root[-1]) + else + call s:build_mpt(['can not find describe for ', join(keys, ' - ')]) + endif + let defined = 0 + else + call s:build_mpt([prompt, join(keys + [''], ' - ')]) + endif + else + redraw! + echohl Comment + echo join(keys, ' - ') . ' is undefined' + echohl NONE + let defined = 0 + endif + while defined + let key = getchar() + let name = s:KEY.nr2name(key) + call add(keys, name) + if has_key(root, name) + let root = root[name] + if type(root) == 3 + if len(root) == 3 + redraw! + call s:open_describe_buffer(root[-1]) else - redraw! - echohl Comment - echo join(keys, ' - ') . ' is undfinded' - echohl NONE - let definded = 0 + call s:build_mpt(['can not find describe for ', join(keys, ' - ')]) endif - endwhile + let defined = 0 + else + call s:build_mpt([prompt, join(keys + [''], ' - ')]) + endif + else + redraw! + echohl Comment + echo join(keys, ' - ') . ' is undefined' + echohl NONE + let defined = 0 + endif + endwhile endfunction function! s:build_mpt(mpt) abort - redraw! - echohl Comment - if type(a:mpt) == 1 - echo a:mpt - elseif type(a:mpt) == 3 - echo join(a:mpt) - endif - echohl NONE + redraw! + echohl Comment + if type(a:mpt) == 1 + echo a:mpt + elseif type(a:mpt) == 3 + echo join(a:mpt) + endif + echohl NONE endfunction function! s:open_describe_buffer(desc) abort - noautocmd botright split __help_describe__ - setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline nospell nonu norelativenumber nocursorline - set filetype=HelpDescribe - call setline(1, a:desc) - let b:defind_file_name = split(a:desc[-1][12:], ':') - let lines = &lines * 30 / 100 - if lines < winheight(0) - exe 'resize ' . lines - endif - setlocal nofoldenable - nnoremap <buffer><silent> q :bd<cr> + noautocmd botright split __help_describe__ + setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline nospell nonu norelativenumber nocursorline + set filetype=HelpDescribe + call setline(1, a:desc) + let b:defind_file_name = split(a:desc[-1][12:], ':') + let lines = &lines * 30 / 100 + if lines < winheight(0) + exe 'resize ' . lines + endif + setlocal nofoldenable + nnoremap <buffer><silent> q :bd<cr> endfunction diff --git a/autoload/SpaceVim/plugins/repl.vim b/autoload/SpaceVim/plugins/repl.vim index 807b67185..a5d3198c8 100644 --- a/autoload/SpaceVim/plugins/repl.vim +++ b/autoload/SpaceVim/plugins/repl.vim @@ -66,7 +66,7 @@ function! s:start(exe) abort \ } let s:start_time = reltime() call s:open_windows() - call s:BUFFER.buf_set_lines(s:bufnr, s:lines , s:lines + 3, 0, ['[REPL executable] ' . a:exe, '', repeat('-', 20)]) + call s:BUFFER.buf_set_lines(s:bufnr, s:lines , s:lines + 3, 0, ['[REPL executable] ' . string(a:exe), '', repeat('-', 20)]) let s:lines += 3 let s:_out_data = [''] let s:_current_line = '' diff --git a/doc/SpaceVim.txt b/doc/SpaceVim.txt index 8a9a45f20..07972639e 100644 --- a/doc/SpaceVim.txt +++ b/doc/SpaceVim.txt @@ -233,6 +233,10 @@ Define the right section of statusline in active windows. By default: *g:spacevim_statusline_unicode_symbols* Enable/Disable unicode symbols in statusline + *g:spacevim_enable_language_specific_leader* +Enable/Disable language specific leader, by default you can use `,` ket +instead of `SPC` `l`. + *g:spacevim_enable_statusline_display_mode* Enable/Disable display mode. Default is 0, mode will be displayed in statusline. To enable this feature: diff --git a/docs/README_zh_cn.md b/docs/README_zh_cn.md index 198c0f05b..41ce35264 100644 --- a/docs/README_zh_cn.md +++ b/docs/README_zh_cn.md @@ -1,44 +1,43 @@ --- title: "SpaceVim ไธญๆๆๅ" -description: "SpaceVim ๆฏไธไธช็คพๅบ้ฉฑๅจ็ Vim ้ ็ฝฎ๏ผๅ ๅซๅค็ง่ฏญ่จๆจกๅ๏ผๆไพไบไปฃ็ ่กฅๅ จใ่ฏญๆณๆฃๆฅใ่ทณ่ฝฌ็ญๅค็ง IDE ็นๆงใ" +description: "SpaceVim ๆฏไธไธช็คพๅบ้ฉฑๅจ็ๆจกๅๅ Vim ้ ็ฝฎ๏ผไปฅๆจกๅ็ๆนๅผ็ป็ปๅ็ฎก็ๆไปถ๏ผไธบไธๅ่ฏญ่จๅผๅๅฎๅถ็นๅฎ็ๆจกๅ๏ผๆไพ่ฏญๆณๆฃๆฅใ่ชๅจ่กฅๅ จใๆ ผๅผๅใไธ้ฎ็ผ่ฏ่ฟ่กใไปฅๅ REPL ๅ DEBUG ๆฏๆใ" --- # SpaceVim ไธญๆๆๅ [](https://travis-ci.org/SpaceVim/SpaceVim) - -[](https://github.com/SpaceVim/SpaceVim/blob/master/LICENSE) -[](https://github.com/SpaceVim/SpaceVim/blob/dev/doc/SpaceVim.txt) +[](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/dev) +[](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev) +[](https://github.com/SpaceVim/SpaceVim/releases) +[](https://github.com/SpaceVim/SpaceVim/blob/dev/LICENSE) [](https://jq.qq.com/?_wv=1027&k=43DB6SG) -[](https://gitter.im/SpaceVim/SpaceVim?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -[](https://www.facebook.com/SpaceVim) - -[](https://github.com/SpaceVim/SpaceVim) +[](https://weibo.com/SpaceVim) [](https://github.com/SpaceVim/SpaceVim) -[](https://github.com/SpaceVim/SpaceVim) -[](https://twitter.com/SpaceVim) - + ้กน ็ฎ ไธป ้กต๏ผ <https://spacevim.org> Github ๅฐๅ : <https://github.com/SpaceVim/SpaceVim> -SpaceVim ๆฏไธไธช็คพๅบ้ฉฑๅจ็ๆจกๅๅ vim/neovim ้ ็ฝฎ้ๅ๏ผๅ ถไธญๅ ๅซไบๅค็งๅ่ฝๆจกๅ๏ผๅนถไธ้ๅฏน neovim ๅไบๅ่ฝไผๅใspacevim ๆๅค็งๅ่ฝๆจกๅๅฏไพ็จๆท้ๆฉ๏ผ้ๅฏนไธๅ่ฏญ่จ้ๆฉ็นๅฎ็ๆจกๅ๏ผๅฐฑๅฏไปฅ้ ็ฝฎๅบไธไธช้ๅ็นๅฎ่ฏญ่จๅผๅ็็ฏๅขใ +SpaceVim ๆฏไธไธช็คพๅบ้ฉฑๅจ็ๆจกๅๅ vim/neovim ้ ็ฝฎ้ๅ๏ผไปฅๆจกๅ็ๆนๅผ็ป็ป็ฎก็ๆไปถไปฅ +ๅ็ธๅ ณ้ ็ฝฎ๏ผไธบไธๅ็่ฏญ่จๅผๅ้่บซๅฎๅถไบ็ธๅ ณ็ๅผๅๆจกๅ๏ผ่ฏฅๆจกๅๆไพไปฃ็ ่ชๅจ่กฅๅ จ๏ผ +่ฏญๆณๆฃๆฅใๆ ผๅผๅใ่ฐ่ฏใREPL ็ญ็นๆงใ็จๆทไป ้่ฝฝๅ ฅ็ธๅ ณ่ฏญ่จ็ๆจกๅๅณๅฏๅพๅฐไธไธชๅผ็ฎฑ +ๅณ็จ็Vim-IDEใ -ไฝฟ็จ่ฟ็จไธญ้ๅฐ้ฎ้ขๆ่ ๆไปไนๅ่ฝ้ๆฑๅฏไปฅๅจ github ๆไบค issue๏ผ่ฟๅฐๆดๅฎนๆ่ขซๅ ณๆณจๅไฟฎๅคใๆไปฌไนๆฌข่ฟๅๆฌข vim/neovim ็็จๆทๅ ๅ ฅๆไปฌ็ QQ ็พค๏ผไธ่ตท่ฎจ่ฎบ vim ็ธๅ ณ็ๆๅทง๏ผ[็นๅปๅ ๅ ฅVim/SpaceVim็จๆท็พค](https://jq.qq.com/?_wv=1027&k=43zWPlT)ใ +ไฝฟ็จ่ฟ็จไธญ้ๅฐ้ฎ้ขๆ่ ๆไปไนๅ่ฝ้ๆฑๅฏไปฅๅจ github ๆไบค issue๏ผ่ฟๅฐๆดๅฎนๆ่ขซๅ ณๆณจ +ๅไฟฎๅคใๆไปฌไนๆฌข่ฟๅๆฌข vim/neovim ็็จๆทๅ ๅ ฅๆไปฌ็ +[QQ็พค(็นๅปๅ ๅ ฅ)](https://jq.qq.com/?_wv=1027&k=43zWPlT)๏ผ่ฏฅ็พคๅฎๆไนไผๅไบซไธไบ +ๅฎ็จ็ Vim ๆๅทงไปฅๅๆไปถใ ไปฅไธๆฏ่ฟๅ ๅจ็ๅผๅๆฑๆป๏ผ [](https://github.com/SpaceVim/SpaceVim/pulse) -**ๆๅฉSpaceVim** -| ๅพฎไฟก | ๆฏไปๅฎ | -| ------------------------------------------------------------------------ | -------------------------------------------------------------------------- | -| <img src="https://spacevim.org/img/weixin.png" height="150" width="150"> | <img src="https://spacevim.org/img/zhifubao.png" height="150" width="150"> | +**ๅ ณๆณจๆไปฌ:** -**ไปฅไธไธบSpaceVimไธญๆๆๅ๏ผ้จๅๅ ๅฎน่ฟๆชๅฎๆ็ฟป่ฏ๏ผไธบไบๆนไพฟๅคงๅฎถๆฅ่ฏข็ธๅ ณไฟกๆฏ๏ผๅทฒๆๅๅๅธๅฎ็ฝไธ๏ผๅ้ขไผ้ๆธๆดๆฐๅฎๆ๏ผๆ่ฐขๅคงๅฎถไธ็ดไปฅๆฅ็ๆฏๆ๏ผ** +<img src="https://spacevim.org/img/weixingongzhonghao.png" height="200" width="200"> <!-- vim-markdown-toc GFM --> @@ -205,7 +204,7 @@ SpaceVimๆฏไธ็งๆจกๅๅ้ ็ฝฎ๏ผๅฏไปฅ่ฟ่กๅจvimๆ่ neovimไธ๏ผๅ ณไบvim **windows๏ผ** -Window ไธๆๆนไพฟ็ๆฏไธ่ฝฝๅฎ่ฃ ่ๆฌ๏ผ[install.cmd](https://spacevim.org/install.cmd)๏ผ่ณๆฌๅฐ๏ผ็ดๆฅ่ฟ่กใ +Window ไธๆๆนไพฟ็ๆฏไธ่ฝฝๅฎ่ฃ ่ๆฌ๏ผ[install.cmd](https://spacevim.org/install.cmd)๏ผ่ณๆฌๅฐ๏ผ็ดๆฅ่ฟ่ก๏ผๅฎ่ฃ ๅฎๆฏๅ๏ผๆๅผ Gvim ไปๅฐ่ชๅจไธ่ฝฝๆไปถ๏ผๅจ Windows ไธ้่ฆๆๅจๅฎ่ฃ [Nerd-fonts](https://github.com/ryanoasis/nerd-fonts) ๅญไฝใ ## ๆดๆฐ @@ -1008,9 +1007,9 @@ SpaceVim ็ๆไปถๆ ๆไพไบ็ๆฌๆงๅถไฟกๆฏ็ๅๅฃ๏ผไฝๆฏ่ฟไธ็นๆง | `g]` | tselect cursor tag | | `g^` | go to leftmost no-white character | | `g_` | go to last char | -| ``g` `` | ่ทณ่ณๆ ็ญพ๏ผ็ญๅไบ `g'` | -| `ga` | ๆๅฐๅ ๆ ๅญ็ฌฆ็ ascii ๅผ | -| `gd` | ่ทณ่ณๅฎไนๅค | +| ``g` `` | ่ทณ่ณๆ ็ญพ๏ผ็ญๅไบ `g'` | +| `ga` | ๆๅฐๅ ๆ ๅญ็ฌฆ็ ascii ๅผ | +| `gd` | ่ทณ่ณๅฎไนๅค | | `ge` | go to end of previous word | | `gf` | edit file under cursor | | `gg` | go to line N | @@ -1025,8 +1024,8 @@ SpaceVim ็ๆไปถๆ ๆไพไบ็ๆฌๆงๅถไฟกๆฏ็ๅๅฃ๏ผไฝๆฏ่ฟไธ็นๆง | `gt` | next tag page | | `gu` | make motion text lowercase | | `g~` | swap case for Nmove text | -| `g<End>` | ่ทณ่ณๆฌ่กๆๅณไพงๅญ็ฌฆ๏ผ็ญๅไบ `g$` | -| `g<C-G>` | ๆพ็คบๅ ๆ ไฟกๆฏ | +| `g<End>` | ่ทณ่ณๆฌ่กๆๅณไพงๅญ็ฌฆ๏ผ็ญๅไบ `g$` | +| `g<C-G>` | ๆพ็คบๅ ๆ ไฟกๆฏ | ### Commands starting with `z` @@ -2141,4 +2140,10 @@ let g:spacevim_guifont = 'DejaVu\ Sans\ Mono\ for\ Powerline\ 11' {% endfor %} </ul> +**ๆๅฉSpaceVim** + +| ๅพฎไฟก | ๆฏไปๅฎ | +| ------------------------------------------------------------------------ | -------------------------------------------------------------------------- | +| <img src="https://spacevim.org/img/weixin.png" height="150" width="150"> | <img src="https://spacevim.org/img/zhifubao.png" height="150" width="150"> | + <!-- vim:set nowrap: --> diff --git a/docs/_posts/2017-12-30-SpaceVim-release-v0.6.0.md b/docs/_posts/2017-12-30-SpaceVim-release-v0.6.0.md new file mode 100644 index 000000000..8afc32f88 --- /dev/null +++ b/docs/_posts/2017-12-30-SpaceVim-release-v0.6.0.md @@ -0,0 +1,147 @@ +--- +title: SpaceVim release v0.6.0 +categories: changelog +excerpt: "Many new features come out with v0.6.0" +type: NewsArticle +image: https://user-images.githubusercontent.com/13142418/33793078-3446cb6e-dc76-11e7-9998-376a355557a4.png +--- + +# [Changelogs](https://spacevim.org/development#changelog) > SpaceVim release v0.6.0 + +## New Features + +- Add c/cpp syntax file [#1188](https://github.com/SpaceVim/SpaceVim/pull/1188) +- Add NeoSolarized guide theme [#1187](https://github.com/SpaceVim/SpaceVim/pull/1187) +- Add gf support in windows for plugin manager [#1184](https://github.com/SpaceVim/SpaceVim/pull/1184) +- Add solarized guide theme [#1180](https://github.com/SpaceVim/SpaceVim/pull/1180) +- Add php runner [#1174](https://github.com/SpaceVim/SpaceVim/pull/1174) +- Add lsp support for vim8 [#1165](https://github.com/SpaceVim/SpaceVim/pull/1165) +- Add lsp support for php [#1163](https://github.com/SpaceVim/SpaceVim/pull/1163) +- add description to the DOC of golang layer [#1140](https://github.com/SpaceVim/SpaceVim/pull/1140) +- add doc of searching files to managing project [#1116](https://github.com/SpaceVim/SpaceVim/pull/1116) +- Add a new plugin for JavaScript [#1099](https://github.com/SpaceVim/SpaceVim/pull/1099) +- Add language server configurations for Haskell [#1094](https://github.com/SpaceVim/SpaceVim/pull/1094) +- Add chat config [#1085](https://github.com/SpaceVim/SpaceVim/pull/1085) +- Add runner syntax file [#1068](https://github.com/SpaceVim/SpaceVim/pull/1068) +- Add func for custom group name [#1052](https://github.com/SpaceVim/SpaceVim/pull/1052) +- Add hunks summary [#1046](https://github.com/SpaceVim/SpaceVim/pull/1046) +- Add mapping for Increase/Decrease numbers [#1039](https://github.com/SpaceVim/SpaceVim/pull/1039) +- Add signatures api [#1036](https://github.com/SpaceVim/SpaceVim/pull/1036) +- Added a new layer lsp [#1014](https://github.com/SpaceVim/SpaceVim/pull/1014) +- Add: Improve spacevim statusline [#1012](https://github.com/SpaceVim/SpaceVim/pull/1012) +- Add mappings for git blame and git log [#1009](https://github.com/SpaceVim/SpaceVim/pull/1009) +- Added a new plugin vim-jplus [#1002](https://github.com/SpaceVim/SpaceVim/pull/1002) +- Added autocmd to update status-line [#1000](https://github.com/SpaceVim/SpaceVim/pull/1000) +- Add gd for help desc buffer && fix SPC p f [#997](https://github.com/SpaceVim/SpaceVim/pull/997) +- Added a runner for Ruby language [#993](https://github.com/SpaceVim/SpaceVim/pull/993) +- Added a runner for Crystal language [#992](https://github.com/SpaceVim/SpaceVim/pull/992) +- Added language features for JavaScript [#991](https://github.com/SpaceVim/SpaceVim/pull/991) +- Added filetypes for Emmet [#990](https://github.com/SpaceVim/SpaceVim/pull/990) +- Added zsh support [#989](https://github.com/SpaceVim/SpaceVim/pull/989) +- Added Denite sources [#988](https://github.com/SpaceVim/SpaceVim/pull/988) +- Added Rust language features [#973](https://github.com/SpaceVim/SpaceVim/pull/973) +- Added Haskell runner [#972](https://github.com/SpaceVim/SpaceVim/pull/972) + + +## Feature Changes + +- Change gitk plugin [#1131](https://github.com/SpaceVim/SpaceVim/pull/1131) + + +## Bug Fixs + +- fix issue 1196 (tab list bug) [#1201](https://github.com/SpaceVim/SpaceVim/pull/1201) +- fix typo [#1198](https://github.com/SpaceVim/SpaceVim/pull/1198) +- Fix win project manager [#1182](https://github.com/SpaceVim/SpaceVim/pull/1182) +- Fix lua repl && add layer doc [#1155](https://github.com/SpaceVim/SpaceVim/pull/1155) +- Fix lua repl [#1149](https://github.com/SpaceVim/SpaceVim/pull/1149) +- fix spelling error for stage all files [#1139](https://github.com/SpaceVim/SpaceVim/pull/1139) +- Fix SPC f b for show bookmarks [#1125](https://github.com/SpaceVim/SpaceVim/pull/1125) +- Fix transient state api [#1124](https://github.com/SpaceVim/SpaceVim/pull/1124) +- Fix two typos. [#1108](https://github.com/SpaceVim/SpaceVim/pull/1108) +- Fix an issue occurd in ALE-enabled environment [#1103](https://github.com/SpaceVim/SpaceVim/pull/1103) +- Fix for ctrlp with ag searcher. #1081 [#1082](https://github.com/SpaceVim/SpaceVim/pull/1082) +- Fix statusline for small windows. [#1076](https://github.com/SpaceVim/SpaceVim/pull/1076) +- Fix ycm config [#1074](https://github.com/SpaceVim/SpaceVim/pull/1074) +- Fix #1070 [#1072](https://github.com/SpaceVim/SpaceVim/pull/1072) +- Fix bot [#1063](https://github.com/SpaceVim/SpaceVim/pull/1063) +- Fix Duplicate meta descriptions [#1060](https://github.com/SpaceVim/SpaceVim/pull/1060) +- fix a syntax error of markdown table in documentation. [#1057](https://github.com/SpaceVim/SpaceVim/pull/1057) +- Fix Yggdroot/indentLine configuration [#1037](https://github.com/SpaceVim/SpaceVim/pull/1037) +- Fix typo whit -> with [#1033](https://github.com/SpaceVim/SpaceVim/pull/1033) +- Fix lint [#1030](https://github.com/SpaceVim/SpaceVim/pull/1030) +- Fix windows installation [#1029](https://github.com/SpaceVim/SpaceVim/pull/1029) +- fix mac fc-cache mkfontdir mkfontscale not exists #1016 [#1017](https://github.com/SpaceVim/SpaceVim/pull/1017) +- Fix lsp support [#1013](https://github.com/SpaceVim/SpaceVim/pull/1013) +- fix word [#1006](https://github.com/SpaceVim/SpaceVim/pull/1006) +- Fixed plugin 'vim-rtags' initialization errors [#995](https://github.com/SpaceVim/SpaceVim/pull/995) +- Fix Logger [#985](https://github.com/SpaceVim/SpaceVim/pull/985) +- Fix server error [#979](https://github.com/SpaceVim/SpaceVim/pull/979) +- Fixed Haskell layer config [#974](https://github.com/SpaceVim/SpaceVim/pull/974) +- Fixed cursor mode-sensitive issue [#971](https://github.com/SpaceVim/SpaceVim/pull/971) +- Fix capitalization on website [#970](https://github.com/SpaceVim/SpaceVim/pull/970) + + +## Unmarked PRs + +- [SPC b t] Open Vimfiler by buffer file dir [#1200](https://github.com/SpaceVim/SpaceVim/pull/1200) +- Auto update neoinclude config [#1195](https://github.com/SpaceVim/SpaceVim/pull/1195) +- Disable welcome when load session at startup [#1191](https://github.com/SpaceVim/SpaceVim/pull/1191) +- Close #1157 [#1189](https://github.com/SpaceVim/SpaceVim/pull/1189) +- Support cwd in job [#1186](https://github.com/SpaceVim/SpaceVim/pull/1186) +- Improve plugin manager [#1179](https://github.com/SpaceVim/SpaceVim/pull/1179) +- Update project index [#1175](https://github.com/SpaceVim/SpaceVim/pull/1175) +- Update JavaScript language server [#1170](https://github.com/SpaceVim/SpaceVim/pull/1170) +- Update c layer doc [#1169](https://github.com/SpaceVim/SpaceVim/pull/1169) +- git: ignore swp files. [#1167](https://github.com/SpaceVim/SpaceVim/pull/1167) +- Update language layer [#1161](https://github.com/SpaceVim/SpaceVim/pull/1161) +- Support disable tabline [#1156](https://github.com/SpaceVim/SpaceVim/pull/1156) +- Update doc for layers [#1154](https://github.com/SpaceVim/SpaceVim/pull/1154) +- [Ready] Improve lua layer [#1147](https://github.com/SpaceVim/SpaceVim/pull/1147) +- Update blog [#1144](https://github.com/SpaceVim/SpaceVim/pull/1144) +- Update java layer [#1138](https://github.com/SpaceVim/SpaceVim/pull/1138) +- Update project key bindings [#1137](https://github.com/SpaceVim/SpaceVim/pull/1137) +- Clear cmdline after open file in flygrep [#1136](https://github.com/SpaceVim/SpaceVim/pull/1136) +- Set sign text [#1135](https://github.com/SpaceVim/SpaceVim/pull/1135) +- [WIP] Lua layer improvements [#1134](https://github.com/SpaceVim/SpaceVim/pull/1134) +- Update init.vim [#1130](https://github.com/SpaceVim/SpaceVim/pull/1130) +- Project manager [#1129](https://github.com/SpaceVim/SpaceVim/pull/1129) +- Update elixir layer [#1127](https://github.com/SpaceVim/SpaceVim/pull/1127) +- Update Home page [#1126](https://github.com/SpaceVim/SpaceVim/pull/1126) +- Update key bindings for debug layer [#1118](https://github.com/SpaceVim/SpaceVim/pull/1118) +- reimplement move text down and up [#1114](https://github.com/SpaceVim/SpaceVim/pull/1114) +- Improve guide cursor [#1113](https://github.com/SpaceVim/SpaceVim/pull/1113) +- Improve lang#ruby layer [#1112](https://github.com/SpaceVim/SpaceVim/pull/1112) +- Improve Emmet configuration [#1111](https://github.com/SpaceVim/SpaceVim/pull/1111) +- Update python layer documentation [#1110](https://github.com/SpaceVim/SpaceVim/pull/1110) +- Update wiki & website & readme [#1106](https://github.com/SpaceVim/SpaceVim/pull/1106) +- Improve implementations of tmux integration [#1105](https://github.com/SpaceVim/SpaceVim/pull/1105) +- doc: fix g:spacevim_terminal_cursor_shape default [#1095](https://github.com/SpaceVim/SpaceVim/pull/1095) +- Add language server configuration for JavaScript [#1093](https://github.com/SpaceVim/SpaceVim/pull/1093) +- Update documents about colorscheme [#1091](https://github.com/SpaceVim/SpaceVim/pull/1091) +- [WARNING!] Implement Sass - second pull request [#1083](https://github.com/SpaceVim/SpaceVim/pull/1083) +- Mouse support in tabline [#1071](https://github.com/SpaceVim/SpaceVim/pull/1071) +- Improve Tabline [#1067](https://github.com/SpaceVim/SpaceVim/pull/1067) +- Update lang#c layer [#1065](https://github.com/SpaceVim/SpaceVim/pull/1065) +- zsh:support autocomplete [#1064](https://github.com/SpaceVim/SpaceVim/pull/1064) +- bashcomplete: can not trigger omnicomplete in some pos [#1061](https://github.com/SpaceVim/SpaceVim/pull/1061) +- Update runner [#1055](https://github.com/SpaceVim/SpaceVim/pull/1055) +- get_complete: compatiable with macOS. [#1054](https://github.com/SpaceVim/SpaceVim/pull/1054) +- bugfix start zsh error [#1050](https://github.com/SpaceVim/SpaceVim/pull/1050) +- File clipboard [#1043](https://github.com/SpaceVim/SpaceVim/pull/1043) +- Update community page [#1041](https://github.com/SpaceVim/SpaceVim/pull/1041) +- Enable syntax error/warning counts in status line [#1040](https://github.com/SpaceVim/SpaceVim/pull/1040) +- Update issue.vim [#1034](https://github.com/SpaceVim/SpaceVim/pull/1034) +- uninstall section added [#1027](https://github.com/SpaceVim/SpaceVim/pull/1027) +- Makefile: fix covimerage integration: use installed [#1026](https://github.com/SpaceVim/SpaceVim/pull/1026) +- Update autocomple layer [#1025](https://github.com/SpaceVim/SpaceVim/pull/1025) +- Run EmmetInstall on vue and eex filetypes [#1020](https://github.com/SpaceVim/SpaceVim/pull/1020) +- Update website [#1011](https://github.com/SpaceVim/SpaceVim/pull/1011) +- Version control [#1005](https://github.com/SpaceVim/SpaceVim/pull/1005) +- Auto install fonts [#998](https://github.com/SpaceVim/SpaceVim/pull/998) +- Enable deoplete in vim8 && lsp support [#994](https://github.com/SpaceVim/SpaceVim/pull/994) +- Made Markdown preview use open-browser.vim [#987](https://github.com/SpaceVim/SpaceVim/pull/987) +- Update version [#984](https://github.com/SpaceVim/SpaceVim/pull/984) +- Update travis setting [#981](https://github.com/SpaceVim/SpaceVim/pull/981) +- Server client [#976](https://github.com/SpaceVim/SpaceVim/pull/976) +- Disabled completions by deoplete [#968](https://github.com/SpaceVim/SpaceVim/pull/968) diff --git a/docs/_posts/2018-01-01-SpaceVim-Newsletter-Never-lost-never-give-up.md b/docs/_posts/2018-01-01-SpaceVim-Newsletter-Never-lost-never-give-up.md new file mode 100644 index 000000000..d1d204f61 --- /dev/null +++ b/docs/_posts/2018-01-01-SpaceVim-Newsletter-Never-lost-never-give-up.md @@ -0,0 +1,94 @@ +--- +title: "Newsletter #2 - Never lost, Never give up" +categories: newsletter +excerpt: "We know exactly what is the purpose of SpaceVim, and we keep trying to get it, never get lost, never give up..." +image: https://user-images.githubusercontent.com/13142418/34612367-18fdf2d6-f1ef-11e7-885e-5e82613c1444.png +--- + +# [newsletter](https://spacevim.org/development#newsletter) > Never lost, Never give up + +Welcome to the second newsletter for SpaceVim, a project that hopes to turn vim into a modular IDE for most languages. + +## What is SpaceVim + +SpaceVim is a vim distribution which's inspired by spacemacs. It manages collection of plugins in layers, which help collect related packages together to provide features. For example, the [python layer](http://spacevim.org/layers/lang/python/) collects [deoplete.nvim](https://github.com/Shougo/deoplete.nvim/), [neomake](https://github.com/neomake/neomake) and [deoplete-jedi](https://github.com/zchee/deoplete-jedi) together to provides autocompletion, syntax checking, and documentation lookup. This approach helps keep configuration organized and reduces overhead for users by keeping them from having to think about what packages to install. + +The development of SpaceVim happened on github: <https://github.com/SpaceVim/SpaceVim>. + +## Participating + +If you are interested in contributing to SpaceVim, read the [development](http://spacevim.org/development/) page to get start. You can also join our [community channels](http://spacevim.org/community/). + +## What's new + +The last newsletter was posted on May 31, SpaceVim has released 4 releases. + +### Release 0.3.1 + +This release is a HOTFIX after 0.3.0, It brings support for old version of vim and fixs some startup errors. + +new features in this release: + +- autocompletion when edit gitcommit. +- Undo/Redo quit windows +- `SPC b` prefix key bindings for buffer +- `SPC f` prefix key bindings for file +- `g` prefix key bindings guide +- `z` prefix key bindings guide +- `SPC s` prefix key bindings for searching && searching index + +for more info, please check the [release page of 0.3.1](https://spacevim.org/SpaceVim-release-v0.3.1/) + +### Release 0.4.0 + +Next letโs see what happened in 0.4.0. As before, check out the [release notes](https://spacevim.org/SpaceVim-release-v0.4.0/) for details. + +- background searching and grep on the fly in incsearch layer +- add prompt and web api +- help describe for key bindings: `SPC h d k` +- Add comment/manipulation/insertion key bindings + +### Release 0.5.0 + +This release is a big release after 0.4.0, three months development brings many new features. + +- Improve help describe key bindings +- Improve ci +- modular statusline/tabline +- job API for neovim/vim +- project manager and remote manager +- new language layers + +for more info, please check the [release page of 0.5.0](https://spacevim.org/SpaceVim-release-v0.5.0/) + +### Release 0.6.0 + +The latest release brings a host of fixes and improvements. We will list some new features here, and be sure to check the [release page](https://spacevim.org/SpaceVim-release-v0.6.0/) for all the details. + +- gf support in windows for plugin manager +- runner/debuger/REPL support for language layer +- language server protocol support +- Improve the plugin manager UI (added in v0.3.0) + +### 0.7.0-dev + +The develop version of SpaceVim is 0.7.0-dev now, here is a list of new features. + +- Guide for windows key bindings: `s` prefix +- new language layer: `lang#dart` +- new layer: `cscope` +- key bindings help describe + +for more info, you can check the [pull requests](https://github.com/SpaceVim/SpaceVim/pulls?q=is%3Apr+is%3Aclosed) + +### Upcoming features + +we recommand to read the [roadmap](https://spacevim.org/roadmap/) of SpaceVim. You can also check the PR list of SpaceVim: + +https://github.com/SpaceVim/SpaceVim/pulls + +[#1102](https://github.com/SpaceVim/SpaceVim/pull/1102) is PR for useing floating windows for grep on the fly, But this need a new neovim [WIP feature](https://github.com/neovim/neovim/pull/6619). + +## Thanks + +Thank you contributors, sponsors, bug-reporters, supporters. Thank you [@wsdjeg](https://github.com/wsdjeg) for the awesome project and thank you [@syl20bnr](https://github.com/syl20bnr) for your foundational work. diff --git a/docs/community.md b/docs/community.md index 72f75132f..efd9a8cac 100644 --- a/docs/community.md +++ b/docs/community.md @@ -7,12 +7,17 @@ description: "A list for community channels for SpaceVim." Visit these resources for help or general questions. +## Discuss + +- [/r/spacevim on Reddit](https://reddit.com/r/spacevim) +- [Mailing list](https://groups.google.com/forum/#!forum/spacevim) +- [Twitter](https://twitter.com/SpaceVim) +- [Facebook](https://www.facebook.com/SpaceVim) + ## Ask -- [issue tracker](https://github.com/SpaceVim/SpaceVim/issues) for issue and feature requests - Try [vi.stackexchange.com](https://vi.stackexchange.com/) for **usage and configuration questions**. -- [Twitter](https://twitter.com/SpaceVim) for hugs & pithy comments -- [Facebook](https://www.facebook.com/SpaceVim) +- [issue tracker](https://github.com/SpaceVim/SpaceVim/issues) for issue and feature requests ## Chat @@ -26,7 +31,3 @@ All of these channels are bridged together. Click on one of the badges below to - [`#spacevim:matrix.org` on Matrix](https://riot.im/app/#/room/%23spacevim:matrix.org) - [`#spacevim` on slack](https://spacevim.slack.com/messages/C88CTJ62J) -## Discuss - -- [google mailing list](https://groups.google.com/forum/#!forum/spacevim) -- [/r/spacevim on Reddit](https://reddit.com/r/spacevim) diff --git a/docs/development.md b/docs/development.md index aa5416665..a8a7a98bb 100644 --- a/docs/development.md +++ b/docs/development.md @@ -21,6 +21,7 @@ description: "Development information about SpaceVim, including contributing gui - [Author of a new layer](#author-of-a-new-layer) - [Contributor to an existing layer](#contributor-to-an-existing-layer) - [Contributing a keybinding](#contributing-a-keybinding) + - [Language specified key bindings](#language-specified-key-bindings) - [Contributing a banner](#contributing-a-banner) - [Build with SpaceVim](#build-with-spacevim) - [Changelog](#changelog) @@ -110,27 +111,29 @@ Write commit messages according to adapted [Tim Popeโs guidelines](http://tbag This is a model commit message: - Capitalized, short (72 chars or less) summary +```gitcommit +Capitalized, short (72 chars or less) summary - More detailed explanatory text, if necessary. Wrap it to about 72 - characters or so. In some contexts, the first line is treated as the - subject of an email and the rest of the text as the body. The blank - line separating the summary from the body is critical (unless you omit - the body entirely); tools like rebase can get confused if you run the - two together. +More detailed explanatory text, if necessary. Wrap it to about 72 +characters or so. In some contexts, the first line is treated as the +subject of an email and the rest of the text as the body. The blank +line separating the summary from the body is critical (unless you omit +the body entirely); tools like rebase can get confused if you run the +two together. - Write your commit message in the imperative: "Fix bug" and not "Fixed bug" - or "Fixes bug." This convention matches up with commit messages generated - by commands like git merge and git revert. +Write your commit message in the imperative: "Fix bug" and not "Fixed bug" +or "Fixes bug." This convention matches up with commit messages generated +by commands like git merge and git revert. - Further paragraphs come after blank lines. +Further paragraphs come after blank lines. - - Bullet points are okay, too +- Bullet points are okay, too - - Typically a hyphen or asterisk is used for the bullet, followed by a - single space, with blank lines in between, but conventions vary here + - Typically a hyphen or asterisk is used for the bullet, followed by a + single space, with blank lines in between, but conventions vary here - - Use a hanging indent + - Use a hanging indent +``` [Gita] provide vim mode for Git commit messages, which helps you to comply to these guidelines. @@ -148,13 +151,13 @@ The file header for vim script should look like the following template: "============================================================================= " FILENAME --- NAME layer file for SpaceVim " Copyright (c) 2012-2016 Shidong Wang & Contributors -" Author: YOUR_NAME <YOUR_EMAIL> +" Author: YOUR NAME <YOUR EMAIL> " URL: https://spacevim.org " License: MIT license "============================================================================= ``` -You should replace FILENAME by the name of the file (e.g. foo.vim) and NAME by the name of the layer you are creating, donโt forget to replace YOUR_NAME and YOUR_EMAIL also. +You should replace FILENAME by the name of the file (e.g. foo.vim) and NAME by the name of the layer you are creating, donโt forget to replace **YOUR NAME** and **YOUR EMAIL** also. ##### Author of a new layer @@ -180,20 +183,27 @@ here is an example for creating a new layer names `foo`: " @parentsection layers " This the doc for this layer: " -" @subsection Mappings +" @subsection Key Bindings " > " Mode Key Function " ------------------------------------------------------------- " normal <leader>jA generate accessors " normal <leader>js generate setter accessor " < -" @subsection options +" @subsection Layer options " > " Name Description Default " ------------------------------------------------------------- -" g:foo_option1 Set option1 for foo layer 1 -" g:foo_option2 Set option2 for foo layer 2 -" g:foo_option3 Set option3 for foo layer 3 +" option1 Set option1 for foo layer '' +" option2 Set option2 for foo layer [] +" option3 Set option3 for foo layer {} +" < +" @subsection Global options +" > +" Name Description Default +" ------------------------------------------------------------- +" g:pluginA_opt1 Set opt1 for plugin A '' +" g:pluginB_opt2 Set opt2 for plugin B [] " < function! SpaceVim#layers#foo#plugins() abort @@ -212,7 +222,46 @@ function! SpaceVim#layers#foo#config() abort endfunction ``` -4. send PR to SpaceVim. +4. Add layer document `docs/layers/foo.md` for `foo` layer. + +```md +--- +title: "SpaceVim foo layer" +description: "This is a short discription for the foo layer" +--- + +# [SpaceVim Layers:](https://spacevim.org/layers) foo + +<!-- vim-markdown-toc GFM --> + +- [Description](#description) +- [Installation](#installation) + - [Layer](#layer) + - [Syntax checking && Code formatting](#syntax-checking--code-formatting) +- [Key bindings](#key-bindings) + - [Inferior REPL process](#inferior-repl-process) + - [RuboCop](#rubocop) + - [Running current script](#running-current-script) + +<!-- vim-markdown-toc --> + +## Description + +This layer is for ruby development. + +## Installation + +### Layer + +To use this configuration layer, add `call SpaceVim#layers#load('foo')` to your custom configuration file. + +### Other dependences + +## Key bindings +``` + +5. Open `docs/layers/index.md`, run `:call SpaceVim#dev#layers#update()` to update layer list. +6. send PR to SpaceVim. ##### Contributor to an existing layer @@ -228,6 +277,26 @@ If you think it worth contributing a new mappings then be sure to read the docum ALWAYS document your new mappings or mappings changes inside the relevant documentation file. It should be the the layer file and the [documentation.md](https://spacevim.org/documentation). +#### Language specified key bindings + +All language specified key bindings are started with `SPC l` prefix. + +we recommended to keep same language specified key bindings for different languages: + +| Key Binding | Description | +| ----------- | ------------------------------------------------ | +| SPC l r | start a runner for current file | +| SPC l e | rename symbol | +| SPC l d | show doc | +| SPC l i r | remove unused imports | +| SPC l i s | sort imports with isort | +| SPC l s i | Start a language specified inferior REPL process | +| SPC l s b | send buffer and keep code buffer focused | +| SPC l s l | send line and keep code buffer focused | +| SPC l s s | send selection text and keep code buffer focused | + +All of these above key bindings are just recommended as default, but it also base on the language layer itself. + #### Contributing a banner The startup banner is by default the SpaceVim logo but there are also ASCII banners available in the core/banner layer. diff --git a/docs/documentation.md b/docs/documentation.md index c4ea2a9dd..376083509 100644 --- a/docs/documentation.md +++ b/docs/documentation.md @@ -32,6 +32,7 @@ description: "General documentation about how to using SpaceVim, including the q - [Alternative directory](#alternative-directory) - [Concepts](#concepts) - [Transient-states](#transient-states) +- [Differences between vim/neovim and SpaceVim](#differences-between-vimneovim-and-spacevim) - [Awesome ui](#awesome-ui) - [Colorschemes](#colorschemes) - [Font](#font) @@ -254,7 +255,6 @@ In SpaceVim, a layer is a single file. In a layer, for example, `autocomplete` l - `SpaceVim#layers#autocomplete#config()`: layer config, such as key bindings and autocmds. - `SpaceVim#layers#autocomplete#set_variable()`: function for setting layer options. - ## Custom Configuration User configuration can be stored in your ~/.SpaceVim.d directory. @@ -354,6 +354,26 @@ Move Text Transient State:  +## Differences between vim/neovim and SpaceVim + +- The `f` key does find char on the right, but in SpaceVim it is the `Unite` key bindings specific leader key by defalut (which can be set on another key binding in dotfile). If you still prefer the origin function of `f`, you can use an empty string to disable this feature. + +the option is `g:spacevim_unite_leader`, defalut value is `f`. + +- The `F` key does find char on the left, but in SpaceVim it is the `Denite` key bindings specific leader key by defalut (which can be set on another key binding in dotfile). If you still prefer the origin function of `F`, you can use an empty string to disable this feature. + +the option is `g:spacevim_denite_leader`, defalut value is `F`. + +- The `s` key does replace cursor char, but in SpaceVim it is the `Window` key bindings specific leader key by defalut (which can be set on another key binding in dotfile). If you still prefer the origin function of `s`, you can use an empty string to disable this feature. + +the option is `g:spacevim_windows_leader`, defalut value is `s`. + +- The `,` key does repeat last `f`, `F`, `t` and `T` in vim, but in SpaceVim it is the language specified Leader key. + +the option is `g:spacevim_enable_language_specific_leader`, defalut value is 1. + +[Send a PR](http://spacevim.org/development/) to add the differences you found in this section. + ## Awesome ui SpaceVim has a minimalistic and distraction free UI: @@ -1786,24 +1806,24 @@ Unite work flow leader can only be used in normal mode. Unite leader need unite ##### Window Management -| Key | Mode | Action | -| --------------- | :----: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `q` | Normal | Smart buffer close | -| `s`+`p` | Normal | Split nicely | -| `s`+`v` | Normal | :split | -| `s`+`g` | Normal | :vsplit | -| `s`+`t` | Normal | Open new tab (:tabnew) | -| `s`+`o` | Normal | Close other windows (:only) | -| `s`+`x` | Normal | Remove buffer, leave blank window | -| `s`+`q` | Normal | Closes current buffer (:close) | -| `s`+`Q` | Normal | Removes current buffer, left buffer in the tabline will be displayed, if there is no buffer on the left, the right buffer will be displayed, if this is the last buffer in the tabline, then an empty buffer will be displayed. | -| `Tab` | Normal | Next window or tab | -| `Shift`+`Tab` | Normal | Previous window or tab | -| `<leader>`+`sv` | Normal | Split with previous buffer | -| `<leader>`+`sg` | Normal | Vertical split with previous buffer | +| Key | Mode | Action | +| --------------- | :----: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `q` | Normal | Smart buffer close | +| `s`+`p` | Normal | Split nicely | +| `s`+`v` | Normal | :split | +| `s`+`g` | Normal | :vsplit | +| `s`+`t` | Normal | Open new tab (:tabnew) | +| `s`+`o` | Normal | Close other windows (:only) | +| `s`+`x` | Normal | Remove buffer, leave blank window | +| `s`+`q` | Normal | Remove current buffer, left buffer in the tabline will be displayed. If there is no buffer on the left, the right buffer will be displayed; if this is the last buffer in the tabline, then an empty buffer will be displayed. | +| `s`+`Q` | Normal | Close current buffer (:close) | +| `Tab` | Normal | Next window or tab | +| `Shift`+`Tab` | Normal | Previous window or tab | +| `<leader>`+`sv` | Normal | Split with previous buffer | +| `<leader>`+`sg` | Normal | Vertically split with previous buffer | SpaceVim has mapped normal <kbd>q</kbd> as smart buffer close, the normal func of <kbd>q</kbd> -can be get by <kbd>`<leader>` q r</kbd> +can be get by <kbd><leader> q r</kbd> ##### Native functions @@ -2095,5 +2115,4 @@ As SpaceVim use above bookmarks mappings, so you can not use `a`, `m`, `n`, `p` [textobj-multiblock]: https://github.com/osyo-manga/vim-textobj-multiblock - <!-- vim:set nowrap: --> diff --git a/docs/img/weixingongzhonghao.png b/docs/img/weixingongzhonghao.png new file mode 100644 index 000000000..f7ce67692 Binary files /dev/null and b/docs/img/weixingongzhonghao.png differ diff --git a/docs/index.md b/docs/index.md index eb3183a81..d772d7ff6 100644 --- a/docs/index.md +++ b/docs/index.md @@ -7,7 +7,7 @@ description: "SpaceVim is a community-driven vim distribution that seeks to prov [](https://travis-ci.org/SpaceVim/SpaceVim) [](https://ci.appveyor.com/project/wsdjeg/spacevim/branch/dev) [](https://codecov.io/gh/SpaceVim/SpaceVim/branch/dev) -[](https://github.com/SpaceVim/SpaceVim/releases/tag/0.5.0) +[](https://github.com/SpaceVim/SpaceVim) [](https://github.com/SpaceVim/SpaceVim/blob/dev/LICENSE) SpaceVim is a distribution of the vim editor that's inspired by spacemacs. It manages collections of plugins in layers, which help collect related packages together to provide features. For example, the python layer collects deoplete.nvim, neomake and jedi-vim together to provides autocompletion, syntax checking, and documentation lookup. This approach helps keep configuration organized and reduces overhead for the user by keeping them from having to think about what packages to install. diff --git a/docs/install.cmd b/docs/install.cmd index 0e907745d..e27b33562 100644 --- a/docs/install.cmd +++ b/docs/install.cmd @@ -11,7 +11,7 @@ echo " \______/| ##____/ \_______/\_______/\_______/ \_/ |__|__/ |__/ echo " | ## " echo " | ## " echo " |__/ " -echo " version : 0.6.0-dev by : spacevim.org " +echo " version : 0.7.0-dev by : spacevim.org " Push-Location ~ diff --git a/docs/install.sh b/docs/install.sh index e65c0fb6f..df1a1235a 100755 --- a/docs/install.sh +++ b/docs/install.sh @@ -11,7 +11,7 @@ # Reset Color_off='\033[0m' # Text Reset -Version='0.6.0-dev' +Version='0.6.0' # Regular Colors Red='\033[0;31m' diff --git a/docs/layers/checkers.md b/docs/layers/checkers.md index 923b9c9ea..b8d7cd1d8 100644 --- a/docs/layers/checkers.md +++ b/docs/layers/checkers.md @@ -24,6 +24,15 @@ checkers layer is loaded by default. ## Configuration +By default, the error will be display below current line, if you want to disabled this feature, you may need to load this layer with `show_cursor_error` to 0. + +```vim +call SpaceVim#layers#load('checkers', { + \ 'show_cursor_error' : 0, + \ }) +``` + + | Name | default value | description | | ---------------------------- | ------------- | -------------------------------------------------------- | | `g:spacevim_enable_neomake` | 1 | Use neomake as default checking tools | diff --git a/docs/layers/cscope.md b/docs/layers/cscope.md new file mode 100644 index 000000000..86307227f --- /dev/null +++ b/docs/layers/cscope.md @@ -0,0 +1,46 @@ +--- +title: "SpaceVim cscope layer" +description: "This layer provide cscope manager for project" +--- + +## Description + +This layer provides a smart [Cscope](http://cscope.sourceforge.net/) and [PyCscope](https://github.com/portante/pycscope) helper for SpaceVim. + +For more info about the differences between Cscope and other similar tools, please read [Comparison with Similar Tools](https://github.com/oracle/opengrok/wiki/Comparison-with-Similar-Tools) + +## Features + +- Tag indexing and searching for C-C++ via Cscope +- Tag indexing and searching for python via PyCscope + +## Installation + +### cscope + +```shell +sudo pacman -S cscope +``` + +### layer + +To use this configuration layer, add it to your `~/.SpaceVim.d/init.vim`. + +```vim +call SpaceVim#layers#load('cscope') +``` + +## Key bindings + +| Key Binding | Description | +| ----------- | -------------------------------------- | +| `SPC m c =` | Find assignments to this symbol | +| `SPC m c i` | Create cscope index | +| `SPC m c c` | Find functions called by this function | +| `SPC m c C` | Find functions calling this function | +| `SPC m c d` | find global definition of a symbol | +| `SPC m c r` | find references of a symbol | +| `SPC m c f` | find file | +| `SPC m c F` | find which files include a file | +| `SPC m c e` | search regular expression | +| `SPC m c t` | search text | diff --git a/docs/layers/index.md b/docs/layers/index.md index 88ec322de..b803d0c84 100644 --- a/docs/layers/index.md +++ b/docs/layers/index.md @@ -52,10 +52,12 @@ call SpaceVim#layers#disable('shell') | [checkers](https://spacevim.org/layers/checkers/) | This layer provides syntax checking feature | | [chinese](https://spacevim.org/layers/chinese/) | Layer for chinese users, include chinese docs and runtime messages | | [colorscheme](https://spacevim.org/layers/colorscheme/) | colorscheme provides a list of colorscheme for SpaceVim, default colorscheme is gruvbox with dark theme. | +| [cscope](https://spacevim.org/layers/cscope/) | This layer provide cscope manager for project | | [debug](https://spacevim.org/layers/debug/) | This layer provide debug workflow support in SpaceVim | | [default](https://spacevim.org/layers/default/) | lt layer contains none plugins, but it has some better default config for vim and neovim | | [git](https://spacevim.org/layers/git/) | This layers adds extensive support for git | | [lang#c](https://spacevim.org/layers/lang/c/) | This layer is for c/c++/object-c development | +| [lang#dart](https://spacevim.org/layers/lang/dart/) | This layer is for dart development, provide autocompletion, syntax checking, code format for dart file. | | [lang#elixir](https://spacevim.org/layers/lang/elixir/) | This layer is for elixir development, provide autocompletion, syntax checking, code format for elixir file. | | [lang#go](https://spacevim.org/layers/lang/go/) | This layer is for golang development. It also provides additional language-specific key mappings. | | [lang#haskell](https://spacevim.org/layers/lang/haskell/) | This layer is for haskell development | diff --git a/docs/layers/lang/dart.md b/docs/layers/lang/dart.md new file mode 100644 index 000000000..31f0fb7a8 --- /dev/null +++ b/docs/layers/lang/dart.md @@ -0,0 +1,90 @@ +--- +title: "SpaceVim lang#dart layer" +description: "This layer is for dart development, provide autocompletion, syntax checking, code format for dart file." +--- + +# [SpaceVim Layers:](https://spacevim.org/layers) lang#dart + +<!-- vim-markdown-toc GFM --> + +- [Description](#description) +- [Features](#features) +- [Installation](#installation) + - [Layer](#layer) + - [Syntax checking && Code formatting](#syntax-checking--code-formatting) + - [Install dart-repl](#install-dart-repl) +- [Key bindings](#key-bindings) + - [Inferior REPL process](#inferior-repl-process) + - [Running current script](#running-current-script) + - [Code formatting](#code-formatting) +- [Screenshots](#screenshots) + +<!-- vim-markdown-toc --> + +## Description + +This layer is for dart development. + +## Features + +- code completion +- syntax checking +- code formatting +- REPL +- code runner + +## Installation + +### Layer + +To use this configuration layer, add `call SpaceVim#layers#load('lang#dart')` to your custom configuration file. + +### Syntax checking && Code formatting + +To enable syntax checking and code formatting in spacevim, you need to install [dart sdk](https://github.com/dart-lang/sdk). + +### Install dart-repl + +you need to install the dart_repl via pub, pub is a build-in package manager in dart-sdk: + +```sh +pub global activate dart_repl +``` + +## Key bindings + +### Inferior REPL process + +Start a `dart.repl` inferior REPL process with `SPC l s i`. + +Send code to inferior process commands: + +| Key Binding | Description | +| ----------- | ------------------------------------------------ | +| `SPC l s b` | send buffer and keep code buffer focused | +| `SPC l s l` | send line and keep code buffer focused | +| `SPC l s s` | send selection text and keep code buffer focused | + +### Running current script + +To running a ruby script, you can press `SPC l r` to run current file without loss focus, and the result will be shown in a runner buffer. + +### Code formatting + +| Key Binding | Description | +| ----------- | --------------------- | +| `SPC b f` | format current buffer | + +## Screenshots + +**code formatting:** + + + +**auto completion:** + + + +**code runner:** + + diff --git a/docs/layers/lang/go.md b/docs/layers/lang/go.md index 70e2b931d..7f83d2606 100644 --- a/docs/layers/lang/go.md +++ b/docs/layers/lang/go.md @@ -9,6 +9,7 @@ description: "This layer is for golang development. It also provides additional - [Description](#description) - [Install](#install) +- [Features](#features) - [Key bindings](#key-bindings) <!-- vim-markdown-toc --> @@ -19,23 +20,30 @@ This layer is for golang development. It also provides additional language-speci ## Install -To use this configuration layer, add `SPLayer 'lang#go` to your custom configuration file. +To use this configuration layer, add `call SpaceVim#layers#load('lang#go')` to your custom configuration file. + +## Features + +- auto-completion +- syntax checking +- goto definition +- refernce finder ## Key bindings **Import key bindings:** -| Key Binding | Description | -| ----------- | ---------------------------------------- | -| SPC l i | go implements | -| SPC l f | go info | -| SPC l e | go rename | -| SPC l r | go run | -| SPC l b | go build | -| SPC l t | go test | -| SPC l d | go doc | -| SPC l v | go doc vertical | -| SPC l c | go coverage | +| Key Binding | Description | +| ----------- | --------------- | +| SPC l i | go implements | +| SPC l f | go info | +| SPC l e | go rename | +| SPC l r | go run | +| SPC l b | go build | +| SPC l t | go test | +| SPC l d | go doc | +| SPC l v | go doc vertical | +| SPC l c | go coverage | **Code formatting:** diff --git a/docs/layers/lang/javascript.md b/docs/layers/lang/javascript.md index 849ba6489..22530d1cd 100644 --- a/docs/layers/lang/javascript.md +++ b/docs/layers/lang/javascript.md @@ -8,7 +8,7 @@ description: "This layer is for JaveScript development" <!-- vim-markdown-toc GFM --> - [Description](#description) -- [Layer Installation](#layer-installation) +- [Install](#install) - [Features](#features) - [Layer configuration](#layer-configuration) @@ -18,7 +18,7 @@ description: "This layer is for JaveScript development" This layer is for JavaScript development. -## Layer Installation +## Install To use this configuration layer, add `call SpaceVim#layers#load('lang#javascript')` to your custom configuration file. diff --git a/docs/layers/lang/lua.md b/docs/layers/lang/lua.md index ab0c03a82..12ed2b8fc 100644 --- a/docs/layers/lang/lua.md +++ b/docs/layers/lang/lua.md @@ -7,13 +7,13 @@ description: "This layer is for lua development, provide autocompletion, syntax <!-- vim-markdown-toc GFM --> -- [Description](#description) -- [Installation](#installation) - - [Layer](#layer) - - [Syntax checking && Code formatting](#syntax-checking--code-formatting) -- [Key bindings](#key-bindings) - - [Inferior REPL process](#inferior-repl-process) - - [Running current script](#running-current-script) +* [Description](#description) +* [Installation](#installation) + * [Layer](#layer) + * [Syntax checking && Code formatting](#syntax-checking--code-formatting) +* [Key bindings](#key-bindings) + * [Inferior REPL process](#inferior-repl-process) + * [Running current script](#running-current-script) <!-- vim-markdown-toc --> @@ -34,7 +34,7 @@ To use this configuration layer, add `SPLayer 'lang#lua'` to your custom configu ### Inferior REPL process -Start a `lua` or `luap` inferior REPL process with `SPC l s i`. You may change the REPL command by layer option `repl_command`. for example, if you want to use `lua.repl`, load this layer via: +Start a `lua` or `luap` inferior REPL process with `SPC l s i`. You may change the REPL command by layer option `repl_command`. For example, if you want to use `lua.repl`, load this layer via: ```vim call SpaceVim#layers#load('lang#lua' @@ -47,6 +47,9 @@ Send code to inferior process commands: | Key Binding | Description | | ----------- | ------------------------------------------------ | +| `SPC l b` | compile current lua buffer | +| `SPC l r` | run current lua file | +| `SPC l f` | format current lua file | | `SPC l s b` | send buffer and keep code buffer focused | | `SPC l s l` | send line and keep code buffer focused | | `SPC l s s` | send selection text and keep code buffer focused | diff --git a/docs/layers/language-server-protocol.md b/docs/layers/language-server-protocol.md index 72afa6bbe..e094f37f5 100644 --- a/docs/layers/language-server-protocol.md +++ b/docs/layers/language-server-protocol.md @@ -36,7 +36,6 @@ else endif ``` - ## Features - Asynchronous calls @@ -70,7 +69,6 @@ npm install -g javascript-typescript-langserver pip install --user python-language-server ``` - ## Configuration To enable lsp support for a specified filetype, you may need to load this layer with `filtypes` option, for example: @@ -87,10 +85,19 @@ call SpaceVim#layers#load('lsp', default language server commands: -| language | server command | -| ------------ | --------------------------------- | -| `javascript` | `['javascript-typescript-stdio']` | -| `haskell` | `['hie', '--lsp']` | +| language | server command | +| ------------ | ------------------------------------------------ | +| `javascript` | `['javascript-typescript-stdio']` | +| `haskell` | `['hie', '--lsp']` | +| `c` | `['clangd']` | +| `cpp` | `['clangd']` | +| `objc` | `['clangd']` | +| `objcpp` | `['clangd']` | +| `dart` | `['dart_language_server']` | +| `go` | `['go-langserver', '-mode', 'stdio']` | +| `rust` | `['rustup', 'run', 'nightly', 'rls']` | +| `python` | `['pyls']` | +| `php` | `['php', 'path/to/bin/php-language-server.php']` | To override the server command, you may need to use `override_cmd` option: