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.

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