Friday, April 23, 2010

VIM - How to format Html source code

  1. :filetype indent on
  2. :set filetype=html
  3. :set shiftwidth=n (n = indent size)
  4. :set smartindent
  5. gg=G (gg = top of file, = is a shortcut of re-tindent, G = botton of file)

For 1,3,4 , you can predefine at .vimrc. While editing Html file, just do 2 and 5

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 "\"

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...