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:

fosist 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 ",")

buyi wen said...
This comment has been removed by a blog administrator.

Config number of file descriptors on Linux

Check file descriptor limit for a process. Vary depending on owner of the process $ cat /proc/{process-id}/limits Check current number of...