-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
63 lines (54 loc) · 2.01 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
set expandtab tabstop=4 softtabstop=4 shiftwidth=4 smarttab
set backspace=indent,eol,start
set cursorline cursorcolumn
set gp=git\ grep\ -n
set hidden ignorecase
set incsearch hlsearch
set laststatus=2
set list listchars=tab:»\ ,nbsp:·,trail:·
set nocompatible
set noswapfile nowritebackup
set number
set path+=**
set ruler
set scrolloff=11
set showcmd
set smartcase
set splitbelow splitright
set termguicolors
set wildignore=*.o,*.tgz,*.pyc
set wildmenu
syntax on
filetype plugin indent on
let c_comment_strings=1 " Highlighting strings inside C comments.
let g:netrw_banner=0 " disable annoying banner
let g:netrw_liststyle=3 " tree view
let g:netrw_list_hide=netrw_gitignore#Hide()
let g:netrw_fastbrowse = 0 " close NetRW after opening a file
" Clear highlights with ESC
map <silent> <esc> :noh<CR>
" When editing a file, always jump to the last known cursor position.
augroup vimStartup
autocmd!
autocmd BufReadPost *
\ let line = line("'\"")
\ | if line >= 1 && line <= line("$") && &filetype !~# 'commit'
\ && index(['xxd', 'gitrebase'], &filetype) == -1
\ | execute "normal! g`\""
\ | endif
augroup END
if !isdirectory($HOME."/.vim/undodir")
call mkdir($HOME."/.vim/undodir", "p", 0700)
endif
set undodir=~/.vim/undodir
set undofile
autocmd BufWritePre * silent! %s/\s\+$//e " Remove trailing whitespace
augroup yamlcmds
autocmd BufRead,BufNewFile */templates/*.y*ml,*/templates/*.tpl set filetype=helm " Detect Helm templates as helm filetype
autocmd FileType helm setlocal syntax=yaml " Define syntax and indentation for helm filetype
autocmd FileType yaml setlocal tabstop=2 softtabstop=2 shiftwidth=2
autocmd BufWritePre *.yml,*.yaml,*.tpl silent! %s/^\(\s*\)#\(\S\)/\1# \2/g " Insert space after first '#' sign in the line
autocmd BufWritePre *.yml,*.yaml,*.tpl silent! %s/^\(\s*\)-\(\S\)/\1- \2/g " Insert space after first dash in the line
augroup END
packadd! matchit
silent! colorscheme habamax