1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 12:50:04 +08:00

Update hint desc (#3050)

This commit is contained in:
Wang Shidong 2019-09-15 14:30:49 +08:00 committed by GitHub
parent 1c8d939640
commit ddecdd7bdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 139 additions and 98 deletions

View File

@ -66,18 +66,18 @@ function! SpaceVim#layers#checkers#config() abort
call SpaceVim#mapping#space#def('nnoremap', ['e', 'c'], 'call call('
\ . string(s:_function('s:clear_errors')) . ', [])',
\ 'clear all errors', 1)
call SpaceVim#mapping#space#def('nnoremap', ['e', 'h'], '', 'describe a syntax checker', 1)
call SpaceVim#mapping#space#def('nnoremap', ['e', 'v'], '', 'verify syntax checker setup', 1)
\ 'clear-all-errors', 1)
call SpaceVim#mapping#space#def('nnoremap', ['e', 'h'], '', 'describe-a-syntax-checker', 1)
call SpaceVim#mapping#space#def('nnoremap', ['e', 'v'], '', 'verify-syntax-checker-setup', 1)
call SpaceVim#mapping#space#def('nnoremap', ['e', 'n'], 'call call('
\ . string(s:_function('s:jump_to_next_error')) . ', [])',
\ 'next-error', 1)
call SpaceVim#mapping#space#def('nnoremap', ['e', 'l'], 'call call('
\ . string(s:_function('s:toggle_show_error')) . ', [0])',
\ 'toggle showing the error list', 1)
\ 'toggle-showing-the-error-list', 1)
call SpaceVim#mapping#space#def('nnoremap', ['e', 'L'], 'call call('
\ . string(s:_function('s:toggle_show_error')) . ', [1])',
\ 'toggle showing the error list', 1)
\ 'toggle-showing-the-error-list', 1)
call SpaceVim#mapping#space#def('nnoremap', ['e', 'p'], 'call call('
\ . string(s:_function('s:jump_to_previous_error')) . ', [])',
\ 'previous-error', 1)
@ -86,16 +86,16 @@ function! SpaceVim#layers#checkers#config() abort
\ 'previous-error', 1)
call SpaceVim#mapping#space#def('nnoremap', ['e', 'v'], 'call call('
\ . string(s:_function('s:verify_syntax_setup')) . ', [])',
\ 'verify syntax setup', 1)
\ 'verify-syntax-setup', 1)
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)
\ 'toggle-syntax-checker', 1)
call SpaceVim#mapping#space#def('nnoremap', ['e', 'e'], 'call call('
\ . string(s:_function('s:explain_the_error')) . ', [])',
\ 'explain the error', 1)
\ 'explain-the-error', 1)
augroup SpaceVim_layer_checker
autocmd!
if g:spacevim_enable_neomake

View File

