aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-23 17:12:01 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-23 17:12:01 +1200
commit3b7b5b7026e96be7d37aacb7d13cd8f7e70f898e (patch)
treea0943dbadf7286201eb759b4e2d28405f5bd1662
parente5a77b2ae47731663c955b6f3fbe803c82f4b85f (diff)
downloaddotfiles-3b7b5b7026e96be7d37aacb7d13cd8f7e70f898e.tar.gz
dotfiles-3b7b5b7026e96be7d37aacb7d13cd8f7e70f898e.zip
Bind \g in Vim to go to the current buffer's dir
-rw-r--r--vim/vimrc2
1 files changed, 2 insertions, 0 deletions
diff --git a/vim/vimrc b/vim/vimrc
index ee01e3fb..ee05236c 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -240,6 +240,8 @@ if has('unix')
endif
" \f shows the current 'formatoptions' at a glance
nnoremap \f :<C-U>set formatoptions?<CR>
+" \g changes directory to the current file's location
+nnoremap \g :<C-U>cd %:h<CR>
" \h toggles highlighting search results
nnoremap \h :<C-U>set hlsearch! hlsearch?<CR>
" \i toggles showing matches as I enter my pattern