4 ms·
I've been digging deeper and deeper into vimscript and also scripting vim with python. It's so amazing what you can do with just a few lines of hacky vimscript!
by AlexanderDhoore 13y ago
I've been digging deeper and deeper into vimscript and also scripting vim with python. It's so amazing what you can do with just a few lines of hacky vimscript!
Today I made it so that every time I open a .markdown file, vim compiles it to html and opens it in my browser (using 'open' command on OS X). It also updates it automatically every time I save or leave insert mode.
I've also hacked together a python REPL inside a vim window. (Wasn't very hard, as vim has python built-in.)
Once you realise that Vim is just an extension of the command line, a new world opens up. Everything you can do from the command line, you can do from Vim. Throw in Python and the options are endless... So much POWER!!
BTW: I also discovered vim has MzScheme built-in, so don't go for emacs just because of lisp... Vim has a nicer lisp! Come to the dark side, we have cookies! (And lisp.)
- bosie 13y agoshare the markdown code if you don't mind?
- AlexanderDhoore 13y agoThis is VERY hacky, but that was kind of the point I was making. Hack together what you need! Here you go: http://pastebin.com/sPmPsCgY http://pastebin.com/sPmPsCgY Edit: Safari reloads the existing tab, so set the default browser to Safari if you want that.
- bosie 13y agothat is quite clever. works here too. any idea how you could convince firefox to reload the tab rather than creating a new one?
- petepete 13y agovim-instant-markdown is an excellent plugin if you edit a lot of markdown content. https://github.com/suan/vim-instant-markdown https://github.com/suan/vim-instant-markdown
- anuragramdasan 13y agoI never looked into it much as i started with lisp just recently and also putting that info with your vimscript makes me love vim a lot more now. Thank you kind sir.
- Zuider 13y agoIt looks like Vim 7.4 has been compiled without MzScheme support.
- S4M 13y agoI am more of an emacs guy, but your last point is making me want to give Vim a shot...