-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc_ubuntu
157 lines (123 loc) · 4.41 KB
/
.vimrc_ubuntu
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
" Automatically source vimrc on change
autocmd! bufwritepost *vimrc source %
set shell=/bin/bash
set nocompatible " be iMproved, required
filetype off " required
" automatically download vim-plug
" Set GIT_SSL_NO_VERIFY to true, and use --insecure for curl to handle proxy
let $GIT_SSL_NO_VERIFY = 'true'
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --insecure --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
Plug 'posva/vim-vue'
Plug 'pangloss/vim-javascript'
Plug 'Valloric/YouCompleteMe', { 'do': 'python3 install.py --gocode-completer --tern-completer ' }
Plug 'ternjs/tern_for_vim'
Plug 'scrooloose/nerdcommenter'
Plug 'tpope/vim-cucumber'
Plug 'airblade/vim-gitgutter'
Plug 'fatih/vim-go'
call plug#end()
" general fold rules
set foldlevel=4 foldcolumn=0 foldnestmax=6 foldmethod=indent
" general indent rules
set ts=2 sw=2 sts=0 expandtab
" special indent rules
augroup indentation_folding
au!
au Filetype javascript setlocal ts=2 sw=2 sts=0 expandtab foldmethod=syntax
au Filetype vue setlocal ts=2 sw=2 sts=0 expandtab foldmethod=syntax
au Filetype html setlocal ts=2 sw=2 sts=0 expandtab foldmethod=syntax
au Filetype css setlocal ts=2 sw=2 sts=0 noexpandtab foldmethod=syntax
au BufRead,BufNewFile *.go setlocal noet ts=4 sw=4 foldnestmax=3 foldlevel=4
\ foldmethod=syntax
au BufRead,BufNewFile *.tex setlocal ts=2 sw=2 foldnestmax=3 foldlevel=4
\ foldmethod=indent expandtab
au BufNewFile,BufRead *.yaml,*.yml setlocal foldmethod=indent ts=2 sw=2 sts=0
\ expandtab foldnestmax=1
au BufNewFile,BufRead *.py setlocal tabstop=4 softtabstop=4 shiftwidth=4
\ textwidth=79 expandtab autoindent foldmethod=indent fileformat=unix
" Don't screw up folds when inserting text that might affect them, until
" leaving insert mode. Foldmethod is local to the window.
autocmd InsertEnter * let w:last_fdm=&foldmethod | setlocal foldmethod=manual
autocmd InsertLeave * let &l:foldmethod=w:last_fdm
augroup END
" COLORS
" first set general color scheme
colorscheme peachpuff
" highlight 'bad' whitespace (at end of line)
highlight BadWhitespace ctermbg=red
augroup highlighting
au!
au BufRead,BufNewFile * match BadWhitespace /\s\+$/
augroup END
" set colors for folded lines
" ssh onto machine, using putty in windows config
map <F6> :highlight Folded ctermfg=2 ctermbg=lightgrey<CR>
" native machine config
map <F7> :highlight Folded ctermfg=white ctermbg=0<CR>
highlight Folded ctermfg=white ctermbg=0
" color scheme for yaml
augroup colors
au!
au BufNewFile,BufRead *.yaml,*.yml so ~/.vim/yaml.vim
augroup END
" MISCELLANEOUS
let g:go_fmt_experimental=1 " fixes closing folds on write in go
let python_highlight_all=1
" disable arrow keys
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
" show ruler
set ruler
" set text width to 80
set tw=79
" use space for toggling fold status
nnoremap <Space> za
" set split directions
set splitbelow
set splitright
" let backspace delete autoindentation and across lines
set backspace=eol,indent,start
set encoding=utf-8
" disable visual bell
set vb
set t_vb=
" Better command-line completion
set wildmenu
" Complete like most shells – longest substring first, then iterate through
" full matches
set wildmode=longest:full,full
" Show partial commands in the last line of the screen
set showcmd
" Do not highlight searches by default
set nohlsearch
" Backups
" don't keep swp files
set noswapfile
"------------------------------------------------------------
" Usability options
"
" These are options that users frequently set in their .vimrc. Some of them
" change Vim's behaviour in ways which deviate from the true Vi way, but
" which are considered to add usability. Which, if any, of these options to
" use is very much a personal preference, but they are harmless.
" Use case insensitive search, except when using capital letters
set ignorecase
set smartcase
" Replace all matches on the line, not just the first,
" by default, without requiring …/g
set gdefault
" Incremental search
set incsearch
" Set the search scan to wrap around the file
set wrapscan
" Always display the status line, even if only one window is displayed
set laststatus=2
" Use <F11> to toggle between 'paste' and 'nopaste'
set pastetoggle=<F11>