I am trying to autoindent a .lisp file from the command line, leveraging vim+slimv to do the indenting.
I tried scripting it:
vi -c 'call SlimvConnectSwank()' -c 'normal gg=G' -c 'wq' -c 'q!' temp.lisp
But the swank server isn't queried to do the indenting, so this just indents the file to .lisp vim defaults (if slimv and the server were not running).
Do I need to put some sort of delay/wait -c command after the call to connect to the swank server? It seems that the whole vi process is closing much too fast, and it isn't giving swank a chance to connect. If the swank connection happens on a separate thread, I suppose this could be the case.
Thoughts/comments/suggestions are appreciated.
Thanks!
Tamas got it. It was (and I checked on this, both are actually needed; really :) ) a sleep command and swank command that got it to work.
I added this to my .bashrc and aliased it to 'ai' so that I can easily indent a .lisp file from the command line:
alias ai="vi \
-c 'call SlimvConnectSwank()' \
-c 'sleep 1' \
-c 'call SlimvEval(['0'])' \
-c 'normal gg=G' \
-c 'wq' \
-c 'q!'"
Now 'ai temp.lisp' auto indents temp.lisp to slimv+vim+swank etc. standards.
All sorts of ways to script this for auto indenting a repo of lisp files, once you have the bash command to do it for one file.