-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.vim
126 lines (101 loc) · 3.82 KB
/
init.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
" ----------------------------------------------------------------------------
" Neobundle Setup
" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
if has('vim_starting')
set nocompatible " Be iMproved
set runtimepath+=~/.vim/bundle/neobundle.vim/
endif
call neobundle#begin(expand('~/.vim/bundle/'))
NeoBundleFetch 'Shougo/neobundle.vim'
" productivity stuff
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'ctrlpvim/ctrlp.vim'
NeoBundle 'ervandew/supertab'
NeoBundle 'rking/ag.vim'
NeoBundle 'flazz/vim-colorschemes' "all colorschemes there are
NeoBundle 'scrooloose/nerdcommenter'
NeoBundle 'scrooloose/nerdtree'
NeoBundle 'benekastah/neomake'
" language support stuff
NeoBundle 'tpope/vim-rails'
NeoBundle 'tpope/vim-rake'
NeoBundle 'tpope/vim-projectionist'
NeoBundle 'sheerun/vim-polyglot'
NeoBundle 'outsmartin/haproxy.vim'
" NeoBundle 'rodjek/vim-puppet'
if filereadable(expand("~/.vim/users/$USER/mybundles"))
source ~/.vim/users/$USER/mybundles
endif
call neobundle#end()
filetype plugin indent on
NeoBundleCheck
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
" Neobundle END
" ----------------------------------------------------------------------------
syntax on
set hidden
set encoding=utf-8
let mapleader = ","
let g:solarized_termcolors=256
set background=dark
colorscheme solarized
if &term =~ '256color'
" Disable Background Color Erase (BCE) so that color schemes
" work properly when Vim is used inside tmux and GNU screen.
" See also http://snk.tuxfamily.org/log/vim-256color-bce.html
set t_ut=
endif
" Tab and spaces settings
set expandtab "convert tabs to spaces
set shiftwidth=2 "length for indentation
set tabstop=2 "length for tabs
set smarttab "enable smart indetation
set autoindent "enable auto indentation
" ----------------------------------------------------------------------------
" moving around, searching and patterns
" ----------------------------------------------------------------------------
set hls! " highlight all matches
set nostartofline " keep cursor in same column for long-range motion cmds
set incsearch " Highlight pattern matches as you type
set ignorecase " ignore case when using a search pattern
set smartcase " override 'ignorecase' when pattern
" has upper case character
set scrolloff=5
set laststatus=2
set backspace=indent,eol,start " make backspace behave normally
set ttyfast " faster vim on fast connections
set ruler
autocmd BufWritePre * :%s/\s\+$//e
autocmd! BufWritePost * Neomake
set clipboard+=unnamedplus
highlight ExtraWhitespace ctermbg=darkblue guibg=darkblue
match ExtraWhitespace /\s\+$/
set wildmode=list:longest,full
" CtrlP stuff
let g:ctrlp_user_command = 'ag %s -l --nocolor --hidden -g ""'
" File tab completion ignores these file patterns
set wildignore+=*.exe,*.swp,.DS_Store,*~,*.o
set wildmenu
map <leader>b :CtrlPBuffer<RETURN>
map <C-b> :CtrlPBuffer<RETURN>
" ================ Turn Off Swap Files ==============
set noswapfile
set nobackup
set nowb
" ================ Persistent Undo ==================
" Keep undo history across sessions, by storing in file.
" Only works all the time.
silent !mkdir ~/.vim/backups > /dev/null 2>&1
set undodir=~/.vim/backups
set undofile
" ,rt -> regenerate ctags with gemdir and code
map <leader>rt :!ctags --extra=+f --languages=-javascript --exclude=.git --exclude=log -R * `rvm gemdir`/gems/* `rvm gemdir`/bundler/gems/*<CR><C-M>
map <leader>n :NERDTreeToggle<RETURN>
" ----------------------------------------------------------------------------
" plugin: syntastic config
" ----------------------------------------------------------------------------
let g:syntastic_check_on_open=1
let g:syntastic_enable_signs=1
if filereadable(expand("~/.vim/users/$USER/myvimrc"))
source ~/.vim/users/$USER/myvimrc
endif