Skip to content

Conversation

dngray
Copy link
Contributor

@dngray dngray commented Aug 25, 2019

I have worked on putting some of the colors from your draft into a colortemplate as your comment here #47 (comment)

I still need to figure out how to set ctermbg=8 for MatchParen and Visual. Not sure about that.

Closes: #47

@jan-warchol
Copy link
Owner

Hmm, I may be doing something wrong, but I got a lot of errors when trying to use the template:

selenized_dark_light.colortemplate|90 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|91 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|93 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|94 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|98 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|100 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|101 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|102 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|104 col 64 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|105 col 64 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|106 col 64 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|107 col 69 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|108 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|109 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|110 col 64 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|111 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|112 col 63 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|113 col 66 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|114 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|115 col 61 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|116 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|117 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|118 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|119 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|120 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|121 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|122 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|123 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|125 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|126 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|127 col 62 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|128 col 63 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|129 col 66 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|130 col 71 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|131 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|132 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|133 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|134 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|135 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|136 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|137 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|138 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|139 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|140 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|141 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|143 col 63 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|144 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|145 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|146 col 64 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|147 col 61 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|149 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|150 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|151 col 61 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|152 col 64 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|153 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|154 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|158 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|159 col 61 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|204 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|205 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|207 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|208 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|212 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|214 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|215 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|216 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|217 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|218 col 64 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|219 col 64 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|220 col 64 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|221 col 69 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|222 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|223 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|224 col 64 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|225 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|226 col 63 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|227 col 77 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|228 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|229 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|230 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|231 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|232 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|233 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|234 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|235 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|236 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|237 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|238 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|239 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|240 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|241 col 62 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|242 col 63 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|243 col 66 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|244 col 71 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|245 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|246 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|247 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|248 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|249 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|250 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|251 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|252 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|253 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|254 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|255 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|257 col 63 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|258 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|259 col 64 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|260 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|261 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|262 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|263 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|264 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|265 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|266 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|267 col 43 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|271 col 44 error| Vim(if):E121: Undefined variable: v:t_string
selenized_dark_light.colortemplate|272 col 61 error| Vim(if):E121: Undefined variable: v:t_string

@lifepillar maybe I misunderstood how to use a colortemplate? Here's what I did:

vim selenized_dark_light.colortemplate
:Colortemplate! ~/.vim

@jan-warchol
Copy link
Owner

oh, and for reference:

$ vim --version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun 07 2019 15:35:43)
Included patches: 1-1689
Extra patches: 8.0.0056
Modified by pkg-vim-maintainers@lists.alioth.debian.org
Compiled by pkg-vim-maintainers@lists.alioth.debian.org
Huge version with GTK2-GNOME GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +tag_binary
+arabic          +file_in_path    +mouse_sgr       +tag_old_static
+autocmd         +find_in_path    -mouse_sysmouse  -tag_any_white
+balloon_eval    +float           +mouse_urxvt     +tcl
+browse          +folding         +mouse_xterm     +terminfo
++builtin_terms  -footer          +multi_byte      +termresponse
+byte_offset     +fork()          +multi_lang      +textobjects
+channel         +gettext         -mzscheme        +timers
+cindent         -hangul_input    +netbeans_intg   +title
+clientserver    +iconv           +packages        +toolbar
+clipboard       +insert_expand   +path_extra      +user_commands
+cmdline_compl   +job             +perl            +vertsplit
+cmdline_hist    +jumplist        +persistent_undo +virtualedit
+cmdline_info    +keymap          +postscript      +visual
+comments        +langmap         +printer         +visualextra
+conceal         +libcall         +profile         +viminfo
+cryptv          +linebreak       -python          +vreplace
+cscope          +lispindent      +python3         +wildignore
+cursorbind      +listcmds        +quickfix        +wildmenu
+cursorshape     +localmap        +reltime         +windows
+dialog_con_gui  +lua             +rightleft       +writebackup
+diff            +menu            +ruby            +X11
+digraphs        +mksession       +scrollbind      -xfontset
+dnd             +modify_fname    +signs           +xim
-ebcdic          +mouse           +smartindent     +xsmp_interact
+emacs_tags      +mouseshape      +startuptime     +xterm_clipboard
+eval            +mouse_dec       +statusline      -xterm_save
+ex_extra        +mouse_gpm       -sun_workshop    +xpm
+extra_search    -mouse_jsbterm   +syntax          
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"

