-
Notifications
You must be signed in to change notification settings - Fork 3
/
.vimrc
36 lines (28 loc) · 931 Bytes
/
.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
set hlsearch
set ts=4 sw=4 sts=4 et ai
filetype plugin on
"- Use the UTF-8 encoding
set encoding=utf-8
set fileencoding=utf-8
"- Colorize OpenFOAM case files
let g:foam256_use_custom_colors=1
set t_Co=256
"- Return to last edit position when opening files
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal! g'\"" |
\ endif
"- Highlight long lines
autocmd FileType python,c,cpp,sh set colorcolumn=100
"- Turn off autoindent
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
"- Highlight trailing whitespaces
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
"- Highlight tabs
set list
set listchars=tab:▸\ ,