aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Christian Pohle2018-06-23 19:25:38 +0200
committerMax Christian Pohle2018-06-23 19:25:38 +0200
commit61b489ddf515ac27a7c6ea9ec329182df96e2b1f (patch)
treed0d1731635029b4bb6c9d63ec4a802fd5a7e4038
parent5d47f01f94ef508033a41ebcfc3de989755fd3ca (diff)
downloadvim-61b489ddf515ac27a7c6ea9ec329182df96e2b1f.tar.bz2
vim-61b489ddf515ac27a7c6ea9ec329182df96e2b1f.zip
Fixed linux terminal support and changed some symbols
-rw-r--r--vimrc-full75
1 files changed, 50 insertions, 25 deletions
diff --git a/vimrc-full b/vimrc-full
index 6e29373..e334071 100644
--- a/vimrc-full
+++ b/vimrc-full
@@ -46,11 +46,18 @@ if has("multi_byte")
46 set encoding=utf-8 | " we need default UTF-8 encoding to use cool chars as line break and so on (see below) 46 set encoding=utf-8 | " we need default UTF-8 encoding to use cool chars as line break and so on (see below)
47 let &termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those 47 let &termencoding=&encoding | " once we use special chars we assume everybody uses a terminal supporting those
48 48
49 set fillchars= | " initialize empty fillchars
50 set listchars= | " initialize empty listchars
51
52 if &term == "linux"
53 set fillchars+=vert:\│ | " cool vertical split char
54 else
55 set fillchars+=vert:\║ | " cool vertical split char
56 endif
57
49 set fillchars+=fold:\ | " 58 set fillchars+=fold:\ | "
50 set fillchars+=vert:\║ | " cool vertical split char
51 set fillchars+=diff:\ | " a white space gets used here 59 set fillchars+=diff:\ | " a white space gets used here
52 60
53 set listchars= | " initialize empty listchars
54 set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars) 61 set listchars+=extends:» | " symbols used when using :set list (which displays non-printable chars)
55 set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars) 62 set listchars+=precedes:« | " symbols used when using :set list (which displays non-printable chars)
56 63
@@ -1032,8 +1039,6 @@ endfunction
1032autocmd! ColorScheme * call ExtendColorTheme() 1039autocmd! ColorScheme * call ExtendColorTheme()
1033 1040
1034 1041
1035set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incompatible with nvim
1036" set t_ut=
1037 1042
1038" ====================================================================================================================== 1043" ======================================================================================================================
1039" CONVENIENCE: 1044" CONVENIENCE:
@@ -1126,7 +1131,7 @@ augroup status
1126 if(exists('w:color') && w:color == '') 1131 if(exists('w:color') && w:color == '')
1127 let w:color = 'NONE' 1132 let w:color = 'NONE'
1128 endif 1133 endif
1129 exec 'highlight '.retval.' gui=NONE guifg='.w:color 1134 silent! exec 'highlight '.retval.' gui=NONE guifg='.w:color.' cterm=NONE ctermfg='.w:color
1130 return l:retval 1135 return l:retval
1131 endfunction 1136 endfunction
1132 1137
@@ -1152,30 +1157,31 @@ augroup status
1152 \ ."%#StatusLineHighlight#" 1157 \ ."%#StatusLineHighlight#"
1153 \ ."%#".a:highlight_group."#" 1158 \ ."%#".a:highlight_group."#"
1154 \ ."%(%w%h%q\ %{ModeString()}%)" 1159 \ ."%(%w%h%q\ %{ModeString()}%)"
1155 \ ."%-2{nr2char(0xe621)}" 1160 \ .g:status_sym_sep_start.' '
1156 \ ."%{(argc()>0\ ?\ argidx()+1.':'.argc().' '.nr2char(0xe621).' '\ :\ '')}" 1161 \ ."%{(argc()>0\ ?\ argidx()+1.':'.argc().' '.g:status_sym_sep_start.' '\ :\ '')}"
1157 \ ."%{winbufnr(0).' '.nr2char(0xe621)}" 1162 \ ."%{winbufnr(0).' '.g:status_sym_sep_start}"
1158 \ ."%{(&readonly\ ?\ '\ \ \ '\ :\ '')}" 1163 \ ."%{(&readonly\ ?\ '\ \ \ '\ :\ '')}"
1159 \ ."%{(&modified\ ?\ nr2char(0xF0C7).'\ '\ :\ '')\ }" 1164 \ ."%{(&modified\ ?\ nr2char(0xF0C7).'\ '\ :\ '')\ }"
1160 \ ."%{(haslocaldir() ?\ fnamemodify(getcwd(),\ ':.').' '.nr2char(0xe0b1)\ \:\ '')}\ " 1165 \ ."%{(haslocaldir() ?\ ' '.fnamemodify(getcwd(),\ ':.').' '.nr2char(0xe0b1)\ \:\ '')}\ "
1161 \ ."%{(&buftype\ ==\ \"terminal\"\ ?\ b:term_title\ :\ substitute(expand('%:p'),\ '^'.getcwd(-1).'/*',\ '',\ ''))\ }" 1166 \ ."%{(&buftype\ ==\ \"terminal\"\ ?\ b:term_title\ :\ substitute(expand('%:p'),\ '^'.getcwd(-1).'/*',\ '',\ ''))\ }"
1167 \ ."%1(%)"
1162 \ ."%#".l:invert_group."#" 1168 \ ."%#".l:invert_group."#"
1163 \ ."%{nr2char(0xE0B4)\ }" 1169 \ .g:status_sym_end
1164 \ .'' 1170 \ .''
1165 \ ."%=" 1171 \ ."%="
1166 \ .'' 1172 \ .''
1167 \ ."%#".l:invert_group."#" 1173 \ ."%#".l:invert_group."#"
1168 \ ."%{nr2char(0xE0B6)}" 1174 \ .g:status_sym_start
1169 \ ."%#".a:highlight_group."#" 1175 \ ."%#".a:highlight_group."#"
1170 \ ."%1(%)" 1176 \ ."%1(%)"
1171 \ ."%{(&filetype\ !=\ ''\ ?\ &filetype\ :\ &buftype)}" 1177 \ ."%{(&filetype\ !=\ ''\ ?\ &filetype\ :\ &buftype)}"
1172 \ ."%(\ %{nr2char(0xe621)}\ %)" 1178 \ ."%(\ %{g:status_sym_sep_end}\ %)"
1173 \ ."%{(&spell\ ?\ &spelllang.' '.nr2char(0xe621)\ :\ '')}" 1179 \ ."%{(&spell\ ?\ &spelllang.' '.g:status_sym_sep_end\ :\ '')}"
1174 \ ."%{(&fileencoding\ !=\ ''\ ?\ &fileencoding.' '.nr2char(0xe621)\ :\ '')}" 1180 \ ."%{(&fileencoding\ !=\ ''\ ?\ &fileencoding.' '.g:status_sym_sep_end.' '\ :\ '')}"
1175 \ ."%{(&fileformat\ !=\ ''\ ?\ &fileformat\ :\ '')}" 1181 \ ."%{(&fileformat\ !=\ ''\ ?\ ' '.&fileformat.' '\ :\ '')}"
1176 \ ."%(\ %{nr2char(0xe621)}\ %)" 1182 \ .g:status_sym_sep_end.' '
1177 \ ."%4l:%-3c" 1183 \ ."%4l:%-3c"
1178 \ ."%(\ %{nr2char(0xe621)}\ %)" 1184 \ .g:status_sym_sep_end.' '
1179 \ ."%-3p%%" 1185 \ ."%-3p%%"
1180 endfunction 1186 endfunction
1181 1187
@@ -1185,29 +1191,48 @@ augroup status
1185 \ ."%#".a:highlight_group."#" 1191 \ ."%#".a:highlight_group."#"
1186 \ ."%3( \ %)" 1192 \ ."%3( \ %)"
1187 \ ."%{getcwd(-1)}" 1193 \ ."%{getcwd(-1)}"
1188 \ ."%{nr2char(0xe621)}" 1194 \ .g:status_sym_sep_start.' '
1189 \ ."%(\ \ %{fugitive#head()}\ %)" 1195 \ ."%(\ ".g:symbol_branch."\ %{fugitive#head()}\ %)"
1190 \ ."%#".l:invert_group."#" 1196 \ ."%#".l:invert_group."#"
1191 \ ."%{nr2char(0xE0B4)\ }" 1197 \ .g:status_sym_end
1192 \ .'' 1198 \ .''
1193 \ ."%=" 1199 \ ."%="
1194 \ .'' 1200 \ .''
1195 \ ."%#".l:invert_group."#" 1201 \ ."%#".l:invert_group."#"
1196 \ ."%{nr2char(0xE0B6)}" 1202 \ .g:status_sym_start
1197 \ ."%#".a:highlight_group."#" 1203 \ ."%#".a:highlight_group."#"
1198 \ ."%3(\ %)" 1204 \ ."%3(\ %)"
1199 \ ."%(%{v:servername}\ %{v:this_session}%)" 1205 \ ."%(%{v:servername}\ %{v:this_session}%)"
1200 \ ."%{nr2char(0xe621)}" 1206 \ .g:status_sym_sep_end.' '
1201 \ ."%(\ \ %{tabpagenr()}/%{tabpagenr('$')}\ %)" 1207 \ ."%(\ \ %{tabpagenr()}/%{tabpagenr('$')}\ %)"
1202 \ ."%##" 1208 \ ."%##"
1203 \ ."" " end 1209 \ ."" " end
1204 endfunction 1210 endfunction
1205 1211
1206 let g:group_active = "StatusLine" 1212 let g:symbol_branch = ''
1207 let g:group_inactive = "StatusLineNC" 1213 let g:status_sym_start = ''
1208 let g:group_tabline = "TabLine" 1214 let g:status_sym_end = ''
1215 let g:status_sym_sep_start = ''
1216 let g:status_sym_sep_end = ''
1217
1218 if &term == "linux"
1219 let g:group_active = "StatusLineTerm"
1220 let g:group_inactive = "StatusLineTermNC"
1221 let g:group_tabline = "StatusLineTerm"
1222 else
1223 let g:symbol_branch = ''
1224
1225 let g:group_active = "StatusLine"
1226 let g:group_inactive = "StatusLineNC"
1227 let g:group_tabline = "TabLine"
1228 endif
1229
1209 1230
1210 function ApplyColorScheme() 1231 function ApplyColorScheme()
1232 " set termguicolors | " When on, uses highlight-guifg and highlight-guibg attributes in the terminal (=24bit color) incompatible with nvim
1233 " set t_ut=
1234 "
1235 "
1211 " set up statusline, global and current window individually 1236 " set up statusline, global and current window individually
1212 set statusline=%!UpdateStatus(g:group_inactive) 1237 set statusline=%!UpdateStatus(g:group_inactive)
1213 setlocal statusline=%!UpdateStatus(g:group_active) 1238 setlocal statusline=%!UpdateStatus(g:group_active)
..