-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
162 lines (133 loc) · 4.19 KB
/
.vimrc
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
" Turn off annoying bell
set belloff=all
" Vundle stuff
set nocompatible " be iMproved, required
filetype off " required
" Pathogen stuff (manage plugins)
execute pathogen#infect()
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" Terraform
let g:terraform_fmt_on_save=1
" Powerline alternative plugin
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
let g:airline_powerline_fonts = 1
" Uncomment for powerline. make sure Font is installed
"set guifont=Meslo\ LG\ L\ DZ\ for\ Powerline:h12
"set guifont=Bitstream\ Vera\ Sans\ Mono\ 12
" Use set guifont? to check current font
" Use below font with gvim
set guifont=Source\ Code\ Pro\ Medium\ 11
" Mouse support
:set mouse=a
" Nerdtree plugin map to ctrl n
map <C-n> :NERDTreeToggle<CR>
" Enable ag plugin for searching
let g:ag_prg="env ag --vimgrep"
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" Go lint
set rtp+=$GOPATH/src/github.com/golang/lint/misc/vim
syntax on
set tabstop=2
set shiftwidth=2
set softtabstop=2
set number
set autoindent
set smartindent
" set noexpandtab
set expandtab
set nospell
" Turn of backup ~ files from being created
set nobackup
set nowritebackup
" Display | to show tabstops
set list
set listchars=tab:\|\
" Search related
set incsearch
set hlsearch
set ignorecase
set smartcase
" Bind tab switch keys
noremap <c-left> <esc>:tabprev<cr>
noremap <c-right> <esc>:tabnext<cr>
noremap <c-s-left> <esc>:tabmove -1<cr>
noremap <c-s-right> <esc>:tabmove +1<cr>
" Set status line to display git
set statusline=%f%{fugitive#statusline()}%=%c,%l/%L\ %P
set laststatus=2
set background=dark
let g:solarized_termcolors=256
" colorscheme solarized
" colorscheme slime-contrast
colorscheme vividchalk
set foldmethod=syntax
set foldlevelstart=20
match ErrorMsg '\s\+$'
set colorcolumn=80
" Map clipboard to yank
if system('uname -s') == "Darwin\n"
set clipboard=unnamed "OSX
else
set clipboard=unnamedplus "Linux
endif
setlocal omnifunc=syntaxcomplete#Complete
filetype plugin on
autocmd! BufNewFile * silent! 0r ~/.vim/skel/tmpl.%:e
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd Filetype ruby,scss,haml,html,css,yml setlocal ts=2 sts=2 sw=2 expandtab
" yaml related
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
" Install plugin https://github.com/Yggdroot/indentLine
let g:indentLine_char = '⦙'
" Install yamllint cmd tool and https://github.com/dense-analysis/ale
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
let g:ale_sign_error = '✘'
let g:ale_sign_warning = '⚠'
let g:ale_lint_on_text_changed = 'never'
" xml formatting
function! DoPrettyXML()
" save the filetype so we can restore it later
let l:origft = &ft
set ft=
" delete the xml header if it exists. This will
" permit us to surround the document with fake tags
" without creating invalid xml.
1s/<?xml .*?>//e
" insert fake tags around the entire document.
" This will permit us to pretty-format excerpts of
" XML that may contain multiple top-level elements.
0put ='<PrettyXML>'
$put ='</PrettyXML>'
silent %!xmllint --format -
" xmllint will insert an <?xml?> header. it's easy enough to delete
" if you don't want it.
" delete the fake tags
2d
$d
" restore the 'normal' indentation, which is one extra level
" too deep due to the extra tags we wrapped around the document.
silent %<
" back to home
1
" restore the filetype
exe "set ft=" . l:origft
endfunction
command! PrettyXML call DoPrettyXML()
let php_sql_query=1
let php_htmlInStrings=1
let g:rubycomplete_buffer_loading = 1
let g:rubycomplete_classes_in_global = 1
let g:rubycomplete_rails = 1