@ -256,21 +256,21 @@ function! SpaceVim#layers#core#config() abort
\ ]
\ , 1)
let g:vimproc#download_windows_dll = 1
call SpaceVim#mapping#space#def('nnoremap', ['p', 't'], 'call SpaceVim#plugins#projectmanager#current_root()', 'find project root', 1)
call SpaceVim#mapping#space#def('nnoremap', ['p', 'k'], 'call SpaceVim#plugins#projectmanager#kill_project()', 'kill all project buffers', 1)
call SpaceVim#mapping#space#def('nnoremap', ['p', 'p'], 'call SpaceVim#plugins#projectmanager#list()', 'List all projects', 1)
call SpaceVim#mapping#space#def('nnoremap', ['p', 't'], 'call SpaceVim#plugins#projectmanager#current_root()', 'find-project-root', 1)
call SpaceVim#mapping#space#def('nnoremap', ['p', 'k'], 'call SpaceVim#plugins#projectmanager#kill_project()', 'kill-all-project-buffers', 1)
call SpaceVim#mapping#space#def('nnoremap', ['p', 'p'], 'call SpaceVim#plugins#projectmanager#list()', 'list-all-projects', 1)
call SpaceVim#mapping#space#def('nnoremap', ['p', '/'], 'Grepper', 'fuzzy search for text in current project', 1)
call SpaceVim#mapping#space#def('nnoremap', ['q', 'q'], 'qa', 'prompt-kill-vim', 1)
call SpaceVim#mapping#space#def('nnoremap', ['q', 'Q'], 'qa!', 'kill-vim', 1)
if has('nvim') && s:SYS.isWindows
call SpaceVim#mapping#space#def('nnoremap', ['q', 'R'], 'call call('
\ . string(s:_function('s:restart_neovim_qt')) . ', [])',
\ 'restrat neovim-qt', 1)
\ 'restrat-neovim-qt', 1)
else
call SpaceVim#mapping#space#def('nnoremap', ['q', 'R'], '', 'restart-vim(TODO)', 1)
endif
call SpaceVim#mapping#space#def('nnoremap', ['q', 'r'], '', 'restart-vim-resume-layouts(TODO)', 1)
call SpaceVim#mapping#space#def('nnoremap', ['q', 't'], 'tabclose!', 'kill current tab', 1)
call SpaceVim#mapping#space#def('nnoremap', ['q', 't'], 'tabclose!', 'kill-current-tab', 1)
call SpaceVim#mapping#gd#add('HelpDescribe', function('s:gotodef'))
let g:_spacevim_mappings_space.c = {'name' : '+Comments'}

View File

@ -16,18 +16,18 @@ 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'], 'call cscope#find("d", expand("<cword>"))', 'find functions called by this function', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'C'], 'call cscope#find("c", expand("<cword>"))', 'find functions calling this function', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'd'], 'call cscope#find("g", expand("<cword>"))', 'find global definition of a symbol', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'r'], 'call cscope#find("s", expand("<cword>"))', 'find references of a symbol', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'f'], 'call cscope#find("f", expand("<cword>"))', 'find files', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'F'], 'call cscope#find("i", expand("<cword>"))', 'find files including this file', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'e'], 'call cscope#find("e", expand("<cword>"))', 'Find this egrep pattern', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 't'], 'call cscope#find("t", expand("<cword>"))', 'find this text string', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', '='], 'call cscope#find("a", expand("<cword>"))', 'find assignments to this symbol', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'u'], 'call cscope#update_databeses()', 'create cscope index', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'i'], 'call cscope#create_databeses()', 'create cscope databases', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'l'], 'call cscope#list_databases()', 'list cscope databases', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'm'], 'call cscope#clear_databases(SpaceVim#plugins#projectmanager#current_root())', 'remove current cscope databases', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'M'], 'call cscope#clear_databases()', 'remove all cscope databases', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'c'], 'call cscope#find("d", expand("<cword>"))', 'find-functions-called-by-this-function', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'C'], 'call cscope#find("c", expand("<cword>"))', 'find-functions-calling-this-function', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'd'], 'call cscope#find("g", expand("<cword>"))', 'find-global-definition-of-a-symbol', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'r'], 'call cscope#find("s", expand("<cword>"))', 'find-references-of-a-symbol', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'f'], 'call cscope#find("f", expand("<cword>"))', 'find-files', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'F'], 'call cscope#find("i", expand("<cword>"))', 'find-files-including-this-file', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'e'], 'call cscope#find("e", expand("<cword>"))', 'Find-this-egrep-pattern', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 't'], 'call cscope#find("t", expand("<cword>"))', 'find-this-text-string', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', '='], 'call cscope#find("a", expand("<cword>"))', 'find-assignments-to-this-symbol', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'u'], 'call cscope#update_databeses()', 'create-cscope-index', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'i'], 'call cscope#create_databeses()', 'create-cscope-databases', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'l'], 'call cscope#list_databases()', 'list-cscope-databases', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'm'], 'call cscope#clear_databases(SpaceVim#plugins#projectmanager#current_root())', 'remove-current-cscope-databases', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'M'], 'call cscope#clear_databases()', 'remove-all-cscope-databases', 1)
endfunction

View File

