Friday, April 23, 2010

VIM - How to format JavaScript source code

  1. Download this plugin jsbeautify
  2. Copy it to $HOME/.vim/plugin/
  3. In Vim, while you want to format JavaScript code, press \ff*
* From jsbeautify's document tells to press <leader>ff which in Vim <leader> by default is set to "\"

5 comments:

Unknown said...
This comment has been removed by a blog administrator.
Lance E Sloan said...

@fosist: That's nice, but it has nothing to do with VIM.

Lance E Sloan said...

@TAP: I had to look around a lot before I found that the map leader character on MacVIM is apparently the comma (",") by default. I wish I knew how to ask VIM what its current map leader character is.

Tap said...

@Lance I don't know how to check current map leader. I only know how to map leader key myself. I'm not sure do you know this.

let mapleader = "," (In this case, I map leader to ",")

DomFilk said...
This comment has been removed by a blog administrator.

Collectd PostgreSQL Plugin

I couldn't find this link when searching with google https://www.collectd.org/documentation/manpages/collectd.conf.html#plugin-postgresql