aboutsummaryrefslogtreecommitdiffstats
path: root/vim/vimrc
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-03-29 13:54:50 +0100
committerMatthew Lemon <y@yulqen.org>2023-03-29 13:54:50 +0100
commit580582a7657a9b0b919ecb0bfcb981b34bfec63a (patch)
treea5b8bb294dcb7ec8069416e3ca60264d78776a89 /vim/vimrc
parenta7937b4cf7744e1a186026554f17c91e4047d133 (diff)
some nice native vim stuff
Diffstat (limited to '')
-rw-r--r--vim/vimrc6
1 files changed, 6 insertions, 0 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 2c8807c..d5f4e8b 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -84,6 +84,9 @@ if executable('rg')
set grepprg=rg\ --color=never\ --vimgrep
endif
+" From Practical Vim p101 - Easy expansion of Active File Directory
+cnoremap <expr> %% getcmdtype() == ':' ? expand('%:h').'/' : '%%'
+
" i don't bother with folding, but it's here if i need it.
if has('folding')
set foldmethod=marker
@@ -91,6 +94,9 @@ if has('folding')
set viewoptions=folds,options,cursor,unix,slash
endif
+" Check whether any buffers have been updated outside of vim
+nnoremap <F5> :checktime<CR>
+
" clear search highlights
nnoremap <leader><space> :noh<cr>:call clearmatches()<cr>