@ -134,8 +134,12 @@ function! SpaceVim#layers#edit#config() abort
call SpaceVim#mapping#space#def('vnoremap', ['x', 'U'], 'gU', 'set the selected text to up case', 0)
" word
let g:_spacevim_mappings_space.x.w = {'name' : '+word'}
let g:_spacevim_mappings_space.x.w = {'name' : '+Word'}
call SpaceVim#mapping#space#def('vnoremap', ['x', 'w', 'c'], "normal! " . ":'<,'>s/\\\w\\+//gn" . "\<cr>", 'count the words in the select region', 1)
let g:_spacevim_mappings_space.x.s = {'name' : '+String'}
call SpaceVim#mapping#space#def('nnoremap', ['x', 's', 'j'], 'call call('
\ . string(s:_function('s:join_string_with')) . ', [])',
\ 'join-string-with', 1)
let g:_spacevim_mappings_space.i = {'name' : '+Insertion'}
let g:_spacevim_mappings_space.i.l = {'name' : '+Lorem-ipsum'}
@ -143,60 +147,60 @@ function! SpaceVim#layers#edit#config() abort
let g:_spacevim_mappings_space.i.U = {'name' : '+UUID'}
call SpaceVim#mapping#space#def('nnoremap', ['i', 'p', 1], 'call call('
\ . string(s:_function('s:insert_simple_password')) . ', [])',
\ 'insert simple password', 1)
\ 'insert-simple-password', 1)
call SpaceVim#mapping#space#def('nnoremap', ['i', 'p', 2], 'call call('
\ . string(s:_function('s:insert_stronger_password')) . ', [])',
\ 'insert stronger password', 1)
\ 'insert-stronger-password', 1)
call SpaceVim#mapping#space#def('nnoremap', ['i', 'p', 3], 'call call('
\ . string(s:_function('s:insert_paranoid_password')) . ', [])',
\ 'insert password for paranoids', 1)
\ 'insert-password-for-paranoids', 1)
call SpaceVim#mapping#space#def('nnoremap', ['i', 'p', 'p'], 'call call('
\ . string(s:_function('s:insert_phonetically_password')) . ', [])',
\ 'insert a phonetically easy password', 1)
\ 'insert-a-phonetically-easy-password', 1)
call SpaceVim#mapping#space#def('nnoremap', ['i', 'p', 'n'], 'call call('
\ . string(s:_function('s:insert_numerical_password')) . ', [])',
\ 'insert a numerical password', 1)
call SpaceVim#mapping#space#def('nnoremap', ['i', 'u'], 'Unite unicode', 'search and insert unicode', 1)
\ 'insert-a-numerical-password', 1)
call SpaceVim#mapping#space#def('nnoremap', ['i', 'u'], 'Unite unicode', 'search-and-insert-unicode', 1)
call SpaceVim#mapping#space#def('nnoremap', ['i', 'U', 'U'], 'call call('
\ . string(s:_function('s:uuidgen_U')) . ', [])',
\ 'uuidgen-4', 1)
call SpaceVim#mapping#space#def('nnoremap', ['i', 'l', 'l'], 'call call('
\ . string(s:_function('s:insert_lorem_ipsum_list')) . ', [])',
\ 'insert lorem-ipsum list', 1)
\ 'insert-lorem-ipsum-list', 1)
call SpaceVim#mapping#space#def('nnoremap', ['i', 'l', 'p'], 'call call('
\ . string(s:_function('s:insert_lorem_ipsum_paragraph')) . ', [])',
\ 'insert lorem-ipsum paragraph', 1)
\ 'insert-lorem-ipsum-paragraph', 1)
call SpaceVim#mapping#space#def('nnoremap', ['i', 'l', 's'], 'call call('
\ . string(s:_function('s:insert_lorem_ipsum_sentence')) . ', [])',
\ 'insert lorem-ipsum sentence', 1)
\ 'insert-lorem-ipsum-sentence', 1)
" move line
call SpaceVim#mapping#space#def('nnoremap', ['x', 'J'], 'call call('
\ . string(s:_function('s:move_text_down_transient_state')) . ', [])',
\ 'move text down(enter transient state)', 1)
\ 'move-text-down(enter-transient-state)', 1)
call SpaceVim#mapping#space#def('nnoremap', ['x', 'K'], 'call call('
\ . string(s:_function('s:move_text_up_transient_state')) . ', [])',
\ 'move text up(enter transient state)', 1)
\ 'move-text-up(enter-transient-state)', 1)
" transpose
let g:_spacevim_mappings_space.x.t = {'name' : '+transpose'}
call SpaceVim#mapping#space#def('nnoremap', ['x', 't', 'c'], 'call call('
\ . string(s:_function('s:transpose_with_previous')) . ', ["character"])',
\ 'swap current character with previous one', 1)
\ 'swap-current-character-with-previous-one', 1)
call SpaceVim#mapping#space#def('nnoremap', ['x', 't', 'w'], 'call call('
\ . string(s:_function('s:transpose_with_previous')) . ', ["word"])',
\ 'swap current word with previous one', 1)
\ 'swap-current-word-with-previous-one', 1)
call SpaceVim#mapping#space#def('nnoremap', ['x', 't', 'l'], 'call call('
\ . string(s:_function('s:transpose_with_previous')) . ', ["line"])',
\ 'swap current line with previous one', 1)
\ 'swap-current-line-with-previous-one', 1)
call SpaceVim#mapping#space#def('nnoremap', ['x', 't', 'C'], 'call call('
\ . string(s:_function('s:transpose_with_next')) . ', ["character"])',
\ 'swap current character with next one', 1)
\ 'swap-current-character-with-next-one', 1)
call SpaceVim#mapping#space#def('nnoremap', ['x', 't', 'W'], 'call call('
\ . string(s:_function('s:transpose_with_next')) . ', ["word"])',
\ 'swap current word with next one', 1)
\ 'swap-current-word-with-next-one', 1)
call SpaceVim#mapping#space#def('nnoremap', ['x', 't', 'L'], 'call call('
\ . string(s:_function('s:transpose_with_next')) . ', ["line"])',
\ 'swap current line with next one', 1)
\ 'swap-current-line-with-next-one', 1)
endfunction
@ -592,6 +596,47 @@ function! s:align_at_regular_expression() abort
endif
endfunction
function! s:join_string_with() abort
if s:is_string(line('.'), col('.'))
let c = col('.')
let a = 0
let b = 0
let _c = c
while c > 0
if s:is_string(line('.'), c)
let c -= 1
else
let a = c
break
endif
endwhile
let c = _c
while c > 0
if s:is_string(line('.'), c)
let c += 1
else
let b = c
break
endif
endwhile
let l:save_register_m = @m
let line = getline('.')[:a] . join(split(getline('.')[a+1 : b]), '-') . getline('.')[b :]
call setline('.', line)
let @m = l:save_register_m
endif
endfunction
let s:string_hi = {
\ 'c' : 'cCppString',
\ 'cpp' : 'cCppString',
\ }
function! s:is_string(l, c) abort
return synIDattr(synID(a:l, a:c, 1), 'name') == get(s:string_hi, &filetype, &filetype . 'String')
endfunction
" function() wrapper
if v:version > 703 || v:version == 703 && has('patch1170')
function! s:_function(fstr) abort