@jan-warchol
Copy link
Owner

Oh, wait! Now I see that my vim is version 7.4, and I've been sure that it's 8.x. I guess that explains things...
Bad luck vim 8 is not in my distro repos (I guess this means it's time to upgrade my distro...). I'll try to workaround this.

@dngray
Copy link
Contributor Author

dngray commented Aug 26, 2019

At least we will have thorough testing across Vim/Neovim (as I use Neovim on Arch Linux). I am going to fix the other issues @lifepillar mentioned in their comment in a bit #47 (comment)

@jan-warchol
Copy link
Owner

I'm reinstalling my system to newest Linux Mint, so I should have Vim 8 at my disposal in a day or two.

@jan-warchol
Copy link
Owner

jan-warchol commented Mar 3, 2020

Hi @dngray ! I've rewritten the templates and pushed my commits to your branch. I've checked the results in both terminal and GUI vim, and they seem correct! (No more problems with the background, thanks to @lifepillar's fix for lifepillar/vim-colortemplate#24)

Please verify whether it works for you and let me know so that we can merge this :) (of course the styling can be improved, but I think it can be done in a separate PR).

@jan-warchol
Copy link
Owner

Hmm, some updates from master got in accidentally, and github is displaying all of them despite the fact that they are already in the target branch... I'll rebase and push-force the branch to make it readable.

Only define the colors for now. This is assuming standard "meaning" of
ANSI colors, as set by selenized configs for terminal emulators.
Match current selenized.vim (as much as possible).
While I've ended up rewriting the templates from scratch (this merge
uses "ours" strategy to drop changes from target branch), Daniel's help
was invaluable in getting this done, so I wanted to give him credit by
including his commits for reference.

Also, put vim templates in vim directory. utils/templates is for
templating the actual palettes (i.e. color values), not highlighting
configuration.

Fixes #47. \o/
Copy link
Owner

@jan-warchol jan-warchol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works nicely for me, and while of course I'd like to improve the styling, I think it can be merged.

Colortemplate requires vim 8 which is not available in my system
repositories.
@jan-warchol jan-warchol changed the title Initial testing of some colors with a "colortemplate" Use vim-colortemplate to generate vim colorscheme Mar 3, 2020
@dngray
Copy link
Contributor Author

dngray commented Mar 4, 2020

Seems to build fine.

Please verify whether it works for you and let me know so that we can merge this :) (of course the styling can be improved, but I think it can be done in a separate PR).

I did notice the background was now grey. Does it look like this for you?

light_dark_neovim

It does however seem to work correctly in nvimqt 👍 🎉 The black/white variant looks correct in both nvim and nvim-qt.

@dngray
Copy link
Contributor Author

dngray commented Mar 4, 2020

It didn't seem to work in Vim either:

vim

