Skip to content

Instantly share code, notes, and snippets.

@ubernil
Created June 23, 2015 16:23
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 ubernil/a69eaa33ad9e5de94a90 to your computer and use it in GitHub Desktop.
Save ubernil/a69eaa33ad9e5de94a90 to your computer and use it in GitHub Desktop.
.vimrc
set t_Co=256
set nocompatible
set fileformat=unix
set encoding=utf-8
" Change leader to a comma because the backslash is too far away
" That means all \x commands turn into ,x
" The mapleader has to be set before vundle starts loading all
" the plugins.
let mapleader=","
" ================ Vundle it! ========================
filetype off "Required by Vundle
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim' " let Vundle manage Vundle, required
" ........... Source Controll section
Plugin 'tpope/vim-fugitive'
Plugin 'airblade/vim-gitgutter'
Plugin 'mattn/webapi-vim' "we need this for gist-vim to work
Bundle 'mattn/gist-vim'
" ........... Navigation section
Plugin 'scrooloose/nerdtree' "Best file browser
map <C-n> :NERDTreeToggle<CR>
Plugin 'kien/ctrlp.vim'
Bundle 'mileszs/ack.vim'
Plugin 'majutsushi/tagbar' "plugin for browsing the tags of source code files
let g:airline#extensions#tagbar#enabled = 1
"Adds automated view session creation and restoration whenever editing a buffer,
"across Vim sessions and window life cycles
Plugin 'kopischke/vim-stay'
" This plugin allows use of ,, before motion commands to boost it
Plugin 'Lokaltog/vim-easymotion'
" ........... Visuals section
Plugin 'bling/vim-airline'
" Plugin 'reedes/vim-thematic "Looks like this can be easily removed
" Colorschemes
"Plugin 'flazz/vim-colorschemes' "We love to color the world
Plugin 'vim-erlang/vim-compot' "Made for erlang, gui
Plugin 'jeetsukumaran/vim-nefertiti' "Gui only
Plugin 'noahfrederick/vim-noctu' "Low contrast 256 color
Plugin 'romainl/Apprentice'
Plugin 'junegunn/seoul256.vim'
Plugin 'altercation/vim-colors-solarized'
Plugin 'vim-scripts/Guardian'
Plugin 'tpope/vim-vividchalk'
Plugin 'morhetz/gruvbox'
" One more iteration to colorschemes (NEOVIM voting on github)
Plugin 'abra/vim-abra'
Plugin 'freeo/vim-kalisi'
Plugin 'daddye/soda.vim'
Plugin 'vim-scripts/rainbow_parentheses.vim'
nmap <D-0> :RainbowParenthesesToggle <CR> :RainbowParenthesesLoadRound <CR> :RainbowParenthesesLoadSquare <CR> :RainbowParenthesesLoadBraces <CR>
"au VimEnter * RainbowParenthesesToggle
"au Syntax * RainbowParenthesesLoadRound
"au Syntax * RainbowParenthesesLoadSquare
"au Syntax * RainbowParenthesesLoadBraces
Plugin 'bronson/vim-trailing-whitespace'
" ........... Language plugins
Bundle 'vim-ruby/vim-ruby'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-bundler'
Plugin 'tpope/vim-haml'
Bundle 'kchmck/vim-coffee-script'
Plugin 'vim-scripts/JSON.vim'
Plugin 'alfredodeza/jacinto.vim'
Plugin 'plasticboy/vim-markdown'
Plugin 'jimenezrick/vimerl'
Plugin 'slim-template/vim-slim'
Plugin 'othree/html5.vim'
Plugin 'chilicuil/vim-sml-coursera'
Plugin 'Keithbsmiley/rspec.vim'
Plugin 'wlangstroth/vim-racket'
Plugin 'elixir-lang/vim-elixir'
" Clojure
Plugin 'vim-scripts/VimClojure.git'
let g:vimclojure#HighlightBuiltins = 1
let g:vimclojure#ParenRainbow = 0
" ........... Utilities section
Plugin 'scrooloose/nerdcommenter' "Allows commenting with a shortcut
map <C-\> :call NERDComment(0, "toggle")<cr>
Plugin 'scrooloose/syntastic' "Syntax checking
let g:syntastic_ruby_checkers = ['mri', 'rubocop']
" syntastic
let g:syntastic_always_populate_loc_list=1
let g:syntastic_error_symbol='✗'
let g:syntastic_warning_symbol='⚠'
let g:syntastic_style_error_symbol = '✗'
let g:syntastic_style_warning_symbol = '⚠'
let g:syntastic_auto_loc_list=1
let g:syntastic_aggregate_errors = 1
" vim-airline
let g:airline_enable_syntastic = 1
Plugin 'sjl/gundo.vim' "Undo-tree
" Lisp-like repl
"Plugin 'slimv.vim'
"let g:slimv_swank_cmd = '!osascript -e "tell application \"Terminal\" to do script \"ccl --load /Users/ubernil/.vim/bundle/slimv.vim/slime/start-swank.lisp\""'
" Games
Plugin 'mattn/flappyvird-vim'
" ........... Backup section
"
"I have to check this Erlang related plugins later
"Plugin 'vim-erlang/vim-erlang-skeletons'
"Plugin 'vim-erlang/vim-dialyzer'
"Plugin 'vim-erlang/vim-rebar'
"Plugin 'edkolev/erlang-motions.vim'
"Plugin 'vim-erlang/vim-erlang-omnicomplete'
"Plugin 'vim-erlang/vim-erlang-tags'
"Plugin 'vim-erlang/vim-erlang-compiler'
call vundle#end() "All plugins must be added before this line
" ================ General Config ====================
colorscheme gruvbox
set background=dark "Use dark background by default
set backspace=indent,eol,start "Allow backspace in insert mode
set history=1000 "Store lots of :cmdline history
set showcmd "Show incomplete cmds down the bottom
set showmode "Show current mode down the bottom
set gcr=a:blinkon0 "Disable cursor blink
set visualbell "No sounds
set autoread "Reload files changed outside vim
set showmatch "Show matching brackets
set laststatus=2 "Show status line always
set nrformats= "Use only 10-based number formats (for C-a C-x)
" Completeon
set complete=.,w,b,kspell,ss "current buffer, other windows' buffers, dictionary, spelling
set completeopt=longest,menuone "Completion preferences
" Vim-stay plugin recommended options (https://github.com/kopischke/vim-stay/blob/master/doc/vim-stay.txt#L37)
set viewoptions=cursor,folds,slash,unix
" UNDOS
set undolevels=1000
" This makes vim act like all other editors, buffers can
" exist in the background without being in a window.
" http://items.sjbach.com/319/configuring-vim-right
set hidden
set tabstop=2 "Tab size
set shiftwidth=2 "Must be the same
set softtabstop=2 "Must be the same
set expandtab "Upaces instead of tabs
set nowrap "Wrap lines
set nolinebreak "Break lines softly
set wrapscan "Wrap search
set incsearch "Move on as we type in
set ignorecase
set smartcase "Smart case for search
set number "Line numbers are good
set relativenumber
set cursorline
set noequalalways "do not make windows equal size
if has('gui_running')
set guifont=PragmataPro:h13
" set fu
" colorscheme nefertiti
colorscheme gruvbox
set guioptions-=l
set guioptions-=L
set guioptions-=r
set guioptions-=R
endif
"turn on syntax highlighting
syntax on
" Airline config
let g:airline_powerline_fonts = 0
let g:airline_theme = 'lucius'
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
"let g:airline_left_sep = '»'
let g:airline_left_sep = '⮀'
"let g:airline_right_sep = '«'
let g:airline_right_sep = '⮂'
"let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '⭡'
"let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⭠'
let g:airline_symbols.paste = 'ρ'
"let g:airline_symbols.paste = 'Þ'
"let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
set noshowmode "do not show native mode line
" Only do this part when compiled with support for autocommands
if has("autocmd")
" Enable file type detection
filetype plugin indent on
" Syntax of these languages is fussy over tabs Vs spaces
autocmd FileType make setlocal ts=8 sts=8 sw=8 noexpandtab
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType ruby setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType python setlocal ts=4 sts=4 sw=4 expandtab
" Customisations based on house-style (arbitrary)
autocmd FileType html setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType css setlocal ts=2 sts=2 sw=2 expandtab
autocmd FileType erlang setlocal ts=4 sts=4 sw=4 expandtab
" Treat .rss files as XML
autocmd BufNewFile,BufRead *.rss setfiletype xml
endif
" ==================================================
" Use the same symbols as TextMate for tabstops and EOLs
set listchars=tab:▸\ ,eol:¬
" Shortcut to rapidly toggle `set list`
nmap <leader>l :set list!<CR>
"nmap “ :bp<CR>
"nmap ‘ :bn<CR>
"nmap <D-Bslash> :b#<CR>
"nmap <D-Bar> :bd<CR>
"nmap <D-D> :split<CR>
"nmap <D-d> :vsplit<CR>
"nmap <D-]> :wincmd w<CR>
"nmap <D-[> :wincmd W<CR>
"Highlight all chars above 80 column
nmap <leader>8 :match ErrorMsg '\%>80v.\+'<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment