[FreeBSD] add crossplatform script & pkg_base
[dotfiles_afify.git] / .config / vifm / vifmrc
blobf05fa664a0f0cf1f304def7fcb1caa4e64dd9185
1 " vim: filetype=vim
3 source ~/.config/vifm/icons
4 " set vicmd=elvis\ -G\ termcap
5 " set vicmd=vile
6 " set fastrun
8 set vicmd=vim
9 set history=100
10 set undolevels=100
11 set timefmt=%m/%d\ %H:%M
13 set trash
14 set syscalls
15 set novimhelp
16 set norunexec
17 set sortnumbers
18 set nofollowlinks
19 set ignorecase
20 set smartcase
22 set nohlsearch
23 set incsearch
25 colorscheme dark
26 set wildmenu
27 set wildstyle=popup
28 set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
29 set scrolloff=4
30 set statusline="  Hint: %z%= %A %10u:%-7g %15s %20d  "
32 if !has('win')
33         set slowfs=curlftpfs
34 endif
36 " :mark mark /full/directory/path [filename]
37 mark b ~/bin/
38 mark h ~/
40 " -----------------------------------------------------------------------------
41 " :com[mand][!] command_name action
42 " The following macros can be used in a command
43 " %a is replaced with the user arguments.
44 " %c the current file under the cursor.
45 " %C the current file under the cursor in the other directory.
46 " %f the current selected file, or files.
47 " %F the current selected file, or files in the other directory.
48 " %b same as %f %F.
49 " %d the current directory name.
50 " %D the other window directory name.
51 " %m run the command in a menu window
53 command! df df -h %m 2> /dev/null
54 command! diff vim -d %f %F
55 command! unzip unzip %f
56 command! run !! ./%f
57 command! make !!make %a
58 command! mkcd :mkdir %a | cd %a
59 command! vgrep vim "+grep %a"
60 command! reload :write | restart
62 " -----------------------------------------------------------------------------
63 " Default Applications
64 " -----------------------------------------------------------------------------
65 " Pdf
66 filextype *.pdf mupdf %c %i &, apvlv %c, xpdf %c
67 "fileviewer *.pdf pdftotext -nopgbrk %c -
69 " PostScript
70 filextype *.ps,*.eps,*.ps.gz
71         \ zathura %f,
72         \ gv %c %i &,
74 " Djvu
75 filextype *.djvu
76         \ zathura %f,
77         \ apvlv %f,
79 " Audio
80 filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus
81         \ mpv %f,
82 fileviewer *.mp3 mp3info
83 fileviewer *.flac soxi
85 " Video
86 filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
87         \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
88         \*.as[fx]
89         \ mpv %f,
90 fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
91         \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
92         \*.as[fx]
93 "       \ ffprobe -pretty %c 2>&1
94 "       \ mpv %f
96 " Web
97 filextype *.html,*.htm
98         \dwb %f %i &,
99         \firefox %f &,
100         \uzbl-browser %f %i &,
101 filetype *.html,*.htm links, lynx
103 " Object
104 filetype *.o nm %f | less
106 " Man page
107 filetype *.[1-8] man ./%c
108 fileviewer *.[1-8] man ./%c | col -b
110 " Images
111 filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
112         \ sxiv %f,
114 fileviewer *.pdf
115     \ vifmimg pdfpreview %px %py %pw %ph %c
116     \ %pc
117     \ vifmimg clear
119 fileviewer *.epub
120     \ vifmimg epubpreview %px %py %pw %ph %c
121     \ %pc
122     \ vifmimg clear
124 fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.xpm
125     \ vifmimg draw %px %py %pw %ph %c
126     \ %pc
127     \ vifmimg clear
129 fileviewer *.gif
130     \ vifmimg gifpreview %px %py %pw %ph %c
131     \ %pc
132     \ vifmimg clear
134 fileviewer *.ico
135     \ vifmimg magickpreview %px %py %pw %ph %c
136     \ %pc
137     \ vifmimg clear
139 " OpenRaster
140 filextype *.ora
141         \ mypaint %f,
143 " Mindmap
144 filextype *.vym
145         \ vym %f &,
147 " MD5
148 filetype *.md5
149        \ md5sum -c %f %S,
151 " SHA1
152 filetype *.sha1
153        \ sha1sum -c %f %S,
155 " SHA256
156 filetype *.sha256
157        \ sha256sum -c %f %S,
159 " SHA512
160 filetype *.sha512
161        \ sha512sum -c %f %S,
163 " GPG signature
164 filetype *.asc
165        \ !!gpg --verify %c,
167 " Torrent
168 filetype *.torrent ktorrent %f &
169 fileviewer *.torrent dumptorrent -v %c
171 " FuseZipMount
172 filetype *.zip,*.jar,*.war,*.ear,*.oxt,*.apkg
173        \ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR,
174        \ zip -sf %c | less,
175        \ tar -xf %c,
176 fileviewer *.zip,*.jar,*.war,*.ear,*.oxt zip -sf %c
178 " ArchiveMount
179 filetype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz,*.tar.xz,*.txz
180        \ FUSE_MOUNT|archivemount %SOURCE_FILE %DESTINATION_DIR,
181 fileviewer *.tgz,*.tar.gz tar -tzf %c
182 fileviewer *.tar.bz2,*.tbz2 tar -tjf %c
183 fileviewer *.tar.txz,*.txz xz --list %c
184 fileviewer *.tar tar -tf %c
186 " Rar2FsMount and rar archives
187 filetype *.rar
188        \ FUSE_MOUNT|rar2fs %SOURCE_FILE %DESTINATION_DIR,
189 fileviewer *.rar unrar v %c
191 " IsoMount
192 filetype *.iso
193        \ FUSE_MOUNT|fuseiso %SOURCE_FILE %DESTINATION_DIR,
195 " SshMount
196 filetype *.ssh
197        \ FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR %FOREGROUND,
199 " FtpMount
200 filetype *.ftp
201        \ FUSE_MOUNT2|curlftpfs -o ftp_port=-,,disable_eprt %PARAM %DESTINATION_DIR %FOREGROUND,
203 " Fuse7z and 7z archives
204 filetype *.7z
205        \ FUSE_MOUNT|fuse-7z %SOURCE_FILE %DESTINATION_DIR,
206 fileviewer *.7z 7z l %c
208 " Office files
209 filextype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx libreoffice %f &
210 fileviewer *.doc catdoc %c
211 fileviewer *.docx docx2txt.pl %f -
213 " TuDu files
214 filetype *.tudu tudu -f %c
216 " Qt projects
217 filextype *.pro qtcreator %f &
219 " Directories
220 filextype */
221         \ Thunar %f &,
223 " ------------------------------------------------------------------------------
225 " set vifminfo=options,filetypes,commands,bookmarks,dhistory,state,cs
226 set vifminfo=dhistory,savedirs,chistory,state,tui,shistory,
227     \phistory,fhistory,dirstack,registers,bookmarks,bmarks
229 "------------------------------------------------------------------------------
230 " Key Mappings
231 "------------------------------------------------------------------------------
232 nnoremap s :shell<cr>                               " Start shell in current directory
233 nnoremap S :sort<cr>                                " Display sorting dialog
234 nnoremap w :view<cr>                                " Toggle visibility of preview window
235 vnoremap w :view<cr>gv
236 nnoremap o :!vim %f<cr>                             " Open file in  vim
237 nnoremap gb :file &<cr>l                            " Open file in the background using its default program
238 nnoremap yd :!echo %d | xclip %i<cr>                " Yank current directory path into the clipboard
239 nnoremap yf :!echo %c:p | xclip %i<cr>              " Yank current file path into the clipboard
240 nnoremap ,t :!st &<cr>                              " Open console in current directory
241 nnoremap n :!mpv --vf=sub,lavfi="negate" %f<cr>     " mpv invert colors
243 " Mappings for faster renaming
244 nnoremap I cw<c-a>
245 nnoremap cc cw<c-u>
246 nnoremap A cw
247 nnoremap ; :
249 " Open editor to edit vifmrc and apply settings after returning to vifm
250 nnoremap ,c :write | edit $MYVIFMRC | restart<cr>
252 " Example of standard two-panel file managers mappings
253 nnoremap <f3> :!less %f<cr>
254 nnoremap <f4> :edit<cr>
255 nnoremap <f5> :copy<cr>
256 nnoremap <f6> :move<cr>
257 nnoremap <f7> :mkdir<space>
258 nnoremap <f8> :delete<cr>