I'm slowing getting to know Vim and Bash shell scripting and am running into this issue:
When I'm running MacVim, I sometimes want to use the command line to compile whatever it is I'm working on (in this case a small Java program). So I type :! bash
and compile whatever it is that I need and test it. Then when I want to go back to the program I was editing I type vim MyProgram.java
and get all kinds of messyness in my Vim session like [8;1H~ [9:1H~ [10:1H~ ... etc.
What am I doing wrong here? Can I not jump back into Vim once I've started running the shell inside of it?
Are there better ways of compiling and running your current file?
(I'm using MacVim 7.2 and Bash 3.2.48 on OSX 10.6.2.)
Two suggestions:
exit
to quit the bash shell and return to vim.:set makeprg=name_of_your_make_program
to automatically compile from within vim with the :make
command. As a bonus, if it's a toolset that vim recognizes, vim will parse the compiler's output, show you the errors, and allow you to jump to each of them so you can fix them. See the commands :cl
, :cc
, :cn
, and :cp
for starters.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With