···11-" vim: filetype=vifm :
22-" Sample configuration file for vifm on OSX (last updated: 2 June, 2019)
33-" You can edit this file by hand.
44-" The " character at the beginning of a line comments out the line.
55-" Blank lines are ignored.
66-" The basic format for each item is shown with an example.
77-88-" ------------------------------------------------------------------------------
99-1010-" Command used to edit files in various contexts. The default is vim.
1111-" If you would like to use another vi clone such as Elvis or Vile
1212-" you will need to change this setting.
1313-1414-set vicmd=vim
1515-" set vicmd=elvis\ -G\ termcap
1616-" set vicmd=vile
1717-1818-" This makes vifm perform file operations on its own instead of relying on
1919-" standard utilities like `cp`. While using `cp` and alike is a more universal
2020-" solution, it's also much slower when processing large amounts of files and
2121-" doesn't support progress measuring.
2222-2323-set syscalls
2424-2525-" Trash Directory
2626-" The default is to move files that are deleted with dd or :d to
2727-" the trash directory. If you change this you will not be able to move
2828-" files by deleting them and then using p to put the file in the new location.
2929-" I recommend not changing this until you are familiar with vifm.
3030-" This probably shouldn't be an option.
3131-3232-set trash
3333-3434-" This is how many directories to store in the directory history.
3535-3636-set history=100
3737-3838-" Automatically resolve symbolic links on l or Enter.
3939-4040-set nofollowlinks
4141-4242-" With this option turned on you can run partially entered commands with
4343-" unambiguous beginning using :! (e.g. :!Te instead of :!Terminal or :!Te<tab>).
4444-4545-" set fastrun
4646-4747-" Natural sort of (version) numbers within text.
4848-4949-set sortnumbers
5050-5151-" Maximum number of changes that can be undone.
5252-5353-set undolevels=100
5454-5555-" Use Vim's format of help file (has highlighting and "hyperlinks").
5656-" If you would rather use a plain text help file set novimhelp.
5757-5858-set vimhelp
5959-6060-" If you would like to run an executable file when you
6161-" press return on the file name set this.
6262-6363-set norunexec
6464-6565-" Selected color scheme
6666-6767-colorscheme solarized-light
6868-6969-" Format for displaying time in file list. For example:
7070-" TIME_STAMP_FORMAT=%m/%d-%H:%M
7171-" See man date or man strftime for details.
7272-7373-set timefmt=%m/%d\ %H:%M
7474-7575-" Show list of matches on tab completion in command-line mode
7676-7777-set wildmenu
7878-7979-" Display completions in a form of popup with descriptions of the matches
8080-8181-set wildstyle=popup
8282-8383-" Display suggestions in normal, visual and view modes for keys, marks and
8484-" registers (at most 5 files). In other view, when available.
8585-8686-set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
8787-8888-" Ignore case in search patterns unless it contains at least one uppercase
8989-" letter
9090-9191-set ignorecase
9292-set smartcase
9393-9494-" Don't highlight search results automatically
9595-9696-set nohlsearch
9797-9898-" Use increment searching (search while typing)
9999-set incsearch
100100-101101-" Try to leave some space from cursor to upper/lower border in lists
102102-103103-set scrolloff=4
104104-105105-" Don't do too many requests to slow file systems
106106-107107-set slowfs=curlftpfs
108108-109109-" Set custom status line look
110110-111111-set statusline=" Hint: %z%= %A %10u:%-7g %15s %20d "
112112-113113-" ------------------------------------------------------------------------------
114114-115115-" :mark mark /full/directory/path [filename]
116116-117117-mark b ~/bin/
118118-mark h ~/
119119-120120-" ------------------------------------------------------------------------------
121121-122122-" :com[mand][!] command_name action
123123-" The following macros can be used in a command
124124-" %a is replaced with the user arguments.
125125-" %c the current file under the cursor.
126126-" %C the current file under the cursor in the other directory.
127127-" %f the current selected file, or files.
128128-" %F the current selected file, or files in the other directory.
129129-" %b same as %f %F.
130130-" %d the current directory name.
131131-" %D the other window directory name.
132132-" %m run the command in a menu window
133133-134134-command! df df -h %m 2> /dev/null
135135-command! diff vim -d %f %F
136136-command! zip zip -r %f.zip %f
137137-command! run !! ./%f
138138-command! make !!make %a
139139-command! mkcd :mkdir %a | cd %a
140140-command! reload :write | restart
141141-142142-" ------------------------------------------------------------------------------
143143-144144-" The file type is for the default programs to be used with
145145-" a file extension.
146146-" :filetype pattern1,pattern2 defaultprogram,program2
147147-" :fileviewer pattern1,pattern2 consoleviewer
148148-" The other programs for the file type can be accessed with the :file command
149149-" The command macros %f, %F, %d, %F may be used in the commands.
150150-" Spaces in an app name will have to be escaped e.g. QuickTime\ Player.app
151151-" The %a macro is ignored. To use a % you must put %%.
152152-153153-" For automated FUSE mounts, you must register an extension with :file[x]type
154154-" in one of following formats:
155155-"
156156-" :filetype extensions FUSE_MOUNT|some_mount_command using %SOURCE_FILE and %DESTINATION_DIR variables
157157-" %SOURCE_FILE and %DESTINATION_DIR are filled in by vifm at runtime.
158158-" A sample line might look like this:
159159-" :filetype *.zip,*.jar,*.war,*.ear FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR
160160-"
161161-" :filetype extensions FUSE_MOUNT2|some_mount_command using %PARAM and %DESTINATION_DIR variables
162162-" %PARAM and %DESTINATION_DIR are filled in by vifm at runtime.
163163-" A sample line might look like this:
164164-" :filetype *.ssh FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR
165165-" %PARAM value is filled from the first line of file (whole line).
166166-" Example first line for SshMount filetype: root@127.0.0.1:/
167167-"
168168-" You can also add %CLEAR if you want to clear screen before running FUSE
169169-" program.
170170-171171-" Pdf
172172-filetype *.pdf
173173- \ {Open in Preview}
174174- \ open -a Preview.app,
175175- \ {Open in Skim}
176176- \ open -a Skim.app,
177177-fileviewer *.pdf pdftotext -nopgbrk %c -
178178-179179-" PostScript
180180-filetype *.ps,*.eps open -a Preview.app
181181-182182-" Djvu
183183-filetype *.djvu open -a MacDjView.app
184184-185185-" Audio
186186-filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus
187187- \ {Play using MPlayerX}
188188- \ open -a MPlayerX.app,
189189- \ {Open in iTunes}
190190- \ open -a iTunes.app,
191191- \ {Open in QuickTime Player}
192192- \ open -a QuickTime\ Player.app,
193193-fileviewer *.mp3 mp3info
194194-fileviewer *.flac soxi
195195-196196-" Video
197197-filetype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
198198- \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
199199- \*.as[fx]
200200- \ {Open in VLC}
201201- \ open -a VLC.app,
202202- \ {Open in QuickTime Player}
203203- \ open -a QuickTime\ Player.app,
204204- \ {Open in MPlayerX}
205205- \ open -a MPlayerX.app,
206206-fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
207207- \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
208208- \*.as[fx]
209209- \ ffprobe -pretty %c 2>&1
210210-211211-" Web
212212-filetype *.html,*.htm
213213- \ {Open in Safari}
214214- \ open -a Safari.app,
215215- \ {Open in Firefox}
216216- \ open -a Firefox.app,
217217- \ {Open in Chrome}
218218- \ open -a Google\ Chrome.app,
219219- \ {Open in vim}
220220- \ vim,
221221-fileviewer *.html,*.htm w3m -dump -T text/html
222222-223223-" Object
224224-filetype *.o nm %f | less
225225-226226-" Man page
227227-filetype *.[1-8] man ./%c
228228-fileviewer *.[1-8] man ./%c | col -b
229229-230230-" Image
231231-filetype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm,
232232- \ open -a Preview.app,
233233-fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
234234- \ identify %f
235235-236236-" MD5
237237-filetype *.md5
238238- \ {Check MD5 hash sum}
239239- \ md5sum -c %f %S,
240240-241241-" SHA1
242242-filetype *.sha1
243243- \ {Check SHA1 hash sum}
244244- \ sha1sum -c %f %S,
245245-246246-" SHA256
247247-filetype *.sha256
248248- \ {Check SHA256 hash sum}
249249- \ sha256sum -c %f %S,
250250-251251-" SHA512
252252-filetype *.sha512
253253- \ {Check SHA512 hash sum}
254254- \ sha512sum -c %f %S,
255255-256256-" Torrent
257257-filetype *.torrent open -a Transmission.app
258258-fileviewer *.torrent dumptorrent -v %c
259259-260260-" Extract zip files
261261-filetype *.zip unzip %f
262262-fileviewer *.zip,*.jar,*.war,*.ear zip -sf %c
263263-264264-" Extract tar archives
265265-filetype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz tar -xf %f
266266-fileviewer *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz tar -tf %f
267267-268268-" Extract .bz2 archives
269269-filetype *.bz2 bzip2 -d %f
270270-271271-" Extract .gz files
272272-filetype *.gz gunzip %f
273273-274274-" Mount .dmg archives
275275-filetype *.dmg open
276276-277277-" Mount disk .img
278278-filetype *.img open
279279-280280-" Open .pkg binaries
281281-filetype *.pkg open
282282-283283-" Office files
284284-filetype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx,*.ppt open -a LibreOffice.app
285285-fileviewer *.doc antiword -
286286-fileviewer *.docx docx2txt.pl %f -
287287-288288-" Syntax highlighting in preview
289289-"
290290-" Explicitly set highlight type for some extensions
291291-"
292292-" 256-color terminal
293293-" fileviewer *.[ch],*.[ch]pp highlight -O xterm256 -s dante --syntax c %c
294294-" fileviewer Makefile,Makefile.* highlight -O xterm256 -s dante --syntax make %c
295295-"
296296-" 16-color terminal
297297-" fileviewer *.c,*.h highlight -O ansi -s dante %c
298298-"
299299-" Or leave it for automatic detection
300300-"
301301-" fileviewer *[^/] pygmentize -O style=monokai -f console256 -g
302302-303303-" Displaying pictures in terminal
304304-"
305305-" fileviewer *.jpg,*.png shellpic %c
306306-307307-" Open all other files with default system programs (you can also remove all
308308-" :file[x]type commands above to ensure they don't interfere with system-wide
309309-" settings). By default all unknown files are opened with 'vi[x]cmd'
310310-" uncommenting one of lines below will result in ignoring 'vi[x]cmd' option
311311-" for unknown file types.
312312-" For OS X:
313313-" filetype * open
314314-315315-" ------------------------------------------------------------------------------
316316-317317-" What should be saved automatically between vifm sessions. Drop "savedirs"
318318-" value if you don't want vifm to remember last visited directories for you.
319319-set vifminfo=dhistory,savedirs,chistory,state,tui,shistory,
320320- \phistory,fhistory,dirstack,registers,bookmarks,bmarks
321321-322322-" ------------------------------------------------------------------------------
323323-324324-" Examples of configuring both panels
325325-326326-" Customize view columns a bit (enable ellipsis for truncated file names)
327327-"
328328-" set viewcolumns=-{name}..,6{}.
329329-330330-" Filter-out build and temporary files
331331-"
332332-" filter! /^.*\.(lo|o|d|class|py[co])$|.*~$/
333333-334334-" ------------------------------------------------------------------------------
335335-336336-" Sample mappings
337337-nnoremap ; :
338338-339339-" Start shell in current directory
340340-nnoremap s :shell<cr>
341341-342342-" Display sorting dialog
343343-nnoremap S :sort<cr>
344344-345345-" Toggle visibility of preview window
346346-nnoremap w :view<cr>
347347-vnoremap w :view<cr>gv
348348-349349-" Open file in new MacVim tab
350350-nnoremap o :!mvim --remote-tab-silent %f<cr>
351351-" Open file in new MacVim window
352352-nnoremap O :!mvim %f<cr>
353353-354354-" Open file in the background using its default program
355355-nnoremap gb :!open -g %f<cr>
356356-357357-" Yank current directory path into the clipboard
358358-nnoremap yd :!printf %d | pbcopy<cr>
359359-360360-" Yank current file path into the clipboard
361361-nnoremap yf :!printf %c:p | pbcopy<cr>
362362-363363-" View preview in Quick Look
364364-nnoremap q :!qlmanage -p %f > /dev/null 2>&1<cr>
365365-" Unhide builtin q* keymaps
366366-nnoremap q: q:
367367-nnoremap q/ q/
368368-nnoremap q? q?
369369-nnoremap q= q=
370370-371371-" Mappings for faster renaming
372372-nnoremap I cw<c-a>
373373-nnoremap cc cw<c-u>
374374-nnoremap A cw
375375-376376-" Open editor to edit vifmrc and apply settings after returning to vifm
377377-nnoremap ,c :write | edit $MYVIFMRC | restart<cr>
378378-" Open MacVim to edit vifmrc
379379-nnoremap ,C :!mvim --remote-tab-silent $MYVIFMRC &<cr>
380380-381381-" Toggle wrap setting on ,w key
382382-nnoremap ,w :set wrap!<cr>
383383-384384-" Example of standard two-panel file managers mappings
385385-nnoremap <f3> :!less %f<cr>
386386-nnoremap <f4> :edit<cr>
387387-nnoremap <f5> :copy<cr>
388388-nnoremap <f6> :move<cr>
389389-nnoremap <f7> :mkdir<space>
390390-nnoremap <f8> :delete<cr>
391391-392392-" ------------------------------------------------------------------------------
393393-394394-" Various customization examples
395395-396396-" Use ag (the silver searcher) instead of grep
397397-"
398398-" set grepprg='ag --line-numbers %i %a %s'
399399-400400-" Add additional place to look for executables
401401-"
402402-" let $PATH = $HOME.'/bin/fuse:'.$PATH
403403-404404-" Block particular shortcut
405405-"
406406-" nnoremap <left> <nop>
407407-408408-" Export IPC name of current instance as environment variable and use it to
409409-" communicate with the instance later.
410410-"
411411-" It can be used in some shell script that gets run from inside vifm, for
412412-" example, like this:
413413-" vifm --server-name "$VIFM_SERVER_NAME" --remote +"cd '$PWD'"
414414-"
415415-" let $VIFM_SERVER_NAME = v:servername