I am trying to create a script that helps to create shebangs (well, maybe this is not so useful, but it has advantages when you do not know where the program is, for example), thatโs what I still have
function! CreateShebang()
call inputsave()
let program = input('Enter the program name: ')
call inputrestore()
let path = system('which ' . program)
call append(0, '#!' . path)
endfunction
By the way, Iโm just starting with vim scripts, so if you notice any wrong functions and concepts or know the best way to achieve the result, please tell me. Any help really appreciated.
The big problem is that after starting the scripts ask for the program name correctly, and then add something like this to the file:
What is doing there ^@?
, , input()? , , , .