Welcome to Vifm Q&A, where you can ask questions about using Vifm. Registration is optional, anonymous posts are moderated. E-mail and GitHub logins are enabled.
0 votes
in vifm by

I'm trying to make a map so that editing opens in a new instance of the terminal with vim.

nnoremap \e :xfce4-terminal -e vim %c

But when spazzing \e, a new instance of the terminal opens, but an error occurs

xfce4-terminal: Unknown parameter “text.txt”
Press return ...

1 Answer

0 votes
by
selected by
 
Best answer

According to manual page of the terminal, you should use -x instead of -c. The latter accepts command as a parameter while the former processes the rest of the command-line. Also, you map looks a bit weird, seems like it should be like this:

nnoremap \e :!xfce4-terminal -x vim %c<cr>
by

Thank you for your help. Everything is working now. I was inattentive and missed the “!”

by

VIFM 0.14 - XTerm - Linux

Hi everyone,

to open a text file - with or whithout extension .txt with vim - in a new intance - I made some change in vifmrc and I tried

nnoremap \e :!xfce4-terminal -x vim %c<cr>

or

`nnoremap \e :!xterm -x vim %c<cr>`

or

nnoremap \e :!xterm -e vim %c<cr>

also

if $DISPLAY != '' && executable('vim')
    " Open file in existing instance of vim
    nnoremap o :!vim --remote-tab-silent %f<cr>
    " Open file in new instance of vim
    nnoremap O :!vim %f<cr>
endif

without any success

Could you give me a little help that would allow me to move forward?

Thx a lot

by

Sounds like you want to run it in background (by adding " &" at the end) to not wait until you close that terminal:

nnoremap \e :!xfce4-terminal -x vim %c &<cr>
" or
nnoremap \e :!xterm -e vim %c &<cr>

It's also -e for xterm, not -x.

by

thank a lot you for your answer.

I'm going to describe the current behaviour

when I select a text file and press enter, it opens in the same window as VIFM and I can't use VIFM until I close the VIM file.

I am looking for a way to open the VIM file in a new window so that I can continue to use VIFM and possibly open other files.

I've tried the code you provided me, when I press "e" on the file it reads the text file in VIFM in the half pane and I can exit this view with pressing "q" - it's a cool think too

nnoremap \e :!xterm -e vim %c &<cr>
by

Why are you pressing e instead of \e? The mapping is for the latter key combination.

by

yes with backslash e -> \e I can open vim in a new instance.

The backslash has burned up my neurons.

You made my day, thx

by

don't know if it's relevant for other vifm users but I changed

nnoremap \e :!xterm -e vim %c &<cr>

in

nnoremap ee :!xterm -e vim %c &<cr>

press \e needs two hands and two fingers - ee one hand one finger

because I am lazy

...