I have this code intended to:
- read current line
- extract variable from end of line, looking for text like
- search for filename that begins with the string
- open that file to edit in vim
- bind this to a few keystrokes
I'm struggling to define and use these variables inside the
execute function calls...
function TaskSearch() let line = getline('.') let task_id = split(line, "#") let task_note = execute('find ~/.task/notes/ -name "task_id*"') execute('edit ~/.task/notes/$task_note') endfunction command! TaskSearch :call TaskSearch() nnoremap <leader>tn :TaskSearch <Enter>
I've tried many different variatlions of the
let task_note... and
execute(...) statements without any success.
I need to take the results of that command, which should be just a single file, and then open that file in a new buffer to edit it. How can I achieve this?