-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
63 lines (56 loc) · 2.02 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
filetype plugin indent on
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
syntax on
set number
set laststatus=2
" status bar function to get git branch
function! GitBranch()
return system("git rev-parse --abbrev-ref HEAD 2>/dev/null | tr -d '\n'")
endfunction
function! StatuslineGit()
let l:branchname = GitBranch()
return strlen(l:branchname) > 0?' '.l:branchname.' │':''
endfunction
" 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 laststatus=2
set noshowmode
set statusline=
set statusline+=%{StatuslineGit()} " Display GIT branch
set statusline+=%3*\ %n\ " Buffer number
set statusline+=%0*\ %<%F%m%r%h%w\ " File path, modified, readonly, helpfile, preview
set statusline+=%0*│ " Separator
set statusline+=%0*\ %Y\ " FileType
set statusline+=%0*│ " Separator
set statusline+=%0*\ %{''.(&fenc!=''?&fenc:&enc).''} " Encoding
set statusline+=\ (%{&ff}) " FileFormat (dos/unix..)
set statusline+=%= " Right Side
set statusline+=%0*\ col:\ %02v\ " Colomn number
set statusline+=%0*│ " Separator
set statusline+=%0*\ ln:\ %02l/%L\ (%3p%%)\ " Line number / total lines, percentage of document
set statusline+=%0*\ %{toupper(g:currentmode[mode()])}\ " The current mode