Dotfiles for different machines on different branches.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

504 lines
15 KiB

  1. " vim: filetype=vifm :
  2. " Sample configuration file for vifm (last updated: 2 June, 2019)
  3. " You can edit this file by hand.
  4. " The " character at the beginning of a line comments out the line.
  5. " Blank lines are ignored.
  6. " The basic format for each item is shown with an example.
  7. " ------------------------------------------------------------------------------
  8. " Command used to edit files in various contexts. The default is vim.
  9. " If you would like to use another vi clone such as Elvis or Vile
  10. " you will need to change this setting.
  11. set vicmd=nvim
  12. " This makes vifm perform file operations on its own instead of relying on
  13. " standard utilities like `cp`. While using `cp` and alike is a more universal
  14. " solution, it's also much slower when processing large amounts of files and
  15. " doesn't support progress measuring.
  16. set syscalls
  17. " Trash Directory
  18. " The default is to move files that are deleted with dd or :d to
  19. " the trash directory. If you change this you will not be able to move
  20. " files by deleting them and then using p to put the file in the new location.
  21. " I recommend not changing this until you are familiar with vifm.
  22. " This probably shouldn't be an option.
  23. set trash
  24. " This is how many directories to store in the directory history.
  25. set history=100
  26. " Automatically resolve symbolic links on l or Enter.
  27. set nofollowlinks
  28. " With this option turned on you can run partially entered commands with
  29. " unambiguous beginning using :! (e.g. :!Te instead of :!Terminal or :!Te<tab>).
  30. " set fastrun
  31. " Natural sort of (version) numbers within text.
  32. set sortnumbers
  33. " Maximum number of changes that can be undone.
  34. set undolevels=100
  35. " Use Vim's format of help file (has highlighting and "hyperlinks").
  36. " If you would rather use a plain text help file set novimhelp.
  37. set vimhelp
  38. " If you would like to run an executable file when you
  39. " press return on the file name set this.
  40. set norunexec
  41. " Selected color scheme
  42. colorscheme Default
  43. " Format for displaying time in file list. For example:
  44. " TIME_STAMP_FORMAT=%m/%d-%H:%M
  45. " See man date or man strftime for details.
  46. set timefmt=%d.%m.%y\ %H:%M
  47. " Show list of matches on tab completion in command-line mode
  48. set wildmenu
  49. " Display completions in a form of popup with descriptions of the matches
  50. set wildstyle=popup
  51. " Display suggestions in normal, visual and view modes for keys, marks and
  52. " registers (at most 5 files). In other view, when available.
  53. set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
  54. " Ignore case in search patterns unless it contains at least one uppercase
  55. " letter
  56. set ignorecase
  57. set smartcase
  58. " Don't highlight search results automatically
  59. set nohlsearch
  60. " Use increment searching (search while typing)
  61. set incsearch
  62. " Try to leave some space from cursor to upper/lower border in lists
  63. set scrolloff=4
  64. " Don't do too many requests to slow file systems
  65. if !has('win')
  66. set slowfs=curlftpfs
  67. endif
  68. " Set custom status line look
  69. set statusline=" Hint: %z%= %A %10u:%-7g %15s %20d "
  70. " ------------------------------------------------------------------------------
  71. " :mark mark /full/directory/path [filename]
  72. mark b ~/bin/
  73. mark h ~/
  74. " ------------------------------------------------------------------------------
  75. " :com[mand][!] command_name action
  76. " The following macros can be used in a command
  77. " %a is replaced with the user arguments.
  78. " %c the current file under the cursor.
  79. " %C the current file under the cursor in the other directory.
  80. " %f the current selected file, or files.
  81. " %F the current selected file, or files in the other directory.
  82. " %b same as %f %F.
  83. " %d the current directory name.
  84. " %D the other window directory name.
  85. " %m run the command in a menu window
  86. command! df df -h %m 2> /dev/null
  87. command! diff vim -d %f %F
  88. command! zip zip -r %f.zip %f
  89. command! run !! ./%f
  90. command! make !!make %a
  91. command! mkcd :mkdir %a | cd %a
  92. command! vgrep vim "+grep %a"
  93. command! reload :write | restart
  94. " ------------------------------------------------------------------------------
  95. " The file type is for the default programs to be used with
  96. " a file extension.
  97. " :filetype pattern1,pattern2 defaultprogram,program2
  98. " :fileviewer pattern1,pattern2 consoleviewer
  99. " The other programs for the file type can be accessed with the :file command
  100. " The command macros %f, %F, %d, %F may be used in the commands.
  101. " The %a macro is ignored. To use a % you must put %%.
  102. " For automated FUSE mounts, you must register an extension with :file[x]type
  103. " in one of following formats:
  104. "
  105. " :filetype extensions FUSE_MOUNT|some_mount_command using %SOURCE_FILE and %DESTINATION_DIR variables
  106. " %SOURCE_FILE and %DESTINATION_DIR are filled in by vifm at runtime.
  107. " A sample line might look like this:
  108. " :filetype *.zip,*.jar,*.war,*.ear FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR
  109. "
  110. " :filetype extensions FUSE_MOUNT2|some_mount_command using %PARAM and %DESTINATION_DIR variables
  111. " %PARAM and %DESTINATION_DIR are filled in by vifm at runtime.
  112. " A sample line might look like this:
  113. " :filetype *.ssh FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR
  114. " %PARAM value is filled from the first line of file (whole line).
  115. " Example first line for SshMount filetype: root@127.0.0.1:/
  116. "
  117. " You can also add %CLEAR if you want to clear screen before running FUSE
  118. " program.
  119. " PDF
  120. filextype *.pdf zathura %c %i &, apvlv %c, xpdf %c
  121. fileviewer *.pdf
  122. \ vifmimg pdfpreview %px %py %pw %ph %c
  123. \ %pc
  124. \ vifmimg clear
  125. "\ pdftotext -nopgbrk %c -
  126. " CSV
  127. filetype *.csv,*.xlsx sc-im %f
  128. " PostScript
  129. filextype *.ps,*.eps,*.ps.gz
  130. \ {View in zathura}
  131. \ zathura %f,
  132. \ {View in gv}
  133. \ gv %c %i &,
  134. " Djvu
  135. filextype *.djvu
  136. \ {View in zathura}
  137. \ zathura %f,
  138. \ {View in apvlv}
  139. \ apvlv %f,
  140. " Audio
  141. filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus
  142. \ {Play using ffplay}
  143. \ ffplay -nodisp -autoexit %c,
  144. \ {Play using MPlayer}
  145. \ mplayer %f,
  146. fileviewer *.mp3 mp3info
  147. fileviewer *.flac soxi
  148. " Video
  149. filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
  150. \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
  151. \*.as[fx]
  152. \ {View using mpv}
  153. \ mpv --fs %f,
  154. fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
  155. \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
  156. \*.as[fx]
  157. \ vifmimg videopreview %px %py %pw %ph %c
  158. \ %pc
  159. \ vifmimg clear
  160. "\ ffprobe -pretty %c 2>&1
  161. " Web
  162. filextype *.html,*.htm
  163. \ {Open with firefox}
  164. \ firefox %f &,
  165. filetype *.html,*.htm links, lynx
  166. " Object
  167. filetype *.o nm %f | less
  168. " Man page
  169. filetype *.[1-8] man ./%c
  170. fileviewer *.[1-8] man ./%c | col -b
  171. " Images
  172. filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
  173. \ {View in sxiv}
  174. \ sxiv -ia %c %d &,
  175. fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
  176. \ vifmimg draw %px %py %pw %ph %c
  177. \ %pc
  178. \ vifmimg clear
  179. fileviewer *.gif
  180. \ vifmimg gifpreview %px %py %pw %ph %c
  181. \ %pc
  182. \vifmimg clear
  183. " OpenRaster
  184. filextype *.ora
  185. \ {Edit in MyPaint}
  186. \ mypaint %f,
  187. " Mindmap
  188. filextype *.vym
  189. \ {Open with VYM}
  190. \ vym %f &,
  191. " MD5
  192. filetype *.md5
  193. \ {Check MD5 hash sum}
  194. \ md5sum -c %f %S,
  195. " SHA1
  196. filetype *.sha1
  197. \ {Check SHA1 hash sum}
  198. \ sha1sum -c %f %S,
  199. " SHA256
  200. filetype *.sha256
  201. \ {Check SHA256 hash sum}
  202. \ sha256sum -c %f %S,
  203. " SHA512
  204. filetype *.sha512
  205. \ {Check SHA512 hash sum}
  206. \ sha512sum -c %f %S,
  207. " GPG signature
  208. filetype *.asc
  209. \ {Check signature}
  210. \ !!gpg --verify %c,
  211. " Torrent
  212. filetype *.torrent ktorrent %f &
  213. fileviewer *.torrent dumptorrent -v %c
  214. " FuseZipMount
  215. filetype *.zip,*.jar,*.war,*.ear,*.oxt,*.apkg
  216. \ {Mount with fuse-zip}
  217. \ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR,
  218. \ {View contents}
  219. \ zip -sf %c | less,
  220. \ {Extract here}
  221. \ tar -xf %c,
  222. fileviewer *.zip,*.jar,*.war,*.ear,*.oxt zip -sf %c
  223. " ArchiveMount
  224. filetype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz,*.tar.xz,*.txz
  225. \ {Mount with archivemount}
  226. \ FUSE_MOUNT|archivemount %SOURCE_FILE %DESTINATION_DIR,
  227. fileviewer *.tgz,*.tar.gz tar -tzf %c
  228. fileviewer *.tar.bz2,*.tbz2 tar -tjf %c
  229. fileviewer *.tar.txz,*.txz xz --list %c
  230. fileviewer *.tar tar -tf %c
  231. " Rar2FsMount and rar archives
  232. filetype *.rar
  233. \ {Mount with rar2fs}
  234. \ FUSE_MOUNT|rar2fs %SOURCE_FILE %DESTINATION_DIR,
  235. fileviewer *.rar unrar v %c
  236. " IsoMount
  237. filetype *.iso
  238. \ {Mount with fuseiso}
  239. \ FUSE_MOUNT|fuseiso %SOURCE_FILE %DESTINATION_DIR,
  240. " SshMount
  241. filetype *.ssh
  242. \ {Mount with sshfs}
  243. \ FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR %FOREGROUND,
  244. " FtpMount
  245. filetype *.ftp
  246. \ {Mount with curlftpfs}
  247. \ FUSE_MOUNT2|curlftpfs -o ftp_port=-,,disable_eprt %PARAM %DESTINATION_DIR %FOREGROUND,
  248. " Fuse7z and 7z archives
  249. filetype *.7z
  250. \ {Mount with fuse-7z}
  251. \ FUSE_MOUNT|fuse-7z %SOURCE_FILE %DESTINATION_DIR,
  252. fileviewer *.7z 7z l %c
  253. " Office files
  254. filextype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx libreoffice %f &
  255. fileviewer *.doc catdoc %c
  256. fileviewer *.docx docx2txt.pl %f -
  257. " TuDu files
  258. filetype *.tudu tudu -f %c
  259. " Qt projects
  260. filextype *.pro qtcreator %f &
  261. " Directories
  262. filextype */
  263. \ {View in thunar}
  264. \ Thunar %f &,
  265. " Syntax highlighting in preview
  266. "
  267. " Explicitly set highlight type for some extensions
  268. "
  269. " 256-color terminal
  270. " fileviewer *.[ch],*.[ch]pp highlight -O xterm256 -s dante --syntax c %c
  271. " fileviewer Makefile,Makefile.* highlight -O xterm256 -s dante --syntax make %c
  272. "
  273. " 16-color terminal
  274. " fileviewer *.c,*.h highlight -O ansi -s dante %c
  275. "
  276. " Or leave it for automatic detection
  277. "
  278. " fileviewer *[^/] pygmentize -O style=monokai -f console256 -g
  279. " Displaying pictures in terminal
  280. "
  281. " fileviewer *.jpg,*.png shellpic %c
  282. " Open all other files with default system programs (you can also remove all
  283. " :file[x]type commands above to ensure they don't interfere with system-wide
  284. " settings). By default all unknown files are opened with 'vi[x]cmd'
  285. " uncommenting one of lines below will result in ignoring 'vi[x]cmd' option
  286. " for unknown file types.
  287. " For *nix:
  288. " filetype * xdg-open
  289. " For OS X:
  290. " filetype * open
  291. " For Windows:
  292. " filetype * start, explorer
  293. " ------------------------------------------------------------------------------
  294. " What should be saved automatically between vifm sessions. Drop "savedirs"
  295. " value if you don't want vifm to remember last visited directories for you.
  296. set vifminfo=dhistory,savedirs,chistory,state,tui,shistory,
  297. \phistory,fhistory,dirstack,registers,bookmarks,bmarks
  298. " ------------------------------------------------------------------------------
  299. " Examples of configuring both panels
  300. " Customize view columns a bit (enable ellipsis for truncated file names)
  301. "
  302. " set viewcolumns=-{name}..,6{}.
  303. " Filter-out build and temporary files
  304. "
  305. " filter! /^.*\.(lo|o|d|class|py[co])$|.*~$/
  306. " ------------------------------------------------------------------------------
  307. " GETTING ICONS TO DISPLAY IN VIFM
  308. " You need the next 14 lines!
  309. " file types
  310. set classify=' :dir:/, :exe:, :reg:, :link:'
  311. " various file names
  312. set classify+=' ::../::, ::*.sh::, ::*.[hc]pp::, ::*.[hc]::, ::/^copying|license$/::, ::.git/,,*.git/::, ::*.epub,,*.fb2,,*.djvu::, ::*.pdf::, ::*.htm,,*.html,,**.[sx]html,,*.xml::'
  313. " archives
  314. set classify+=' ::*.7z,,*.ace,,*.arj,,*.bz2,,*.cpio,,*.deb,,*.dz,,*.gz,,*.jar,,*.lzh,,*.lzma,,*.rar,,*.rpm,,*.rz,,*.tar,,*.taz,,*.tb2,,*.tbz,,*.tbz2,,*.tgz,,*.tlz,,*.trz,,*.txz,,*.tz,,*.tz2,,*.xz,,*.z,,*.zip,,*.zoo::'
  315. " images
  316. set classify+=' ::*.bmp,,*.gif,,*.jpeg,,*.jpg,,*.ico,,*.png,,*.ppm,,*.svg,,*.svgz,,*.tga,,*.tif,,*.tiff,,*.xbm,,*.xcf,,*.xpm,,*.xspf,,*.xwd::'
  317. " audio
  318. set classify+=' ::*.aac,,*.anx,,*.asf,,*.au,,*.axa,,*.flac,,*.m2a,,*.m4a,,*.mid,,*.midi,,*.mp3,,*.mpc,,*.oga,,*.ogg,,*.ogx,,*.ra,,*.ram,,*.rm,,*.spx,,*.wav,,*.wma,,*.ac3::'
  319. " media
  320. set classify+=' ::*.avi,,*.ts,,*.axv,,*.divx,,*.m2v,,*.m4p,,*.m4v,,.mka,,*.mkv,,*.mov,,*.mp4,,*.flv,,*.mp4v,,*.mpeg,,*.mpg,,*.nuv,,*.ogv,,*.pbm,,*.pgm,,*.qt,,*.vob,,*.wmv,,*.xvid::'
  321. " office files
  322. set classify+=' ::*.doc,,*.docx::, ::*.xls,,*.xls[mx]::, ::*.pptx,,*.ppt::'
  323. " Sample mappings
  324. " Start shell in current directory
  325. nnoremap s :shell<cr>
  326. " Display sorting dialog
  327. nnoremap S :sort<cr>
  328. " Toggle visibility of preview window
  329. nnoremap w :view<cr>
  330. vnoremap w :view<cr>gv
  331. " Open file in existing instance of gvim
  332. nnoremap o :!gvim --remote-tab-silent %f<cr>
  333. " Open file in new instance of gvim
  334. nnoremap O :!gvim %f<cr>
  335. " Open file in the background using its default program
  336. nnoremap gb :file &<cr>l
  337. " Interaction with system clipboard
  338. if has('win')
  339. " Yank current directory path to Windows clipboard with forward slashes
  340. nnoremap yp :!echo %"d:gs!\!/! %i | clip<cr>
  341. " Yank path to current file to Windows clipboard with forward slashes
  342. nnoremap yf :!echo %"c:gs!\!/! %i | clip<cr>
  343. elseif executable('xclip')
  344. " Yank current directory path into the clipboard
  345. nnoremap yd :!echo %d | xclip %i<cr>
  346. " Yank current file path into the clipboard
  347. nnoremap yf :!echo %c:p | xclip %i<cr>
  348. elseif executable('xsel')
  349. " Yank current directory path into primary and selection clipboards
  350. nnoremap yd :!echo -n %d | xsel --input --primary %i &&
  351. \ echo -n %d | xsel --clipboard --input %i<cr>
  352. " Yank current file path into into primary and selection clipboards
  353. nnoremap yf :!echo -n %c:p | xsel --input --primary %i &&
  354. \ echo -n %c:p | xsel --clipboard --input %i<cr>
  355. endif
  356. " Mappings for faster renaming
  357. nnoremap I cw<c-a>
  358. nnoremap cc cw<c-u>
  359. nnoremap A cw
  360. " Open console in current directory
  361. nnoremap ,t :!xterm &<cr>
  362. " Open editor to edit vifmrc and apply settings after returning to vifm
  363. nnoremap ,c :write | edit $MYVIFMRC | restart<cr>
  364. " Open gvim to edit vifmrc
  365. nnoremap ,C :!gvim --remote-tab-silent $MYVIFMRC &<cr>
  366. " Toggle wrap setting on ,w key
  367. nnoremap ,w :set wrap!<cr>
  368. " Example of standard two-panel file managers mappings
  369. nnoremap <f3> :!less %f<cr>
  370. nnoremap <f4> :edit<cr>
  371. nnoremap <f5> :copy<cr>
  372. nnoremap <f6> :move<cr>
  373. nnoremap <f7> :mkdir<space>
  374. nnoremap <f8> :delete<cr>
  375. " ------------------------------------------------------------------------------
  376. " Various customization examples
  377. " Use ag (the silver searcher) instead of grep
  378. "
  379. " set grepprg='ag --line-numbers %i %a %s'
  380. " Add additional place to look for executables
  381. "
  382. " let $PATH = $HOME.'/bin/fuse:'.$PATH
  383. " Block particular shortcut
  384. "
  385. " nnoremap <left> <nop>
  386. " Export IPC name of current instance as environment variable and use it to
  387. " communicate with the instance later.
  388. "
  389. " It can be used in some shell script that gets run from inside vifm, for
  390. " example, like this:
  391. " vifm --server-name "$VIFM_SERVER_NAME" --remote +"cd '$PWD'"
  392. "
  393. " let $VIFM_SERVER_NAME = v:servername