aboutsummaryrefslogtreecommitdiffhomepage
path: root/.vimrc
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2021-11-29 10:10:52 +0900
committernsfisis <nsfisis@gmail.com>2021-11-29 10:10:52 +0900
commit616241470486ed2cd4098b12c72b49c66c083607 (patch)
treeb3d565bc1ffb33c86dfd14b16813ceeaf96f240c /.vimrc
parent942b477f438d61a5ccaf29d18d10df0ba9762424 (diff)
downloaddotfiles-616241470486ed2cd4098b12c72b49c66c083607.tar.gz
dotfiles-616241470486ed2cd4098b12c72b49c66c083607.tar.zst
dotfiles-616241470486ed2cd4098b12c72b49c66c083607.zip
neovim/vim: add key mappings to toggle some options
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc23
1 files changed, 23 insertions, 0 deletions
diff --git a/.vimrc b/.vimrc
index 04e11e1..bef1d50 100644
--- a/.vimrc
+++ b/.vimrc
@@ -289,6 +289,29 @@ nnoremap tc <C-w>c
nnoremap to <C-w>o
nnoremap <silent> tO :<C-u>tabonly<CR>
+nnoremap T <Nop>
+
+nnoremap <silent> Tb :<C-u>if &background == 'dark' <Bar>set background=light <Bar>else <Bar>set background=dark <Bar>endif<CR>
+nnoremap <silent> Tc :<C-u>set cursorcolumn! <Bar>set cursorline!<CR>
+nnoremap <silent> Td :<C-u>if &diff <Bar>diffoff <Bar>else <Bar>diffthis <Bar>endif<CR>
+nnoremap <silent> Te :<C-u>set expandtab!<CR>
+nnoremap <silent> Th :<C-u>set hlsearch!<CR>
+nnoremap <silent> Tn :<C-u>set number!<CR>
+nnoremap <silent> Ts :<C-u>set spell!<CR>
+nnoremap <silent> T8 :<C-u>if &textwidth ==# 80 <Bar>set textwidth= <Bar>else <Bar>set textwidth=80 <Bar>endif<CR>
+nnoremap <silent> T0 :<C-u>if &textwidth ==# 100 <Bar>set textwidth= <Bar>else <Bar>set textwidth=100 <Bar>endif<CR>
+nnoremap <silent> T2 :<C-u>if &textwidth ==# 120 <Bar>set textwidth= <Bar>else <Bar>set textwidth=120 <Bar>endif<CR>
+nnoremap <silent> Tw :<C-u>set wrap!<CR>
+
+nmap TB Tb
+nmap TC Tc
+nmap TD Td
+nmap TE Te
+nmap TH Th
+nmap TN Tn
+nmap TS Ts
+nmap TW Tw
+
nnoremap gh <Nop>
nnoremap gH <Nop>
nnoremap g<C-h> <Nop>