On 05/12/13 21:00, Ajabu Tex wrote:
> Hello.
>
> On linux mint 16, to open a file with vim in the terminal i wrote a nemo
> action that sends to the system the following command:
>
> gnome-terminal --working-directory=%P -e "vim %F"
>
> where %P is the insert path of parent (current) directory and %F is the
> insert path list of selection.
>
> The trick seems to work and the selected file is opened, but many lines
> in file are badly showed or not showed at all and CTRL-L doesn't work.
>
> Where can be the problem?
>
When I try to send this command at the bash prompt in konsole, a
gnome-terminal window opens with Vim inside it, but that Vim gets the
current directory (my $HOME) as working directory (as shown by :pwd)
instead of %P, and (with %F a bare file name, of a file which exists in
%P but not in $HOME) Vim opens an empty buffer of that name.
Without the -e switch and its argument, gnome-terminal opens at a bash
prompt, with %P as the current directory, as shown by the prompt. Then
typing the vim command, with the bare filename, at the bash prompt,
opens that file correctly.
:-? :-? :-? :-? :-?
Why don't you try to invoke gvim instead? You could use
gvim --cmd "cd %P" -c "e %F"
to start gvim with %P as the current directory (set before reading the
vimrc) and %F (relative to %P) as the current editfile (opened after
reading the vimrc). With a bare filename not part of a -c parameter, I
see gvim opening with the correct pwd but with a file %F relative to the
_original_ directory from which it was invoked. Maybe that's what you
want after all: in that case the command is
gvim --cmd "cd %P" %F
Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
49. You never have to deal with busy signals when calling your ISP...because
you never log off.
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Thursday, December 5, 2013
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment