aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-24 11:25:03 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-24 11:25:43 +1200
commit4b0c278a08c785cf07cb746b01b815217ca9752b (patch)
treef78718969c4c10dca78c2aa3528cebcad7cd8008
parentBump up 'history' again (diff)
downloaddotfiles-4b0c278a08c785cf07cb746b01b815217ca9752b.tar.gz
dotfiles-4b0c278a08c785cf07cb746b01b815217ca9752b.zip
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.
-rw-r--r--vim/plugin/quickfix_auto_open.vim22
-rw-r--r--vim/vimrc9
2 files changed, 22 insertions, 9 deletions
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 <tom@sanctum.geek.nz>
+" 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 <Bslash><Delete> :bdelete<CR>
" \INS edits a new buffer
nnoremap <Bslash><Insert> :<C-U>enew<CR>
-" 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