From 0cb11c628e993afa1b4ce8d55cdc02bf4845e891 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 24 Jul 2018 09:48:07 +1200 Subject: Adjust 'indentkeys' in HTML indenting --- vim/after/indent/html.vim | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 vim/after/indent/html.vim diff --git a/vim/after/indent/html.vim b/vim/after/indent/html.vim new file mode 100644 index 00000000..6eae00ac --- /dev/null +++ b/vim/after/indent/html.vim @@ -0,0 +1,4 @@ +" Don't re-indent lines on right-angle-bracket or enter +setlocal indentkeys-=<>> +setlocal indentkeys-= +let b:undo_ftplugin .= '|setlocal indentkeys<' -- cgit v1.2.3 From 4ce298cef69a92a124718f4f887e42f4fb7cdc78 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 24 Jul 2018 10:35:38 +1200 Subject: Bump up 'history' again --- vim/vimrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 47422f87..17817408 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -80,8 +80,8 @@ endif " Allow buffers to have changes without being displayed set hidden -" Keep more command and search history -set history=500 +" Keep much more command and search history +set history=2000 " Highlight completed searches; clear on reload set hlsearch -- cgit v1.2.3 From 4b0c278a08c785cf07cb746b01b815217ca9752b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 24 Jul 2018 11:25:03 +1200 Subject: Move quickfix auto-open into a little plugin file I might package this one up, but it's not original and it's so tiny/trivial it's probably not going to get uploaded on vim.org. --- vim/plugin/quickfix_auto_open.vim | 22 ++++++++++++++++++++++ vim/vimrc | 9 --------- 2 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 vim/plugin/quickfix_auto_open.vim diff --git a/vim/plugin/quickfix_auto_open.vim b/vim/plugin/quickfix_auto_open.vim new file mode 100644 index 00000000..e2f111fb --- /dev/null +++ b/vim/plugin/quickfix_auto_open.vim @@ -0,0 +1,22 @@ +" +" quickfix_auto_open.vim: Always pop open the quickfix list or location list +" when they're changed. Dispassionately stolen from romainl's minivimrc. +" +" Author: Tom Ryder +" License: Same as Vim itself +" +if exists('g:loaded_quickfix_auto_open') || &compatible + finish +endif +if !exists('##QuickfixCmdPost') || !exists('##VimEnter') + finish +endif +let g:loaded_quickfix_auto_open = 1 + +" Always pop open quickfix and location lists when changed +augroup quickfix_auto_open + autocmd! + autocmd QuickfixCmdPost [^l]* cwindow + autocmd QuickfixCmdPost l* lwindow + autocmd VimEnter * cwindow +augroup END diff --git a/vim/vimrc b/vim/vimrc index 17817408..cd059d28 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -300,14 +300,5 @@ nnoremap :bdelete " \INS edits a new buffer nnoremap :enew -" Always pop open quickfix and location lists when changed -if exists('##QuickfixCmdPost') - augroup vimrc_quickfix - autocmd! - autocmd QuickfixCmdPost [^l]* cwindow - autocmd QuickfixCmdPost l* lwindow - augroup END -endif - " Source any .vim files from ~/.vim/config runtime! config/*.vim -- cgit v1.2.3 From ac03762d0218727d97e52adadb30cf2a9f32dd26 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 24 Jul 2018 14:18:54 +1200 Subject: Add colon_operator.vim plugin --- vim/plugin/colon_operator.vim | 24 ++++++++++++++++++++++++ vim/vimrc | 3 +++ 2 files changed, 27 insertions(+) create mode 100644 vim/plugin/colon_operator.vim diff --git a/vim/plugin/colon_operator.vim b/vim/plugin/colon_operator.vim new file mode 100644 index 00000000..4360e7ab --- /dev/null +++ b/vim/plugin/colon_operator.vim @@ -0,0 +1,24 @@ +" +" colon_operator.vim: Select ranges and run colon commands on them, rather +" like the ! operator but for colon commands like :sort. +" +" Author: Tom Ryder +" License: Same as Vim itself +" +if exists('g:loaded_colon_operator') || &compatible + finish +endif +if v:version < 700 + finish +endif +let g:loaded_colon_operator = 1 + +" Operator function starts typing an ex command with the operated range +" pre-specified +function! ColonOperator(type) abort + call feedkeys(':''[,'']', 'n') +endfunction + +" Set up mapping +nnoremap (ColonOperator) + \ :set operatorfunc=ColonOperatorg@ diff --git a/vim/vimrc b/vim/vimrc index cd059d28..3dadba76 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -195,6 +195,9 @@ if exists(':xnoremap') xnoremap & :&& endif +" Map g: as a 'colon operator' +nmap g: (ColonOperator) + " Cycle through argument list nnoremap [a :previous nnoremap ]a :next -- cgit v1.2.3 From 26cb1cbb6f38ab476e6666a7806b55a469236d90 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 24 Jul 2018 14:47:16 +1200 Subject: Improved colon_operator.vim plugin --- vim/plugin/colon_operator.vim | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/vim/plugin/colon_operator.vim b/vim/plugin/colon_operator.vim index 4360e7ab..e752e87c 100644 --- a/vim/plugin/colon_operator.vim +++ b/vim/plugin/colon_operator.vim @@ -13,12 +13,24 @@ if v:version < 700 endif let g:loaded_colon_operator = 1 -" Operator function starts typing an ex command with the operated range -" pre-specified +" Operator prompts for a command if it doesn't have one from a prior run, and +" then runs the command on the selected text function! ColonOperator(type) abort - call feedkeys(':''[,'']', 'n') + if !exists('s:command') + let s:command = input('g:', '', 'command') + endif + execute 'normal! :''[,'']'.s:command."\" +endfunction + +" Clear command so that we get prompted to input it, set operator function, +" and return motions to run it +function! ColonMap() abort + unlet! s:command + set operatorfunc=ColonOperator + return 'g@' endfunction " Set up mapping -nnoremap (ColonOperator) - \ :set operatorfunc=ColonOperatorg@ +nnoremap + \ (ColonOperator) + \ ColonMap() -- cgit v1.2.3 From 81ce247cc6c7a6fa45bad76dbc13d43e72085ba3 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 24 Jul 2018 15:11:54 +1200 Subject: Spin out colon_operator.vim plugin into submodule --- .gitmodules | 3 +++ vim/bundle/colon_operator | 1 + vim/plugin/colon_operator.vim | 36 ------------------------------------ 3 files changed, 4 insertions(+), 36 deletions(-) create mode 160000 vim/bundle/colon_operator delete mode 100644 vim/plugin/colon_operator.vim diff --git a/.gitmodules b/.gitmodules index c7d2d0bd..972ca896 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,6 +5,9 @@ [submodule "vim/bundle/cmdwin_ctrlc"] path = vim/bundle/cmdwin_ctrlc url = https://sanctum.geek.nz/code/vim-cmdwin-ctrlc.git +[submodule "vim/bundle/colon_operator"] + path = vim/bundle/colon_operator + url = https://sanctum.geek.nz/code/vim-colon-operator.git [submodule "vim/bundle/copy_linebreak"] path = vim/bundle/copy_linebreak url = https://sanctum.geek.nz/code/vim-copy-linebreak.git diff --git a/vim/bundle/colon_operator b/vim/bundle/colon_operator new file mode 160000 index 00000000..5525627d --- /dev/null +++ b/vim/bundle/colon_operator @@ -0,0 +1 @@ +Subproject commit 5525627dd9727f2ee713e3a06145a145410bcd7c diff --git a/vim/plugin/colon_operator.vim b/vim/plugin/colon_operator.vim deleted file mode 100644 index e752e87c..00000000 --- a/vim/plugin/colon_operator.vim +++ /dev/null @@ -1,36 +0,0 @@ -" -" colon_operator.vim: Select ranges and run colon commands on them, rather -" like the ! operator but for colon commands like :sort. -" -" Author: Tom Ryder -" License: Same as Vim itself -" -if exists('g:loaded_colon_operator') || &compatible - finish -endif -if v:version < 700 - finish -endif -let g:loaded_colon_operator = 1 - -" Operator prompts for a command if it doesn't have one from a prior run, and -" then runs the command on the selected text -function! ColonOperator(type) abort - if !exists('s:command') - let s:command = input('g:', '', 'command') - endif - execute 'normal! :''[,'']'.s:command."\" -endfunction - -" Clear command so that we get prompted to input it, set operator function, -" and return motions to run it -function! ColonMap() abort - unlet! s:command - set operatorfunc=ColonOperator - return 'g@' -endfunction - -" Set up mapping -nnoremap - \ (ColonOperator) - \ ColonMap() -- cgit v1.2.3 From 2315102498f0371eab14420c379721a3e9c505ed Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 24 Jul 2018 15:12:41 +1200 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index c43e3c76..d84a24f6 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v1.39.0 -Mon Jul 23 10:18:52 UTC 2018 +tejr dotfiles v1.40.0 +Tue Jul 24 03:12:33 UTC 2018 -- cgit v1.2.3