Skip to content

Instantly share code, notes, and snippets.

@raninho
Created February 19, 2014 14:13
Show Gist options
  • Save raninho/9092928 to your computer and use it in GitHub Desktop.
Save raninho/9092928 to your computer and use it in GitHub Desktop.
vimrc
syntax on
set encoding=utf-8
set nocompatible
set backspace=indent,eol,start
set tabstop=4
set shiftwidth=4
set scrolloff=2
set laststatus=2
set showtabline=2
set showmatch
set noerrorbells
set autowrite
set nowrap
set nobackup
set history=50
set ruler
set showcmd
set incsearch
set formatoptions=tcq
set smartindent
set number
set vb t_vb=
set t_Co=256
set hlsearch
set cursorline
nnoremap <silent> <backspace> :noh<CR>
filetype plugin indent on
let mapleader=","
autocmd FileType python autocmd BufWritePre <buffer> :%s/\s\+$//e
au FileType python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 textwidth=78
au FileType javascript setlocal expandtab tabstop=2 sw=2 sts=2 textwidth=0
"C- para [Control]
"M- para [Alt]
"D- para [Command]
"S- para [shift]
map tt :tabnew
nmap <S-Right> :tabnext<CR>
imap <S-Right> <esc>:tabnext<CR>
nmap <S-Left> :tabprevious<CR>
imap <S-Left> <esc>:tabprevious<CR>
map <D-1> :tabn 1<CR>
map <D-2> :tabn 2<CR>
map <D-3> :tabn 3<CR>
map <D-4> :tabn 4<CR>
map <D-5> :tabn 5<CR>
map <D-6> :tabn 6<CR>
map <D-7> :tabn 7<CR>
map <D-8> :tabn 8<CR>
map <D-9> :tabn 9<CR>
map <D-0> :tabn 10<CR>
imap <D-1> <ESC>:tabn 1<CR>a
imap <D-2> <ESC>:tabn 2<CR>a
imap <D-3> <ESC>:tabn 3<CR>a
imap <D-4> <ESC>:tabn 4<CR>a
imap <D-5> <ESC>:tabn 5<CR>a
imap <D-6> <ESC>:tabn 6<CR>a
imap <D-7> <ESC>:tabn 7<CR>a
imap <D-8> <ESC>:tabn 8<CR>a
imap <D-9> <ESC>:tabn 9<CR>a
imap <D-0> <ESC>:tabn 10<CR>a
" ========== Bad whitespaces ==========
autocmd BufEnter * highlight BadWhitespace ctermbg=red guibg=red
autocmd BufEnter * match BadWhitespace /^\t\+/
autocmd BufEnter * match BadWhitespace /\s\+$/"
if has("gui_gtk2")
set guioptions=aegmitA
set guifont=Ubuntu\ Mono\ 15
else
set guioptions=efgmt
set guifont=Monaco:h14
endif
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
" ============= Plugins ===============
" Nerdtree
Bundle 'scrooloose/nerdtree'
autocmd vimenter * if !argc() | NERDTree | endif
map <F2> :NERDTreeToggle<CR>
let NERDTreeIgnore = ['\.pyc$']
" eof Nerdtree
" Powerline
Bundle 'Lokaltog/vim-powerline'
" eof Powerline
" Fugitive
Bundle 'tpope/vim-fugitive'
" eof Fugitive
" Flake8
Bundle 'nvie/vim-flake8'
let g:flake8_max_line_length=99
let g:flake8_max_complexity=10
let g:flake8_ignore="E501,W293"
autocmd FileType python map <buffer> <F3> :call Flake8()<CR>
autocmd BufWritePost *.py call Flake8()
" eof Flake8
" Auto-pairs
Bundle 'jiangmiao/auto-pairs'
" eof Auto-pairs
" vim-scripts / Efficient-python-folding
" Bundle 'vim-scripts/Efficient-python-folding'
" eof vim-scripts / Efficient-python-folding
" Code commenter
Bundle 'scrooloose/nerdcommenter'
" eof Code commenter
" snipmate
Bundle 'MarcWeber/vim-addon-mw-utils'
Bundle 'tomtom/tlib_vim'
Bundle 'garbas/vim-snipmate'
Bundle 'honza/vim-snippets'
let g:snipMate = {}
let g:snipMate.scope_aliases = {}
let g:snipMate.scope_aliases['ruby'] = 'ruby,ruby-rails,ruby-1.9'
let g:snipMate.scope_aliases['python'] = 'python,django'
" eof snipmate
" ctrlP
Bundle 'kien/ctrlp.vim'
Bundle 'tacahiroy/ctrlp-funky'
let g:ctrlp_extensions = ['funky']
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn)$',
\ 'file': '\v\.(exe|so|dll|pyc)$',
\ 'link': 'some_bad_symbolic_links',
\ }
let g:ctrlp_open_new_file = '<t>'
" eof ctrlP
" vim-multiple-cursors
Bundle 'terryma/vim-multiple-cursors'
" Default mapping
let g:multi_cursor_next_key='<C-n>'
let g:multi_cursor_prev_key='<C-p>'
let g:multi_cursor_skip_key='<C-x>'
let g:multi_cursor_quit_key='<Esc>'
let g:multi_cursor_start_key='<F6>'
" eof vim-multiple-cursors
" colorscheme solarized
Bundle 'altercation/vim-colors-solarized'
if has('gui_running')
set background=dark
colorscheme solarized
endif
" eof colorscheme solarized
" YouCompleteMe
" Bundle 'Valloric/YouCompleteMe'
" eof YouCompleteMe
" Jedi-vim
"Bundle 'davidhalter/jedi-vim'
" eof Jedi-vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment