Update vifm config

This commit is contained in:
samedamci 2020-03-18 12:53:51 +01:00
parent 58497f45be
commit c7138335d1
2 changed files with 35 additions and 164 deletions

View File

@ -1,3 +1,14 @@
"
" ██
" ░██
" █████ ██████ ░██ ██████ ██████ ██████
" ██░░░██ ██░░░░██ ░██ ██░░░░██░░██░░█ ██░░░░
" ░██ ░░ ░██ ░██ ░██░██ ░██ ░██ ░ ░░█████
" ░██ ██░██ ░██ ░██░██ ░██ ░██ ░░░░░██
" ░░█████ ░░██████ ███░░██████ ░███ ██████
" ░░░░░ ░░░░░░ ░░░ ░░░░░░ ░░░ ░░░░░░
highlight clear
highlight Win ctermfg=white ctermbg=none cterm=none
@ -26,5 +37,5 @@ highlight TabLine ctermfg=9 ctermbg=0 cterm=none
highlight TabLineSel ctermfg=default ctermbg=default cterm=none,reverse
highlight /^.*\.(mp3|ogg|oga|flac|m4a)$/ ctermfg=magenta
highlight /^.*\.(jpg|jpeg|png|gif|tiff|webp|bmp|svg|svgz)$/ ctermfg=yellow
highlight /^.*\.(jpg|jpeg|png|gif|tiff|webp|bmp|svg|svgz)$/ ctermfg=green
highlight /^.*\.(zip|gz|bz2|xz|tar|tgz|tbz2|7z|rar|iso|rpm|deb)$/ ctermfg=red

View File

@ -8,113 +8,44 @@
" ░░██ ░██ ░██ ███ ░██ ░██
" ░░ ░░ ░░ ░░░ ░░ ░░
" Editor
set vicmd=nvim
" 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 return on the file name set this.
set norunexec
" Selected color scheme
colorscheme biual
" 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 vicmd=nvim
set syscalls
set trash
set history=100
set nofollowlinks
set sortnumbers
set undolevels=100
set norunexec
set timefmt=%m/%d/%Y\ %H:%M
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]
set statusline="%A %10u:%-7g %=%15s %20d "
mark b ~/bin/
mark h ~/
" Sample mappings
nnoremap ` :cd ~<cr>
nnoremap ~ :cd ~<cr>
nnoremap s :shell<cr>
nnoremap S :sort<cr>
nnoremap w :view<cr>
vnoremap w :view<cr>gv
nnoremap cc cw<c-u>
" ------------------------------------------------------------------------------
" :com[mand][!] command_name action
@ -167,7 +98,7 @@ command! reload :write | restart
" program.
" Pdf
filextype *.pdf zathura %c %i &, apvlv %c, xpdf %c
filextype *.pdf mupdf %c %i &, apvlv %c, xpdf %c
fileviewer *.pdf pdftotext -nopgbrk %c -
" PostScript
@ -186,8 +117,8 @@ filextype *.djvu
" Audio
filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus
\ {Play using ffplay}
\ ffplay -nodisp -autoexit %c,
\ {Play using mpd}
\ mpc clear && mpc add %c && mpc play,
\ {Play using MPlayer}
\ mplayer %f,
fileviewer *.mp3 mp3info
@ -332,7 +263,7 @@ filextype *.pro qtcreator %f &
filextype */
\ {View in thunar}
\ Thunar %f &,
filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus mpv --no-audio-display --input-ipc-server=/tmp/mpvsoc$(date +%%s) %c
" Syntax highlighting in preview
"
" Explicitly set highlight type for some extensions
@ -368,8 +299,6 @@ filextype */
" 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=chistory,shistory,
\phistory,dirstack,registers,bookmarks,bmarks
" ------------------------------------------------------------------------------
@ -385,25 +314,6 @@ set vifminfo=chistory,shistory,
" ------------------------------------------------------------------------------
" 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 existing instance of gvim
nnoremap o :!gvim --remote-tab-silent %f<cr>
" Open file in new instance of gvim
nnoremap O :!gvim %f<cr>
" Open file in the background using its default program
nnoremap gb :file &<cr>l
" Interaction with system clipboard
if has('win')
@ -425,54 +335,4 @@ elseif executable('xsel')
\ 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 :!xterm &<cr>
" Open editor to edit vifmrc and apply settings after returning to vifm
nnoremap ,c :write | edit $MYVIFMRC | restart<cr>
" Open gvim to edit vifmrc
nnoremap ,C :!gvim --remote-tab-silent $MYVIFMRC &<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>
" ------------------------------------------------------------------------------
" 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
" vim: filetype=vifm