-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
71 lines (56 loc) · 2.1 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
64
65
66
67
68
69
70
71
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
syntax on
" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark
" Uncomment the following to have Vim jump to the last position when
" reopening a file
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
filetype plugin indent on
" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
set showcmd " Show (partial) command in status line.
set showmatch " Show matching brackets.
"set ignorecase " Do case insensitive matching
"set smartcase " Do smart case matching
set incsearch " Incremental search
"set autowrite " Automatically save before commands like :next and :make
"set hidden " Hide buffers when they are abandoned
set mouse=a " Enable mouse usage (all modes)
" Use system clipboard
" needs vim compiled with 'clipboard' feature, e.g. in vim-gtk
if has("clipboard")
set clipboard=unnamedplus
endif
" Sudo call from vim
cmap w!! w !sudo tee > /dev/null %
" Show line numbers
set nu
set relativenumber
" Tab handling
set expandtab ts=4 shiftwidth=4
" Highlight current line
set cursorline
highlight CursorLine cterm=none ctermbg=234
" Highlight line max length
highlight ColorColumn ctermbg=233
au BufRead,BufNewFile *.py set colorcolumn=89
" Highlight unnecessary whitespace
" au BufRead,BufNewFile *.py match BadWhitespace /\s\+$/
highlight ExtraWhitespace ctermbg=237
au BufRead,BufNewFile *.py match ExtraWhitespace /\s\+$/
" Auto-fold files according to syntax (maximum depth 1)
set foldmethod=indent
set foldnestmax=1
nnoremap <space> za
vnoremap <space> zf
" Open all folds on new buffer
au BufWinEnter * normal zR
" Highlight folds
highlight Folded cterm=none ctermbg=235 ctermfg=129
" Auto-save and auto-load folds
"au BufWinLeave * mkview
"au BufWinEnter * silent loadview