aboutsummaryrefslogtreecommitdiff
path: root/vimrc-full
diff options
context:
space:
mode:
authorMax Christian Pohle2018-05-13 22:55:11 +0200
committerMax Christian Pohle2018-05-13 22:55:11 +0200
commit2d99b2952df8f2b009e86b851627a3502ce78f62 (patch)
tree8cf8f0b391501c2a5ce7f7f09258d6671e0ee5b8 /vimrc-full
parent039bbf24263aa5782d290410206eedfb9354b237 (diff)
downloadvim-karlmarks-2d99b2952df8f2b009e86b851627a3502ce78f62.tar.bz2
vim-karlmarks-2d99b2952df8f2b009e86b851627a3502ce78f62.zip
A little bit refactoring, switched Papercolor theme to light
Diffstat (limited to 'vimrc-full')
-rw-r--r--vimrc-full202
1 files changed, 73 insertions, 129 deletions
diff --git a/vimrc-full b/vimrc-full
index a4fb101..83b5c81 100644
--- a/vimrc-full
+++ b/vimrc-full
@@ -740,81 +740,6 @@ let g:tagbar_foldlevel = 99
740 740
741nnoremap <F9> :TagbarToggle<CR>| " bind TagBar to hotkey F9 741nnoremap <F9> :TagbarToggle<CR>| " bind TagBar to hotkey F9
742 742
743
744" LIGHTLINE: a fancy status line =======================================================================================
745"
746set noshowmode | " mode will be shown twice, in lightline and below, so we want to deactivate one
747set laststatus=2 | " required by AirLine and Lightline, without status line does not appear until a window split
748
749" Plug 'itchyny/lightline.vim'
750
751" lightline-buffer ui settings
752" replace these symbols with ASCII characters if your environment does not support unicode
753let g:lightline_buffer_logo = ''
754let g:lightline_buffer_readonly_icon = ''
755let g:lightline_buffer_modified_icon = '✭'
756let g:lightline_buffer_git_icon = ' '
757let g:lightline_buffer_ellipsis_icon = '..'
758let g:lightline_buffer_active_buffer_left_icon = ' '
759let g:lightline_buffer_active_buffer_right_icon = ''
760" let g:lightline_buffer_separator_icon = 'XX'
761
762" lightline-buffer function settings
763let g:lightline_buffer_show_bufnr = 0
764let g:lightline_buffer_rotate = 0
765let g:lightline_buffer_fname_mod = ':t'
766let g:lightline_buffer_excludes = ['vimfiler']
767let g:lightline_buffer_maxflen = 30
768let g:lightline_buffer_maxfextlen = 3
769let g:lightline_buffer_minflen = 16
770let g:lightline_buffer_minfextlen = 3
771let g:lightline_buffer_reservelen = 20
772
773" \ ['warnings', 'errors', 'syntastic']
774" \ 'left': [ [ 'bufferinfo' ], [ 'bufferbefore', 'buffercurrent', 'bufferafter' ], ],
775let g:lightline = {
776 \ 'tabline': {
777 \ 'left': [ [ 'servername', 'sessionname' ] ],
778 \ 'right': [ [], ['gitbranch', 'tabnumber'] ],
779 \ },
780 \ 'colorscheme': 'Tomorrow_Night',
781 \ 'separator': { 'left': "\uE0B4", 'right': "\uE0B6" },
782 \ 'subseparator': { 'left': "\uE0b1", 'right': "\uE0b3" },
783 \ 'inactive': {
784 \ 'left': [ [ 'pwd', 'relativepath'] ],
785 \ 'right': []
786 \ },
787 \ 'active': {
788 \ 'left': [ [ 'mode', 'register', 'paste' ], [ 'pwd', 'relativepath' ] , ['tagbar']],
789 \ 'right': [ [ 'lineinfo', 'percent' ], [ 'filetype', 'readonly', 'spell', 'fileencoding', 'fileformat' ] ]
790 \ },
791 \ 'component': {
792 \ 'tagbar': '%{substitute(tagbar#currenttag("%s", "", "fs"), "\(.*\)", "", "")}',
793 \ 'ycmparent': '%{substitute(execute("YcmComplete GetParent"), "\(.*\)", "", "")}',
794 \ 'filename': '%t',
795 \ 'buffer_alt': '%{expand("#:t")}',
796 \ 'servername': ' %{v:servername}',
797 \ 'sessionname': '%{v:this_session}',
798 \ 'gitbranch': ' %{fugitive#head()}',
799 \ 'tabnumber': " %{tabpagenr()}/%{tabpagenr('$')}",
800 \ 'readonly': '%{&readonly ? "" : ""}',
801 \ 'register': '%{v:register}',
802 \ 'title': '%{getwinvar(0, "quickfix_title")}',
803 \ 'pwd': '%{fnamemodify(getcwd(), ":~")}',
804 \ 'relativepath': '%{fnamemodify(expand("%"), ":.")}'
805 \ },
806 \ 'component_expand': {
807 \ 'buffercurrent': 'lightline#buffer#buffercurrent2',
808 \ 'syntastic': 'SyntasticStatuslineFlag',
809 \ },
810 \ 'component_function': {
811 \ 'bufferinfo': 'lightline#buffer#bufferinfo',
812 \ 'warnings': 'youcompleteme#GetWarningCount',
813 \ 'errors': 'youcompleteme#GetErrorCount',
814 \ },
815 \ }
816
817
818" Autocompleter: ===================================== 743" Autocompleter: =====================================
819if has("python") 744if has("python")
820 745
@@ -824,7 +749,7 @@ if has("python")
824 " let g:UltiSnipsExpandTrigger = '<Tab>'| " expands the snippet, be careful not to use <tab> elsewhere (ycm uses it by default, but it has been deactivated by g:ycm_key_list_select_completion) 749 " let g:UltiSnipsExpandTrigger = '<Tab>'| " expands the snippet, be careful not to use <tab> elsewhere (ycm uses it by default, but it has been deactivated by g:ycm_key_list_select_completion)
825 let g:UltiSnipsExpandTrigger = '<Tab>'| " expands the snippet, be careful not to use <tab> elsewhere (ycm uses it by default, but it has been deactivated by g:ycm_key_list_select_completion) 750 let g:UltiSnipsExpandTrigger = '<Tab>'| " expands the snippet, be careful not to use <tab> elsewhere (ycm uses it by default, but it has been deactivated by g:ycm_key_list_select_completion)
826 751
827 let g:UltiSnipsJumpForwardTrigger = '<Tab>'| 752 let g:UltiSnipsJumpForwardTrigger = '<Tab>'|
828 let g:UltiSnipsJumpBackwardTrigger = '<S-Tab>'| 753 let g:UltiSnipsJumpBackwardTrigger = '<S-Tab>'|
829 "d let g:UltiSnipsJumpForwardTrigger = '<PageDown>' 754 "d let g:UltiSnipsJumpForwardTrigger = '<PageDown>'
830 " let g:UltiSnipsJumpBackwardTrigger = '<PageUp>' 755 " let g:UltiSnipsJumpBackwardTrigger = '<PageUp>'
@@ -1046,9 +971,9 @@ function! ExtendColorTheme()
1046 highlight! SpecialKey ctermfg=19 971 highlight! SpecialKey ctermfg=19
1047 highlight! WhiteSpace ctermfg=19 972 highlight! WhiteSpace ctermfg=19
1048 973
1049 highlight! link TabLine LineNr 974 " highlight! link TabLine LineNr
1050 highlight! TabLineSel ctermbg=blue ctermfg=black 975 " highlight! TabLineSel ctermbg=blue ctermfg=black
1051 highlight! link TabLineFill LineNr 976 " highlight! link TabLineFill LineNr
1052 highlight! Search ctermbg=LightYellow ctermfg=black guibg=#fefd86 guifg=#222222 977 highlight! Search ctermbg=LightYellow ctermfg=black guibg=#fefd86 guifg=#222222
1053 highlight! link WildMenu Search 978 highlight! link WildMenu Search
1054 979
@@ -1161,15 +1086,19 @@ else
1161 let g:PaperColor_Theme_Options = { 1086 let g:PaperColor_Theme_Options = {
1162 \ 'theme': { 1087 \ 'theme': {
1163 \ 'default': { 1088 \ 'default': {
1164 \ 'transparent_background': 1 1089 \ 'transparent_background': 0
1165 \ } 1090 \ }
1166 \ } 1091 \ }
1167 \ } 1092 \ }
1168 set background=dark 1093 set background=light
1169 colorscheme PaperColor 1094 colorscheme PaperColor
1170endif 1095endif
1171 1096
1097
1172augroup status 1098augroup status
1099 set noshowmode | " mode will be shown twice, in lightline and below, so we want to deactivate one
1100 set laststatus=2 | " required by AirLine and Lightline, without status line does not appear until a window split
1101
1173 function! CreateInvertGroup(highlight_group) 1102 function! CreateInvertGroup(highlight_group)
1174 if(synIDattr(hlID(a:highlight_group), "reverse")==1) 1103 if(synIDattr(hlID(a:highlight_group), "reverse")==1)
1175 let w:color=synIDattr(hlID(a:highlight_group), "fg#") 1104 let w:color=synIDattr(hlID(a:highlight_group), "fg#")
@@ -1185,63 +1114,78 @@ augroup status
1185 return l:retval 1114 return l:retval
1186 endfunction 1115 endfunction
1187 1116
1117 function ModeString()
1118 return get({
1119 \ 'n' : 'normal',
1120 \ 'i' : 'insert',
1121 \ 'R' : 'replace',
1122 \ 'v' : 'visual',
1123 \ "V" : 'visual line',
1124 \ "\<C-V>" : 'visual block',
1125 \ 'c' : 'command',
1126 \ 's' : 'select',
1127 \ 'S' : 'select line',
1128 \ "\<C-s>" : 'select block',
1129 \ 't' : 'terminal'
1130 \ }, mode(), mode())
1131 endfunction
1132
1188 function! UpdateStatus(highlight_group) 1133 function! UpdateStatus(highlight_group)
1189 let l:invert_group = CreateInvertGroup(a:highlight_group) 1134 let l:invert_group = CreateInvertGroup(a:highlight_group)
1190 return 1135 return ''
1191 \ "%#StatusLineHighlight#" . 1136 \ ."%#StatusLineHighlight#"
1192 \ "%#".a:highlight_group."#" . 1137 \ ."%#".a:highlight_group."#"
1193 \ "%{(&readonly\ ?\ '\ \ \ '\ :\ '')}" . 1138 \ ."%(%w%h%q\ %{ModeString()}%)"
1194 \ "%{(&modified\ ?\ nr2char(0xF0C7).'\ '\ :\ '')}" . 1139 \ ."%-2{nr2char(0xe621)}"
1195 \ "%(%w%h%q\ %-8{mode(1)}%)" . 1140 \ ."%{(&readonly\ ?\ '\ \ \ '\ :\ '')}"
1196 \ "%{nr2char(0xe621)}" . 1141 \ ."%{(&modified\ ?\ nr2char(0xF0C7).'\ '\ :\ '')}"
1197 \ "%(\ %{fnamemodify(getcwd(),\ ':~')}\ %)" . 1142 \ ."%(\ %{fnamemodify(getcwd(),\ ':~')}\ %)"
1198 \ "%{nr2char(0xf44a)}" . 1143 \ ."%{nr2char(0xf44a)}"
1199 \ "%(\ %f\ %)" . 1144 \ ."%(\ %f\ %)"
1200 \ "%#".l:invert_group."#" . 1145 \ ."%#".l:invert_group."#"
1201 \ "%{nr2char(0xE0B4)\ }" . 1146 \ ."%{nr2char(0xE0B4)\ }"
1202 \ '' . 1147 \ .''
1203 \ "%=" . 1148 \ ."%="
1204 \ '' . 1149 \ .''
1205 \ "%#".l:invert_group."#" . 1150 \ ."%#".l:invert_group."#"
1206 \ "%{nr2char(0xE0B6)}" . 1151 \ ."%{nr2char(0xE0B6)}"
1207 \ "%#".a:highlight_group."#" . 1152 \ ."%#".a:highlight_group."#"
1208 \ "%1(%)" . 1153 \ ."%1(%)"
1209 \ "%{\ &filetype}" . 1154 \ ."%{\ &filetype}"
1210 \ "%(\ %{nr2char(0xe621)}\ %)" . 1155 \ ."%(\ %{nr2char(0xe621)}\ %)"
1211 \ "%{&fileencoding}" . 1156 \ ."%{&fileencoding}"
1212 \ "%(\ %{nr2char(0xe621)}\ %)" . 1157 \ ."%(\ %{nr2char(0xe621)}\ %)"
1213 \ "%{&fileformat}" . 1158 \ ."%{&fileformat}"
1214 \ "%(\ %{nr2char(0xe621)}\ %)" . 1159 \ ."%(\ %{nr2char(0xe621)}\ %)"
1215 \ "%4l:%-4c" . 1160 \ ."%4l:%-4c"
1216 \ "%-3p%%" . 1161 \ ."%-3p%%"
1217 \ '' " end ^
1218 endfunction 1162 endfunction
1219 1163
1220 function! UpdateTabline(highlight_group) 1164 function! UpdateTabline(highlight_group)
1221 let l:invert_group = CreateInvertGroup(a:highlight_group) 1165 let l:invert_group = CreateInvertGroup(a:highlight_group)
1222 return 1166 return ''
1223 \ "%#".a:highlight_group."#" . 1167 \ ."%#".a:highlight_group."#"
1224 \ "%3(\ %)" . 1168 \ ."%3(\ %)"
1225 \ "%{nr2char(0xe621)}" . 1169 \ ."%{nr2char(0xe621)}"
1226 \ "%(%{v:servername}\ %{v:this_session}%)" . 1170 \ ."%(%{v:servername}\ %{v:this_session}%)"
1227 \ "%#".l:invert_group."#" . 1171 \ ."%#".l:invert_group."#"
1228 \ "%{nr2char(0xE0B4)\ }" . 1172 \ ."%{nr2char(0xE0B4)\ }"
1229 \ '' . 1173 \ .''
1230 \ "%=" . 1174 \ ."%="
1231 \ '' . 1175 \ .''
1232 \ "%#".l:invert_group."#" . 1176 \ ."%#".l:invert_group."#"
1233 \ "%{nr2char(0xE0B6)}" . 1177 \ ."%{nr2char(0xE0B6)}"
1234 \ "%#".a:highlight_group."#" . 1178 \ ."%#".a:highlight_group."#"
1235 \ "%(\ \ %{fugitive#head()}\ %)" . 1179 \ ."%(\ \ %{fugitive#head()}\ %)"
1236 \ "%{nr2char(0xe621)}" . 1180 \ ."%{nr2char(0xe621)}"
1237 \ "%(\ \ %{tabpagenr()}/%{tabpagenr('$')}\ %)" . 1181 \ ."%(\ \ %{tabpagenr()}/%{tabpagenr('$')}\ %)"
1238 \ "%##" . 1182 \ ."%##"
1239 \ "" " end ^ 1183 \ ."" " end
1240 endfunction 1184 endfunction
1241 1185
1242 let g:group_active = "StatusLine" 1186 let g:group_active = "StatusLine"
1243 let g:group_inactive = "StatusLineNC" 1187 let g:group_inactive = "StatusLineNC"
1244 let g:group_tabline = "TabLineSel" 1188 let g:group_tabline = "TabLine"
1245 1189
1246 function ApplyColorScheme() 1190 function ApplyColorScheme()
1247 " set up statusline, global and current window individually 1191 " set up statusline, global and current window individually
..