-
Notifications
You must be signed in to change notification settings - Fork 4
/
vimrc
191 lines (150 loc) · 3.67 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
" Vladimiroff's vimfile
"
" Forget about Vi compatibility.
set nocompatible
" Workaround of E837.
if has('python3')
endif
" Load plugins with vim-plug
runtime! plugs.vim
" Enable filetypes
filetype on
filetype plugin on
filetype plugin indent on
syntax on
" 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).
" Also don't do it when the mark is in the first line, that is the default
" position when opening a file.
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
" Close preview split when completion is done
if exists('#CompleteDone')
autocmd CompleteDone <buffer> pclose
endif
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
" Switch between buffers without saving
set hidden
" Colors
set t_Co=256
set background=dark
set termguicolors
let g:nord_italic = 1
let g:nord_italic_comments = 1
let g:nord_underline = 1
let g:nord_uniform_diff_background = 1
let g:lightline =
\ {
\ 'colorscheme': 'nord',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'absolutepath', 'modified' ] ],
\ }
\ }
colorscheme nord
set noshowmode
set number
" Mouse support
set mouse=a
if !has('nvim')
if has("mouse_sgr")
set ttymouse=sgr
else
set ttymouse=xterm2
endif
endif
" Send more characters for faster re-draws
set ttyfast
" Status line and fillchars
set fillchars=stl:-,stlnc:-,vert:│,fold:\ ,diff:-
set statusline=%F%m%r%h%w\ %y\ \ %=[%04l\|%04v][%p%%][%L\ lines]%{fugitive#statusline()}
set laststatus=2
" Disable swap files
set noswapfile
" Backups
if !exists('$SUDO_USER')
set backup
set backupdir=~/.vim/backups
endif
" Indent stuff
set smartindent
set autoindent
" Disable line wrapping
set nowrap
" Command line history
set history=50
" Show the cursor position all the time
set ruler
" Display incomplete commands
set showcmd
" Search options
set incsearch
set hlsearch
" Matching braces
set showmatch
set matchtime=3
" Default encoding
set encoding=utf-8
" Fancy title, based on opened file
" set title
" We all know, what is that for
set nopaste
" Whitespace
set list
set listchars=tab:→·,trail:·,extends:#,nbsp:·
" Command-line
set cmdheight=1
set wildmenu
set wildmode=list:longest,full
set wildignore+=*.o,*.obj,.git,*pyc,*pyo,*.pid,*.sock
" Clipbaord
if has('nvim')
set clipboard+=unnamedplus
elseif has('unnamedplus')
set clipboard=unnamedplus
else
set clipboard=unnamed
endif
" Completion options
set completefunc=syntaxcomplete#Complete
set completeopt=longest,menuone
" Don't leave spaces between joined lines
set nojoinspaces
" Use tags from .tags file
set tags+=.tags
" NeoVim handles <ESC> keys as <M+key>
if has('nvim')
set ttimeout
set ttimeoutlen=0
endif
" Persistent undo
if has("persistent_undo") && !exists('$SUDO_USER')
set undodir=~/.vim/undodir/
set undofile
endif
" Don't persist viewdir
set viewdir=/tmp/vimviewdir
" Don't check for capital letters at start of sentence
if has ('syntax')
set spellcapcheck=
endif
" Allow cursor to move where there is no text in visual block mode
if has('virtualedit')
set virtualedit=block
endif
" Leader
let mapleader = "\<space>"
" Folding
set foldenable
set foldlevel=1
set foldnestmax=1
set foldmethod=indent
" Cyrillic langmap
set langmap=
\АA,БB,ЦC,ДD,ЕE,ФF,ГG,ХH,ИI,ЙJ,КK,ЛL,МM,НN,ОO,ПP,ЯQ,РR,СS,ТT,УU,ЖV,ВW,ѝX,ЪY,ЗZ,Ш{,Щ},
\аa,бb,цc,дd,еe,фf,гg,хh,иi,йj,кk,лl,мm,нn,оo,пp,яq,рr,сs,тt,уu,жv,вw,ьx,ъy,зz,ш[,щ],
\Ч~,\ч`,
runtime! startup/*.vim