Skip to content

Commit 8bf138f

Browse files
committed
emacs-like binding added
1 parent 2139cfd commit 8bf138f

File tree

1 file changed

+33
-13
lines changed

1 file changed

+33
-13
lines changed

.SpaceVim.d/autoload/myspacevim.vim

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
function! myspacevim#before() abort
22
let g:spacevim_lint_on_save = 0
33
let g:spacevim_lint_on_the_fly = 1
4+
let g:mapleader = ','
45

56
" call SpaceVim#custom#SPCGroupName(['G'], '+TestGroup')
6-
call SpaceVim#custom#SPC('nore', ['f', 'u'], 'UndotreeToggle', 'undo tree', 1)
7+
call SpaceVim#custom#SPC('nore', ['f', 'u'], 'MundoToggle', 'undo tree', 1)
78
call SpaceVim#custom#SPC('nore', ['l', 't'], 'Tagbar', 'tag bar', 1)
89
call SpaceVim#custom#SPC('nore', ['q', 'w'], 'wqa', 'write and quit all files', 1)
910
call SpaceVim#custom#SPC('nore', ['l', 'b'], 'call F6()', 'hard breakpoint', 1)
10-
call SpaceVim#custom#SPC('nore', ['l', 'c'], 'CancelDebug', 'write off all hard breakpoints', 1)
11+
call SpaceVim#custom#SPC('nore', ['l', 'c'], 'call CancelDebugForAllBuffers()', 'write off all hard breakpoints', 1)
1112
call SpaceVim#custom#SPC('nore', ['f', 'v', 'm'], 'e ~/.SpaceVim.d/autoload/myspacevim.vim', 'open myspacevim.vim', 1)
1213
call SpaceVim#custom#SPC('nore', ['B', 'l'], 'Lines', 'fzf in all buffers', 1)
1314
call SpaceVim#custom#SPC('nore', ['b', 'l'], 'BLines', 'fzf in current buffer', 1)
1415
" when using ale, the behavior of next/previous error of SpaceVim is wrong
1516
" so I have to turn to the functions of ale
1617
if g:spacevim_enable_ale
17-
call SpaceVim#custom#SPC('nore', ['e', 'n'], 'ALENext', 'next-error', 1)
18-
call SpaceVim#custom#SPC('nore', ['e', 'p'], 'ALEPrevious', 'previous-error', 1)
19-
call SpaceVim#custom#SPC('nore', ['e', 'N'], 'ALEPrevious', 'previous-error', 1)
18+
call SpaceVim#custom#SPC('nore', ['e', 'n'], 'ALENext', 'ale-next-error', 1)
19+
call SpaceVim#custom#SPC('nore', ['e', 'p'], 'ALEPrevious', 'ale-previous-error', 1)
20+
call SpaceVim#custom#SPC('nore', ['e', 'N'], 'ALEPrevious', 'ale-previous-error', 1)
2021
endif
22+
" formatting code will mess up the folding, so it's help to rearrange it
23+
call SpaceVim#custom#SPC('nore', ['b', 'f'], 'call Format()', 'format-code-and-rearrange-folding', 1)
24+
call SpaceVim#custom#SPC('nore', ['t', 'L'], 'Limelight!!', 'toggle lime light', 1)
2125

2226
" switch python interpreter
2327
let g:python_location = system('which python')
@@ -29,13 +33,24 @@ function! myspacevim#after() abort
2933
set ignorecase
3034
set smartcase
3135

32-
unmap <c-x>
36+
nnoremap ; :
37+
vnoremap ; :
3338
nnoremap Y y$
39+
nnoremap S i<enter><esc>
40+
if has('nvim')
41+
cmap <M-b> <S-Left>
42+
cmap <M-f> <S-Right>
43+
endif
44+
45+
unmap <c-x>
3446
unmap <
3547
unmap >
3648

49+
Limelight
50+
RainbowParentheses
51+
3752
noremap <f6> :call F6()<CR>
38-
command! CancelDebug :bufdo call CancelDebug()
53+
" command! CancelDebug :bufdo call CancelDebug()
3954
command! LatexToURL :call LatexToURL()
4055
command! CopyMode :call CopyMode()
4156

@@ -61,6 +76,11 @@ function! myspacevim#after() abort
6176
endif
6277
endfunc
6378

79+
func! Format()
80+
Neoformat
81+
normal zx
82+
endfunc
83+
6484
func! CancelDebugForAllBuffers()
6585
let l:winview = winsaveview()
6686
let curBuffer = bufnr("%")
@@ -92,11 +112,11 @@ function! myspacevim#after() abort
92112
let g:ale_python_flake8_options = '--ignore=E501'
93113
let g:ale_python_autopep8_options = '--ignore E501'
94114

95-
" LeaderGuid
96-
nnoremap <silent> [ :<c-u>LeaderGuide '['<CR>
97-
vnoremap <silent> [ :<c-u>LeaderGuide '['<CR>
98-
nnoremap <silent> ] :<c-u>LeaderGuideVisual ']'<CR>
99-
vnoremap <silent> ] :<c-u>LeaderGuideVisual ']'<CR>
100-
115+
" " LeaderGuid
116+
" nnoremap <silent> [ :<c-u>LeaderGuide '['<CR>
117+
" vnoremap <silent> [ :<c-u>LeaderGuide '['<CR>
118+
" nnoremap <silent> ] :<c-u>LeaderGuideVisual ']'<CR>
119+
" vnoremap <silent> ] :<c-u>LeaderGuideVisual ']'<CR>
120+
"
101121
endfunction
102122

0 commit comments

Comments
 (0)