Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to the Power Users community on Codidact!

Power Users is a Q&A site for questions about the usage of computer software and hardware. We are still a small site and would like to grow, so please consider joining our community. We are looking forward to your questions and answers; they are the building blocks of a repository of knowledge we are building together.

Post History

75%
+4 −0
Q&A Open file from vifm in split view

From the FAQ: No, unfortunately it's not possible. Allowing this would require embedding terminal multiplexer into Vifm, which is kinda silly because it is a file manager. The compromise is to r...

posted 3y ago by Quasímodo‭  ·  edited 3y ago by Quasímodo‭

Answer
#3: Post edited by user avatar Quasímodo‭ · 2021-10-28T22:55:49Z (about 3 years ago)
  • From the [FAQ][1]:
  • > No, unfortunately it's not possible. Allowing this would require embedding terminal multiplexer into Vifm, which is kinda silly because it is a file manager. The compromise is to run Vifm inside terminal multiplexer and provide some integration between them (there is already some builtin support for GNU Screen and tmux in Vifm, e.g. `:screen`, `:ls`).
  • However, there are several options to prevent the editor from blocking Vifm.
  • ### Use Gvim
  • A GUI editor opens in a new window, leaving Vifm's terminal free.
  • :set vixcmd="gvim &"
  • Note this option really needs to specify a Vi editor if you want external editor tasks to work. In other words, if you try, for example,
  • :set vixcmd="xedit &"
  • :set vixcmd="xterm -e nano &"
  • that will work fine for normal file editing, but will break `q:` and `:rename`. The reason is explained in the [manual][2]:
  • > **vicmd**
  • >
  • > Command used to edit files in various contexts. Ampersand sign at the end (regardless whether it's preceded by space or not) means backgrounding of command.
  • >
  • > Background flag is ignored in certain context where vifm waits for the editor to finish. Such contexts include any command that spawns editor to change list of file names or a command, with :rename being one example. ’-f’ is also appended to prevent forking in such cases, so the command needs to handle the flag.
  • >
  • > Additionally ’+{num}’ and ’+'call cursor()'’ arguments are used to position cursor when location is known.
  • []()### Use a terminal multiplexer
  • If you run Vifm under Tmux or Screen and activate multiplexer integration with the `:screen!` command, then the files are opened in a new Tmux or Screen window.
  • ### Open a new terminal for the editor
  • Vifm supports binding different commands to different mime-types (as listed by `file -i filename`) or file patterns. For example,
  • :filextype <text/*> xterm -e vim %f &
  • opens files whose mime-type matches `text/*` in a new terminal with Vim, while
  • :filextype *.txt xterm -e vim %f &
  • does the same for all files with a `.txt` extension, and since the Vim terminal is put in the background, the Vifm terminal does not block.
  • [1]: https://wiki.vifm.info/index.php/FAQ#Is_it_possible_to_embed_Vim_or_another_terminal_application_into_one_of_Vifm.27s_panes.3F
  • [2]: https://vifm.info/manual.shtml#Commands
  • From the [FAQ][1]:
  • > No, unfortunately it's not possible. Allowing this would require embedding terminal multiplexer into Vifm, which is kinda silly because it is a file manager. The compromise is to run Vifm inside terminal multiplexer and provide some integration between them (there is already some builtin support for GNU Screen and tmux in Vifm, e.g. `:screen`, `:ls`).
  • However, there are several options to prevent the editor from blocking Vifm.
  • ### Use Gvim
  • A GUI editor opens in a new window, leaving Vifm's terminal free.
  • :set vixcmd="gvim &"
  • Note this option really needs to specify a Vi editor if you want external editor tasks to work. In other words, if you try, for example,
  • :set vixcmd="xedit &"
  • :set vixcmd="xterm -e nano &"
  • that will work fine for normal file editing, but will break `q:` and `:rename`. The reason is explained in the [manual][2]:
  • > **vicmd**
  • >
  • > Command used to edit files in various contexts. Ampersand sign at the end (regardless whether it's preceded by space or not) means backgrounding of command.
  • >
  • > Background flag is ignored in certain context where vifm waits for the editor to finish. Such contexts include any command that spawns editor to change list of file names or a command, with :rename being one example. ’-f’ is also appended to prevent forking in such cases, so the command needs to handle the flag.
  • >
  • > Additionally ’+{num}’ and ’+'call cursor()'’ arguments are used to position cursor when location is known.
  • ### Use a terminal multiplexer
  • If you run Vifm under Tmux or Screen and activate multiplexer integration with the `:screen!` command, then the files are opened in a new Tmux or Screen window.
  • ### Open a new terminal for the editor
  • Vifm supports binding different commands to different mime-types (as listed by `file -i filename`) or file patterns. For example,
  • :filextype <text/*> xterm -e vim %f &
  • opens files whose mime-type matches `text/*` in a new terminal with Vim, while
  • :filextype *.txt xterm -e vim %f &
  • does the same for all files with a `.txt` extension, and since the Vim terminal is put in the background, the Vifm terminal does not block.
  • [1]: https://wiki.vifm.info/index.php/FAQ#Is_it_possible_to_embed_Vim_or_another_terminal_application_into_one_of_Vifm.27s_panes.3F
  • [2]: https://vifm.info/manual.shtml#Commands
#2: Post edited by user avatar Quasímodo‭ · 2021-10-28T22:55:03Z (about 3 years ago)
  • From the [FAQ][1]:
  • > No, unfortunately it's not possible. Allowing this would require embedding terminal multiplexer into Vifm, which is kinda silly because it is a file manager. The compromise is to run Vifm inside terminal multiplexer and provide some integration between them (there is already some builtin support for GNU Screen and tmux in Vifm, e.g. `:screen`, `:ls`).
  • However, there are several options to prevent the editor from blocking Vifm.
  • ### Use Gvim
  • A GUI editor opens in a new window, leaving Vifm's terminal free.
  • :set vixcmd=gvim
  • ### Use a terminal multiplexer
  • If you run Vifm under Tmux or Screen and activate multiplexer integration with the `:screen!` command, then the files are opened in a new Tmux or Screen window.
  • ### Open a new terminal for the editor
  • Vifm supports binding different commands to different mime-types (as listed by `file -i filename`) or file patterns. For example,
  • :filextype <text/*> xterm -e vim %f &
  • opens files whose mime-type matches `text/*` in a new terminal with Vim, while
  • :filextype *.txt xterm -e vim %f &
  • does the same for all files with a `.txt` extension, and since the Vim terminal is put in the background, the Vifm terminal does not block.
  • [1]: https://wiki.vifm.info/index.php/FAQ#Is_it_possible_to_embed_Vim_or_another_terminal_application_into_one_of_Vifm.27s_panes.3F
  • From the [FAQ][1]:
  • > No, unfortunately it's not possible. Allowing this would require embedding terminal multiplexer into Vifm, which is kinda silly because it is a file manager. The compromise is to run Vifm inside terminal multiplexer and provide some integration between them (there is already some builtin support for GNU Screen and tmux in Vifm, e.g. `:screen`, `:ls`).
  • However, there are several options to prevent the editor from blocking Vifm.
  • ### Use Gvim
  • A GUI editor opens in a new window, leaving Vifm's terminal free.
  • :set vixcmd="gvim &"
  • Note this option really needs to specify a Vi editor if you want external editor tasks to work. In other words, if you try, for example,
  • :set vixcmd="xedit &"
  • :set vixcmd="xterm -e nano &"
  • that will work fine for normal file editing, but will break `q:` and `:rename`. The reason is explained in the [manual][2]:
  • > **vicmd**
  • >
  • > Command used to edit files in various contexts. Ampersand sign at the end (regardless whether it's preceded by space or not) means backgrounding of command.
  • >
  • > Background flag is ignored in certain context where vifm waits for the editor to finish. Such contexts include any command that spawns editor to change list of file names or a command, with :rename being one example. ’-f’ is also appended to prevent forking in such cases, so the command needs to handle the flag.
  • >
  • > Additionally ’+{num}’ and ’+'call cursor()'’ arguments are used to position cursor when location is known.
  • []()### Use a terminal multiplexer
  • If you run Vifm under Tmux or Screen and activate multiplexer integration with the `:screen!` command, then the files are opened in a new Tmux or Screen window.
  • ### Open a new terminal for the editor
  • Vifm supports binding different commands to different mime-types (as listed by `file -i filename`) or file patterns. For example,
  • :filextype <text/*> xterm -e vim %f &
  • opens files whose mime-type matches `text/*` in a new terminal with Vim, while
  • :filextype *.txt xterm -e vim %f &
  • does the same for all files with a `.txt` extension, and since the Vim terminal is put in the background, the Vifm terminal does not block.
  • [1]: https://wiki.vifm.info/index.php/FAQ#Is_it_possible_to_embed_Vim_or_another_terminal_application_into_one_of_Vifm.27s_panes.3F
  • [2]: https://vifm.info/manual.shtml#Commands
#1: Initial revision by user avatar Quasímodo‭ · 2021-10-27T15:31:57Z (about 3 years ago)
From the [FAQ][1]: 

> No, unfortunately it's not possible. Allowing this would require embedding terminal multiplexer into Vifm, which is kinda silly because it is a file manager. The compromise is to run Vifm inside terminal multiplexer and provide some integration between them (there is already some builtin support for GNU Screen and tmux in Vifm, e.g. `:screen`, `:ls`).

However, there are several options to prevent the editor from blocking Vifm.

### Use Gvim

A GUI editor opens in a new window, leaving Vifm's terminal free.

    :set vixcmd=gvim

### Use a terminal multiplexer

If you run Vifm under Tmux or Screen and activate multiplexer integration with the `:screen!` command, then the files are opened in a new Tmux or Screen window.

### Open a new terminal for the editor

Vifm supports binding different commands to different mime-types (as listed by `file -i filename`) or file patterns. For example,

    :filextype <text/*> xterm -e vim %f &

opens files whose mime-type matches `text/*` in a new terminal with Vim, while

    :filextype *.txt xterm -e vim %f &

does the same for all files with a `.txt` extension, and since the Vim terminal is put in the background, the Vifm terminal does not block.

[1]: https://wiki.vifm.info/index.php/FAQ#Is_it_possible_to_embed_Vim_or_another_terminal_application_into_one_of_Vifm.27s_panes.3F