m(Adding nnn, another alternative in the terminal file manager category)

(23 intermediate revisions by 15 users not shown)

Line 1:

Line 1:

[[Category:File managers]]

[[Category:File managers]]

+

[[Category:Console applications]]

[[ar:Vifm]]

[[ar:Vifm]]

+

[[ja:Vifm]]

{{Related articles start}}

{{Related articles start}}

+

{{Related|nnn}}

{{Related|ranger}}

{{Related|ranger}}

{{Related articles end}}

{{Related articles end}}

−

From the [http://vifm.sourceforge.net/ Vifm] home page:

+

From the [http://vifm.info/ Vifm] home page:

−

:'' Vifm is a ncurses based file manager with vi like keybindings, which also borrows some useful ideas from mutt. If you use vi, vifm gives you complete keyboard control over your files without having to learn a new set of commands.''

+

:Vifm is an ncurses based file manager with vi like keybindings/modes/options/commands/configuration, which also borrows some useful ideas from [[mutt]].

+

If you use [[vi]], Vifm gives you complete keyboard control over your files without having to learn a new set of commands.

As of 0.6.2 you can customize key bindings in Vifm. These can be set from the command mode using the map command, like so:

As of 0.6.2 you can customize key bindings in Vifm. These can be set from the command mode using the map command, like so:

−

:map ] :s

+

:map ] :s

However, these mappings will not be saved between sessions. To map a key permanently, place them in ~/vifm/vifmrc. More sample mappings can be seen at the end of that file.

However, these mappings will not be saved between sessions. To map a key permanently, place them in ~/vifm/vifmrc. More sample mappings can be seen at the end of that file.

Line 109:

Line 113:

'[a-z][A-Z][0-9]

'[a-z][A-Z][0-9]

Vifm will remember the marks between the sessions.

Vifm will remember the marks between the sessions.

+

+

=== Previews ===

+

Provided {{Pkg|poppler}} is installed,

+

putting

+

fileviewer *.pdf

+

\ pdftotext %c -

+

into vifmrc enables pdf-previewing using pdftotext.

+

The {{ic|%c}} is a vifm macro for the current file under the cursor.

+

The preview is activated with

+

:view

+

Neat image previewing can be achieved using img2txt from {{Pkg|libcaca}}

+

fileviewer *.png,*.jpeg,*.jpg

+

\ img2txt %c

+

Previewing the contents of tar-archives:

+

fileviewer *.tar,*.tar.gz

+

\ tar -tvf %c

+

For previewing html documents suitable programs are

+

text based browsers including {{Pkg|lynx}}, {{Pkg|links}} or {{Pkg|w3m}}

+

fileviewer *.html

+

\ w3m %c

+

For printing text instead of previewing the file (for binary files for example):

+

fileviewer *.exe

+

\ echo Binary file: no preview available. %i

+

{{ic|%i}} is there because {{ic|%c}} is implicitly used if no other macro is used. In this case, {{ic|%i}} is ignored.

+

+

For handling filetypes not handled by anything else, put {{ic|fileviewer * <your command>}} as the last fileviewer option in your config file.

+

+

Further useful programs for previews include

+

* {{Pkg|tree}} for directory previews

+

* {{Pkg|mp3info}} for viewing information about mp3 files

+

* {{Pkg|libmediainfo}} for the mediainfo program (audio and video information)

== Tips and tricks ==

== Tips and tricks ==

Line 115:

Line 150:

Single stroke to access command line

Single stroke to access command line

−

nmap ; :

+

nmap ; :

+

+

=== Non-vim Users ===

+

{{ic|vifm}} assumes that you are using {{ic|vim}} and will throw errors if it doesn't find it. If you are using {{ic|vi}} or {{ic|nvim}} ([[Neovim]]), you need to edit your {{ic|~/.vifm/vifmrc}} file. Comment out the line {{ic|<nowiki>set vicmd=vim</nowiki>}} and replace it with {{ic|<nowiki>set vicmd=vi</nowiki>}} or {{ic|<nowiki>set vicmd=nvim</nowiki>}}. Note that, just like {{ic|.exrc}}, comment lines are introduced by double quotes.

+

+

=== Total size of selected files ===

+

+

To get the total size of selected files change %s to %E in {{ic|~/.vifm/vifmrc}}, like so:

+

set statusline=" %t%= %A %10u:%-7g %15E %20d "

+

+

=== Use output of external program in status line ===

+

+

Here's a status line that calls [[File_permissions_and_attributes#chattr_and_lsattr|lsattr]], passing it the name of the file currently under the cursor:

+

set statusline="%{system('lsattr -l ' . expand('%c'))}"

+

+

For more, see [https://vifm.info/manual.shtml#Expression%20syntax expression syntax] and available [https://vifm.info/manual.shtml#Functions functions].

Tips and tricks

Useful key mappings

Single stroke to access command line

nmap ; :

Non-vim Users

vifm assumes that you are using vim and will throw errors if it doesn't find it. If you are using vi or nvim (Neovim), you need to edit your ~/.vifm/vifmrc file. Comment out the line set vicmd=vim and replace it with set vicmd=vi or set vicmd=nvim. Note that, just like .exrc, comment lines are introduced by double quotes.

Total size of selected files

To get the total size of selected files change %s to %E in ~/.vifm/vifmrc, like so:

set statusline=" %t%= %A %10u:%-7g %15E %20d "

Use output of external program in status line

Here's a status line that calls lsattr, passing it the name of the file currently under the cursor: