forked from meinside/rpi-configs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
225 lines (192 loc) · 6.17 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
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
" meinside's .vimrc file,
" created by [email protected],
"
" last update: 2017.10.27.
"
" XXX - change default text editor:
" $ sudo update-alternatives --config editor
"
" XXX - setup for nvim:
" $ sudo apt-get install python3-pip
" $ sudo pip3 install --upgrade neovim
" $ mkdir -p ~/.config/nvim
" $ ln -sf ~/.vimrc ~/.config/nvim/init.vim
""""""""""""""""""""""""""""""""""""
" settings for vundle (https://github.com/VundleVim/Vundle.vim)
let vundle_readme=expand('~/.vim/bundle/Vundle.vim/README.md')
let vundle_fresh=0
if !filereadable(vundle_readme)
echo "Installing Vundle..."
echo ""
silent execute "!git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim"
let vundle_fresh=1
endif
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
""""""""
" vundle packages
" Useful plugins
Plugin 'matchit.zip'
Plugin 'ragtag.vim' " TAG + <ctrl-x> + @, !, #, $, /, <space>, <cr>, ...
Plugin 'surround.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'vim-airline/vim-airline'
let g:airline#extensions#ale#enabled = 1
Plugin 'docunext/closetag.vim'
" For autocompletion
if has('nvim')
Plugin 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } " XXX - python3 needed ($ sudo pip3 install --upgrade neovim)
let g:deoplete#enable_at_startup = 1
endif
" For source file browsing, XXX: ctags and vim-nox is needed! ($ sudo apt-get install vim-nox ctags)
Plugin 'majutsushi/tagbar'
nmap <F8> :TagbarToggle<CR>
" For uploading Gist
Plugin 'mattn/webapi-vim'
Plugin 'mattn/gist-vim'
" For Ruby
Plugin 'vim-ruby/vim-ruby'
Plugin 'tpope/vim-endwise'
" For Go
Plugin 'fatih/vim-go'
" For Haskell
if has('nvim')
Plugin 'neovimhaskell/haskell-vim'
endif
Plugin 'itchyny/vim-haskell-indent'
" XXX - do not load following plugins on machines with low performance:
" (touch '~/.vimrc.lowperf' for it)
let lowperf=expand('~/.vimrc.lowperf')
if !filereadable(lowperf)
" For syntax checking
Plugin 'vim-syntastic/syntastic'
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 0
let g:syntastic_check_on_wq = 0
" For gitgutter
Plugin 'airblade/vim-gitgutter' " [c, ]c for prev/next hunk
let g:gitgutter_highlight_lines = 1
let g:gitgutter_realtime = 0
let g:gitgutter_eager = 0
" For Go
if has('nvim')
Plugin 'zchee/deoplete-go', { 'do': 'make'} " For autocompletion
endif
let g:go_fmt_command = "goimports" " auto import dependencies
let g:go_highlight_build_constraints = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_fields = 1
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_operators = 1
let g:go_highlight_structs = 1
let g:go_highlight_types = 1
let g:go_auto_sameids = 1
let g:go_auto_type_info = 1
let g:syntastic_go_checkers = ['go'] " XXX: 'golint' is too slow, use :GoLint manually.
let g:syntastic_aggregate_errors = 1
" For Python
if has('nvim')
Plugin 'zchee/deoplete-jedi' " For autocompletion
endif
endif
"
""""""""
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" install bundles
if vundle_fresh == 1
echo "Installing bundles..."
echo ""
:BundleInstall
endif
"
""""""""""""""""""""""""""""""""""""
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
set nobackup " do not keep a backup file, use versions instead
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set cindent
set ai
set smartindent
set nu
set ts=4
set sw=4
set sts=4
set fencs=ucs-bom,utf-8,korea
set termencoding=utf-8
set wildmenu " visual autocomplete for command menu
set showbreak=↳
set breakindent
" for color schemes
set t_Co=256
if exists('$TMUX')
set termguicolors " not working in terminals
endif
colo elflord
" file browser (netrw)
" :Ex, :Sex, :Vex
let g:netrw_liststyle = 3
let g:netrw_winsize = 30
" <F2> for vertical file browser
nmap <F2> :Vex <CR>
" Don't use Ex mode, use Q for formatting
map Q gq
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx
au!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
" For html/javascript/css
autocmd FileType htm,html,js,json set ai sw=2 ts=2 sts=2 et
autocmd FileType css,scss set ai sw=2 ts=2 sts=2 et
" For programming languages
autocmd FileType go set ai sw=4 ts=4 sts=4 noet " Golang
autocmd FileType ruby,eruby,yaml set ai sw=2 ts=2 sts=2 et " Ruby
autocmd FileType python set ai sw=2 ts=2 sts=2 et " Python
autocmd FileType haskell set ai sw=2 ts=2 sts=2 et " Haskell
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
augroup END
else
set autoindent " always set autoindenting on
endif " has("autocmd")