dotfiles

Personal dotfiles
git clone https://git.bracken.jp/dotfiles.git
Log | Files | Refs | LICENSE

commit 10adc6df115962b1ec5f10500c8e247a0f565021
parent de15c7fec90a709fef29f2fb40a655ba3337da89
Author: Chris Bracken <chris@bracken.jp>
Date:   Tue, 14 May 2024 23:48:52 -0700

vim: use noremap over map where reasonable

Most of these didn't rely on recursive evaluation.

Diffstat:
M.config/nvim/init.vim | 29+++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim @@ -17,6 +17,10 @@ call plug#end() runtime ftplugin/man.vim set keywordprg=:Man +" Disable visual-mode mouse select. +set mouse= + +" Set <leader> to comma for convenience. let mapleader=',' " Enable middle-mouse paste. @@ -26,9 +30,6 @@ map <S-Insert> <MiddleMouse> " Kill ex mode. noremap Q <NOP> -" Disable visual-mode mouse select. -set mouse= - " Kill arrow keys, for great justice. noremap <Up> <NOP> noremap <Down> <NOP> @@ -36,8 +37,16 @@ noremap <Left> <NOP> noremap <Right> <NOP> " Retain selection on <,>. -vmap < <gv -vmap > >gv +vnoremap < <gv +vnoremap > >gv + +" Snippets. +nnoremap <leader>sch :0r ~/.config/nvim/snippets/cc.h<CR> +nnoremap <leader>sci :0r ~/.config/nvim/snippets/cc.cc<CR> +nnoremap <leader>scn :.-1r ~/.config/nvim/snippets/namespace.cc<CR> +nnoremap <leader>scs :.-1r ~/.config/nvim/snippets/struct.cc<CR> +nnoremap <leader>scc :.-1r ~/.config/nvim/snippets/class.cc<CR> +nnoremap <leader>sjn :.-1r ~/.config/nvim/snippets/journal.md<CR> " Basic options. set incsearch " Turn on incrememental searching. @@ -72,14 +81,6 @@ au FileType python setl ts=2 sw=2 sts=2 et set tags+=~/.local/tags/system.tags set tags+=~/.local/tags/cxx.tags -" Snippets. -nmap <leader>sch :0r ~/.config/nvim/snippets/cc.h<CR> -nmap <leader>sci :0r ~/.config/nvim/snippets/cc.cc<CR> -nmap <leader>scn :.-1r ~/.config/nvim/snippets/namespace.cc<CR> -nmap <leader>scs :.-1r ~/.config/nvim/snippets/struct.cc<CR> -nmap <leader>scc :.-1r ~/.config/nvim/snippets/class.cc<CR> -nmap <leader>sjn :.-1r ~/.config/nvim/snippets/journal.md<CR> - " Configure colour scheme and syntax highlighting. if &t_Co > 2 syntax enable @@ -117,4 +118,4 @@ function! ToggleNumbering() set nonumber endif endfunc -nmap <C-n> :call ToggleNumbering()<CR> +nnoremap <C-n> :call ToggleNumbering()<CR>