how can I make the vim javascript pretty formatter plugin run?
I downloaded jsbeautify.vim from http://www.vim.org/scripts/script.php?script_id=2727
So where do I put jsbeautify.vim ? In ~/.vim/ or ~/.vim/ftplugin/ ?
After I position the plugin file, I will vim somefile.js containing javascript code without any newlines (difficult to read).
How do I invoke the plugin to pretty the code make it readable (exactly what key sequence).
How do others read/edit large crunched javascript code files (like firefox or chrome extensions)?
Fyi: this is a chrome exten开发者_如何转开发sion so the files are overly large to cut-paste into an web-based tool. I really just want to edit the file in-place to fix a bug, test theories.
Thanks, - Greg
figured it out.
The file jsbeautify.vim must be placed in the ~/.vim/plugin/ directory.
To invoke, do:
vim somefile.js
\ff
where the \ char is your char. The default is backslash.
also, you can run it by using:
:call g:Jsbeautify()
Then you can edit and save the javascript file.
精彩评论