Skip to content

Instantly share code, notes, and snippets.

@hkjels
Created May 28, 2013 22:26
Show Gist options
  • Save hkjels/5666635 to your computer and use it in GitHub Desktop.
Save hkjels/5666635 to your computer and use it in GitHub Desktop.
Override native `cd`-command, so that the `z` index is updated with whatever directories you `cd` into.
fun! s:CD(directory)
exec '!cd '.directory
exec 'cd '.directory
endfun
cabbrev cd <c-r>=(getcmdtype()==':' && getcmdpos()==1 ? 'CD' : 'cd')<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment