Skip to content

Instantly share code, notes, and snippets.

View gaveen's full-sized avatar

Gaveen Prabhasara gaveen

View GitHub Profile
" Set the key to toggle NERDTree
nnoremap <leader>d :NERDTreeToggle<cr>
" set Enter/Return to activate a node
let NERDTreeMapActivateNode='<CR>'
" 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 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 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