I wrote a simple function to call an edit command with a path followed by a given file name.
However, it looks like edit l:path is editing for a file named "l:path" instead of the value of the l:path variable. I think this is a trivial problem, but itβs hard to get the search results for calling the editing function in the function, and not from the vim editor.
The following code shows the correct l value: the path when I change edit to echon .
command! -nargs=1 E call EditAtCurrentPath(<f-args>) function! EditAtCurrentPath(filename) let l:path=expand('%:p:h').'/'.a:filename edit l:path endfunction
source share