xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit 746e74c4722eb60cdc731d342de3aa8c420e7987

Update :diff command in sample vifmrc files
Make it more useful by altering behaviour depending on the selection and
by preserving relative order.

Thanks to an anonymous at Vifm Q2A site.
Author: xaizek
Author date (UTC): 2026-03-28 13:33
Committer name: xaizek
Committer date (UTC): 2026-03-28 13:33
Parent(s): d66e27bb42a226ae1aa3ad5b8ef517fb164179f2
Signing key: 99DC5E4DB05F6BE2
Tree: 3b053669180941d2d4d2eff93e463df381bb360d
File Lines added Lines deleted
ChangeLog 3 0
data/vifmrc 14 2
data/vifmrc-osx 14 2
File ChangeLog changed (mode: 100644) (index 4e1254874..1c81fd21b)
110 110 Improved wording in documentation describing general behaviour of visual Improved wording in documentation describing general behaviour of visual
111 111 mode. mode.
112 112
113 Updated :diff command in sample vifmrc files to be more useful. Thanks to
114 an anonymous at Vifm Q2A site.
115
113 116 Fixed 'trashdir' with "%r" on BSD-like systems (those with getmntinfo() Fixed 'trashdir' with "%r" on BSD-like systems (those with getmntinfo()
114 117 instead of getmntent() API). The regression was apparently introduced in instead of getmntent() API). The regression was apparently introduced in
115 118 v0.9.1-beta. Thanks to sublimal. v0.9.1-beta. Thanks to sublimal.
File data/vifmrc changed (mode: 100644) (index 3cda2a08a..215f741dd)
1 1 " vim: filetype=vifm : " vim: filetype=vifm :
2 2 " "
3 " Sample configuration file for vifm (last updated: 11 February 2026)
3 " Sample configuration file for vifm (last updated: 28 March 2026)
4 4 " "
5 5 " You can edit this file by hand. The " character at the beginning of a line " You can edit this file by hand. The " character at the beginning of a line
6 6 " comments out the line. Blank lines are ignored. The basic format for each " comments out the line. Blank lines are ignored. The basic format for each
 
... ... mark h ~/
174 174 " see `:help vifm-macros` and `:help vifm-filename-modifiers` for more " see `:help vifm-macros` and `:help vifm-filename-modifiers` for more
175 175
176 176 command! df df -h %m 2> /dev/null command! df df -h %m 2> /dev/null
177 command! diff vim -d %f %F
178 177 command! zip zip -r %c.zip %f command! zip zip -r %c.zip %f
179 178 command! run !! ./%f command! run !! ./%f
180 179 command! make !!make %a command! make !!make %a
 
... ... command! mkcd :mkdir %a | cd %a
182 181 command! vgrep vim "+grep %a" command! vgrep vim "+grep %a"
183 182 command! reload :write | restart full command! reload :write | restart full
184 183
184 " use Vim to diff files
185 " uses selection of the current pane when it contains more than one file
186 " otherwise uses left pane file and right pane file keeping order inside Vim
187 command! diff : if selected() < 2
188 \ | if paneisat('right') && paneisat('bottom')
189 \ | execute '!vim -d %%C %%c'
190 \ | else
191 \ | execute '!vim -d %%c %%C'
192 \ | endif
193 \ | else
194 \ | execute '!vim -d %%f'
195 \ | endif
196
185 197 " ------------------------------------------------------------------------------ " ------------------------------------------------------------------------------
186 198 " File handlers and previewers " File handlers and previewers
187 199 " ------------------------------------------------------------------------------ " ------------------------------------------------------------------------------
File data/vifmrc-osx changed (mode: 100644) (index 6bf3d23be..e80aec5ce)
1 1 " vim: filetype=vifm : " vim: filetype=vifm :
2 2 " "
3 " Sample configuration file for vifm on OSX (last updated: 7 September 2025)
3 " Sample configuration file for vifm on OSX (last updated: 28 March 2026)
4 4 " "
5 5 " You can edit this file by hand. The " character at the beginning of a line " You can edit this file by hand. The " character at the beginning of a line
6 6 " comments out the line. Blank lines are ignored. The basic format for each " comments out the line. Blank lines are ignored. The basic format for each
 
... ... mark h ~/
172 172 " see `:help vifm-macros` and `:help vifm-filename-modifiers` for more " see `:help vifm-macros` and `:help vifm-filename-modifiers` for more
173 173
174 174 command! df df -h %m 2> /dev/null command! df df -h %m 2> /dev/null
175 command! diff vim -d %f %F
176 175 command! zip zip -r %c.zip %f command! zip zip -r %c.zip %f
177 176 command! run !! ./%f command! run !! ./%f
178 177 command! make !!make %a command! make !!make %a
179 178 command! mkcd :mkdir %a | cd %a command! mkcd :mkdir %a | cd %a
180 179 command! reload :write | restart full command! reload :write | restart full
181 180
181 " use Vim to diff files
182 " uses selection of the current pane when it contains more than one file
183 " otherwise uses left pane file and right pane file keeping order inside Vim
184 command! diff : if selected() < 2
185 \ | if paneisat('right') && paneisat('bottom')
186 \ | execute '!vim -d %%C %%c'
187 \ | else
188 \ | execute '!vim -d %%c %%C'
189 \ | endif
190 \ | else
191 \ | execute '!vim -d %%f'
192 \ | endif
193
182 194 " ------------------------------------------------------------------------------ " ------------------------------------------------------------------------------
183 195 " File handlers and previewers " File handlers and previewers
184 196 " ------------------------------------------------------------------------------ " ------------------------------------------------------------------------------
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master