Skip to content

Instantly share code, notes, and snippets.

View gaveen's full-sized avatar

Gaveen Prabhasara gaveen

View GitHub Profile
set nocompatible
set bs=indent,eol,start
set viminfo='20,\"50
set history=50
set ruler
set number
set smarttab
set title
set incsearch
set t_Co=256
" Set the leader key
let mapleader = ","
" Map w!! to write file with sudo, when forgot to open with sudo.
cmap w!! w !sudo tee % >/dev/null
" Map F1 to Esc. Safe to remove if not desirable.
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
" Set keys to toggle Scratch buffer
function! ToggleScratch()
if expand('%') == g:ScratchBufferName
quit
else
Sscratch
endif
endfunction
map <leader>s :call ToggleScratch()<CR>
" Set the key to toggle NERDTree
nnoremap <leader>d :NERDTreeToggle<cr>
" set Enter/Return to activate a node
let NERDTreeMapActivateNode='<CR>'
" Disabling filetype before Pathogen. Loaded later.
filetype off
" Invoke pathogen
call pathogen#runtime_append_all_bundles()
" Set the key to launch conque - terminal
nnoremap <leader>t :ConqueTermSplit bash<cr>
set guifont=DejaVu\ Sans\ Mono\ 11
set columns=80
set guioptions-=T
set guioptions-=r
set guioptions-=L
colorscheme monokai
# .bashrc
# Cool bash prompt (with git goodness)
function parse_git_branch {
BRANCH_PROMPT=$(__git_ps1)
if [ -n "$BRANCH_PROMPT" ]; then
BR_GIT_STATUS=$(get_git_status)
echo $BRANCH_PROMPT$BR_GIT_STATUS
fi
}
@gaveen
gaveen / extension.js
Created December 9, 2011 04:51
GNOME Shell extention - ConnectionManager - Set Icon
// Trying to set icon
let icon = new St.Icon({ icon_name: 'emblem-cm-symbolic',
icon_type: St.IconType.SYMBOLIC,
icon_size: 16 });
this.actor.get_children().forEach(function(c) { c.destroy() });
this.actor.add_actor(icon);
// Place the 'emblem-cm-symbolic.svg' in the same directory
@gaveen
gaveen / .vimrc-snip
Created December 9, 2011 19:27
Part of my vimrc which sets indentation (tabs, spaces, etc.)
" I'm using the following config to make my code look the same everywhere.
set bs=indent,eol,start " allow backspacing over everything
set autoindent " enable auto-indentation
set tabstop=2 " no. of spaces for tab in file
set shiftwidth=2 " no. of spaces for step in autoindent
set softtabstop=2 " no. of spaces for tab when editing
set expandtab " expand tabs into spaces
set smarttab " smart tabulation and backspace