you could just create a function, and put your commands in that function:
fun! LeinCMD()
execute 'ConqueTerm lein repl'
execute 'set syntax=clojure'
execute 'normal! i'
endf
command! Repl call LeinCMD()
you could source above codes, and type :Repl
and Enter
to test if it works for you.
EDIT
very nice comments by @Zyx. I just put them in answer, so that readers won't miss valuable information in future.
- You need exactly no
:execute
calls here.
:normal!
i is useless, to start insert mode from functions there is :startinsert and :call feedkeys(), former should be preferred. // Note: :normal! i
“works” here because :startinsert
is run by :ConqueTerm
. I.e. due to the way Conque is written you don’t need :startinsert
at all, but if it was not already there :normal! i
would continue to do nothing useful.
Just mentioned: it would be much nicer to use command -bar
: this way you won’t need :execute
to chain your command with pipe symbol (try Repl | echo "Here"
with and without -bar as a second argument to :command
). I think it have been the default option, don’t know why Bram likes to have bad defaults in a number of places.