View File

@ -14,13 +14,13 @@ endfunction
function! SpaceVim#layers#gtags#config() abort
let g:_spacevim_mappings_space.m.g = {'name' : '+gtags'}
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'c'], 'GtagsGenerate!', 'create a gtags database', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'u'], 'GtagsGenerate', 'update tag database', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'p'], 'Gtags -p', 'list all file in GTAGS', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'd'], 'exe "Gtags -d " . expand("<cword>")', 'find definitions', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'r'], 'exe "Gtags -r " . expand("<cword>")', 'find references', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 's'], 'exe "Gtags -s " . expand("<cword>")', 'find cursor symbol', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'g'], 'exe "Gtags -g " . expand("<cword>")', 'find cursor string', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'c'], 'GtagsGenerate!', 'create-a-gtags-database', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'u'], 'GtagsGenerate', 'update-tag-database', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'p'], 'Gtags -p', 'list-all-file-in-GTAGS', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'd'], 'exe "Gtags -d " . expand("<cword>")', 'find-definitions', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'r'], 'exe "Gtags -r " . expand("<cword>")', 'find-references', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 's'], 'exe "Gtags -s " . expand("<cword>")', 'find-cursor-symbol', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'g'], 'exe "Gtags -g " . expand("<cword>")', 'find-cursor-string', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'f'], 'Gtags -f %', 'list of objects', 1)
let g:gtags_gtagslabel = s:gtagslabel
augroup spacevim_layer_tags

