From 3b7b5b7026e96be7d37aacb7d13cd8f7e70f898e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Jun 2018 17:12:01 +1200 Subject: Bind \g in Vim to go to the current buffer's dir --- vim/vimrc | 2 ++ 1 file changed, 2 insertions(+) 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 :set formatoptions? +" \g changes directory to the current file's location +nnoremap \g :cd %:h " \h toggles highlighting search results nnoremap \h :set hlsearch! hlsearch? " \i toggles showing matches as I enter my pattern -- cgit v1.2.3