:version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Mar  1 2020 17:21:03)
Included patches: 1-343
Compiled by Arch Linux
Huge version without GUI.  Features included (+) or not (-):
+acl               +cursorshape       +jumplist          +mouse_xterm       +smartindent       +vertsplit
+arabic            +dialog_con        +keymap            +multi_byte        -sound             +virtualedit
+autocmd           +diff              +lambda            +multi_lang        +spell             +visual
+autochdir         +digraphs          +langmap           -mzscheme          +startuptime       +visualextra
-autoservername    -dnd               +libcall           +netbeans_intg     +statusline        +viminfo
-balloon_eval      -ebcdic            +linebreak         +num64             -sun_workshop      +vreplace
+balloon_eval_term +emacs_tags        +lispindent        +packages          +syntax            +wildignore
-browse            +eval              +listcmds          +path_extra        +tag_binary        +wildmenu
++builtin_terms    +ex_extra          +localmap          +perl/dyn          -tag_old_static    +windows
+byte_offset       +extra_search      +lua/dyn           +persistent_undo   -tag_any_white     +writebackup
+channel           -farsi             +menu              +popupwin          +tcl/dyn           -X11
+cindent           +file_in_path      +mksession         +postscript        +termguicolors     -xfontset
-clientserver      +find_in_path      +modify_fname      +printer           +terminal          -xim
-clipboard         +float             +mouse             +profile           +terminfo          -xpm
+cmdline_compl     +folding           -mouseshape        +python/dyn        +termresponse      -xsmp
+cmdline_hist      -footer            +mouse_dec         +python3/dyn       +textobjects       -xterm_clipboard
+cmdline_info      +fork()            +mouse_gpm         +quickfix          +textprop          -xterm_save
+comments          +gettext           -mouse_jsbterm     +reltime           +timers
+conceal           -hangul_input      +mouse_netterm     +rightleft         +title
+cryptv            +iconv             +mouse_sgr         +ruby/dyn          -toolbar
+cscope            +insert_expand     -mouse_sysmouse    +scrollbind        +user_commands
+cursorbind        +job               +mouse_urxvt       +signs             +vartabs
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIF
Y_SOURCE=1
Linking: gcc   -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -Wl
,-E -Wl,-rpath,/usr/lib/perl5/5.30/core_perl/CORE  -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr/local/lib -Wl,--as-
needed -o vim        -lm -ltinfo -lelf -lnsl    -lacl -lattr -lgpm -ldl   -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.30/core_perl/CORE
-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/perl5/5.30/core_perl/CO
RE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc   -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm
Press ENTER or type command to continue

@jan-warchol
Copy link
Owner

@dngray no, it should not look like that. It should look like this:
image

How can I reproduce your environment? Is that neovim? What terminal emulator?
BTW, I have tested it relying on terminal's ANSI palette (it is set to selenized). Are you using 256-color mode? What is your $TERM set to?

@dngray
Copy link
Contributor Author

dngray commented Mar 4, 2020

Is that neovim?

The first screenshot was neovim, the second one was vim.

BTW, I have tested it relying on terminal's ANSI palette (it is set to selenized)

Mine looks like this:

term_colors

What terminal emulator?

I'm using termite with selenized-dark.config.

What is your $TERM set to?

$TERM is set to xterm-256color

@jan-warchol
Copy link
Owner

Okay, I've reproduced this with set t_Co=256. The root cause of the problem is that terminals' 256-color palettes are extremely limited: while proper selenized background is #103c48, the nearest color (at least as calculated by colortemplate) in 256-color palette is 3a3a3a.

See for yourself how limited the palette is: https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg One color that could potentially be used is 23, #005f5f, but it's much too bright (its CIE Lab lightness is 36, while selenized's background lightness should be 23).

@jan-warchol
Copy link
Owner

BTW, I have tested it relying on terminal's ANSI palette (it is set to selenized)

Mine looks like this: [selenized dark palette]

What is your $TERM set to?

$TERM is set to xterm-256color

Okay, so you can either set t_Co=16 inside vim, or export TERM=xterm in your shell to tell vim to rely on ANSI colors, which should produce correct look.

@jan-warchol
Copy link
Owner

I think we should use shades of grey for base colors in 256-color mode - I've checked that Solarized does the same thing. It would look like this:
image
What do you think?

256-color palettes don't have enough colors to approximate reasonably
selenized background shades. It makes more sense to specify grayscale,
as Solarized does.
Selected ones are better than colortemplate's default approximation.
@dngray
Copy link
Contributor Author

