Skip to content

Instantly share code, notes, and snippets.

@ricardopereira
Forked from bendc/.vimrc
Last active February 21, 2017 16:07
Show Gist options
  • Save ricardopereira/7cac96dbbad2a865e30001eeba8d923d to your computer and use it in GitHub Desktop.
Save ricardopereira/7cac96dbbad2a865e30001eeba8d923d to your computer and use it in GitHub Desktop.
Vim config (`vim +PluginInstall +qall`)
set nocompatible
set encoding=utf-8 nobomb
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Vundle
Plugin 'VundleVim/Vundle.vim'
" Utilities
Plugin 'altercation/vim-colors-solarized'
Plugin 'keith/swift.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'
Plugin 'vim-airline/vim-airline'
Plugin 'elzr/vim-json'
" All of your Plugins must be added before the following line
call vundle#end()
filetype plugin indent on
" show the filename in the window titlebar
set title
" enable ruler and line numbers
set ruler
set number
" enable solarized theme
syntax enable
let g:solarized_termtrans=1
set background=dark
let g:solarized_termcolors=256
colorscheme solarized
" don’t reset cursor to start of line when moving around
set nostartofline
" show the (partial) command as it’s being typed
set showcmd
" ignore case of searches
set ignorecase
" start scrolling three lines before the horizontal window border
set scrolloff=3
" enable mouse cursor
set mouse=a
" disable cursorline in insert mode
set cul
autocmd InsertEnter,InsertLeave * set nocul!
" nicer netrw directory browser
let g:netrw_banner=0
let g:netrw_liststyle=3
" enable tabs for different files
let g:airline#extensions#tabline#enabled = 1
" disable folding on markdown
let g:vim_markdown_folding_disabled = 1
" strip trailing spaces
fun! <SID>StripTrailingWhitespaces()
let l = line(".")
let c = col(".")
%s/\s\+$//e
call cursor(l, c)
endfun
autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()
" insert HTML template in new HTML files
:autocmd BufNewFile *.html 0r ~/.vim/templates/html.tpl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment