-
Notifications
You must be signed in to change notification settings - Fork 0
/
vifmrc.append
165 lines (135 loc) · 4.47 KB
/
vifmrc.append
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
" K
" Opts
set dotfiles
set vicmd=nvim
set shell=/usr/bin/zsh
set vifminfo+=tabs
set viewcolumns=*{name}..,16{mtime},7{}.
set statusline=" %{system('file -b ' . expand('%c'))}%=%A %u:%g %a / %c "
set timeoutlen=30000
if executable('vifm-media')
set mediaprg=vifm-media
endif
" Commands
command! diff nvim -d %f %F
if executable('fzf')
command! fzf :!fzf --multi
if executable('wl-copy')
command! fzf :!fzf --multi | tr '\n' ' ' | wl-copy
elseif executable('xclip')
command! fzf :!fzf --multi | tr '\n' ' ' | xclip -selection clipboard
endif
nnoremap <space>fzf :fzf<cr>
command! FZFfind : set noquickview
\| let $FZF_PICK = term('find | fzf --height 10 2>/dev/tty')
\| if $FZF_PICK != ''
\| execute 'goto' fnameescape($FZF_PICK)
\| endif
nnoremap <space>fzg :FZFfind<cr>
if executable('locate')
command! FZFlocate : set noquickview
\| let $FZF_PICK = term('locate $HOME | fzf --height 10 2>/dev/tty')
\| if $FZF_PICK != ''
\| execute 'goto' fnameescape($FZF_PICK)
\| endif
nnoremap <space>fzc :FZFlocate<cr>
endif
endif
if executable('atool')
command! archive :!atool -a %a %f
command! unarchive :!atool -X %a %f
nnoremap <space>zc :archive<space>
nnoremap <space>zu :unarchive<space>
endif
if executable('7z')
nnoremap <space>z7 :!7z x -o%c:r %c<cr>
endif
if $WAYLAND_DISPLAY
if executable('wl-copy')
" Yank current file name into primary and selection clipboards
nnoremap yn :!echo -n %c | wl-copy %i &&
\ echo -n %c | wl-copy -p %i<cr>
endif
elseif $DISPLAY
if executable('xclip')
" Yank current file name into the clipboard
nnoremap yn :!echo -n %c | xclip -selection clipboard %i<cr>
elseif executable('xsel')
" Yank current file name into primary and selection clipboards
nnoremap yn :!echo -n %c | xsel --input --primary %i &&
\ echo -n %c | xsel --clipboard --input %i<cr>
endif
endif
if executable('wl-paste')
command! pastescreenshot :!wl-paste > %a.png
elseif executable('xclip')
command! pastescreenshot :!xclip -selection c -o -t image/png > %a.png
endif
" Maps
nnoremap Q :qall<cr>
nnoremap r cw
nnoremap o :touch<space>
nnoremap O :mkdir<space>
nnoremap ~ :cd ~<cr>
nnoremap ` :cd /<cr>
nnoremap <a-q> :view<cr>
nnoremap t :tabnext<cr>
nnoremap T :tabprev<cr>
nnoremap <c-t> :tabnew<cr>
map <space> <nop>
nnoremap <space><space> t
nnoremap <space>c :cd<space>
nnoremap <space>r :rename<cr>
nnoremap <space>b :bmarks<cr>
nnoremap <space>B :bmark<space>
nnoremap <space>hh :history<cr>
nnoremap <space>hn :histnext<cr>
nnoremap <space>hp :histprev<cr>
nnoremap <space>ps :pastescreenshot<space>
nnoremap <space>ft :!!find -printf "%%T@ %%Tc %%p\n" | sort -n<cr>
if $TERM_PROGRAM == 'tmux'
nnoremap <c-v> :!tmux new-window nvim -p %f:p<cr>
nnoremap <a-v> :!tmux new-window nvim<cr>
nnoremap <c-s> :!tmux new-window<cr>
elseif $TERM == 'screen'
nnoremap <c-v> :!screen nvim -p %f:p<cr>
nnoremap <a-v> :!screen nvim<cr>
nnoremap <c-s> :!screen<cr>
elseif executable('konsole')
nnoremap <c-v> :!konsole --new-tab --workdir %d -e nvim -p %f:p<cr>
nnoremap <a-v> :!konsole --new-tab --workdir %d -e nvim<cr>
nnoremap <c-s> :!konsole --new-tab --workdir %d<cr>
endif
if executable('dragon-drop')
nnoremap <space>x :!dragon-drop %f &<cr>
nnoremap <space>X :!dragon-drop --target &<cr>
endif
" Theme
highlight StatusLine ctermfg=234
highlight StatusLine ctermbg=59
highlight CurrLine ctermfg=102
highlight CurrLine ctermbg=234
highlight TopLineSel ctermfg=234
highlight TopLineSel ctermbg=102
highlight TopLine ctermfg=245
highlight TopLine ctermbg=236
highlight TabLine ctermfg=250
highlight TabLine ctermbg=none
highlight OtherLine ctermbg=236
highlight OtherLine ctermfg=245
highlight WildMenu ctermfg=237
highlight TabLineSel ctermbg=234
highlight Win ctermbg=none
highlight CmdLine ctermbg=none
highlight Border ctermbg=none
" Fileviewers/filextypes
fileviewer <image/*> img2txt %c
filextype {*.odt,*.doc,*.docx,*.xls,*.xlsx,*.odp,*.pptx,*.ppt},
\ <application/vnd.openxmlformats-officedocument.*,
\ application/msword,
\ application/vnd.ms-excel>
\ onlyoffice %d/%c &
" Sources
if filereadable(expand('$VIFM/icons'))
source $VIFM/icons
endif