Some VIM tips

I've been writing quite abit of javascript recently. Unfortunately by formatting is abit hit and miss. Thankfully sites like http://jsbeautifier.org/ exist to tidy up.

There is also a vim plugin: http://www.vim.org/scripts/script.php?script_id=2727

Drop it into your .vim/plugins folder and then "use: leader ff or bind the g:Jsbeautify() function to any short key you like."

If those instructions look like gobbledegook to you (it did to me) then know that leader defaults to "\" (so you would type \ff) and you can bind it to F5 (for example) by putting this into your .vimrc file:

map <F5> :call g:Jsbeautify()<CR>
No votes yet

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Well that's awesome post! to

Well that's awesome post! to be visiting your blog again, it has been months for me. Well this article that i've been waited for so long. I need this article to complete my assignment in the college, and it has same topic with your article. Thanks, great share this great and very informative post
1z0-535 exam | 642-611 exam | 642-681 exam | HP2-E32 exam | HP0-Y31 exam | 117-101 exam | PW0-104 exam | 650-294 exam |------------------------------

Post new comment

The content of this field is kept private and will not be shown publicly.