View File

@ -18,7 +18,7 @@ function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
\ :<C-u>split<CR>
let lnum = expand('<slnum>') + s:lnum - 4
let g:_spacevim_mappings_windows.v = ['split',
\ 'split window',
\ 'split-window',
\ [
\ '[WIN v] is to split windows, switch to the new window',
\ '',
@ -29,7 +29,7 @@ function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
\ :<C-u>split +bp<CR>
let lnum = expand('<slnum>') + s:lnum - 4
let g:_spacevim_mappings_windows.V = ['split +bp',
\ 'split previous buffer',
\ 'split-previous-buffer',
\ [
\ '[WIN V] is to split previous buffer, switch to the new window',
\ '',
@ -40,7 +40,7 @@ function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
\ :<C-u>vsplit<CR>
let lnum = expand('<slnum>') + s:lnum - 4
let g:_spacevim_mappings_windows.g = ['vsplit',
\ 'vsplit window',
\ 'vsplit-window',
\ [
\ '[WIN g] is to split previous buffer vertically, switch to the new window',
\ '',
@ -51,7 +51,7 @@ function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
\ :<C-u>vsplit +bp<CR>
let lnum = expand('<slnum>') + s:lnum - 4
let g:_spacevim_mappings_windows.G = ['vsplit +bp',
\ 'vsplit previous buffer',
\ 'vsplit-previous-buffer',
\ [
\ '[WIN G] is to split windows vertically, switch to the new window',
\ '',
@ -62,7 +62,7 @@ function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
\ :<C-u>tabnew<CR>
let lnum = expand('<slnum>') + s:lnum - 4
let g:_spacevim_mappings_windows.t = ['tabnew',
\ 'create new tab',
\ 'create-new-tab',
\ [
\ '[WIN t] is to create new tab',
\ '',
@ -73,7 +73,7 @@ function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
\ :<C-u>only<Space><Bar><Space>doautocmd WinEnter<CR>
let lnum = expand('<slnum>') + s:lnum - 4
let g:_spacevim_mappings_windows.o = ['only | doautocmd WinEnter',
\ 'Close other windows',
\ 'close-other-windows',
\ [
\ '[WIN o] is to close all other windows',
\ '',
@ -84,7 +84,7 @@ function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
\ :<C-u>call SpaceVim#mapping#BufferEmpty()<CR>
let lnum = expand('<slnum>') + s:lnum - 4
let g:_spacevim_mappings_windows.x = ['call SpaceVim#mapping#BufferEmpty()',
\ 'Empty current buffer',
\ 'empty-current-buffer',
\ [
\ '[WIN x] is to empty current buffer',
\ '',
@ -95,7 +95,7 @@ function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
\ :<C-u>b#<CR>
let lnum = expand('<slnum>') + s:lnum - 4
let g:_spacevim_mappings_windows['\'] = ['b#',
\ 'Switch to the last buffer',
\ 'switch-to-the-last-buffer',
\ [
\ '[WIN \] is to switch to the last buffer',
\ '',
@ -106,7 +106,7 @@ function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
\ :<C-u>close<CR>
let lnum = expand('<slnum>') + s:lnum - 4
let g:_spacevim_mappings_windows.Q = ['close',
\ 'Close current windows',
\ 'close-current-windows',
\ [
\ '[WIN Q] is to close current windows',
\ '',
@ -117,7 +117,7 @@ function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
\ :<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',
\ 'delete-current-windows',
\ [
\ '[WIN q] is to delete current windows',
\ '',
@ -128,7 +128,7 @@ function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
\ :<C-u>call SpaceVim#mapping#clear_buffers()<CR>
let lnum = expand('<slnum>') + s:lnum - 4
let g:_spacevim_mappings_windows.c = ['call SpaceVim#mapping#clear_buffers()',
\ 'Clear all the buffers',
\ 'clear-all-the-buffers',
\ [
\ '[WIN c] is to clear all the buffers',
\ '',

View File

@ -56,7 +56,7 @@ function! SpaceVim#mapping#space#init() abort
let s:lnum = expand('<slnum>') + s:funcbeginline
call SpaceVim#mapping#space#def('nnoremap', ['w', '.'], 'call call('
\ . string(s:_function('s:windows_transient_state')) . ', [])',
\ ['buffer transient state',
\ ['buffer-transient-state',
\ [
\ '[SPC w .] is to open the buffer transient state',
\ '',
@ -76,7 +76,7 @@ function! SpaceVim#mapping#space#init() abort
\ , 1)
let s:lnum = expand('<slnum>') + s:funcbeginline
call SpaceVim#mapping#space#def('nnoremap', ['w', 'D'], 'ChooseWin | close | wincmd w',
\ ['delete window (other windows)',
\ ['delete-window-(other-windows)',
\ [
\ '[SPC w D] is to select a windows to close',
\ '',
@ -86,7 +86,7 @@ function! SpaceVim#mapping#space#init() abort
\ , 1)
let s:lnum = expand('<slnum>') + s:funcbeginline
call SpaceVim#mapping#space#def('nnoremap', ['w', 'f'], 'tabnew',
\ ['create new tab',
\ ['create-new-tab',
\ [
\ '[SPC w f] is to create new tab',
\ '',
@ -98,7 +98,7 @@ function! SpaceVim#mapping#space#init() abort
call SpaceVim#mapping#space#def('nnoremap', ['w', 'F'], 'call call('
\ . string(function('s:create_new_named_tab'))
\ . ', [])',
\ ['create new named tab',
\ ['create-new-named-tab',
\ [
\ '[SPC w F] is to create new named tab',
\ '',
@ -297,7 +297,7 @@ function! SpaceVim#mapping#space#init() abort
call SpaceVim#mapping#space#def('nnoremap', ['w', 'u'], 'call SpaceVim#plugins#windowsmanager#UndoQuitWin()', 'undo quieted window', 1)
call SpaceVim#mapping#space#def('nnoremap', ['w', 'U'], 'call SpaceVim#plugins#windowsmanager#RedoQuitWin()', 'redo quieted window', 1)
let s:lnum = expand('<slnum>') + s:funcbeginline
call SpaceVim#mapping#space#def('nnoremap', ['b', 'n'], 'bnext', ['next buffer',
call SpaceVim#mapping#space#def('nnoremap', ['b', 'n'], 'bnext', ['next-buffer',
\ [
\ '[SPC b n] is running :bnext, jump to next buffer',
\ 'which is a vim build in command',
@ -308,7 +308,7 @@ function! SpaceVim#mapping#space#init() abort
\ ]
\ , 1)
let s:lnum = expand('<slnum>') + 3
call SpaceVim#mapping#space#def('nnoremap', ['b', 'p'], 'bp', ['previous buffer',
call SpaceVim#mapping#space#def('nnoremap', ['b', 'p'], 'bp', ['previous-buffer',
\ [
\ 'SPC b p is running :bp, jump to previous buffer',
\ 'which is a vim build in command',
@ -323,54 +323,55 @@ function! SpaceVim#mapping#space#init() abort
let g:_spacevim_mappings_space.B = {'name' : '+Global buffers'}
if g:spacevim_relativenumber
nnoremap <silent> [SPC]tn :<C-u>setlocal nonumber! norelativenumber!<CR>
let g:_spacevim_mappings_space.t.n = ['setlocal nonumber! norelativenumber!', 'toggle line number']
let g:_spacevim_mappings_space.t.n = ['setlocal nonumber! norelativenumber!', 'toggle-line-number']
call SpaceVim#mapping#menu('toggle line number', '[SPC]tn', 'set nu!')
else
nnoremap <silent> [SPC]tn :<C-u>setlocal number!<CR>
let g:_spacevim_mappings_space.t.n = ['setlocal number!', 'toggle line number']
let g:_spacevim_mappings_space.t.n = ['setlocal number!', 'toggle-line-number']
call SpaceVim#mapping#menu('toggle line number', '[SPC]tn', 'setlocal number!')
endif
call extend(g:_spacevim_mappings_prefixs['[SPC]'], get(g:, '_spacevim_mappings_space', {}))
" Searching in current buffer
call SpaceVim#mapping#space#def('nnoremap', ['s', 's'], "call SpaceVim#plugins#flygrep#open({'input' : input(\"grep pattern:\"), 'files': bufname(\"%\")})",
\ 'grep in current buffer', 1)
\ 'grep-in-current-buffer', 1)
call SpaceVim#mapping#space#def('nnoremap', ['s', 'S'], "call SpaceVim#plugins#flygrep#open({'input' : expand(\"<cword>\"), 'files': bufname(\"%\")})",
\ 'grep cursor word in current buffer', 1)
\ 'grep-cword-in-current-buffer', 1)
" Searching in all loaded buffers
call SpaceVim#mapping#space#def('nnoremap', ['s', 'b'], "call SpaceVim#plugins#flygrep#open({'input' : input(\"grep pattern:\"), 'files':'@buffers'})",
\ 'grep in all loaded buffers', 1)
\ 'grep-in-all-buffers', 1)
call SpaceVim#mapping#space#def('nnoremap', ['s', 'B'], "call SpaceVim#plugins#flygrep#open({'input' : expand(\"<cword>\"), 'files':'@buffers'})",
\ 'grep cursor word in all loaded buffers', 1)
\ 'grep-cword-in-all-buffers', 1)
" Searching in buffer directory
call SpaceVim#mapping#space#def('nnoremap', ['s', 'd'], "call SpaceVim#plugins#flygrep#open({'input' :"
\ . " input(\"grep pattern:\"), 'dir' : fnamemodify(expand('%'), ':p:h')})",
\ 'grep in buffer directory', 1)
\ 'grep-in-buffer-directory', 1)
call SpaceVim#mapping#space#def('nnoremap', ['s', 'D'], "call SpaceVim#plugins#flygrep#open({'input' :"
\ . " expand(\"<cword>\"), 'dir' : fnamemodify(expand('%'), ':p:h')})",
\ 'grep cursor word in buffer directory', 1)
\ 'grep-cword-in-buffer-directory', 1)
" Searching in files in an arbitrary directory
call SpaceVim#mapping#space#def('nnoremap', ['s', 'f'], "call SpaceVim#plugins#flygrep#open({'input' :"
\ . " input(\"grep pattern:\"), 'dir' : input(\"arbitrary dir:\", '', 'dir')})",
\ 'grep in arbitrary directory', 1)
call SpaceVim#mapping#space#def('nnoremap', ['s', 'F'], "call SpaceVim#plugins#flygrep#open({'input' :"
\ 'grep-in-arbitrary-directory', 1)
call SpaceVim#mapping#space#def('nnoremap', ['s', 'F'],
\ "call SpaceVim#plugins#flygrep#open({'input' :"
\ . " expand(\"<cword>\"), 'dir' : input(\"arbitrary dir:\", '', 'dir')})",
\ 'grep cursor word in arbitrary directory', 1)
\ 'grep-cword-in-arbitrary-directory', 1)
" Searching in project
call SpaceVim#mapping#space#def('nnoremap', ['s', 'p'],
\ 'call SpaceVim#plugins#flygrep#open(' .
\ "{'input' : input(\"grep pattern:\"), 'dir' : get(b:, \"rootDir\", getcwd())})",
\ 'grep in project', 1)
\ 'grep-in-project', 1)
call SpaceVim#mapping#space#def('nnoremap', ['s', 'P'],
\ "call SpaceVim#plugins#flygrep#open({'input' : expand(\"<cword>\"), 'dir' : get(b:, \"rootDir\", getcwd())})",
\ 'grep cursor word in project', 1)
\ 'grep-cword-in-project', 1)
" Searching background
call SpaceVim#mapping#space#def('nnoremap', ['s', 'j'],
\ 'call SpaceVim#plugins#searcher#find("", SpaceVim#mapping#search#default_tool()[0])', 'Background search keywords in project', 1)
\ 'call SpaceVim#plugins#searcher#find("", SpaceVim#mapping#search#default_tool()[0])', 'background-search-in-project', 1)
call SpaceVim#mapping#space#def('nnoremap', ['s', 'J'],
\ 'call SpaceVim#plugins#searcher#find(expand("<cword>"),SpaceVim#mapping#search#default_tool()[0])',
\ 'Background search cursor words in project', 1)
call SpaceVim#mapping#space#def('nnoremap', ['s', 'l'], 'call SpaceVim#plugins#searcher#list()', 'List all searching results', 1)
\ 'background-search-cwords-in-project', 1)
call SpaceVim#mapping#space#def('nnoremap', ['s', 'l'], 'call SpaceVim#plugins#searcher#list()', 'list-all-searching-results', 1)
" Searching tools
" ag
@ -490,32 +491,27 @@ function! SpaceVim#mapping#space#init() abort
call SpaceVim#mapping#space#def('nnoremap', ['s', 't', 'J'], 'call SpaceVim#plugins#searcher#find(expand("<cword>"), "pt")',
\ 'Background search cursor words in project with pt', 1)
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)
\ 'grep-on-the-fly', 1)
call SpaceVim#mapping#space#def('nnoremap', ['s', 'c'], 'noh',
\ 'clear search highlight', 1)
\ 'clear-search-highlight', 1)
"Symbol
nnoremap <silent> <plug>SpaceVim-plugin-iedit :call SpaceVim#plugins#iedit#start()<cr>
xnoremap <silent> <plug>SpaceVim-plugin-iedit :call SpaceVim#plugins#iedit#start(1)<cr>
call SpaceVim#mapping#space#def('nmap', ['s', 'e'], '<plug>SpaceVim-plugin-iedit',
\ 'start iedit mode', 0, 1)
\ 'start-iedit-mode', 0, 1)
call SpaceVim#mapping#space#def('nnoremap', ['s', 'H'], 'call SpaceVim#plugins#highlight#start(1)',
\ 'highlight all symbols', 1)
\ 'highlight-all-symbols', 1)
call SpaceVim#mapping#space#def('nnoremap', ['s', 'h'], 'call SpaceVim#plugins#highlight#start(0)',
\ 'highlight current symbols', 1)
\ 'highlight-current-symbols', 1)
" Getting help
let g:_spacevim_mappings_space.h.d = {'name' : '+help-describe'}
call SpaceVim#mapping#space#def('nnoremap', ['h', 'd', 'b'],
\ 'call SpaceVim#plugins#help#describe_bindings()',
\ 'describe key bindings', 1)
let g:_spacevim_mappings_space.h.d = {'name' : '+help describe'}
call SpaceVim#mapping#space#def('nnoremap', ['h', 'd', 'k'],
\ 'call SpaceVim#plugins#help#describe_key()',
\ 'describe key bindings', 1)
call SpaceVim#custom#SPC('nnoremap', ['a', 'o'], 'call SpaceVim#plugins#todo#list()', 'Open todo manager', 1)
\ 'describe-key-bindings', 1)
call SpaceVim#custom#SPC('nnoremap', ['a', 'o'], 'call SpaceVim#plugins#todo#list()', 'open-todo-manager', 1)
endfunction
function! SpaceVim#mapping#space#def(m, keys, cmd, desc, is_cmd, ...) abort