aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-22 16:22:05 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-22 16:22:05 +1200
commit8db92b1752ccaa95ada91bfca9955603a0a1ea59 (patch)
tree57b67bdc9fc5e5eacf8f7a31fe64a0ac6455419e /vim
parent1289b19e2faa92ac45cf0b761c10991ea7cf7025 (diff)
downloaddotfiles-8db92b1752ccaa95ada91bfca9955603a0a1ea59.tar.gz
dotfiles-8db92b1752ccaa95ada91bfca9955603a0a1ea59.zip
Allow numbers in place of symbol leader maps
Diffstat (limited to 'vim')
-rw-r--r--vim/vimrc13
1 files changed, 8 insertions, 5 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 6aa1838b..817b6938 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -1554,9 +1554,10 @@ nnoremap <Leader>+
"" Leader,_ uses last changed or yanked text as an object
onoremap <Leader>_
\ :<C-U>execute 'normal! `[v`]'<CR>
-"" Leader,% uses entire buffer as an object
+"" Leader,% or Leader,5 uses entire buffer as an object
onoremap <Leader>%
\ :<C-U>execute 'normal! 1GVG'<CR>
+omap <Leader>5 <Leader>%
" This group defines some useful motions, including navigating by indent
" block using a custom plugin:
@@ -1601,17 +1602,19 @@ nnoremap <Leader>?
"" Leader,. runs the configured make program into the location list
nnoremap <Leader>.
\ :<C-U>lmake!<CR>
-"" Leader,! repeats the last command, adding a bang
-nnoremap <Leader>!
- \ :<Up><Home><S-Right>!<CR>
"" Leader,q formats the current paragraph
nnoremap <Leader>q gqap
"" Leader,r acts as a replacement operator
nmap <Leader>r <Plug>(ReplaceOperator)
xmap <Leader>r <Plug>(ReplaceOperator)
-"" Leader,* escapes regex metacharacters
+"" Leader,!/1 repeats the last command, adding a bang
+nnoremap <Leader>!
+ \ :<Up><Home><S-Right>!<CR>
+nmap <Leader>1 <Leader>!
nmap <Leader>* <Plug>(RegexEscape)
+nmap <Leader>8 <Leader>*
xmap <Leader>* <Plug>(RegexEscape)
+xmap <Leader>8 <Leader>*
" And last, but definitely not least, I'm required by Vim fanatic law to
" include a mapping that reloads my whole configuration. This uses the