-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
111 lines (89 loc) · 3.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
" ____ _ _
"| _ \ __ _| | |___ ___
"| |_) / _` | | / __|/ _ \
"| _ < (_| | | \__ \ (_) |
"|_| \_\__,_|_|_|___/\___/
"
" Encoding
set encoding=utf-8
" Syntax
syntax enable
set ruler
set hidden
set number
" Tab
set smartindent
set tabstop=2
set softtabstop=2
set expandtab
set shiftwidth=2
" display indentation guides
set list listchars=tab:❘·,trail:·,extends:»,precedes:«,nbsp:×
" convert spaces to tabs when reading file
autocmd! bufreadpost * set noexpandtab | retab! 2
" convert tabs to spaces before writing file
autocmd! bufwritepre * set expandtab | retab! 2
" convert spaces to tabs after writing file (to show guides again)
autocmd! bufwritepost * set noexpandtab | retab! 2
let &colorcolumn="80"
" Mouse enable
set mouse=a
" Cursorline enable
set cursorline
highlight CursorLine gui=underline cterm=underline
" Save change
set autowrite
set backupdir=~/.tmp
" Highlight matching search
set hlsearch
set wildmenu
set showcmd
set showmatch
set laststatus=2
set matchpairs+=<:>
" status bar colors
au InsertEnter * hi statusline guifg=black guibg=#d7afff ctermfg=black ctermbg=magenta
au InsertLeave * hi statusline guifg=black guibg=#8fbfdc ctermfg=black ctermbg=cyan
hi statusline guifg=black guibg=#8fbfdc ctermfg=black ctermbg=cyan
" Status line
" default: set statusline=%f\ %h%w%m%r\ %=%(%l,%c%V\ %=\ %P%)
" Status Line Custom
let g:currentmode={
\ 'n' : 'Normal',
\ 'no' : 'Normal·Operator Pending',
\ 'v' : 'Visual',
\ 'V' : 'V·Line',
\ '^V' : 'V·Block',
\ 's' : 'Select',
\ 'S' : 'S·Line',
\ '^S' : 'S·Block',
\ 'i' : 'Insert',
\ 'R' : 'Replace',
\ 'Rv' : 'V·Replace',
\ 'c' : 'Command',
\ 'cv' : 'Vim Ex',
\ 'ce' : 'Ex',
\ 'r' : 'Prompt',
\ 'rm' : 'More',
\ 'r?' : 'Confirm',
\ '!' : 'Shell',
\ 't' : 'Terminal'
\}
set noshowmode
set statusline=
set statusline+=%0*\ %n\ " Buffer number
set statusline+=%1*\ %<%F%m%r%h%w\ " File path, modified, readonly, helpfile, preview
set statusline+=%3*│ " Separator
set statusline+=%2*\ %Y\ " FileType
set statusline+=%3*│ " Separator
set statusline+=%2*\ %{''.(&fenc!=''?&fenc:&enc).''} " Encoding
set statusline+=\ (%{&ff}) " FileFormat (dos/unix..)
set statusline+=%= " Right Side
set statusline+=%2*\ col:\ %02v\ " Colomn number
set statusline+=%3*│ " Separator
set statusline+=%1*\ ln:\ %02l/%L\ (%3p%%)\ " Line number / total lines, percentage of document
set statusline+=%0*\ %{toupper(g:currentmode[mode()])}\ " The current mode
hi User1 ctermfg=007 ctermbg=239 guibg=#4e4e4e guifg=#adadad
hi User2 ctermfg=007 ctermbg=236 guibg=#303030 guifg=#adadad
hi User3 ctermfg=236 ctermbg=236 guibg=#303030 guifg=#303030
hi User4 ctermfg=239 ctermbg=239 guibg=#4e4e4e guifg=#4e4e4e