dotfiles/nvim/keybindings.vimrc

36 lines
816 B
Plaintext

" Auto-toggle paste mode
let &t_SI .= "\<Esc>[?2004h"
let &t_EI .= "\<Esc>[?2004l"
function! XTermPasteBegin()
set pastetoggle=<Esc>[201~
set paste
return ""
endfunction
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
" Clear search highlighting
noremap <Leader><Esc> :noh<CR>
" Spellcheck
nnoremap <Leader>S :setlocal spell! spelllang=en_us<CR>
" Easy motion to start/end of a line
noremap H ^
noremap L $
" Toggle cursorline and relativelinenumber quickly
noremap <Leader>c :set cursorline!<CR>
noremap <Leader>n :set relativenumber!<CR>
" Oops, forgot a semi-colon...
noremap <Leader>; $a;<Esc>
" Search highlighted text in buffer
vnoremap // y/\V<C-R>=escape(@",'/\')<CR><CR>
" Shift + J/K moves selected lines down/up in visual mode
vnoremap J :m '>+1<CR>gv=gv
vnoremap K :m '<-2<CR>gv=gv