iTerm 2 with oh-my-zsh

This gist describes very well how you can install a copy of iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX).
This is just a copy of what is on Kevin Smet’s gist so all credit goes to him.

How to install


Download and install iTerm2 (it has better color fidelity than the built in Terminal).

Get the iTerm color settings

Dark theme
Light theme
– More themes @ iterm2colorschemes

Just save it somewhere and open the file(s). The color settings will be imported into iTerm2. Apply them in iTerm through iTerm -> preferences -> profiles -> colors -> load presets. You can create a different profile, other than Default if you wish to do so.

Oh my zsh

More info here:

curl -L | sh

edit `~/.zshrc` and set `ZSH_THEME="agnoster"`

Install a patched font

Meslo. Click “view raw” to download the font.
– Others @ powerline fonts

Open the downloaded font and press “Install Font”.

Set this font in iTerm2 (14px is my personal preference) (iTerm -> preferences -> profiles -> text).

– Regular Font -> “Change Font”

– Non-ASCII Font -> “Change Font”

Restart iTerm for all changes to take effect.

Shorter prompt style

By default, your prompt will now show [email protected] in the prompt. This will make your prompt rather bloated. Optionally set `DEFAULT_USER` in `~/.zshrc` to your regular username (these must match) to hide the [email protected] info when you’re logged in as yourself on your local machine.

Read More

Setting up LateX to work with VIM

To use vim efficiently with LateX I use the bundle called Vimtex provided here
To install vimtex:

If you use vim-plug, then add the following line to your vimrc file:

Plug ‘lervag/vimtex’
Or use some other plugin manager:


Next we need to also download and install MacTex.
I don’t like to download the whole installation and therefore use the basic one instead, which is a lot smaller. I find the graphical interfaces to be useless and take up unnecessary space, we are using VIM!

After installing MacTex, we should add the texbin path to our $PATH.
I added the path /usr/texbin to my zshrc and looks like this
By doing this we can execute tlmgr directly from terminal.

Since vimtex depends on latexmk we need to install that using sudo tlmgr install latexmk
After this you should be able to compile latex inside of VIM using the vimtex bundle.

Read More

VIM shortcuts and plugins

In this post I want to make a collection of useful shortcuts I have learned.

Change text between brackets
ci] or ci) or ci"

Pre-pend to multiple lines
Go to the first foo, press Ctrlv to enter visual block mode and press down until all the lines with foo are marked. Then press Shifti to insert at the beginning (of the block). When you are finished and press Esc, the inserted characters will be added to each line at the left of the marked block.

Append to multiple lines
To insert at the end, press again Ctrlv, move up/down to mark all affected lines and then press End or $ to extend the selection until the end of the lines. Now you can press Shiftato append at the end of all the lines, just like previously with Shifti.

Surround word/line with parentheses, brackets, quotes etc.. 

Search and replace


Find each occurrence of ‘foo’ (in all lines), and replace it with ‘bar’.

Find each occurrence of ‘foo’ (in the current line only), and replace it with ‘bar’.
Change each ‘foo’ to ‘bar’, but ask for confirmation first.
Change only whole words exactly matching ‘foo’ to ‘bar’; ask for confirmation.
Change each ‘foo’ (case insensitive) to ‘bar’; ask for confirmation.
This may be wanted after using :set noignorecase to make searches case sensitive (the default).
Change each ‘foo’ (case sensitive) to ‘bar’; ask for confirmation.
This may be wanted after using :set ignorecase to make searches case insensitive.

Align in VIM

Read More

De-bloat Nexus 5

Yes, the nexus 5 is an stock android phone and doesn’t really come with bloatware as what you get with Samsung phones for example.
However I still like to remove a lot of Google Apps.
For one, you can get pretty much all the apps from the Play store, so I see no reason for it to be flashed with the image.
Secondly, there are just apps I don’t use for example newsstand, fitness apps, movies etc..
I got this idea from
However, instead of removing the files after flashing, I want to remove the files before flashing.

This should hold for any nexus device, however some might have additional files or less files.

So here I’m creating a list of apps that are safe to remove, read along!

Using a slightly different approach to colour coding that kacangbawang
green = safe to remove
yellow  = probably safe
red = not safe to remove
black = unknown

