aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorMax Christian Pohle2019-05-01 18:48:30 +0200
committerMax Christian Pohle2019-05-01 18:48:30 +0200
commit7a09b882a53e44125488f8aab750b8bffed7b8ea (patch)
tree8b339ae8ed529343fa6f1de7666ba6b61fa1e765 /plugin
parent74f0e402f7a9c869665fcfab7388a76e88027fb4 (diff)
downloadvim-karlmarks-7a09b882a53e44125488f8aab750b8bffed7b8ea.tar.bz2
vim-karlmarks-7a09b882a53e44125488f8aab750b8bffed7b8ea.zip
Improved statusline
Diffstat (limited to 'plugin')
-rw-r--r--plugin/max-fix-colorschemes.vim2
-rw-r--r--plugin/statusline.vim26
2 files changed, 16 insertions, 12 deletions
diff --git a/plugin/max-fix-colorschemes.vim b/plugin/max-fix-colorschemes.vim
index db8aad5..87c9efe 100644
--- a/plugin/max-fix-colorschemes.vim
+++ b/plugin/max-fix-colorschemes.vim
@@ -42,6 +42,8 @@ function! ExtendColorTheme()
42 highlight! PmenuThumb cterm=inverse 42 highlight! PmenuThumb cterm=inverse
43 highlight! MoreMsg cterm=inverse 43 highlight! MoreMsg cterm=inverse
44 44
45 highlight! link Tabline StatusLine
46
45endfunction 47endfunction
46autocmd ColorScheme * call ExtendColorTheme() 48autocmd ColorScheme * call ExtendColorTheme()
47 49
diff --git a/plugin/statusline.vim b/plugin/statusline.vim
index 270f666..e3c03ed 100644
--- a/plugin/statusline.vim
+++ b/plugin/statusline.vim
@@ -4,9 +4,9 @@ augroup MAX_FANCYLINE
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:status_sym_start = '' 12 let g:status_sym_start = ''
@@ -21,7 +21,8 @@ augroup MAX_FANCYLINE
21 else 21 else
22 let g:group_active = "StatusLine" 22 let g:group_active = "StatusLine"
23 let g:group_inactive = "StatusLineNC" 23 let g:group_inactive = "StatusLineNC"
24 let g:group_tabline = "TabLine" 24 " let g:group_tabline = "TabLine"
25 let g:group_tabline = "StatusLine"
25 endif 26 endif
26 27
27 " this function reverts foreground color and background color of a given 28 " this function reverts foreground color and background color of a given
@@ -63,12 +64,12 @@ augroup MAX_FANCYLINE
63 \ ."%#".a:highlight_group."#" 64 \ ."%#".a:highlight_group."#"
64 \ ."%{(&readonly\ ?\ '\ \ 🔒'\ :\ '')}" 65 \ ."%{(&readonly\ ?\ '\ \ 🔒'\ :\ '')}"
65 \ ."%{(&modified\ ?\ '\ \ 💾'\ :\ '')}" 66 \ ."%{(&modified\ ?\ '\ \ 💾'\ :\ '')}"
66 \ ."%(%w%h%q%)".' '.l:mode.' ' 67 \ ."%(%w%h%q%)".' '.l:mode.' '.g:status_sym_sep_start
67 \ ."%{(argc()>0\ ?\ argidx()+1.':'.argc().' '.g:status_sym_sep_start.' '\ :\ '')}" 68 \ ."%{(argc()>1\ ?\ ' '.(argidx()+1).':'.argc().' '.g:status_sym_sep_start:'')}"
68 \ ."%{(haslocaldir() ?\ g:status_sym_sep_start.' '.fnamemodify(getcwd(),\ ':.').'/ '\ \:\ '')}\ " 69 \ ."%{(haslocaldir() ?\ fnamemodify(getcwd(),\ ':.').'/ '\ \:'')}\ "
69 \ ."%{bufname('%')==''?'':g:status_sym_sep_start.' '.substitute(bufname('%'),\ '^'.getcwd(-1).'/*',\ '',\ '').' '}" 70 \ ."%{bufname('%')==''?'':substitute(bufname('%'),\ '^'.getcwd(-1).'/*',\ '',\ '').' '}"
70 \ ."%{(&titlestring\ ?\ has('nvim')?b:term_title:expand(&titlestring):'')\ }" 71 \ ."%{(&titlestring\ ?\ has('nvim')?b:term_title:expand(&titlestring):'')\ }"
71 \ ."%{g:status_sym_sep_start.' '.winbufnr(0).' '}" 72 \ ."%{'['.winbufnr(0).']'}"
72 \ ."%#".l:invert_group."#" 73 \ ."%#".l:invert_group."#"
73 \ .g:status_sym_end 74 \ .g:status_sym_end
74 \ .'' 75 \ .''
@@ -77,8 +78,8 @@ augroup MAX_FANCYLINE
77 \ ."%#".l:invert_group."#" 78 \ ."%#".l:invert_group."#"
78 \ .g:status_sym_start 79 \ .g:status_sym_start
79 \ ."%#".a:highlight_group."#" 80 \ ."%#".a:highlight_group."#"
80 \ ."%{&buftype==''?'':' '.&buftype.' '.g:status_sym_sep_start.' '}" 81 \ ."%{&buftype==''?'':' '.&buftype.' '.g:status_sym_sep_end.' '}"
81 \ .l:webdev_ft_icon." %{&filetype==''?'':&filetype.' '.g:status_sym_sep_start.' '}" 82 \ .l:webdev_ft_icon." %{&filetype==''?'':&filetype.' '.g:status_sym_sep_end.' '}"
82 \ ."%{(&spell\ ?\ &spelllang.' '.g:status_sym_sep_end\ :\ '')}" 83 \ ."%{(&spell\ ?\ &spelllang.' '.g:status_sym_sep_end\ :\ '')}"
83 \ ."%{(&fileencoding=~'^$\\|^utf\-8$'?'':&fileencoding.' '.g:status_sym_sep_end.' ')}" 84 \ ."%{(&fileencoding=~'^$\\|^utf\-8$'?'':&fileencoding.' '.g:status_sym_sep_end.' ')}"
84 \ ."%{(&fileformat=~'^$\\|^unix$'?'':&fileformat.' '.g:status_sym_sep_end)}" 85 \ ."%{(&fileformat=~'^$\\|^unix$'?'':&fileformat.' '.g:status_sym_sep_end)}"
@@ -90,9 +91,10 @@ augroup MAX_FANCYLINE
90 function! UpdateTabline(highlight_group) 91 function! UpdateTabline(highlight_group)
91 let l:invert_group = CreateInvertGroup(a:highlight_group) 92 let l:invert_group = CreateInvertGroup(a:highlight_group)
92 let l:git_branch = FugitiveHead() 93 let l:git_branch = FugitiveHead()
94" 
93 return '' 95 return ''
94 \ ."%#".a:highlight_group."#" 96 \ ."%#".a:highlight_group."#"
95 \ ."%3( 📂\ %)\ " 97 \ ."%3( \ %)\ "
96 \ ."%{getcwd(-1)}\ " 98 \ ."%{getcwd(-1)}\ "
97 \ ."%{FugitiveHead()==''?'':g:status_sym_sep_start.' '.g:symbol_branch.' '.FugitiveHead().' '}" 99 \ ."%{FugitiveHead()==''?'':g:status_sym_sep_start.' '.g:symbol_branch.' '.FugitiveHead().' '}"
98 \ ."%#".l:invert_group."#" 100 \ ."%#".l:invert_group."#"
..