123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- " vim: filetype=vifm :
- " Sample configuration file for vifm (last updated: 9 September, 2020)
- " You can edit this file by hand.
- " The " character at the beginning of a line comments out the line.
- " Blank lines are ignored.
- " The basic format for each item is shown with an example.
- " ------------------------------------------------------------------------------
- " Command used to edit files in various contexts. The default is vim.
- " If you would like to use another vi clone such as Elvis or Vile
- " you will need to change this setting.
- set vicmd=nvim
- " set vicmd=elvis\ -G\ termcap
- " set vicmd=vile
- " This makes vifm perform file operations on its own instead of relying on
- " standard utilities like `cp`. While using `cp` and alike is a more universal
- " solution, it's also much slower when processing large amounts of files and
- " doesn't support progress measuring.
- set syscalls
- " Trash Directory
- " The default is to move files that are deleted with dd or :d to
- " the trash directory. If you change this you will not be able to move
- " files by deleting them and then using p to put the file in the new location.
- " I recommend not changing this until you are familiar with vifm.
- " This probably shouldn't be an option.
- set trash
- " This is how many directories to store in the directory history.
- set history=100
- " Automatically resolve symbolic links on l or Enter.
- set nofollowlinks
- " With this option turned on you can run partially entered commands with
- " unambiguous beginning using :! (e.g. :!Te instead of :!Terminal or :!Te<tab>).
- " set fastrun
- " Natural sort of (version) numbers within text.
- set sortnumbers
- " Maximum number of changes that can be undone.
- set undolevels=100
- " Use Vim's format of help file (has highlighting and "hyperlinks").
- " If you would rather use a plain text help file set novimhelp.
- set vimhelp
- " If you would like to run an executable file when you
- " press Enter, l or Right Arrow, set this.
- set runexec
- " List of color schemes to try (picks the first one supported by the terminal)
- colorscheme gruvbox Default-256 Default
- " Format for displaying time in file list. For example:
- " TIME_STAMP_FORMAT=%m/%d-%H:%M
- " See man date or man strftime for details.
- set timefmt=%m/%d\ %H:%M
- " Show list of matches on tab completion in command-line mode
- set wildmenu
- " Display completions in a form of popup with descriptions of the matches
- set wildstyle=popup
- " Display suggestions in normal, visual and view modes for keys, marks and
- " registers (at most 5 files). In other view, when available.
- set suggestoptions=normal,visual,view,otherpane,keys,marks,registers
- " Ignore case in search patterns unless it contains at least one uppercase
- " letter
- set ignorecase
- set smartcase
- " Don't highlight search results automatically
- set nohlsearch
- " Use increment searching (search while typing)
- set incsearch
- " Try to leave some space from cursor to upper/lower border in lists
- set scrolloff=4
- " Don't do too many requests to slow file systems
- if !has('win')
- set slowfs=curlftpfs
- endif
- " Set custom status line look
- set statusline=" Hint: %z%= %A %10u:%-7g %15s %20d "
- " ------------------------------------------------------------------------------
- " :mark mark /full/directory/path [filename]
- mark h ~/
- mark d ~/Documents
- mark D ~/Downloads
- mark m ~/Music
- mark s ~/Scripts
- mark f ~/Movies
- mark g ~/Games
- mark v ~/Videos
- mark p ~/Pictures
- " ------------------------------------------------------------------------------
- " :com[mand][!] command_name action
- " The following macros can be used in a command
- " %a is replaced with the user arguments.
- " %c the current file under the cursor.
- " %C the current file under the cursor in the other directory.
- " %f the current selected file, or files.
- " %F the current selected file, or files in the other directory.
- " %b same as %f %F.
- " %d the current directory name.
- " %D the other window directory name.
- " %m run the command in a menu window
- command! df df -h %m 2> /dev/null
- command! diff vim -d %f %F
- command! zip zip -r %f.zip %f
- command! run !! ./%f
- command! make !!make %a
- command! mkcd :mkdir %a | cd %a
- command! vgrep vim "+grep %a"
- command! reload :write | restart full
- command! unarchive !!aunpack %f
- " ------------------------------------------------------------------------------
- fileviewer {*.torrent},<application/x-bittorrent> transmission-show %c
- fileviewer {*.tar*}, tar -tvf %c
- fileviewer {*.doc},<application/msword> catdoc %c
- fileviewer {*.docx},
- \<application/
- \vnd.openxmlformats-officedocument.wordprocessingml.document>
- \ docx2txt.pl %f -
- fileviewer {*.xpi,*.7z,*.iso}, 7z l %c
- filetype <image/*> sxiv -a %f
- filetype <video/*> mpv %f
- filetype <audio/*> mpv %f --volume=50
- filetype {*.cbz,*.cbr,*.djvu} zathura %f
- filetype <application/pdf> zathura %f
- filetype <application/vnd.appimage> chmod +x %f && sh %f
- filetype {*.exe,*.msi} wine %f
- filetype {*.html} xdg-open %f &>/dev/null
- filetype {*.xcf} gimp %f
- filetype <text/*> nvim %f
- " filetype <text/*> emacsclient -a '' -c %f
- filetype {*.docx,*.xlsx,*.rtf,*.odt} libreoffice %f
- filetype {*.7z,*.rar,*.zip,*.tar*} emacsclient -a '' -c %f
- " Syntax highlighting in preview
- " Explicitly set highlight type for some extensions
- " 256-color terminal
- " fileviewer *.[ch],*.[ch]pp highlight -O xterm256 -s dante --syntax c %c
- " fileviewer Makefile,Makefile.* highlight -O xterm256 -s dante --syntax make %c
- " 16-color terminal
- " fileviewer *.c,*.h highlight -O ansi -s dante %c
- " Or leave it for automatic detection
- " fileviewer *[^/] pygmentize -O style=monokai -f console256 -g
- " Open all other files with default system programs (you can also remove all
- " :file[x]type commands above to ensure they don't interfere with system-wide
- " settings). By default all unknown files are opened with 'vi[x]cmd'
- " uncommenting one of lines below will result in ignoring 'vi[x]cmd' option
- " for unknown file types.
- " For *nix:
- filetype * xdg-open
- " For OS X:
- " filetype * open
- " For Windows:
- " filetype * start, explorer
- " ------------------------------------------------------------------------------
- " What should be saved automatically between vifm sessions. Drop "savedirs"
- " value if you don't want vifm to remember last visited directories for you.
- set vifminfo=dhistory,savedirs,chistory,state,tui,shistory,
- \phistory,fhistory,dirstack,registers,bookmarks,bmarks
- " ------------------------------------------------------------------------------
- " Examples of configuring both panels
- " Customize view columns a bit (enable ellipsis for truncated file names)
- " set viewcolumns=-{name}..,6{}.
- " Filter-out build and temporary files
- filter {*.aux,*.bbl,*.bcf,*.blg,*.run.xml,*.lo,*.o,*.d,*.pyc,*.pyo,.*~}
- " ------------------------------------------------------------------------------
- " MY BINDINGS
- nnoremap xx :!detach.sh xdg-open %f &<cr>
- nnoremap xr :!detach.sh rox &<cr>
- nnoremap xi :!detach.sh inkscape %f &<cr>
- nnoremap xG :!detach.sh gimp %f &<cr>
- nnoremap xE :!detach.sh nvim-qt --no-ext-tabline %f &<cr>
- nnoremap xe :!detach.sh emacsclient -a "" -c %f &<cr>
- nnoremap xM :!detach.sh mypaint %f &<cr>
- nnoremap xu :!detach.sh aunpack %f &<cr>
- nnoremap xU :!aunpack %f<cr>
- nnoremap xb :!detach.sh xdg-open %f &<cr>
- nnoremap xcq :!cmus-remote -q %f &<cr>
- " nnoremap xga :!git --git-dir=~/.dotfiles --work-tree=~/ %f &<cr>
- nnoremap xga :!link-to-dotfiles.sh %f &<cr>
- nnoremap xgA :!git-dotfiles.sh -a %f &<cr>
- " Sample mappings
- " Start shell in current directory
- nnoremap s :shell<cr>
- " Display sorting dialog
- nnoremap S :sort<cr>
- " Toggle visibility of preview window
- nnoremap w :view<cr>
- vnoremap w :view<cr>gv
- " Open file in new instance of nvim
- nnoremap o :!nvim %f<cr>
- " Open file in existing instance of neovim-qt
- nnoremap O :!detach.sh nvim-qt --no-ext-tabline %f<cr>
- " Open file in the background using its default program
- nnoremap gb :file &<cr>l
- " Interaction with system clipboard
- if has('win')
- " Yank current directory path to Windows clipboard with forward slashes
- nnoremap yp :!echo %"d:gs!\!/! %i | clip<cr>
- " Yank path to current file to Windows clipboard with forward slashes
- nnoremap yf :!echo %"c:gs!\!/! %i | clip<cr>
- elseif executable('xclip')
- " Yank current directory path into the clipboard
- nnoremap yd :!echo %d | xclip %i<cr>
- " Yank current file path into the clipboard
- nnoremap yf :!echo %c:p | xclip %i<cr>
- elseif executable('xsel')
- " Yank current directory path into primary and selection clipboards
- nnoremap yd :!echo -n %d | xsel --input --primary %i &&
- \ echo -n %d | xsel --clipboard --input %i<cr>
- " Yank current file path into into primary and selection clipboards
- nnoremap yf :!echo -n %c:p | xsel --input --primary %i &&
- \ echo -n %c:p | xsel --clipboard --input %i<cr>
- endif
- " Mappings for faster renaming
- nnoremap I cw<c-a>
- nnoremap cc cw<c-u>
- nnoremap A cw
- " Open console in current directory
- nnoremap ,t :!x-terminal-emulator &<cr>
- " Open editor to edit vifmrc and apply settings after returning to vifm
- nnoremap ,c :write | edit $MYVIFMRC | restart full<cr>
- " Toggle wrap setting on ,w key
- nnoremap ,w :set wrap!<cr>
- " Example of standard two-panel file managers mappings
- nnoremap <f3> :!less %f<cr>
- nnoremap <f4> :edit<cr>
- nnoremap <f5> :copy<cr>
- nnoremap <f6> :move<cr>
- nnoremap <f7> :mkdir<space>
- nnoremap <f8> :delete<cr>
- " Midnight commander alike mappings
- " Open current directory in the other pane
- nnoremap <a-i> :sync<cr>
- " Open directory under cursor in the other pane
- nnoremap <a-o> :sync %c<cr>
- " Swap panes
- nnoremap <c-u> <c-w>x
- " ------------------------------------------------------------------------------
- " Various customization examples
- " Use ag (the silver searcher) instead of grep
- "
- " set grepprg='ag --line-numbers %i %a %s'
- " Add additional place to look for executables
- "
- " let $PATH = $HOME.'/bin/fuse:'.$PATH
- " Block particular shortcut
- "
- " nnoremap <left> <nop>
- " Export IPC name of current instance as environment variable and use it to
- " communicate with the instance later.
- "
- " It can be used in some shell script that gets run from inside vifm, for
- " example, like this:
- " vifm --server-name "$VIFM_SERVER_NAME" --remote +"cd '$PWD'"
- "
- " let $VIFM_SERVER_NAME = v:servername
|