0

I am looking for a $TERM which displays bold text in vim and display airline statusline too. To know what I mean,I have screenshot of two identical files opened by vim but using different terms by sourcing .bashrc file. XTERM VS XTERM-256 color

The left picture is using $TERM=xterm while right picture is using $TERM=xterm-256color. When using xterm, the statusline isn't visible no matter what airline theme I choose. When using xterm-256color, the statusline is visible but text isn't bold.

However, even when the terms are different, the color produced looks same. Here, the left is using xterm while right is using xterm-256color. python term

So, it seems changing term is triggering something in vim that causes unbold color when using xterm-256color and disappeared statusline when using xterm. I want to display both bold color as well as statusline. Is there a fix which would help me get both? I have mistakely asked this question in unix&linux rather than vi stackexchange so I fear my question will get closed. Also, give me names of other $TERMS so that I can try and tell if it fixed the problem.

Machinexa
  • 123
  • Maybe you'll find help in this? xterm is a terminal emulator (just one of many), by default 16-color, xterm-256 instructs the same emulator to use 256 color scheme. vim's settings are in .vimrc if created, if not I think it uses /etc/default/vimrc or /usr/share/vimrc. Statusbar and other colorizations are just settings among others. If the link above doesn't get you started, there's a lot of web resources that advice how to adjust or create a .vimrc that makes it look and behave just the way you want. – Peregrino69 Sep 13 '21 at 17:36
  • 2
    vim kind of ignores the terminal description (it has a lot of exceptions). There's no status-line feature in xterm-256color because tsl needs a parameter (not implemented by any terminal you're likely to use). – Thomas Dickey Sep 13 '21 at 19:04
  • So I should implement my own tsl @ThomasDickey? – Machinexa Sep 13 '21 at 19:33
  • @Peregrino69 the question is specifically about changing some settings of vim or xterm or something else like term to get statusline present and bold text present. however thanks for the link, so maybe if i'll not get an answer I will have to implement my own statusline – Machinexa Sep 13 '21 at 19:35
  • Well you did ask specifically for a terminal recommendation... :-) I'd implement my own statusline, if for no other reason but it forces me to figure out what's going on in the preferences, which is never a bad idea. The question's still open here, but if StackExchange actually hosts a vi/vim -specific site, I'd definitely drop the question there. – Peregrino69 Sep 13 '21 at 20:08
  • OP needs perhaps a tutorial in customizing terminfo. ncurses doesn't have an infinite number of combinations, but users can fill in the rest from the examples. There are building-blocks which simplify things. – Thomas Dickey Sep 13 '21 at 22:20
  • The link seems too hard to understand – Machinexa Sep 14 '21 at 09:45
  • @ThomasDickey Do you know why t_Co isn't working in i3 window manager. It was working fine in xfce but now I have switched to i3, the bold part got away. Again I tested termcolor and it seems bold color is present but vim isn't displaying again. This time I tried t_Co from 0, 8, 16 ... 256 but none of them got bold – Machinexa Sep 16 '21 at 04:36

1 Answers1

0

So, after random trial and error using different $TERMs, $TERMSs with bce, $TERMs with -s, nothing was being changed. I encountered upon this question which let me to variable t_Ut which didn't fix it. However, on further reading questions I read this answer and discovered t_Co variable. I set t_Co=0 which got no color and t_Co=256 got no bold. Setting bad numbers like 1 and 2 didn't give me color but at 8 it was perfect. So my current settings is $TERM=xterm-256color and t_Co=8 in vimrc. vim

This settings gives both awesome color as well as awesome statusline without implementation of custom statusline.

Machinexa
  • 123