path: root/vim
diff options
authorTom Ryder <tom@sanctum.geek.nz>2018-08-23 14:41:13 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-08-23 14:41:13 +1200
commit852408bc78b1ecc67ed5e6574a1cab47a66a59d7 (patch)
tree9aa46e80ac73ffd71102ace4da40d767846cf35a /vim
parentUpgrade sahara.vim colorscheme (diff)
Add visual-mode analogues to some leader maps
Diffstat (limited to 'vim')
1 files changed, 15 insertions, 0 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 032d3085..a3d4ede4 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -257,6 +257,9 @@ nmap <Bslash>b <Plug>(CopyLinebreakToggle)
nnoremap <Bslash>c :<C-U>setlocal cursorline! cursorline?<CR>
" \C toggles 'cursorcolumn'
nnoremap <Bslash>C :<C-U>setlocal cursorcolumn! cursorcolumn?<CR>
+if exists(':xnoremap')
+ xnoremap <Bslash>C :<C-U>setlocal cursorcolumn! cursorcolumn?<CR>gv
" \d inserts the local date (POSIX date)
nnoremap <Bslash>d :read !date<CR>
" \D inserts the UTC date (POSIX date)
@@ -281,14 +284,23 @@ nnoremap <Bslash>j :<C-U>buffers<CR>:buffer<Space>
nnoremap <Bslash>k :<C-U>marks<CR>
" \l toggles showing tab, end-of-line, and trailing whitespace
nnoremap <Bslash>l :<C-U>setlocal list! list?<CR>
+if exists(':xnoremap')
+ xnoremap <Bslash>l :<C-U>setlocal list! list?<CR>gv
" \m shows normal maps
nnoremap <Bslash>m :<C-U>map<CR>
" \M shows buffer-local normal maps
nnoremap <Bslash>M :<C-U>map <buffer><CR>
" \n toggles line numbers
nnoremap <Bslash>n :<C-U>setlocal number! number?<CR>
+if exists(':xnoremap')
+ xnoremap <Bslash>n :<C-U>setlocal number! number?<CR>gv
" \N toggles 'ruler'
nnoremap <Bslash>N :<C-U>set ruler! ruler?<CR>
+if exists(':xnoremap')
+ xnoremap <Bslash>N :<C-U>set ruler! ruler?<CR>gv
" \o opens a line below in paste mode
nmap <Bslash>o <Plug>(PasteOpenBelow)
" \O opens a line above in paste mode
@@ -318,6 +330,9 @@ nnoremap <Bslash>v :<C-U>let g: v:<CR>
nnoremap <Bslash>V :<C-U>let b: t: w:<CR>
" \w toggles wrapping
nnoremap <Bslash>w :<C-U>setlocal wrap! wrap?<CR>
+if exists(':xnoremap')
+ xnoremap <Bslash>w :<C-U>setlocal wrap! wrap?<CR>gv
" \x strips trailing whitespace via a custom plugin
nmap <Bslash>x :StripTrailingWhitespace<CR>
if exists(':xmap')