When opening a file from dolphin gvim doesn't take over the correct path info
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vim (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: vim-gnome
Scenario:
This is happening on Intrepid (8.10) amd64
vim-gnome package version: 1:7.1.314-3ubuntu3
dolphin package version: 4:4.1.2-0ubuntu4
- Mapped the file-association of .tex files to gvim
- Opening a .tex file from dolphin (or konqueror)
- Trying to use some features from vim-latexsuite (e.g.: :call Tex_ViewLatex() for viewing the compiled document in an external viewer)
-> commands have no effect, because gvim thinks its still located at the standard path (/home/user) which can be confirmed by running '!ls' from the vim-command-line.
Problem doesn't exist when I run gvim from the command-line. '!ls' then shows the path where the edited document is located and gvim/latex-suite works as expected.
Don't know if its really a gvim issue or more a dolphin/
hmm... seems like expected behaviour to me. gvim's 'current directory' is the directory where it is run from, not the directory of the file edited. e.g. if you run "gvim ~/myfolder/ myfile. tex" from your home dir, vim's current dir will be your home, not ~/myfolder.
From within gvim, you can use :pwd to display the current directory, and :cd ~/myfolder to change it.
A possible solution to your problem is too add this to your .vimrc:
autocmd BufRead * cd %:p:h
It will automatically change the current directory to the one of the file read when you open a file (it can be a bit irritating because it does it for all files, including helpfiles...) so you can use that if you prefer:
autocmd BufRead *.tex cd %:p:h