App Description
./system/app/BasicDreams Screensaver
./system/app/Bluetooth Bluetooth
./system/app/Books Google bookshelf
./system/app/BrowserProviderProxy Bookmarks for browser?
./system/app/Calculator Not on google play! remove if you use alternative
./system/app/CalendarGooglePrebuilt Google Calendar
./system/app/CaptivePortalLogin ?
./system/app/CertInstaller WiFi certification installer
./system/app/Chrome Google Chrome
./system/app/CloudPrint2 Cloud Print
./system/app/ConfigUpdater ?
./system/app/DMAgent ?
./system/app/DeskClockGoogle Clock app (remove if you use e.g. Timely)
./system/app/DocumentsUI ?
./system/app/DownloadProviderUi ?
./system/app/Drive Google Drive
./system/app/EditorsDocs Google Docs
./system/app/EditorsSheets Google Sheets
./system/app/EditorsSlides Google Slides
./system/app/FaceLock FaceLock, probably safe to remove if you don’t use it
./system/app/FitnessPrebuilt Google Fitness
./system/app/GoogleCamera Google Camera
./system/app/GoogleContactsSyncAdapter Sync contacts with Google
./system/app/GoogleEars Sound search for google play
./system/app/GoogleEarth Google Earth
./system/app/GoogleHindiIME Hindi input
./system/app/GoogleHome Google Launcher
./system/app/GooglePinyinIME Chinese input
./system/app/GoogleTTS Text to speech
./system/app/HTMLViewer HTML viewer, probably can remove
./system/app/KeyChain Storage for passwords
./system/app/KoreanIME Korean input
./system/app/LatinImeGoogle English input
./system/app/LiveWallpapersPicker Live wallpaper picker
./system/app/Maps Google Maps
./system/app/MediaShortcuts ?
./system/app/Music2 Google Music
./system/app/Newsstand Google Newsstand
./system/app/NfcNci NFC
./system/app/OmaDmclient ?
./system/app/PacProcessor ?
./system/app/PackageInstaller Installing APKs?
./system/app/PartnerBookmarksProvider Browser bookmarks
./system/app/Photos Google Photos (doesn’t work without Google Plus)
./system/app/PlayGames Google Play Games
./system/app/PlusOne Google Plus
./system/app/PrebuiltEmailGoogle email app (not gmail)
./system/app/PrebuiltExchange3Google exchange support for the email app
./system/app/PrebuiltGmail Gmail
./system/app/PrebuiltKeep Google Keep, I replace it with Evernote
./system/app/PrebuiltNewsWeather Google News/Weather
./system/app/PrintSpooler Used for printing
./system/app/SprintHiddenMenu Remove if you’re not on Sprint
./system/app/Stk Sim tool kit, I usually remove it.
./system/app/Street Part of google maps
./system/app/SunBeam Live wallpaper
./system/app/TimeService ?
./system/app/UpdateSetting ?
./system/app/UserDictionaryProvider User Dictionary
./system/app/Videos Google Video
./system/app/WebViewGoogle ?
./system/app/YouTube Youtube
./system/app/iWnnIME Emoji keyboard
./system/app/qcrilmsgtunnel ?
./system/app/shutdownlistener ?
./system/app/talkback Google talkback (accessibility app

Priv-app Description
./system/priv-app/CellBroadcastReceiver If you don’t want notifications as AMBER alert
./system/priv-app/GoogleContacts Contacts
./system/priv-app/GoogleDialer Dialer
./system/priv-app/Hangouts Google Hangouts
./system/priv-app/Phonesky Google Play Store
./system/priv-app/Settings Settings
./system/priv-app/Wallet Not actually the wallet app, this is needed for setting up a google account.

A very nice ROM you could use is the one by XDA user Vomer, he has an already very clean rom with just the bare minimum!
Check his ROM out here: [ROM] CleanCore N5 by vomer | LMY47I | 100% Lean Stock

Read More

Homebrew package manager for mac

What is Homebrew?

As the subtitle of their website says, it’s the missing package manager for OS X. People who are familiar with Ubuntu or Debian are familiar with “apt-get install” to install packages they need. Homebrew does exactly this but for the mac with “brew install”.
It’s a very neat and clean way to install packages. Instead of using linux repositories, it actually gets its files from github. So this means you can instantly update the package to their latest version as it’s released.

So how do we install it?
The process of installing homebrew is very easy, you only have to open terminal and run the following command:

ruby -e "$(curl -fsSL

Within moments it’s installed and you can now add packages.
To add packages you can simply use:

brew install [package name]

For example if you want to install the latest gcc compiler and python 3.x. You can just type the following.

brew install gcc
brew install python3

It automatically installs dependencies and symlinks the programs. It just doesn’t get easier than this

A few very useful commands are:

brew update

To update

brew doctor

To check the status

brew cleanup

Cleans up the cache

Several useful packages are:


Read More


Some time ago a friend introduced me to VIM. I’ve known about the editor since the days of linux, however I’ve never tried getting into it as the learning curve is quite steep.

However, seeing how excited he is about VIM and the neat tricks you can do with it, I also decided to give it a go. Except it being my go to text editor, I mainly use it for programming in Python and \LaTeX.

Here’s my vimrc file:

" set leader and localleader
let mapleader = ","
let maplocalleader = ","

" ===================================================
" Vundle
" ===================================================
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

" ---- non-customised plugins

Plugin 'gmarik/Vundle.vim'
Plugin 'flazz/vim-colorschemes'
Plugin 'sheerun/vim-polyglot' " Syntax highlighting for multiple languages
Plugin 'ervandew/supertab' " Use tab for completion
Plugin 'SirVer/ultisnips' " Snippets
Plugin 'Valloric/YouCompleteMe' " auto completion for multiple languages
Plugin 'Shougo/neocomplcache' " auto completion based on cache
Plugin 'bling/vim-airline' " statusline plugin for vim

" ---- customised plugins

Plugin 'davidhalter/jedi-vim' " auto completion for python

" don't let docstring window to popup during completion
autocmd FileType python setlocal completeopt-=preview

Plugin 'lervag/vim-latex' " Latex for Vim!

" Singleshot compile with latexmk
nnoremap <localleader>ls :VimLatexCompileSS!<cr>

" autocomplete brackets
Plugin 'Raimondi/delimitMate'

" autocomplete '$' in tex
au FileType tex let b:delimitMate_quotes = "\" ' $"

" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required

" ===================================================
" Shortcuts
" ===================================================

" insert a single character from normal mode
function! RepeatChar(char, count)
return repeat(a:char, a:count)
nnoremap cc :<C-U>exec "normal i".RepeatChar(nr2char(getchar()), v:count1)<CR>
nnoremap cl :<C-U>exec "normal a".RepeatChar(nr2char(getchar()), v:count1)<CR>

"easier movement between windows
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l

" Use tab instead of % for moving between brackets
nnoremap <tab> %
vnoremap <tab> %

" Insert new line without going into insert mode
map <S-Enter> O<ESC>
map <Enter> o<ESC>

" Move a line of text using ALT+[jk] or Command+[jk] on mac
nmap <M-j> mz:m+<cr>`z
nmap <M-k> mz:m-2<cr>`z
vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z
vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z

if has("mac") || has("macunix")
nmap <D-j> <M-j>
nmap <D-k> <M-k>
vmap <D-j> <M-j>
vmap <D-k> <M-k>

" Save using <leader>w
nnoremap <leader>w :w <CR>

" ===================================================
" General
" ===================================================

" be iMproved, required
set nocompatible

" required
filetype off

" backspace also deletes indents
set backspace=indent,eol,start

" set tabsize
set expandtab tabstop=2
set shiftwidth=2
set softtabstop=2

" Use spaces instead of tabs
set expandtab

" Be smart when using tabs ;)
set smarttab

" autosave when focus is lost
autocmd FocusLost * silent! wa

" save on buffer switch
set autowriteall

" autoreload vimrc
augroup reload_vimrc " {
autocmd BufWritePost $MYVIMRC source $MYVIMRC
augroup END " }

"no beeping
set noerrorbells novisualbell
autocmd VimEnter * set vb t_vb=

" enable mouse
set mouse=a

"relative numbering by default
if exists("+relativenumber")
set relativenumber
"line numbering by default
set number

" Set to auto read when a file is changed from the outside
set autoread

" Delete trailing white space on save, useful for Python and CoffeeScript ;)
func! DeleteTrailingWS()
exe "normal mz"
exe "normal `z"
autocmd BufWrite *.py :call DeleteTrailingWS()
autocmd BufWrite *.coffee :call DeleteTrailingWS()

" ===================================================
" Search
" ===================================================

" Ignore case when searching
set ignorecase

" When searching try to be smart about cases
set smartcase

" Highlight search results
set hlsearch

" Makes search act like search in modern browsers (incremental search)
set incsearch

" ===================================================
" Visual
" ===================================================

" syntax highlighting
syntax on

" line numbering
set number

" 256 colors
set t_Co=256

" colorscheme
colorscheme lucius

" always show statusline
set laststatus=2

" statusline config
set statusline= " clear the statusline for when vimrc is reloaded
set statusline+=%-3.3n\ " buffer number
set statusline+=%f\ " file name
set statusline+=%h%m%r%w " flags
set statusline+=[%{strlen(&ft)?&ft:'none'}, " filetype
set statusline+=%{strlen(&fenc)?&fenc:&enc}, " encoding
set statusline+=%{&fileformat}] " file format
set statusline+=%= " right align
set statusline+=%{synIDattr(synID(line('.'),col('.'),1),'name')}\ " highlight
set statusline+=%b,0x%-8B\ " current char
set statusline+=%-14.(%l,%c%V%)\ %<%P " offset
I’ll keep the vimrc constantly updated on github as I update it on my machine.

The theme I’m using is Lucius, I really like a dark theme when I’m typing. It’s a lot less straining for the eyes plus the colours do pop a lot more.


Read More