I'm trying to get vim to execute the script I'm editing with a key mapping, say ctrl + x, so I used this in
:map <C-x> :!exec_file %<CR>
To pass the file name to a script I wrote which parses the extension and calls the appropriate interpreter, this works great so far.
However, I was wondering if I can call
bash directly with the script name and have it execute it since most scripts I edit have a shebang line, so I tried this mapping instead:
:map <C-x> :!bash %<CR>
But it doesn't work, is it possible to execute a script by passing its name to bash ?