-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
200 lines (158 loc) · 4.09 KB
/
vimrc
File metadata and controls
200 lines (158 loc) · 4.09 KB
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
set nocompatible
filetype off
"""""""""""""""""""""""""
" Plugin "
"""""""""""""""""""""""""
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'Lokaltog/vim-easymotion'
Plugin 'altercation/vim-colors-solarized'
Plugin 'ekalinin/Dockerfile.vim'
Plugin 'plasticboy/vim-markdown'
Plugin 'nginx.vim'
Plugin 'bling/vim-airline'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-eunuch'
Plugin 'vim-perl/vim-perl'
Plugin 'klen/python-mode'
Plugin 'cburroughs/pep8.py'
Plugin 'Yggdroot/indentLine'
call vundle#end()
filetype plugin indent on
"IndentLine Vim
let g:indentLine_color_term = 239
"IndentLine Vim Char
let g:indentLine_char = '|'
"""""""""""""""""""""""""
" Colors "
"""""""""""""""""""""""""
syn on
set t_Co=256
set background=dark
colorscheme solarized
"""""""""""""""""""""""""
" Space/Tabs "
"""""""""""""""""""""""""
"Use space instead of tabs
set expandtab
" Be smart when using tabs
set smarttab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set backspace=2
"Auto Indent
set ai
"Smart Indent
set si
"Wrap lines
set wrap
"FixWhitespace to remove end of line white space.
function! s:FixWhitespace(lin1,line2)
let l:save_cursor ) getpos(".)
silent! execute ':' . a:line1 . ',' . a:line2 . 's/\s\+$//'
call setpos('.', l:save_cursor)
endfunction
command! -range=% FixWhitespace call <SID>FixWhitespace(<line1>,<line2>)
"""""""""""""""""""""""""
" Search "
"""""""""""""""""""""""""
set showmatch
set incsearch
set smartcase
"set smarttab
set ignorecase
"For regular expression
set magic
set hlsearch
"Turn off hlsearch
nnoremap <leader><space> :nohlsearch<CR>
"Visual mode pressing * or # searches for the current selection
"Super useful! From an idea by Michael Naumann
vnoremap <silent> * :call VisualSelection('f')<CR>
vnoremap <silent> # :call VisualSelection('b')<CR>
"""""""""""""""""""""""""
" UI "
"""""""""""""""""""""""""
let mapleader =","
set wildmenu
set wildmode=list:longest,full
"Highlight seearch terms
set listchars=tab:>\ ,trail:*,extends:#,nbsp:.
set lazyredraw
set laststatus=2
"Always show current position
set ruler
set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%)
set showcmd
"A buffer becomes hideen when it is abandoned
set hidden
set ffs=unix,dos,mac
"Return to last edit position when opening files
"autocmd BufReadPost *
" \ if line("'\"") > 0 && line("'\"") <= line("$") |
" \ exe "normal! g`\"" |
" \ endif
"Remember info about open buffers on close
"set viminfo^=%
"Specify the behavio when switching between buffers
"try
" set switchbuf=useopen,usetab,newtab
" set stal=2
"catch
"entry
"Backspace for dummies.
set backspace=indent,eol,start
"set whichwrap+=<,>,h,l
set whichwrap=b,s,h,l,<,>,[,]
set list
set nowrap
set autoindent
set nojoinspaces
set wildmode=longest:full
set wildignore=*.o,*~,*.pyc
"set cmdheight=2
set noerrorbells
set novisualbell
set t_vb=
set tm=500
"set nu
set mouse=a
set mousehide
set encoding=utf-8
scriptencoding utf-8
"highlight ExtraWhitespace ctermbg=darked guibg=650C0C
"autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
"autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
"autocmd InsertLeave * match ExtraWhitespace /\s\+$/
"autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
let g:powerline_loaded = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
""""""""""""""""""""""""""
" Backup "
""""""""""""""""""""""""""
set nobackup
set nowb
set noswapfile
" Delete trailing whitespaces
fun! DeleteTrailingWS()
exe "normal mz"
%s/\s\+$//ge
exe "normal`z"
endfunc
"Delete trailing whitespaces each time you save a document pyton
"autocmd BufWrite *.py :call DeleteTrailingWS()
"Delete trailing whitespaces each time you save a file SH
"autocmd BufWrite *.sh :call DeleteTrailingWS()
"All files
autocmd BufWrite * :call DeleteTrailingWS()
"""""""""""""""""""""""""
" Folding "
"""""""""""""""""""""""""
set foldenable
set foldlevelstart=10
set foldnestmax=10
nnoremap <space> za
set foldmethod=indent