From 79bd6b4273325f891d2fcdb2a79ede59e313e414 Mon Sep 17 00:00:00 2001 From: Thomas Buckley-Houston Date: Tue, 30 May 2017 16:24:00 +0700 Subject: Formalise plugin: functions, autoload, tests --- plugin/novim-mode.vim | 92 --------------------------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 plugin/novim-mode.vim (limited to 'plugin/novim-mode.vim') diff --git a/plugin/novim-mode.vim b/plugin/novim-mode.vim deleted file mode 100644 index 5df9bba..0000000 --- a/plugin/novim-mode.vim +++ /dev/null @@ -1,92 +0,0 @@ -" Make sure insert mode is the default mode when opening/switching to files -function! InsertMode() - if &buftype ==# 'nofile' - \|| !&modifiable - \|| &readonly - \|| bufname('%') =~# 'NERD_tree_' - exe "set noinsertmode" - else - exe "set insertmode" - endif -endfunction - -augroup start_insertmode - autocmd! - autocmd BufEnter * call InsertMode() -augroup END - -" Mostly changes the way selection works. -" See: http://vimdoc.sourceforge.net/htmldoc/gui.html#:behave -" An extract from the docs about the difference between `behave mswin` -" and `behave xterm`: -" mswin xterm -" 'selectmode' 'mouse,key' '' -" 'mousemodel' 'popup' 'extend' -" 'keymodel' 'startsel,stopsel' '' -" 'selection' 'exclusive' 'inclusive' -behave mswin - -" Copy and paste stuff -inoremap p -vnoremap y -vnoremap x - -" CTRL-A for selecting all text -inoremap gggHG -cnoremap gggHG -vnoremap gggHG - -" Indenting -" TODO: TAB doesn't work in mswin selection mode, but SHIFT+TAB does?? -vnoremap > -vnoremap < - -" CTRL+q to exit pane/app -inoremap :q -" Useful for exiting buffers like NERDTree that don't use insertmode -nnoremap :q - -" Find -inoremap / -" Find next -inoremap n -" Find previous -inoremap N -" Clears highlighting. NB. Overriding ESC makes it very hard to get into -" NORMAL mode. -inoremap :noh - -" Undo/redo -" Doesn't use Ctrl+Z because that's already a significant *nix shortcut -" Unfortunately Vim can't use uppercase (shifted) key combos, otherwise -" we'd use CTRL+SHIFT+U here. -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 in 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: -" * Make this feature optional. -" * Make End key move to end of current wrapped piece of line. -" * Scroll window 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