Monday, August 27, 2012

Color scheme for vim (not for gvim)

I was always wondering why some color scheme does work on gvim (MacVim) but not on vim launched from terminal. That's the reason.

Using GUI color settings in a terminal
http://vim.wikia.com/wiki/Using_GUI_color_settings_in_a_terminal

Tuesday, August 21, 2012

Updated: After Installed Mountain Lion

  1. Changed trackpad settings to "NORMAL"
    1. Enabled tap and click
    2. Fixed scrolling direction
    3. Enabled click and drag
      1. System Preference -> Accessibility -> Mouse & Trackpad -> Trackpad Options
  2. Enabled key repeat 
    1. Issue "defaults write -g ApplePressAndHoldEnabled -bool false"
  3. Made user's library directory visible from finder
    1. Issue "chflags nohidden /Users/USERNAME/Library"
  4. Installed
    1. MacVim
      1. Installed "ocean deep" color scheme
      2. Syntax highlight for arduino
      3. Made .vimrc 
    2. TextWrangler
    3. Xcode
      1. Added "command line tools" component
        1. Preferences -> Downloads -> Components
    4. VMware Fusion
      1. Installed Ubuntu 12.04 Desktop 64bit
        1. Updated installed packages
          1. $ sudo apt-get update
          2. $ sudo apt-get upgrade
        2. Installed C compiler
          1. $ sudo apt-get install build-essential
        3. Installed Oracle JAVA 7
          1. $ sudp add-apt-repository ppa:webupd8team/java
          2. $ sudo apt-get update
          3. $ sudo apt-get install oracle-java7-installer
          4. $ java -version
            Ref: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
        4. Installed Netbeans
          1. Download package, and the run install script
            http://netbeans.org
        5. Installed Arduino programming environment
          1. $ sudo apt-get install arduino-core arduino 
      2. Installed Windows 7
        1. Windows Update - Required packages
        2. Windows Update - Recommended packages
          *CAUTION* VMware Fusion got freeze while patching
    5. Adobe Acrobat Pro 9.0
      1. Patched manually! There was no automatic update option on 9.0...
        After all the patches were done (Ver. 9.5.2) the Acrobat got "Check for update" option in "Help" menu.
    6. The unarchiver
    7. MplayerX
    8. Caffeine
    9. Reeder
    10. Microsoft Office
    11. iWorks
    12. ScanSnap Manager


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