From 55c98eaa013c5f319fa11dfc44eab86e25de0872 Mon Sep 17 00:00:00 2001 From: Thomas Buckley-Houston Date: Mon, 15 May 2017 10:46:03 +0700 Subject: Initial commit. Basic plugin and start of docs --- plugin/novim-mode.vim | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 plugin/novim-mode.vim (limited to 'plugin/novim-mode.vim') diff --git a/plugin/novim-mode.vim b/plugin/novim-mode.vim new file mode 100644 index 0000000..ef72015 --- /dev/null +++ b/plugin/novim-mode.vim @@ -0,0 +1,64 @@ +" Make sure insert mode is the default mode when opening/switching to files +augroup start_insertmode + autocmd! + autocmd BufEnter * if &modifiable | startinsert | endif +augroup END + +" Copy and paste stuff +" TODO: +" * Doesn't work when cursor is on the first col +" * Support SHIFT+ARROW in visual mode +inoremap v +inoremap v +inoremap v +inoremap v +inoremap pi +vnoremap yi +vnoremap di + +" Indenting +" The `gv` returns you to the exact same selection, so you can repeat the +" command +vnoremap >gv +vnoremap <gv + +" CTRL+q to exit pane/app +inoremap :q + +" Find +inoremap / +inoremap n +" Clears highlighting. NB. Overriding ESC makes it very hard to get into +" NORMAL mode. +inoremap :noh + +" Undo/redo +inoremap u +inoremap + +" CTRL+s saves +inoremap :update + +" CTRL+k deletes the current line +inoremap "_dd + +" CTRL+d duplicates current line +" TODO: don't put it vim's clipboard, so CTRL+V works as expected +inoremap yyp + +" Alt+/- moves the current line up and down +inoremap :m -2 +inoremap :m +1 + +" Home goes back to the first non-whitespace character of the line +inoremap ^ + +" Allow text to wrap in text files +au BufNewFile,BufRead *.txt,*.md,*.markdown setlocal linebreak spell +" Make arrow keys move through wrapped lines +" TODO: +" * Scroll 1 wrapped soft line at a time rather an entire block of wrapped +" lines. +au BufNewFile,BufRead *.txt,*.md,*.markdown inoremap gk +au BufNewFile,BufRead *.txt,*.md,*.markdown inoremap gj + -- cgit v1.2.3-70-g09d2