Skip to content

Instantly share code, notes, and snippets.

@admiral0
Last active December 19, 2015 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save admiral0/5998745 to your computer and use it in GitHub Desktop.
Save admiral0/5998745 to your computer and use it in GitHub Desktop.
My current vimrc. To setup: download this in your home and name it .vimrc ; execute "mkdir -p ~/.vim/bundle; git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle" ; open vim and write :BundleInstall<Enter>
" Vundle
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" Installed bundles
Bundle 'gmarik/vundle'
Bundle "MarcWeber/vim-addon-mw-utils"
Bundle "tomtom/tlib_vim"
Bundle "garbas/vim-snipmate"
Bundle "honza/vim-snippets"
Bundle "ervandew/supertab"
Bundle "scrooloose/nerdtree.git"
Bundle "scrooloose/nerdcommenter"
Bundle "scrooloose/syntastic.git"
Bundle "davidhalter/jedi-vim"
Bundle "Perldoc.vim"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Generic vim
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"Standard vim stuff
set nocompatible
syntax on
"Leader
let mapleader = "ç"
let g:mapleader = "ç"
"Filetype
filetype plugin on
filetype indent on
" Turn on the WiLd menu
set wildmenu
" Ignore compiled files
set wildignore=*.o,*~,*.pyc
"Always show current position
set ruler
set number
" Better search
set hlsearch
set incsearch
"Show braces match
set showmatch
colorscheme desert
set background=dark
" Set extra options when running in GUI mode
if has("gui_running")
set guioptions-=T
set guioptions+=e
set t_Co=256
set guitablabel=%M\ %t
endif
" Set utf8 as standard encoding and en_US as the standard language
set encoding=utf8
" Use Unix as the standard file type
set ffs=unix,dos,mac
" Turn backup off
set nobackup
set nowb
set noswapfile
" Use spaces instead of tabs
set expandtab
" Be smart when using tabs ;)
set smarttab
" 1 tab == 4 spaces
set shiftwidth=4
set tabstop=4
" Linebreak on 500 characters
set lbr
set tw=500
set ai "Auto indent
set si "Smart indent
" Python length
augroup vimrc_autocmds
autocmd!
" highlight characters past column 120
autocmd FileType python highlight Excess ctermbg=DarkGrey guibg=Black
autocmd FileType python match Excess /\%120v.*/
autocmd FileType python set nowrap
augroup END
au FileType perl let g:perldoc_program = substitute(system("which perldoc"),"\n$","","")
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Key remaps
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map <S-Right> :tabn<cr>
map <S-Left> :tabp<cr>
map <F2> :NERDTreeToggle<cr>
map <F3> :call NERDTreeSync()<cr>
map <leader>o :browse confirm e<cr>
map <leader>n :tabnew<cr>
inoremap <leader>p <ESC>"+p`]a
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Functions
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
fun! NERDTreeSync()
lcd %:p:h
NERDTreeCWD
endf
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Plugin section
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set laststatus=2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment