A blog dedicated to text editing and general exploration of computing knowledge
Of course, this works in the VIM command-line as well::cd /tmp:cd -
[...] and from inside of shell scripts as well.In shell script, I find it cleaner to do cd in a subshell so that the old dir is automatically restored.# commands in olddir( cd newdir # commands in newdir)# commands in olddir
Don't forget about pushd and popd. pushd works just like cd but puts your current directory onto a stack. popd removes the directory from the top of the stack and cds into it.
This was a pretty mundane bash tip, and not really a vim tip ... But pushd and popd were new to me! Thanks!
@SpugYeah, sorry, they can't all be exciting.pushd and popd were covered in a previous post:http://dailyvim.blogspot.com/2008/06/pushd-popd.html
Post a Comment