Integrate file renaming script to vifm
This commit is contained in:
parent
9ef5736174
commit
025a2c457e
|
@ -22,7 +22,7 @@ else
|
||||||
|
|
||||||
if (!length(name) && c == "-")
|
if (!length(name) && c == "-")
|
||||||
continue;
|
continue;
|
||||||
else if (c ~ /[0-9A-Za-z_.-\/]/)
|
else if (c ~ /[0-9A-Za-z_.\-\/]/)
|
||||||
name = name c
|
name = name c
|
||||||
else if (c == " ")
|
else if (c == " ")
|
||||||
name = name "_"
|
name = name "_"
|
||||||
|
|
|
@ -16,7 +16,7 @@ requires_gui_error() {
|
||||||
}
|
}
|
||||||
|
|
||||||
open_pdf() {
|
open_pdf() {
|
||||||
zathura "$1" &
|
zathura "$1" &>/dev/null &
|
||||||
}
|
}
|
||||||
|
|
||||||
open_image() {
|
open_image() {
|
||||||
|
|
12
vifm/scripts/vifm_rename_and_move_file.sh
Executable file
12
vifm/scripts/vifm_rename_and_move_file.sh
Executable file
|
@ -0,0 +1,12 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
declare newname
|
||||||
|
newname="$(~/.configs_pointer/bin/rename_for_shell.sh "$@")"
|
||||||
|
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
if ! ~/.configs_pointer/bin/rename_and_move.sh "$@"; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
printf '%s' "$newname"
|
||||||
|
else
|
||||||
|
exit 2
|
||||||
|
fi
|
|
@ -39,10 +39,8 @@ nnoremap s :sort<cr>
|
||||||
nnoremap <C-l> :!/usr/bin/env IS_VIFM_NEST='T' bash -l<cr>
|
nnoremap <C-l> :!/usr/bin/env IS_VIFM_NEST='T' bash -l<cr>
|
||||||
nnoremap <C-f> :!/usr/bin/env IS_VIFM_NEST='T' bash -l<cr>
|
nnoremap <C-f> :!/usr/bin/env IS_VIFM_NEST='T' bash -l<cr>
|
||||||
|
|
||||||
" Open cwd in finder
|
" Rename file/dir under cursor to unix standards Ore[name]
|
||||||
nnoremap <space>ofinder :!open .<cr>
|
nnoremap <space>ore :exe 'goto "'.system("~/.configs_pointer/vifm/scripts/vifm_rename_and_move_file.sh ".expand('%c')).'"'<cr>
|
||||||
|
|
||||||
nnoremap <space>ogadd :!git add %c<cr>
|
|
||||||
|
|
||||||
" Logical conflict mappings
|
" Logical conflict mappings
|
||||||
" Navigate back from symlinks
|
" Navigate back from symlinks
|
||||||
|
@ -149,9 +147,6 @@ nnoremap <space>m :sync %d<cr><space>
|
||||||
"nnoremap <C-d> 6j
|
"nnoremap <C-d> 6j
|
||||||
"vnoremap <C-d> 6j
|
"vnoremap <C-d> 6j
|
||||||
|
|
||||||
nnoremap <space>orestore :!git restore %c<cr>
|
|
||||||
nnoremap <space>oadd :!git add %c<cr>
|
|
||||||
|
|
||||||
" Make and navigate to a directory in the other pane
|
" Make and navigate to a directory in the other pane
|
||||||
command! cddir :sync! | exe 'wincmd w' | mkdir "%d/%a" | cd "%d/%a" | exe 'wincmd w'
|
command! cddir :sync! | exe 'wincmd w' | mkdir "%d/%a" | cd "%d/%a" | exe 'wincmd w'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue