-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc.settings
238 lines (183 loc) · 6.65 KB
/
.vimrc.settings
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
let s:running_windows = has("win16") || has("win32") || has("win64")
let s:gui_running = has('gui_running')
" file type detection
filetype on
" special indentation rules for file type
filetype indent on
" auto-completion rules for file type
filetype plugin on
syntax on
" OS Dependant things
if s:running_windows
set wildignore+=*\\.git\\*,*\\.hg\\*,*\\.svn\\*
else
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*
endif
if s:gui_running
set guifont=FiraCode-Regular:h13
endif
let g:airline_powerline_fonts = 1
let g:airline_theme = 'codedark'
runtime macros/matchit.vim
set nobackup
set nowritebackup
set noswapfile
colorscheme gruvbox
set background=dark
set fenc=utf-8 " UTF-8
set encoding=utf-8
set cmdheight=2
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
" delays and poor user experience.
set updatetime=300
" Don't pass messages to |ins-completion-menu|.
set shortmess+=c
" Always show the signcolumn, otherwise it would shift the text each time
" diagnostics appear/become resolved.
if has("nvim-0.5.0") || has("patch-8.1.1564")
" Recently vim can merge signcolumn and number column into one
set signcolumn=number
else
set signcolumn=yes
endif
" Hide the mouse pointer while typing
set mousehide
set mousemodel=popup
" Set to auto read when a file is changed from the outside
set autoread
set splitbelow
set splitright
set formatoptions=tcqor
set cpoptions=aABceFsmq
" |||||||||
" ||||||||+-- When joining lines, leave the cursor between joined lines
" |||||||+-- When a new match is created (showmatch) pause for .5
" ||||||+-- Set buffer options when entering the buffer
" |||||+-- :write command updates current file name automatically add <CR> to the last line when using :@r
" |||+-- Searching continues at the end of the match at the cursor position
" ||+-- A backslash has no special meaning in mappings
" |+-- :write updates alternative file name
" +-- :read updates alternative file name
set whichwrap=b,s,h,l,<,>,~,[,] " everything wraps
" | | | | | | | | |
" | | | | | | | | +-- "]" Insert and Replace
" | | | | | | | +-- "[" Insert and Replace
" | | | | | | +-- "~" Normal
" | | | | | +-- <Right> Normal and Visual
" | | | | +-- <Left> Normal and Visual
" | | | +-- "l" Normal and Visual (not recommended)
" | | +-- "h" Normal and Visual (not recommended)
" | +-- <Space> Normal and Visual
" +-- <BS> Normal and Visual
set statusline=%F%m%r%h%w[%L][%{&ff}]%y[%p%%][%04l,%04v]
" | | | | | | | | | | |
" | | | | | | | | | | + current column
" | | | | | | | | | +-- current line
" | | | | | | | | +-- current % into file
" | | | | | | | +-- current syntax in square brackets
" | | | | | | +-- current fileformat
" | | | | | +-- number of lines
" | | | | +-- preview flag in square brackets
" | | | +-- help flag in square brackets
" | | +-- readonly flag in square brackets
" | +-- rodified flag in square brackets
" +-- full path to file in the buffer
" Recognise lists like 1), 1., a), a., and so on
" Note that | need to be escaped AND preceeded by a literal backslash
set formatlistpat=^\\s*\\(\\d\\\|[-*]\\)\\+[\\]:.)}\\t\ ]\\s* "and bullets, too
" Use incremental searches
set incsearch
" highlight search terms
set hls
set autoread
set clipboard+=unnamed
set history=10000 " big old history
set fileformats=unix,dos,mac " support all three, in this order
set laststatus=2 " always show the status line
set lazyredraw " do not redraw while running macros
set linespace=0 " don't insert any extra pixel lines betweens rows
set list " we do want to show tabs and tailing to ensure we get them out of my files
set listchars=tab:>-,trail:- " show tabs and trailing
set nostartofline " leave my cursor where it was
" Better Completion
set complete=.,w,b,u,t
set completeopt=longest,menuone,preview
set nowrap " do not wrap line
set shiftround " when at 3 spaces, and I hit > ... go to 4, not 5
" Folding
set foldenable " Turn on folding
set foldmethod=indent " Fold on the indent
set foldmarker={,} " use simple markers
set foldlevel=100 " Don't autofold anything (but I can still fold manually)
set foldnestmax=1 " I only like to fold outer functions
set foldopen=block,hor,mark,percent,quickfix,tag " what movements open folds
" Show line numbers
set number
set numberwidth=5 " We are good up to 99999 lines
"default indent settings
set shiftwidth=4
set softtabstop=4
set tabstop=4
" Auto expand tabs to spaces
set expandtab
" Copy the indentation from the previous line, when starting a new line
set autoindent
" Automatically inserts one extra level of indentation in some cases (for example, after { )
set smartindent
" Be smart when using tabs ;)
set smarttab
" 1000 undos
set undolevels=1000
" Jump 5 lines when running out of the screen
set scrolljump=5
" Indicate jump out of the screen when 7 lines before end of the screen
set scrolloff=7
" Repair wired terminal/vim settings
set backspace=indent,eol,start
" CaseInsensitive searches
set ignorecase
set infercase " case inferred by default
set showcmd " show the command being typed
" Always show command or insert mode
set showmode
" Show line and column information
set ruler
" Show matching brackets
set showmatch
" Make sure that unsaved buffers that are to be put in the background are
" allowed to go in there (ie. the "must save first" error doesn't come up)
set hidden " you can change buffers without saving
set history=1000
set smartcase
" For regular expressions turn magic on
set magic
" Automatically read a file that has changed on disk
set autoread
" No annoying sound on errors
set noerrorbells
set visualbell
set t_vb=
set tm=500
set title
"tf: improves redrawing for newer computers
set ttyfast
" Time out on key codes but not mappings.
" Basically this makes terminal Vim work sanely.
set notimeout
set ttimeout
set ttimeoutlen=10
set timeoutlen=1200 " A little bit more time for macros
" Make completion more like bash
set wildmode=longest,list,full
set wildmenu
" Ignore compiled files
set wildignore=*.pyo,*.pyc,*.dll,*.o,*.obj,*.bak,*.exe,*.pyc,*.jpg,*.gif,*.png " ignore these
set wildignore+=tags
set wildmode=list:longest " turn on wild mode huge list
set t_Co=256
" When completing by tag, show the whole tag, not just the function name
set showfulltag
set cul
hi CursorLine term=none cterm=none ctermbg=16
set dictionary=/usr/share/dict/words
set shortmess=a