Browse Source

vim, vifm: renamepdfs: syntax highlighting, shortkeys

Maxim Likhachev 6 years ago
parent
commit
254007ceb1
  1. 2
      etc/soft/vifm/commands
  2. 13
      etc/soft/vim/vim/+ftplugin/rename.vim

2
etc/soft/vifm/commands

@ -45,5 +45,5 @@ command config :nvim $MYVIFMRC @@ -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

13
etc/soft/vim/vim/+ftplugin/rename.vim

@ -17,3 +17,16 @@ endfun @@ -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 <leader>D :g/^"[^"]*"\s*$/d<CR>

Loading…
Cancel
Save