vifmrc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. "##############################################################################
  2. " My config file for the vifm terminal file manager
  3. "##############################################################################
  4. set vicmd=nvim
  5. set syscalls
  6. set trash
  7. set trashdir="~/.local/share/vifm/Trash"
  8. set history=100
  9. set nofollowlinks
  10. set sortnumbers
  11. set undolevels=100
  12. set vimhelp
  13. set norunexec
  14. set timefmt=%d/%m/%Y\ %H:%M
  15. " set viewcolumns=*{name}..,6{}.
  16. set viewcolumns=-{name}..,10{}.
  17. set rulerformat="%l/%S%[ +%x%] "
  18. set wildmenu
  19. set wildstyle=popup
  20. set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
  21. set ignorecase
  22. set smartcase
  23. set nohlsearch
  24. set incsearch
  25. set scrolloff=4
  26. set statusline=" %A %10u:%-7g %8s [%8E] %18d %{&sort} %= %a/%c "
  27. set vifminfo=dhistory,savedirs,chistory,state,tui,shistory,
  28. \phistory,fhistory,dirstack,registers,bookmarks,bmarks
  29. set slowfs=curlftpfs
  30. source $HOME/.config/vifm/icons.vifm
  31. colorscheme my_everforest
  32. "##############################################################################
  33. " File associations
  34. "##############################################################################
  35. " Pdf, Djvu -------------------------------------------------------------------
  36. " filextype *.pdf atril %c %i &, apvlv %c, xpdf %c
  37. filextype *.pdf,*.djvu
  38. \ {View in atril}
  39. \ atril %f %i &,
  40. \ {View in zathura}
  41. \ zathura %c %i &,
  42. \ {View in qpdfview}
  43. \ qpdfview %f %i &,
  44. filetype *.pdf,*.djvu
  45. \ {View in zathura}
  46. \ zathura %c %i &,
  47. \ {View in apvlv}
  48. \ apvlv %c &
  49. fileviewer *.pdf
  50. \ vifmimg pdfpreview %px %py %pw %ph %c
  51. \ %pc
  52. \ vifmimg clear
  53. " \ pdftotext -nopgbrk %c -
  54. " PostScript ------------------------------------------------------------------
  55. filetype *.ps,*.eps,*.ps.gz
  56. \ {View in zathura}
  57. \ zathura %c %i,
  58. \ {View in gv}
  59. \ gv %c %i &,
  60. " Audio -----------------------------------------------------------------------
  61. filextype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus
  62. \ {View using deadbeef}
  63. \ deadbeef %f %i &,
  64. \ {Play using MPlayer}
  65. \ mplayer %f %i &
  66. filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus
  67. \ {View using cmus}
  68. \ $TERMINAL -e cmus %f &,
  69. \ {Play using ffplay}
  70. \ ffplay -nodisp -autoexit %c
  71. fileviewer *.mp3 mp3info
  72. fileviewer *.flac soxi
  73. " Video -----------------------------------------------------------------------
  74. filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
  75. \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
  76. \*.as[fx]
  77. \ {View using smplayer}
  78. \ smplayer %f %i &
  79. filetype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
  80. \ {View using ffplay}
  81. \ ffplay -fs -autoexit %f
  82. fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
  83. \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
  84. \*.as[fx]
  85. \ vifmimg videopreview %px %py %pw %ph %c
  86. \ %pc
  87. \ vifmimg clear
  88. " Web -------------------------------------------------------------------------
  89. filextype *.html,*.htm
  90. \ {Open with gvim}
  91. \ gvim %c &,
  92. \ {Open with vim}
  93. \ wezterm start --always-new-process --cwd %d -e vim %c &,
  94. \ {Open with dwb}
  95. \ dwb %f %i &,
  96. \ {Open with firefox}
  97. \ firefox %f &,
  98. \ {Open with uzbl}
  99. \ uzbl-browser %f %i &
  100. filetype *.html,*.htm
  101. \ {Open with vim}
  102. \ $TERMINAL -e vim %c &,
  103. \ {Open with links}
  104. \ links %c &,
  105. \ {Open with lynx}
  106. \ lynx %c &
  107. " Object ----------------------------------------------------------------------
  108. filetype *.o nm %f | less
  109. " Man page --------------------------------------------------------------------
  110. filetype *.[1-8] man ./%c
  111. fileviewer *.[1-8] man ./%c | col -b
  112. " Images ----------------------------------------------------------------------
  113. filextype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
  114. \ {View in qView}
  115. \ qview %f %i &,
  116. \ {View in XnViewMP}
  117. \ xnviewmp %F %i &,
  118. \ {View in ristretto}
  119. \ ristretto %f &
  120. filetype *.bmp,*.jpg,*.jpeg,*.png,*.gif,*.xpm
  121. \ {View in sxiv}
  122. \ sxiv -ia %f &,
  123. \ {View in imv}
  124. \ imv-x11 -b 1D2330 -d %d &,
  125. \ {View in feh}
  126. \ feh %d &
  127. fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.xpm
  128. \ vifmimg draw %px %py %pw %ph %c
  129. \ %pc
  130. \ vifmimg clear
  131. fileviewer *.gif
  132. \ vifmimg gifpreview %px %py %pw %ph %c
  133. \ %pc
  134. \ vifmimg clear
  135. " OpenRaster ------------------------------------------------------------------
  136. filetype *.ora
  137. \ {Edit in MyPaint}
  138. \ mypaint %f,
  139. " Mindmap ---------------------------------------------------------------------
  140. filetype *.vym
  141. \ {Open with VYM}
  142. \ vym %f &,
  143. " MD5 -------------------------------------------------------------------------
  144. filetype *.md5
  145. \ {Check MD5 hash sum}
  146. \ md5sum -c %f %S,
  147. " SHA1 ------------------------------------------------------------------------
  148. filetype *.sha1
  149. \ {Check SHA1 hash sum}
  150. \ sha1sum -c %f %S,
  151. " SHA256 ----------------------------------------------------------------------
  152. filetype *.sha256
  153. \ {Check SHA256 hash sum}
  154. \ sha256sum -c %f %S,
  155. " SHA512 ----------------------------------------------------------------------
  156. filetype *.sha512
  157. \ {Check SHA512 hash sum}
  158. \ sha512sum -c %f %S,
  159. " GPG signature ---------------------------------------------------------------
  160. filetype *.asc
  161. \ {Check signature}
  162. \ !!gpg --verify %c,
  163. " Torrent ---------------------------------------------------------------------
  164. filextype *.torrent tixati %f &
  165. fileviewer *.torrent dumptorrent -v %c
  166. " FuseZipMount ----------------------------------------------------------------
  167. filextype *.zip,*.jar,*.war,*.ear,*.oxt,*.apkg
  168. \ {View contents}
  169. \ engrampa %f &
  170. filetype *.zip,*.jar,*.war,*.ear,*.oxt,*.apkg
  171. \ {Mount with fuse-zip}
  172. \ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR,
  173. \ {View contents}
  174. \ zip -sf %c | less,
  175. \ {Extract here}
  176. \ tar -xf %c
  177. fileviewer *.zip,*.jar,*.war,*.ear,*.oxt zip -sf %c
  178. " ArchiveMount ----------------------------------------------------------------
  179. filextype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz,*.tar.xz,*.txz
  180. \ {View contents}
  181. \ engrampa %f &
  182. filetype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz,*.tar.xz,*.txz
  183. \ {Mount with archivemount}
  184. \ FUSE_MOUNT|archivemount %SOURCE_FILE %DESTINATION_DIR,
  185. \ {View contents}
  186. \ zip -sf %c | less,
  187. \ {Extract here}
  188. \ tar -xf %c
  189. fileviewer *.tgz,*.tar.gz tar -tzf %c
  190. fileviewer *.tar.bz2,*.tbz2 tar -tjf %c
  191. fileviewer *.tar.txz,*.txz xz --list %c
  192. fileviewer *.tar tar -tf %c
  193. " Rar2FsMount and rar archives ------------------------------------------------
  194. filextype *.rar
  195. \ {View contents}
  196. \ engrampa %f &
  197. filetype *.rar
  198. \ {Mount with rar2fs}
  199. \ FUSE_MOUNT|rar2fs %SOURCE_FILE %DESTINATION_DIR
  200. fileviewer *.rar unrar v %c
  201. " Fuse7z and 7z archives ------------------------------------------------------
  202. filextype *.7z
  203. \ {View contents}
  204. \ engrampa %f &
  205. filetype *.7z
  206. \ {Mount with fuse-7z}
  207. \ FUSE_MOUNT|fuse-7z %SOURCE_FILE %DESTINATION_DIR
  208. fileviewer *.7z 7z l %c
  209. " IsoMount --------------------------------------------------------------------
  210. filetype *.iso
  211. \ {Mount with fuseiso}
  212. \ FUSE_MOUNT|fuseiso %SOURCE_FILE %DESTINATION_DIR,
  213. " SshMount --------------------------------------------------------------------
  214. filetype *.ssh
  215. \ {Mount with sshfs}
  216. \ FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR %FOREGROUND,
  217. " FtpMount --------------------------------------------------------------------
  218. filetype *.ftp
  219. \ {Mount with curlftpfs}
  220. \ FUSE_MOUNT2|curlftpfs -o ftp_port=-,,disable_eprt %PARAM %DESTINATION_DIR %FOREGROUND,
  221. " Office files ----------------------------------------------------------------
  222. filextype *.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx,*.ppt wps %f &, libreoffice %f &
  223. fileviewer *.doc catdoc %c
  224. fileviewer *.docx docx2txt.pl %f -
  225. " TuDu files ------------------------------------------------------------------
  226. filetype *.tudu tudu -f %c
  227. " Qt projects -----------------------------------------------------------------
  228. " filextype *.pro qtcreator %f &
  229. filextype *.pro wezterm start --always-new-process --cwd %d -e vim %f &
  230. filetype *.pro $TERMINAL -e vim %f &
  231. " Directories -----------------------------------------------------------------
  232. filextype */
  233. \ {View in dolphin}
  234. \ dolphin %f &,
  235. \ {View in thunar}
  236. \ Thunar %f &
  237. filextype */
  238. \ {View in Vifm}
  239. \ vifm %f &,
  240. \ {View in Yazi}
  241. \ yazi %f &,
  242. \ {View in Ranger}
  243. \ ranger %f &
  244. " Config & exec files ---------------------------------------------------------
  245. filextype *.conf,*rc,*.txt,*.yml,*.json,config,*.fish,*.sh,*.ini,*.css,*.bak,*.backup,*info,*.md,*.dat,*.xml,*.Xresources,*.asm,*.py,*.c,*.cpp,*.h,*.awk,*bash*,*.git*,*.zsh,*zshrc,*.profile,*.log,*.desktop,*.vifm,*.vim,*.rs,*.hs,*.lua,*.go,*.org,*.el,*.toml,*.yml,*.lock,*.sql,*.pas,*.dart/
  246. \ {View in vim}
  247. \ alacritty -e vim %f %i &,
  248. \ {View in gvim}
  249. \ gvim %f &,
  250. \ {View in vim (wezterm terminal)}
  251. \ wezterm start --always-new-process --cwd %d -e vim %f &,
  252. \ {View in vim (kitty terminal)}
  253. \ kitty -e vim %f %i,
  254. filetype *.conf,*rc,*.txt,*.yml,*.json,config,*.fish,*.sh,*.ini,*.css,*.bak,*.backup,*info,*.md,*.dat,*.xml,*.Xresources,*.asm,*.py,*.c,*.cpp,*.h,*.awk,*bash*,*.git*,*.zsh,*zshrc,*.profile,*.log,*.desktop,*.vifm,*.vim,*.rs,*.hs,*.lua,*.go,*.org,*.el,*.toml,*.yml,*.lock,*.sql,*.pas,*.dart/
  255. \ {View in vim}
  256. \ alacritty -e vim %f %i &,
  257. \ {View in vim (wezterm terminal)}
  258. \ wezterm start --always-new-process --cwd %d -e vim %f &,
  259. \ {View in vim (kitty terminal)}
  260. \ kitty -e vim %f %i &,
  261. \ {View in Helix}
  262. \ $TERMINAL -e hx %f %i &,
  263. " filetype *.conf,*rc,*.txt,*.yml,*.json,config,*.fish,*.sh,*.ini,*.css,*.bak,*.backup,*info,*.md,*.dat,*.xml,*.Xresources,*.asm,*.py,*.c,*.cpp,*.h,*.awk,*bash*,*.git*,*.zsh,*zshrc,*.profile,*.log,*.desktop,*.vifm,*.vim,*.rs,*.hs,*.lua,*.org,*.el $TERMINAL -e vim %f &
  264. " Books -----------------------------------------------------------------------
  265. " filextype *.fb2,*.epub cr3 %f %i &
  266. filextype *.fb2,*.epub
  267. \ {View in cr3}
  268. \ cr3 %f %i &,
  269. \ {View in FBReader}
  270. \ FBReader %f %i &,
  271. " Fonts -----------------------------------------------------------------------
  272. filextype *.ttf,*.otf gnome-font-viewer %f %i &
  273. " .deb ------------------------------------------------------------------------
  274. filextype *.deb gdebi-gtk %f &, engrampa %f %i &
  275. "##############################################################################
  276. " Syntax highlighting in preview
  277. "##############################################################################
  278. " Explicitly set highlight type for some extensions ---------------------------
  279. " 256-color terminal
  280. " fileviewer *.[ch],*.[ch]pp highlight -O xterm256 -s dante --syntax c %c
  281. " fileviewer Makefile,Makefile.* highlight -O xterm256 -s dante --syntax make %c
  282. "
  283. " 16-color terminal
  284. " fileviewer *.c,*.h highlight -O ansi -s dante %c
  285. "
  286. " Or leave it for automatic detection -----------------------------------------
  287. fileviewer *[^/] pygmentize -O style=monokai -f console256 -g
  288. " Displaying pictures in terminal ---------------------------------------------
  289. "
  290. " fileviewer *.jpg,*.png shellpic %c
  291. " Open all other files with default system programs (you can also remove all
  292. " :file[x]type commands above to ensure they don't interfere with system-wide
  293. " settings). By default all unknown files are opened with 'vi[x]cmd'
  294. " uncommenting one of lines below will result in ignoring 'vi[x]cmd' option
  295. " for unknown file types.
  296. " For *nix:
  297. " filetype * xdg-open
  298. " For OS X:
  299. " filetype * open
  300. " For Windows:
  301. " filetype * start, explorer
  302. "##############################################################################
  303. " Marks
  304. "##############################################################################
  305. " :mark mark /full/directory/path [filename]
  306. mark h ~/
  307. mark d ~/Desktop
  308. mark w ~/Downloads
  309. mark b ~/OS/Linux/+backup
  310. mark p ~/Projects
  311. mark c ~/.config
  312. mark s ~/.myScripts
  313. mark l ~/.local/share
  314. mark a ~/.cache
  315. mark M /run/media
  316. " mark M /media
  317. mark R /
  318. "##############################################################################
  319. " Commands
  320. "##############################################################################
  321. " Archives -------------------------------------------------------------------
  322. command! zip zip -9 -r %c.zip %f
  323. command! unzip unzip %f
  324. command! tar tar -czvf %c.tar.gz %f
  325. command! untar tar -xzvf %f
  326. " Copy and move (instead of copy and move) WITH menu dialog -------------------
  327. command! cp :yank | winrun , put
  328. command! mv :yank | winrun , put!
  329. command! diff vim -d %f %F
  330. command! run !! ./%f
  331. command! mkcd :mkdir %a | cd %a
  332. command! reload :write | restart
  333. " Edit image in XnViewMP (cause file not found) -------------------------------
  334. command! editimage :!xnviewmp (echo %d/%c)
  335. " Create a file or a dir (for dir last char must be '/')
  336. command! create :
  337. \| let $last_char = expand(system("str=\"%a\"; echo \"${str: -1}\""))
  338. \| if $last_char == "/"
  339. \| mkdir "%a"
  340. \| else
  341. \| touch "%a"
  342. \| endif
  343. " Toggle detailed/brief information about files -------------------------------
  344. command! togglefilesinfo
  345. \ : if &viewcolumns == '-{name}..,10{}.'
  346. \ | set viewcolumns=*{name}..,10{size}.
  347. \ | echo 'Files information: detailed'
  348. \ | else
  349. \ | set viewcolumns='-{name}..,10{}.'
  350. \ | echo 'Files information: brief'
  351. \ | endif
  352. command! togglefilesmoreinfo
  353. \ : if &viewcolumns == '-{name}..,10{}.'
  354. " \ | set viewcolumns=*{name}.,10{size}.,12{perms},10{uname},-7{gname},18{mtime}
  355. " \ | set viewcolumns=*{name}..,{ext},10{size}.,12{perms},10{uname},-10{gname},18{mtime}
  356. \ | set viewcolumns=*{name}..,10{size}.,18{mtime}
  357. \ | echo 'Files information: detailed'
  358. \ | else
  359. \ | set viewcolumns='-{name}..,10{}.'
  360. \ | echo 'Files information: brief'
  361. \ | endif
  362. " Reset sort ------------------------------------------------------------------
  363. command! resetsort
  364. \ : if &sort != '+name'
  365. \ | set sort=+name
  366. \ | echo 'Reset sort to +name'
  367. \ | endif
  368. " Open most used tabs ---------------------------------------------------------
  369. command! openProgrammingDirs
  370. \ :tabonly
  371. \ | tabnew
  372. \ | tabname Rust
  373. \ | cd ~/Documents/forProgramming/Rust/Books/ ~/Projects/Rust/
  374. \ | tabnew
  375. \ | tabname Lua
  376. \ | cd ~/Documents/forProgramming/Lua/Books/ ~/Projects/Lua/
  377. \ | tabnew
  378. \ | tabname Haskell
  379. \ | cd ~/Documents/forProgramming/Haskell/Books/ ~/Projects/Haskell/
  380. \ | tabnext 1
  381. \ | tabclose
  382. command! openBackupDirs
  383. \ :tabonly
  384. \ | tabnew
  385. \ | tabname Backups
  386. \ | cd ~/OS/Linux/+backup/DropboxDesktop/Desktop/ ~/.config/
  387. \ | tabnew
  388. \ | tabname yay
  389. \ | cd ~/.cache/yay ~/.cache/yay_Backups
  390. \ | tabnew
  391. \ | tabname Kernel
  392. \ | cd ~/OS/Linux/+backup/Drivers/NVidia/GeForce9600GT/WorksOnLinuxKernel419/Kernel419/ /var/cache/pacman/pkg/
  393. \ | tabnext 1
  394. \ | tabclose
  395. "##############################################################################
  396. " Mappings
  397. "##############################################################################
  398. " Archives --------------------------------------------------------------------
  399. nnoremap <wait> ,cz :!alacritty -e zip -9 -r %c.zip %f & <cr>
  400. nnoremap <wait> ,xz :!alacritty -e unzip %f & <cr>
  401. nnoremap <wait> ,ct :!alacritty -e tar -czvf %c.tar.gz %f & <cr>
  402. nnoremap <wait> ,xt :!alacritty -e tar -xzvf %f & <cr>
  403. " nnoremap <wait> ,cz :zip <cr>
  404. " nnoremap <wait> ,xz :unzip <cr>
  405. " nnoremap <wait> ,ct :tar <cr>
  406. " nnoremap <wait> ,xt :untar <cr>
  407. nnoremap <wait> ,ac :!engrampa --add %f &<cr>
  408. nnoremap <wait> ,ax :!engrampa -f %f &<cr>
  409. " Open all images in current directory in sxiv thumbnail mode -----------------
  410. nnoremap sx :!sxiv -t %d &<cr>
  411. " Open file in the background using its default program -----------------------
  412. nnoremap gb :file &<cr>l
  413. " Open selected images in gimp ------------------------------------------------
  414. nnoremap gp :!gimp %f %i &<cr>
  415. " Open selected files in gvim -------------------------------------------------
  416. nnoremap gv :!gvim %f %i &<cr>
  417. " Open selected files in vim (kitty) ------------------------------------------
  418. nnoremap gi :!kitty -e vim %f %i &<cr>
  419. " Open selected files in vim (wezterm) ----------------------------------------
  420. nnoremap gw :!wezterm start --always-new-process --cwd %d -e vim %c &<cr>
  421. " Open selected files in xnviewmp ---------------------------------------------
  422. nnoremap ge :editimage<cr>
  423. " Start shell in current directory --------------------------------------------
  424. nnoremap s :shell<cr>
  425. " Open poetry shell (.venv) ---------------------------------------------------
  426. nnoremap <wait> ,,pt :!$TERMINAL -e poetry shell &<cr>
  427. nnoremap <wait> ,,pw :!wezterm start --always-new-process --cwd %d -e poetry shell &<cr>
  428. nnoremap <wait> ,,pk :!kitty -e poetry shell %i &<cr>
  429. " Open console in current directory -------------------------------------------
  430. nnoremap <wait> ,,t :!$TERMINAL &<cr>
  431. nnoremap <wait> ,,w :!wezterm start --always-new-process --cwd %d &<cr>
  432. nnoremap <wait> ,,k :!kitty %i &<cr>
  433. " nohlsearch ------------------------------------------------------------------
  434. nnoremap ,nh :nohlsearch<cr>
  435. " Display sorting dialog ------------------------------------------------------
  436. nnoremap S :sort<cr>
  437. " Toggle visibility of preview window -----------------------------------------
  438. nnoremap w :view<cr>
  439. vnoremap w :view<cr>gv
  440. " yank current directory path into the clipboard ------------------------------
  441. nnoremap yd :!echo -n %d | xclip -sel clipboard %i<cr>:echo expand('%"d') "is yanked to clipboard"<cr>
  442. " yank current file path into the clipboard -----------------------------------
  443. nnoremap yf :!echo -n %c:p | xclip -sel clipboard %i<cr>:echo expand('%"c:p') "is yanked to clipboard"<cr>
  444. " yank current filename without path into the clipboard -----------------------
  445. nnoremap yn :!echo -n %c | xclip -sel clipboard %i<cr>:echo expand('%"c') "is yanked to clipboard"<cr>
  446. " yank root of current file's name into the clipboard -------------------------
  447. nnoremap yr :!echo -n %c:r | xclip -sel clipboard %i<cr>:echo expand('%"c:r') "is yanked to clipboard"<cr>
  448. " Mappings for faster renaming ------------------------------------------------
  449. nnoremap I cw<c-a>
  450. nnoremap cc cw<c-u>
  451. nnoremap A cw
  452. " Reload ----------------------------------------------------------------------
  453. nnoremap <wait> ,r :reload<cr>
  454. " Open bookmarks --------------------------------------------------------------
  455. nnoremap <wait> ,b :bmarks<cr>
  456. nnoremap <wait> ,bf :bmarks<space>
  457. " Open editor to edit vifmrc and apply settings after returning to vifm -------
  458. nnoremap <wait> ,ev :write | edit $MYVIFMRC | restart<cr>
  459. " Toggle wrap setting on ,w key -----------------------------------------------
  460. nnoremap <wait> ,w :set wrap!<cr>
  461. " Toggle detailed/brief information about files -------------------------------
  462. nnoremap <wait> ,it :togglefilesinfo<cr>
  463. nnoremap <wait> ,im :togglefilesmoreinfo<cr>
  464. " Reset sort to +name ---------------------------------------------------------
  465. nnoremap <wait> ,s :resetsort<cr>
  466. " Mount/Unmount windows disks: /dev/sda1 (C) and /dev/sda2 (D) ----------------
  467. nnoremap <wait> ,mc :!~/.myScripts/winC_mount.sh<cr>
  468. nnoremap <wait> ,md :!~/.myScripts/winD_mount.sh<cr>
  469. nnoremap <wait> ,uc :!~/.myScripts/winC_unmount.sh<cr>
  470. nnoremap <wait> ,ud :!~/.myScripts/winD_unmount.sh<cr>
  471. " Quit ------------------------------------------------------------------------
  472. map <wait> <Esc><Esc> :q!<cr>
  473. " Quit all windows without saving
  474. nnoremap ,,q :qa!<cr>
  475. " Quit all windows with saving
  476. nnoremap ,,x :xa<cr>
  477. " Quit the current windows with saving
  478. nnoremap ,,z :x<cr>
  479. " Tabs ------------------------------------------------------------------------
  480. " nnoremap <S-Tab> :tabprevious<cr>
  481. " nnoremap <Tab> :tabnext<cr>
  482. nnoremap ,to :tabnew<cr>
  483. nnoremap ,tx :tabclose<cr>
  484. nnoremap ,tp :tabprevious<cr>
  485. nnoremap ,tn :tabnext<cr>
  486. nnoremap ,tr :tabname<space>
  487. nnoremap ,t1 1gt
  488. nnoremap ,t2 2gt
  489. nnoremap ,t3 3gt
  490. nnoremap ,t4 4gt
  491. nnoremap ,t5 5gt
  492. nnoremap ,t6 6gt
  493. nnoremap ,t7 7gt
  494. nnoremap ,t8 8gt
  495. nnoremap ,t9 9gt
  496. " Move focus between panes ----------------------------------------------------
  497. noremap <C-k> <C-w>k
  498. noremap <C-j> <C-w>j
  499. noremap <C-h> <C-w>h
  500. " noremap <BS> <C-w>h
  501. noremap <C-l> <C-w>l
  502. " Adjust pane size (left for decreasing, right for increasing) ----------------
  503. nnoremap <left> <C-w><
  504. nnoremap <right> <C-w>>
  505. nnoremap <up> <C-w>-
  506. nnoremap <down> <C-w>+
  507. " Moving cursor in another pane -----------------------------------------------
  508. nnoremap <silent> J <tab>j<tab>
  509. nnoremap <silent> K <tab>k<tab>
  510. " Example of standard two-panel file managers mappings ------------------------
  511. nnoremap <f3> :!$TERMINAL -e bat --paging=always %f<cr>
  512. " nnoremap <f4> :edit<cr>
  513. nnoremap <f4> :!$TERMINAL -e vim %f &<cr>
  514. " nnoremap <f5> :copy<cr>
  515. " nnoremap <f6> :move<cr>
  516. nnoremap <f5> :cp<cr>
  517. nnoremap <f6> :mv<cr>
  518. nnoremap <f7> :mkdir<space>
  519. nnoremap <c-a> :create<space>
  520. nnoremap <f10> :q<cr>
  521. " nnoremap <f11> :<cr>
  522. " nnoremap <f12> :<cr>
  523. " Midnight commander alike mappings -------------------------------------------
  524. " Open current directory in the other pane
  525. nnoremap <a-i> :sync<cr>
  526. " Open directory under cursor in the other pane
  527. nnoremap <a-o> :sync %c<cr>
  528. " Swap panes
  529. nnoremap <c-u> <c-w>x
  530. " " Try to open several tabs
  531. " tabname Rust
  532. " cd ~/Documents/forProgramming/Rust/Books/ ~/Projects/Rust/
  533. "
  534. " tabnew
  535. " tabname Lua
  536. " cd ~/Documents/forProgramming/Lua/Books/ ~/Projects/Lua/
  537. "
  538. " tabnew
  539. " tabname Haskell
  540. " cd ~/Documents/forProgramming/Haskell/Books/ ~/Projects/Haskell/
  541. "
  542. " " start on the first tab
  543. " tabnext 1