diff --git a/etc/soft/vifm/commands b/etc/soft/vifm/commands index 6861049..e71c4c8 100644 --- a/etc/soft/vifm/commands +++ b/etc/soft/vifm/commands @@ -45,5 +45,5 @@ command config :nvim $MYVIFMRC command z !!zathura %c:p -command renamepdf !f() { for f in "$@"; do echo "\"$f\""; done }; cd %d; f %f | viper +'set ft=rename' +"let b:rename_dir=\"$(pwd)\"" | sed "s/^/mv /" | sh +command renamepdfs !renamepdfs --directory %d %f diff --git a/etc/soft/vim/vim/+ftplugin/rename.vim b/etc/soft/vim/vim/+ftplugin/rename.vim index a3360df..0986367 100644 --- a/etc/soft/vim/vim/+ftplugin/rename.vim +++ b/etc/soft/vim/vim/+ftplugin/rename.vim @@ -17,3 +17,16 @@ endfun setlocal omnifunc=PdfTags +syntax region newName start=/\v"/ skip=/\v\\[^"]/ end=/\v"\s*$/ +syntax match oldName '^"[^"]*"\s' +syntax match errorLine '^"[^"]*"$' + +highlight errorLine ctermfg=red +highlight oldName ctermfg=darkblue +highlight newName ctermfg=darkgreen cterm=bold + +" ----------------------------------------------------- + +cabbrev q cq +nmap D :g/^"[^"]*"\s*$/d +