-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
56 lines (45 loc) · 1.2 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
set t_Co=256"
set ts=4
set sw=4
set sts=4
set expandtab
set autoindent
set hlsearch
set smartcase
set incsearch
set ignorecase
set cindent shiftwidth=2
set wildmode=list:longest
set encoding=utf8
set fileencoding=utf8
" always show ^M in DOS files
set fileformats=unix
syntax on
set backspace=indent,eol,start
set laststatus=2
set ruler
set showcmd
set scrolloff=1
set sidescrolloff=5
set cursorline
"Let quit insert mode with "kj"
inoremap kj <Esc>
"when a file called .vimrc is written, we load ~/.vimrc
autocmd! BufWritePost .vimrc source ~/.vimrc
"yaml support
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab foldmethod=indent
au BufNewFile,BufRead *.yaml,*.yml so ~/.vim/syntax/yaml.vim
" Highlight redundant whitespaces and tabs.
highlight RedundantSpaces ctermbg=red guibg=red
match RedundantSpaces /\s\+$\| \+\ze\t\|\t/
function RemoveTrailingSpaces()
%s/\s\+$//
endfunction
" pulgin "rainbow": https://github.com/luochen1990/rainbow
let g:rainbow_active = 1 "0 if you want to enable it later via :RainbowToggle
" ensure arrow-keys are properly interpreted
" (this implements the fix from https://vi.stackexchange.com/a/14446/43994 )
set <up>=OA
set <down>=OB
set <left>=OD
set <right>=OC