I have this in my .vimrclet $ROOTPATH=FindRootDirectory()nnoremap <leader>ct :!clear<CR>:!$ROOTPATH/app/Console/cake test %:p<CR>Is there a way I can write this in one line?Using vim-rooter pluguin
How can I get path from vim-rooter's function and add it to another path VIM
vimscript;vimrc
nnoremap <leader>ct :exe !clear; .FindRootDirectory()./app/Console/cake test %:p<CR>The key is the :exe command, which executes its argument strings. In this case there is one argument string, which is the concatenation (. operator) of !clear; , the output of the FindRootDirectory() function, and /app/Console/cake test %:p. The <CR> terminates the mapping. I transformed the two shell commands into one, but you can use two commands if you prefer. See:help :exe