blob: bd66f6214387e42f7a666bf109bdf600b7abfedd [file] [log] [blame]
azvyagintsev5a2d6ec2018-07-19 21:25:25 +03001syntax on
2set t_Co=256
3set background=dark
4""" https://www.vim.org/scripts/script.php?script_id=945
5au BufRead,BufNewFile *.groovy setf groovy
6if did_filetype()
7 finish
8endif
9if getline(1) =~ '^#!.*[/\\]groovy\>'
10 setf groovy
11endif
12""" https://raw.githubusercontent.com/Glench/Vim-Jinja2-Syntax/master/syntax/jinja.vim
13au BufRead,BufNewFile *.jinja setfiletype jinja
14au BufRead,BufNewFile *.sls setfiletype jinja
15"""
16au BufRead,BufNewFile *.lio setfiletype yaml
17""" syntaxer
18set ignorecase
19set hlsearch
20set nocompatible
21set backspace=2
22inoremap ^? ^H
23set ruler
24set showcmd
25set gdefault
26set nobackup
27set nodigraph
28set incsearch
29set nojoinspaces
30set laststatus=2
31set tabstop=2
32set bg=light
33set bs=2
34set colorcolumn=80
35
36function! TrimWhiteSpace()
37 %s/\s\+$//e
38endfunction
39highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen
40match ExtraWhitespace /\s\+$/
41match ExtraWhitespace /\s\+\%#\@<!$/
42match ExtraWhitespace /\s\+$/
43autocmd ColorScheme * highlight WhiteSpaces gui=undercurl guifg=LightGray | match WhiteSpaces / \+/
44
45set viminfo='10,\"100,:20,%,n~/.viminfo
46
47" when we reload, tell vim to restore the cursor to the saved position
48augroup JumpCursorOnEdit
49 au!
50 autocmd BufReadPost *
51 \ if expand("<afile>:p:h") !=? $TEMP |
52 \ if line("'\"") > 1 && line("'\"") <= line("$") |
53 \ let JumpCursorOnEdit_foo = line("'\"") |
54 \ let b:doopenfold = 1 |
55 \ if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo - 1)) |
56 \ let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo - 1 |
57 \ let b:doopenfold = 2 |
58 \ endif |
59 \ exe JumpCursorOnEdit_foo |
60 \ endif |
61 \ endif
62 " Need to postpone using "zv" until after reading the modelines.
63 autocmd BufWinEnter *
64 \ if exists("b:doopenfold") |
65 \ exe "normal zv" |
66 \ if(b:doopenfold > 1) |
67 \ exe "+".1 |
68 \ endif |
69 \ unlet b:doopenfold |
70 \ endif
71augroup END
72