blob: 3ccc3191448f319358ff5694ae33e12c4ca17cd9 [file] [log] [blame]
Ivan Berezovskiyc46e7c02018-10-29 18:22:09 +04001syntax 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
34
35function! TrimWhiteSpace()
36 %s/\s\+$//e
37endfunction
38highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen
39match ExtraWhitespace /\s\+$/
40match ExtraWhitespace /\s\+\%#\@<!$/
41match ExtraWhitespace /\s\+$/
42autocmd ColorScheme * highlight WhiteSpaces gui=undercurl guifg=LightGray | match WhiteSpaces / \+/
43
44set viminfo='10,\"100,:20,%,n~/.viminfo
45
46" when we reload, tell vim to restore the cursor to the saved position
47augroup JumpCursorOnEdit
48 au!
49 autocmd BufReadPost *
50 \ if expand("<afile>:p:h") !=? $TEMP |
51 \ if line("'\"") > 1 && line("'\"") <= line("$") |
52 \ let JumpCursorOnEdit_foo = line("'\"") |
53 \ let b:doopenfold = 1 |
54 \ if (foldlevel(JumpCursorOnEdit_foo) > foldlevel(JumpCursorOnEdit_foo - 1)) |
55 \ let JumpCursorOnEdit_foo = JumpCursorOnEdit_foo - 1 |
56 \ let b:doopenfold = 2 |
57 \ endif |
58 \ exe JumpCursorOnEdit_foo |
59 \ endif |
60 \ endif
61 " Need to postpone using "zv" until after reading the modelines.
62 autocmd BufWinEnter *
63 \ if exists("b:doopenfold") |
64 \ exe "normal zv" |
65 \ if(b:doopenfold > 1) |
66 \ exe "+".1 |
67 \ endif |
68 \ unlet b:doopenfold |
69 \ endif
70augroup END
71