Skip to content

Instantly share code, notes, and snippets.

@m4rw3r
Last active December 14, 2015 11:39
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 m4rw3r/5080934 to your computer and use it in GitHub Desktop.
Save m4rw3r/5080934 to your computer and use it in GitHub Desktop.
" General {
set nocompatible
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=ucs-bom,utf-8
" Display incomplete commands
set showcmd
" Allow switching buffsers without saving changes to file
set hidden
" Don't add invisible linebreak at EOF
set binary noeol
" }
" Vundle {
" Brief help
" :BundleList - list configured bundles
" :BundleInstall(!) - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" Let Vundle manage Vundle
" Required!
Bundle 'gmarik/vundle'
Bundle 'beyondwords/vim-twig'
Bundle 'Lokaltog/vim-distinguished'
Bundle 'kchmck/vim-coffee-script'
Bundle 'tpope/vim-markdown'
Bundle 'scrooloose/syntastic'
Bundle 'kien/ctrlp.vim'
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-powerline'
Bundle 'airblade/vim-rooter'
Bundle 'vim-scripts/Smart-Tabs'
" Required!
filetype plugin indent on
" }
" Syntastic {
let g:syntastic_check_on_open=1
" It uses PHP Mess Detector, I do not like how that behaves
let g:syntastic_mode_map = { 'mode': 'active',
\ 'active_filetypes': [],
\ 'passive_filetypes': ['php'] }
let g:syntastic_error_symbol='✗'
let g:syntastic_warning_symbol='⚠'
" }
" vim-powerline {
set laststatus=2
let g:Powerline_symbols = 'fancy'
" }
" Rooter {
let g:rooter_use_lcd = 1
" }
" Backup, Swap and View Files {
" Create dirs
silent execute '!mkdir -p $HOME/.vimbackup'
silent execute '!mkdir -p $HOME/.vimswap'
silent execute '!mkdir -p $HOME/.vimviews'
silent execute '!mkdir -p $HOME/.vimundo'
" Store backups in $HOME to keep the directory trees clean
set backup
set undofile
set backupdir=$HOME/.vimbackup/
set directory=$HOME/.vimswap/
set viewdir=$HOME/.vimviews/
set undodir=$HOME/.vimundo/
" }
" Tabs and Indentation {
set noexpandtab
set autoindent
set tabstop=4
set shiftwidth=4
" Different tab-width on YAML files, and only spaces
autocmd FileType yaml setlocal expandtab shiftwidth=2 tabstop=2
" }
" Font and Color {
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline:h12
set antialias
" Force MacVim to skip colors
let macvim_skip_colorscheme=1
syntax on
colorscheme github
if has("gui_running")
set transparency=2
endif
" Fix the listchars style
hi clear NonText
hi clear SpecialKey
hi NonText ctermfg=59 guifg=#5f5f5f
hi SpecialKey ctermfg=59 guifg=#5f5f5f
" Fix LineNr styling, so it matches with most themes
hi clear LineNr
hi LineNr ctermfg=59 guifg=#5f5f5f
" Fix todo highlight
hi clear Todo
hi Todo ctermfg=124 guifg=#af0000
" }
" UI {
set list
set listchars=eol:¬,tab:▸\ ,trail:·
set number
set showmatch
" Incremental search (ie. search while you type)
set incsearch
set hlsearch
" Ignore case for search unless it contains uppercase characters
set ignorecase
set smartcase
" Always keep this many lines below the line currently being edited
set scrolloff=5
" Remove scrollbars
set guioptions+=lrbRL
set guioptions-=lrbRL
" No audio bell
set vb
" }
" Key Mappings {
" Normal backspace
set backspace=2
" Avoid escape
inoremap jj <Esc>
" Don't allow arrow keys in insert mode
inoremap <Left> <NOP>
inoremap <Right> <NOP>
inoremap <Up> <NOP>
inoremap <Down> <NOP>
" Make so that J and K moves up and down a line while keeping the caret in the
" same column
nmap j gj
nmap k gk
" easier cursor navigation between split windows using CTRL and h,j,k, or l
noremap <C-h> <C-w>h
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l
" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment