aboutsummaryrefslogtreecommitdiff
path: root/vim/vimrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-01 23:48:54 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-01 23:48:54 +1200
commit1e845312f6396cad8bf7d3c9bb2a83f353438832 (patch)
treea1e64b64d6081f7ea46537a01c565611fe29cfb2 /vim/vimrc
parentAllow range for \d and \D bindings (diff)
downloaddotfiles-1e845312f6396cad8bf7d3c9bb2a83f353438832.tar.gz
dotfiles-1e845312f6396cad8bf7d3c9bb2a83f353438832.zip
Add \m, \M, \v, and \V mappings
For listing maps and variables.
Diffstat (limited to 'vim/vimrc')
-rw-r--r--vim/vimrc8
1 files changed, 8 insertions, 0 deletions
diff --git a/vim/vimrc b/vim/vimrc
index c4f6c2dd..f322c191 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -234,6 +234,10 @@ nnoremap <Bslash>i :<C-U>set incsearch! incsearch?<CR>
nnoremap <Bslash>j :<C-U>buffers<CR>:buffer<Space>
" \l toggles showing tab, end-of-line, and trailing whitespace
nnoremap <Bslash>l :<C-U>set list! list?<CR>
+" \m shows all maps
+nnoremap <Bslash>m :<C-U>map<CR>
+" \M shows buffer-local maps
+nnoremap <Bslash>M :<C-U>map <buffer><CR>
" \n toggles line numbers
nnoremap <Bslash>n :<C-U>set number! number?<CR>
" \o and \O open 'pasted insert' lines
@@ -249,6 +253,10 @@ nnoremap <Bslash>s :<C-U>setlocal spell! spell?<CR>
nnoremap <Bslash>t :<C-U>set filetype?<CR>
" \u sets US English spelling (compare \z)
nnoremap <Bslash>u :<C-U>setlocal spelllang=en_us spelllang?<CR>
+" \v shows all global variables
+nnoremap <Bslash>v :<C-U>let g: v:<CR>
+" \V shows all local variables
+nnoremap <Bslash>v :<C-U>let b: t: w:<CR>
" \w toggles wrapping
nnoremap <Bslash>w :<C-U>set wrap! wrap?<CR>
" \x strips trailing whitespace via a custom plugin