I would like to create an nmap that would first cd to a particular directory and then edit a file in that directory. For instance, this would allow me to open a LaTeX file and edit it, but then exit from that file and be in the directory to pull up the pdf file that LaTeX created. I have tried the following:
nmap b :cd /path/to/directory/ <cr> :edit file.tex
This almost works and will suffice if it is the only way to do it. What happens is that the left pane changes to the correct directory and the file is opened in the right pane. Then when I quit I only need to move between panes to get to the other files. However, it would be simpler/cleaner if I could get both commands to happen in the same pane.
Is this possible?
Thanks