Skip to content

Instantly share code, notes, and snippets.

@timlenardo
Created June 28, 2016 15:41
Show Gist options
  • Save timlenardo/bb7377733b7b8b67cd86ce9dabd85816 to your computer and use it in GitHub Desktop.
Save timlenardo/bb7377733b7b8b67cd86ce9dabd85816 to your computer and use it in GitHub Desktop.
set paste
set nocp
set nocompatible
set softtabstop=2
set tabstop=2
set shiftwidth=2
set expandtab
set guioptions-=T
set guioptions+=e
set t_Co=256
set mouse=a
syntax enable
set guitablabel=%M\ %t
set ruler
set nowrap
set autoindent
set number
set ignorecase
set smartcase
set hlsearch
set incsearch
set undolevels=1000
set history=1000
set title
set novisualbell
set noerrorbells
set nobackup
set pastetoggle=<F3>
set laststatus=2
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l
set magic "for regex pattern matching
set background=dark "for better solarized
colorscheme solarized
"save file tby hitting space twice
nnoremap <space><space> :w<cr>
"highlight tabs(\t char)
syn match tab display "\t"
hi link tab Error
"eliminate traling whitespaces
fun! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endfun
" kill any trailing whitespace on save
autocmd FileType c,cabal,cpp,haskell,javascript,php,python,readme,text
\ autocmd BufWritePre <buffer>
\ :call <SID>StripTrailingWhitespaces()
function! HasPaste()
if &paste
return 'PASTE MODE '
en
return ''
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment