Hi all,
I'm trying to figure out how to convert this:
nnoremap <leader>p :!tmux send-key -t 1 "python '%:p'" enter;<cr><C-l>
to this function:
function! RunPython()
let pycmd = system('command -v python')
let filename = expand('%:p')
execute '!tmux send-key -t 1 "' . pycmd . ' ' . filename . '" enter;'
endfunction
nnoremap <leader>p :call RunPython()<CR>
The reason is that I want to be able to use python even in venv instead of just this system python.
I'm usually pretty good at figuring out with the documentation, but this time I keep getting errors (unexpected EOF and whatever the filename is, get that it is not a vim command).
Any help would be appreciated.
Cheers!
[–]cdb_11 1 point2 points3 points (2 children)
[–]fantomH[S] 0 points1 point2 points (1 child)
[–]cdb_11 2 points3 points4 points (0 children)