Editing Quitting Vifm

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 98: Line 98:
 
When <code>-f</code> command-line argument is given to Vifm, it starts acting
 
When <code>-f</code> command-line argument is given to Vifm, it starts acting
 
like file picker.  Most of commands work as usual, but instead of opening files
 
like file picker.  Most of commands work as usual, but instead of opening files
Vifm:
+
it:
  
 
# Stores selected files (or current file when selection is empty) in place accessible by invoker (see below).
 
# Stores selected files (or current file when selection is empty) in place accessible by invoker (see below).
# Quits.
+
# Quits Vifm.
  
And quiting Vifm by user causes empty list of files to be written, so that
+
'''TODO:''' running commands store selection and quit.
output file always contains list of selected files (which is empty in case of
 
abortion of file picking).
 
  
 
Selected files are stored in main configuration directory (<code>~/.vifm/</code>
 
Selected files are stored in main configuration directory (<code>~/.vifm/</code>
Line 112: Line 110:
 
properly).
 
properly).
  
==== Usage example ====
+
'''TODO:''' example for shell.
 
 
Here is an example how this special mode can be used from a shell.  Say, one
 
wants to open file in in Vim, but it's easier to pick it with Vifm rather than
 
writing path.  It's also might be desirable to get process tree like
 
 
 
<pre>
 
shell --> vim
 
</pre>
 
 
 
instead of
 
 
 
<pre>
 
shell --> vifm --> vim
 
</pre>
 
 
 
i.e. use Vifm to pick a file and close it afterwards.  It could as simple as the
 
following one-liner in [https://en.wikipedia.org/wiki/Bash_(Unix_shell) Bash]:
 
 
 
<source lang="bash">
 
vifm -f && [ -s ~/.vifm/vimfiles ] && xargs --arg-file ~/.vifm/vimfiles -d '\n' vim
 
# or
 
vifm -f && xargs --no-run-if-empty --arg-file ~/.vifm/vimfiles -d '\n' vim
 
</source>
 
 
 
Where <code>[ -s "path" ]</code> checks that file specified by the
 
<code>path</code> exists and has non-zero size.
 
[https://en.wikipedia.org/wiki/Xargs xargs] passes each line of the file as a
 
separate argument to Vim.
 
  
 
=== Updating shell directory after leaving Vifm ===
 
=== Updating shell directory after leaving Vifm ===

Please note that all contributions to Vifm Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Vifm:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)