Ivan Berezovskiy | c46e7c0 | 2018-10-29 18:22:09 +0400 | [diff] [blame] | 1 | syntax on |
| 2 | set t_Co=256 |
| 3 | set background=dark |
| 4 | """ https://www.vim.org/scripts/script.php?script_id=945 |
| 5 | au BufRead,BufNewFile *.groovy setf groovy |
| 6 | if did_filetype() |
| 7 | finish |
| 8 | endif |
| 9 | if getline(1) =~ '^#!.*[/\\]groovy\>' |
| 10 | setf groovy |
| 11 | endif |
| 12 | """ https://raw.githubusercontent.com/Glench/Vim-Jinja2-Syntax/master/syntax/jinja.vim |
| 13 | au BufRead,BufNewFile *.jinja setfiletype jinja |
| 14 | au BufRead,BufNewFile *.sls setfiletype jinja |
| 15 | """ |
| 16 | au BufRead,BufNewFile *.lio setfiletype yaml |
| 17 | """ syntaxer |
| 18 | set ignorecase |
| 19 | set hlsearch |
| 20 | set nocompatible |
| 21 | set backspace=2 |
| 22 | inoremap ^? ^H |
| 23 | set ruler |
| 24 | set showcmd |
| 25 | set gdefault |
| 26 | set nobackup |
| 27 | set nodigraph |
| 28 | set incsearch |
| 29 | set nojoinspaces |
| 30 | set laststatus=2 |
| 31 | set tabstop=2 |
| 32 | set bg=light |
| 33 | set bs=2 |
| 34 | |
| 35 | function! TrimWhiteSpace() |
| 36 | %s/\s\+$//e |
| 37 | endfunction |
| 38 | highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen |
| 39 | match ExtraWhitespace /\s\+$/ |
| 40 | match ExtraWhitespace /\s\+\%#\@<!$/ |
| 41 | match ExtraWhitespace /\s\+$/ |
| 42 | autocmd ColorScheme * highlight WhiteSpaces gui=undercurl guifg=LightGray | match WhiteSpaces / \+/ |
| 43 | |
| 44 | set viminfo='10,\"100,:20,%,n~/.viminfo |
| 45 | |
| 46 | " when we reload, tell vim to restore the cursor to the saved position |
| 47 | augroup 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 |
| 70 | augroup END |
| 71 | |