Sunday, August 19, 2012

Vim: set path to working directory

Add the following to .vim


" Add the current file's directory to the path if not already present.
BufRead *
  \ let s:tempPath=escape(escape(expand("%:p:h"), ' '), '\ ') |
  \ exec "set path+=".s:tempPath

Ref: Set working directory to the current file

With previous make and javac binding, you can compile and execute Java code from vim with
  :mak
  :!java FILENAME

Saturday, August 18, 2012

Vim: Binding :make and javac

Add the following to your .vimrc

filetype on
autocmd FileType java set makeprg=javac\ %

You can make .java files with :make command.
To view errors, try ":cope", ":ccl", ":cc", ":cn", ":cp", etc.

Friday, August 17, 2012

Ubuntu 12.04: Font Install/Uninstall

Install with Terminal
1. Make .font directory in your home directory
    $ mkdir .font
2. Download and put font file or files in the .font directory (e.g. Monaco_Linux.ttff)
    $ mv Downloads/Monaco_Linux.ttf.font
3. Register the font
    $ sudo fc-cache -f -v
3. Confirm the install
    $ fc-list | grep Monaco

Install with GUI

Uninstall
1. Delete font file (e.g. Monaco.Linux.ttf)
    $ rm Monaco_Linux.ttf
2. Unregister the font
    $sudo fc-cache -f -v
3. Confirm the uninstall
    $ fc-list | grep Monaco

It's better not to install custom fonts to "/usr/share/fonts".

Thursday, August 16, 2012

Monday, August 13, 2012