Browse Source

vim, notes: shellescape paths when finding logs / links

This was leading to a slighly cryptic error from zsh about unmatched single
quotes before I remembered that vim is actually invoking my current shell
to run these commands.

Came up when processing the page for Meghan O'Gieblyn.
main
Brennen Bearnes 1 year ago
parent
commit
111edd5fc7
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      home/.vim/vimrc

+ 3
- 2
home/.vim/vimrc View File

@ -946,7 +946,7 @@ let mapleader = ","
let realpath = system('readlink -fn ' . shellescape(expand('%')))
" override default grep so we can populate the location list:
setlocal grepprg=notes-links-for\ --file\ $*
silent execute "silent lgrep! " . realpath
silent execute "silent lgrep! " . shellescape(realpath)
" https://vim.fandom.com/wiki/Avoiding_the_%22Hit_ENTER_to_continue%22_prompts
" https://vi.stackexchange.com/questions/2809/silent-makes-my-vim-go-blank
@ -980,10 +980,11 @@ let mapleader = ","
" XXX: Experimental - catenate log entries for current wiki page
function! s:LogForFile()
let realpath = system('readlink -fn ' . shellescape(expand('%')))
echom 'Finding logs for ' . realpath
botright new
edit ~/notes/vimwiki/_logscratch.wiki
1,$d " delete everything in file
execute '$read !' . 'notes-logs-for ' . realpath
execute '$read !' . 'notes-logs-for ' . shellescape(realpath)
0delete " delete blank first line - get rid of this if you need debug msgs
1
endfunction


Loading…
Cancel
Save