dngray commented Mar 4, 2020

Okay, so you can either set t_Co=16 inside vim, or export TERM=xterm

So that worked to fix Vim, and it seems I found a solution for Neovim ie: set set termguicolors.

Awesome. on the left is the original vim theme post those fixes. On the right is the colortemplate. Only suggestion there would be the background of the popup box is a bit hard to see, otherwise looking good!

awesome

@jan-warchol
Copy link
Owner

Okay, so you can either set t_Co=16 inside vim, or export TERM=xterm

So that worked to fix Vim, and it seems I found a solution for Neovim ie: set set termguicolors.

Does it mean that set t_Co=16 doesn't work for Neovim?

I'm thinking what the default behaviour should be. The recommended way of using selenized is to rely on properly configured terminal palette. However, even with that done many terminals will advertise themselves as 256 color, which will result in vim trying to use inferior 256-color variant. Should we disable them altogether? Or set t_Co=16 inside the theme by default, forcing vim to use ANSI colors?

Awesome. on the left is the original vim theme post those fixes. On the right is the colortemplate. Only suggestion there would be the background of the popup box is a bit hard to see

Sure, will fix this later this evening :-)

In the meantime, can you play around with improved 256-color themes and let me know how do youl like them?

@dngray
Copy link
Contributor Author

dngray commented Mar 4, 2020

Hmm. set t_Co=16 didn't seem to help. Maybe this is needed:

https://github.com/lifepillar/vim-colortemplate/blob/master/doc/colortemplate.txt#L241

Also:

'termguicolors' 'tgc'	boolean (default off)
global
Enables 24-bit RGB color in the |TUI|.  Uses "gui" |:highlight|
attributes instead of "cterm" attributes. |highlight-guifg|
Requires an ISO-8613-3 compatible terminal.

@dngray
Copy link
Contributor Author

dngray commented Mar 4, 2020

So I don't think t_Co actually works in neovim. Maybe @lifepillar knows?

@dngray
Copy link
Contributor Author

dngray commented Mar 4, 2020

I think we should use shades of grey for base colors in 256-color mode - I've checked that Solarized does the same thing. It would look like this:

Yes I think that looks rather nice.

@dngray
Copy link
Contributor Author

dngray commented Mar 4, 2020

Interesting, i get the same issue with vim-solarized8 if I don't set termguicolors.

Eg:

solarized8

Left is with termguicolors disabled, right is with it enabled. Terminal is alacritty.

@dngray
Copy link
Contributor Author

dngray commented Mar 4, 2020

So I think I might have figured it out. It's this issue: https://github.com/lifepillar/vim-solarized8#but-my-terminal-has-only-256-colors

I did ask in neovim:matrix.org

bfredl ╡ no, termguicolors is always off by default
     ↪ ╡ you have to set it yourself
     ↪ ╡ exists('&t_Co') is still true
