aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorMax Christian Pohle2018-11-20 23:56:02 +0100
committerMax Christian Pohle2018-11-20 23:56:02 +0100
commit9e36bdf1a060a2ffcb0172eb42e954c475ec3f70 (patch)
tree9ec87e653e13b4fc077789d028e22e9576dabbf1 /plugin
parenta693df562838c3f93fcb6055359091aab834c8e2 (diff)
downloadvim-9e36bdf1a060a2ffcb0172eb42e954c475ec3f70.tar.bz2
vim-9e36bdf1a060a2ffcb0172eb42e954c475ec3f70.zip
Improved Tab/Statusline, e.g. fixed spacing
also added <leader>gh for c files, guess what that does ;)
Diffstat (limited to 'plugin')
-rw-r--r--plugin/statusline.vim62
1 files changed, 32 insertions, 30 deletions
diff --git a/plugin/statusline.vim b/plugin/statusline.vim
index 98fc4a9..7bcc963 100644
--- a/plugin/statusline.vim
+++ b/plugin/statusline.vim
@@ -2,22 +2,26 @@ augroup MAX_FANCYLINE
2 set noshowmode | " mode will be shown twice, in lightline and below, so we want to deactivate one 2 set noshowmode | " mode will be shown twice, in lightline and below, so we want to deactivate one
3 set laststatus=2 | " required by AirLine and Lightline, without status line does not appear until a window split 3 set laststatus=2 | " required by AirLine and Lightline, without status line does not appear until a window split
4 4
5 let g:status_sym_start = '' 5 let g:status_sym_start = ''
6 let g:status_sym_end = '' 6 let g:status_sym_end = ''
7 let g:status_sym_sep_start = '' 7 let g:status_sym_sep_start = ''
8 let g:status_sym_sep_end = '' 8 let g:status_sym_sep_end = ''
9 let g:symbol_branch = '' 9 let g:symbol_branch = ''
10 10
11 if &term == "linux" 11 if &term == "linux"
12 let g:symbol_branch = '' 12 let g:status_sym_start = ''
13 let g:status_sym_end = ''
14 let g:status_sym_sep_start = ''
15 let g:status_sym_sep_end = ''
16 let g:symbol_branch = ''
13 17
14 let g:group_active = "StatusLineTerm" 18 let g:group_active = "StatusLineTerm"
15 let g:group_inactive = "StatusLineTermNC" 19 let g:group_inactive = "StatusLineTermNC"
16 let g:group_tabline = "StatusLineTerm" 20 let g:group_tabline = "StatusLineTerm"
17 else 21 else
18 let g:group_active = "StatusLine" 22 let g:group_active = "StatusLine"
19 let g:group_inactive = "StatusLineNC" 23 let g:group_inactive = "StatusLineNC"
20 let g:group_tabline = "TabLine" 24 let g:group_tabline = "TabLine"
21 endif 25 endif
22 26
23 " this function reverts foreground color and background color of a given 27 " this function reverts foreground color and background color of a given
@@ -55,14 +59,14 @@ augroup MAX_FANCYLINE
55 return '' 59 return ''
56 \ ."%#StatusLineHighlight#" 60 \ ."%#StatusLineHighlight#"
57 \ ."%#".a:highlight_group."#" 61 \ ."%#".a:highlight_group."#"
58 \ ."%(%w%h%q%)".' '.l:mode.' '.g:status_sym_sep_start.' '
59 \ ."%{(argc()>0\ ?\ argidx()+1.':'.argc().' '.g:status_sym_sep_start.' '\ :\ '')}"
60 \ ."%{winbufnr(0).' '.g:status_sym_sep_start}"
61 \ ."%{(&readonly\ ?\ '\ \ 🔒'\ :\ '')}" 62 \ ."%{(&readonly\ ?\ '\ \ 🔒'\ :\ '')}"
62 \ ."%{(&modified\ ?\ '\ \ '.nr2char(0xF0C7).'\ '\ :\ '')\ }" 63 \ ."%{(&modified\ ?\ '\ \ '\ :\ '')}"
63 \ ."%{(haslocaldir() ?\ fnamemodify(getcwd(),\ ':.').' '.nr2char(0xe0b1)\ \:\ '')}\ " 64 \ ."%(%w%h%q%)".' '.l:mode.' '
64 \ ."%{(&buftype\ ==\ \"terminal\"\ ?\ has('nvim')?b:term_title:expand(&titlestring)\ :\ substitute(expand('%:p'),\ '^'.getcwd(-1).'/*',\ '',\ ''))\ }" 65 \ ."%{(argc()>0\ ?\ argidx()+1.':'.argc().' '.g:status_sym_sep_start.' '\ :\ '')}"
65 \ ."%1(%)" 66 \ ."%{(haslocaldir() ?\ g:status_sym_sep_start.' '.fnamemodify(getcwd(),\ ':.').'/ '\ \:\ '')}\ "
67 \ ."%{bufname('%')==''?'':g:status_sym_sep_start.' '.substitute(bufname('%'),\ '^'.getcwd(-1).'/*',\ '',\ '').' '}"
68 \ ."%{(&titlestring\ ?\ has('nvim')?b:term_title:expand(&titlestring):'')\ }"
69 \ ."%{g:status_sym_sep_start.' '.winbufnr(0).' '}"
66 \ ."%#".l:invert_group."#" 70 \ ."%#".l:invert_group."#"
67 \ .g:status_sym_end 71 \ .g:status_sym_end
68 \ .'' 72 \ .''
@@ -71,26 +75,24 @@ augroup MAX_FANCYLINE
71 \ ."%#".l:invert_group."#" 75 \ ."%#".l:invert_group."#"
72 \ .g:status_sym_start 76 \ .g:status_sym_start
73 \ ."%#".a:highlight_group."#" 77 \ ."%#".a:highlight_group."#"
74 \ ."%1(%)" 78 \ ."%{&buftype==''?'':' '.&buftype.' '.g:status_sym_sep_start.' '}"
75 \ ."%{(&filetype\ !=\ ''\ ?\ &filetype\ :\ &buftype)}" 79 \ ."%{&filetype==''?'':' '.&filetype.' '.g:status_sym_sep_start.' '}"
76 \ ."%(\ %{g:status_sym_sep_end}\ %)"
77 \ ."%{(&spell\ ?\ &spelllang.' '.g:status_sym_sep_end\ :\ '')}" 80 \ ."%{(&spell\ ?\ &spelllang.' '.g:status_sym_sep_end\ :\ '')}"
78 \ ."%{(&fileencoding\ !=\ ''\ ?\ &fileencoding.' '.g:status_sym_sep_end.' '\ :\ '')}" 81 \ ."%{(&fileencoding=~'^$\\|^utf\-8$'?'':&fileencoding.' '.g:status_sym_sep_end.' ')}"
79 \ ."%{(&fileformat\ !=\ ''\ ?\ ' '.&fileformat.' '\ :\ '')}" 82 \ ."%{(&fileformat=~'^$\\|^unix$'?'':&fileformat.' '.g:status_sym_sep_end)}"
80 \ .g:status_sym_sep_end.' ' 83 \ ."%l:%-3c"
81 \ ."%4l:%-3c"
82 \ .g:status_sym_sep_end.' ' 84 \ .g:status_sym_sep_end.' '
83 \ ."%-3p%%" 85 \ ."%p%% "
84 endfunction 86 endfunction
85 87
86 function! UpdateTabline(highlight_group) 88 function! UpdateTabline(highlight_group)
87 let l:invert_group = CreateInvertGroup(a:highlight_group) 89 let l:invert_group = CreateInvertGroup(a:highlight_group)
90 let l:git_branch = FugitiveHead()
88 return '' 91 return ''
89 \ ."%#".a:highlight_group."#" 92 \ ."%#".a:highlight_group."#"
90 \ ."%3( \ %)\ " 93 \ ."%3( \ %)\ "
91 \ ."%{getcwd(-1)}\ " 94 \ ."%{getcwd(-1)}\ "
92 \ .g:status_sym_sep_start.' ' 95 \ ."%{FugitiveHead()==''?'':g:status_sym_sep_start.' '.g:symbol_branch.' '.FugitiveHead().' '}"
93 \ ."%(\ ".g:symbol_branch."\ %{fugitive#head()}\ %)"
94 \ ."%#".l:invert_group."#" 96 \ ."%#".l:invert_group."#"
95 \ .g:status_sym_end 97 \ .g:status_sym_end
96 \ .'' 98 \ .''
@@ -102,7 +104,7 @@ augroup MAX_FANCYLINE
102 \ ."%3(\ %)" 104 \ ."%3(\ %)"
103 \ ."%(%{v:servername}\ %{v:this_session}%)" 105 \ ."%(%{v:servername}\ %{v:this_session}%)"
104 \ .g:status_sym_sep_end.' ' 106 \ .g:status_sym_sep_end.' '
105 \ ."%(\ \ %{tabpagenr()}/%{tabpagenr('$')}\ %)" 107 \ ."%(\ \ \ %{tabpagenr()}/%{tabpagenr('$')}\ %)"
106 \ ."%##" 108 \ ."%##"
107 \ ."" " end 109 \ ."" " end
108 endfunction 110 endfunction
..