bfredl ╡ via using 16 colors custom set in the terminal emulator?
     ↪ ╡ you probably want a g: var override in the color scheme, to force use 16 colors even if 265 colors is available
     ↪ ╡ t_Co is for the number of colors that actually is available, setting the wrong value to config a color scheme is a bit of a hack
     ↪ ╡ we could add it back if a lot of popular color schemes rely on it  (but I don't think so)

Maybe this provides more insight.

@dngray
Copy link
Contributor Author

dngray commented Mar 4, 2020

I also found this might be worth taking a look at lifepillar/vim-solarized8#71

@dngray
Copy link
Contributor Author

dngray commented Mar 4, 2020

I think I'd look at this commit lifepillar/vim-solarized8@de124fa

Maybe we could have a selenized_use16 variable, that seems to be the way to do it.

And to make sure we set "Neovim = yes" as I noticed in the docs #59 (comment) seems @lifepillar has done that for his solarized8 theme too: https://github.com/lifepillar/vim-solarized8/blob/master/templates/_info.colortemplate#L8

@jan-warchol
Copy link
Owner

Thanks for the research! I'll look at it tomorrow. For now I'm pushing a commit that styles completion menu.

@dngray
Copy link
Contributor Author

dngray commented Mar 5, 2020

I did notice a couple of things, the old theme (bottom) had highlighting for incorrect spelling, and for hyperlinks. I'm sure you're gradually working these things back in.

spelling_error_hyperlink.

I'm personally a fan of underlining incorrect spelling as opposed to highlighting it as the word remains readable.

See this example with Solarized8:

solarized8_wavy

Generally red underlining is used for grammar, green/blue is used for grammar.

@jan-warchol
Copy link
Owner

I did notice a couple of things, the old theme (bottom) had highlighting for incorrect spelling, and for hyperlinks. I'm sure you're gradually working these things back in.

spelling_error_hyperlink.

I've just added styling for links and underlined elements. As for incorrect spelling, I'm not sure why it's not working. I suppose that "Error" is group responsible for styling it, and it is already configured (btw, you can check highlighting group names with :call SyntaxAttr()).

Thanks for the research! I'll look at it tomorrow. For now I'm pushing a commit that styles completion menu.

I've tried adding an option just like solarized_use16 and... it worked except for yellow color 😕 (in both Vim and Neovim). I went on reading what you found but didn't manage to solve it. I am completely brainf***** with regard to this.

I'd like to leave it as is for now (with a note about the workaround) and merge this PR, as it's getting quite long. The discussion in issue #47 is also very long and mostly related to how colortemplate works. Therefore I suggest to close it and move unsolved parts to separate issues. Do you agree?

@dngray
Copy link
Contributor Author

dngray commented Mar 6, 2020

I'd like to leave it as is for now (with a note about the workaround) and merge this PR, as it's getting quite long. The discussion in issue #47 is also very long and mostly related to how colortemplate works. Therefore I suggest to close it and move unsolved parts to separate issues. Do you agree?

Sure sounds good. You've done some awesome work here.

@dngray
Copy link
Contributor Author

dngray commented Mar 6, 2020

@jan-warchol did you get my email?

@jan-warchol
Copy link
Owner

jan-warchol commented Mar 6, 2020

@jan-warchol did you get my email?

Yes, yes, I'm just a little busy. I'll reply in more detail in the evening.

I'd like to leave it as is for now (with a note about the workaround) and merge this PR, as it's getting quite long. The discussion in issue #47 is also very long and mostly related to how colortemplate works. Therefore I suggest to close it and move unsolved parts to separate issues. Do you agree?

Sure sounds good. You've done some awesome work here.

Thanks! I was motivated by your patience and help, it is very welcome! :-)

I'll just push README commit that I wrote in the morning so that you can take a look and merge in the evening.
edit: hmm, looks like I've already pushed it :p

@dngray
Copy link
Contributor Author

dngray commented Mar 6, 2020

Thanks! I was motivated by your patience and help, it is very welcome! :-)

You've chosen some great colours, and I'm really terrible at that kind of thing. Looking back at solarized now, the background is too dark, so I guess I am a selnized convert.

About the only other theme I've seen recently that has made me not want to vomit was Nord.

I'll just push README commit that I wrote in the morning so that you can take a look and merge in the evening.

Yeah I had a skim through it and didn't see anything wrong. Glad we got colortemplate to work.

@jan-warchol jan-warchol merged commit 76b0a15 into jan-warchol:master Mar 6, 2020
@dngray dngray deleted the pr_vim branch March 7, 2020 04:53
clach04 pushed a commit to clach04/selenized that referenced this pull request Dec 14, 2024
Use vim-colortemplate to generate vim theme files in all 4 variants
(dark, light, black, white). Styling is almost the same as in previous
version of the theme.

It also fixes jan-warchol#33 and closes jan-warchol#62 (makes it obsolete).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vim colorscheme, separate repo, togglebg, 24bit RGB
2 participants