41

GitHub - nightsense/cosmic_latte: ☕ vim + emacs + textmate/sublime + atom + term...

 4 years ago
source link: https://github.com/nightsense/cosmic_latte
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

cosmic_latte

wayup.jpg from highest heaven…

latte.png

become one with the UIverse

waydn.jpg …to deepest ocean

screenshot of the cosmic_latte vim theme, light version

screenshot of the cosmic_latte vim theme, dark version

Normal bg 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f6666663865372e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f6334343735362e706e67 Identifier 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f6331376238642e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3230326133312e706e67 Normal bg ColorColumn 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f6566653464322e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3931366430332e706e67 Special 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f6232383736312e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3262333734302e706e67 ColorColumn MatchParen 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f6231623461322e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3166383333322e706e67 Statement 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3764393736312e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3463353736342e706e67 MatchParen Comment 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3633373537652e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3030376638612e706e67 PreProc 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3435396439302e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3839386639652e706e67 Comment Normal fg 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3438356136322e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3030373563392e706e67 Constant 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3534393662642e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f6162623063302e706e67 Normal fg Cursor 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3336343835302e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f6131353461652e706e67 Type 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3962383562622e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f6335636264622e706e67 Cursor Search 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f6636633936372e706e67

687474703a2f2f7777772e636f6c6f72686578612e636f6d2f6666303035362e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3030393666662e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3030613663302e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f6465336666632e706e67

Spell

687474703a2f2f7777772e636f6c6f72686578612e636f6d2f6331376238642e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3534393662642e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3435396439302e706e67 687474703a2f2f7777772e636f6c6f72686578612e636f6d2f3962383562622e706e67

687474703a2f2f7777772e636f6c6f72686578612e636f6d2f6232383736312e706e67 Search

All colors are derived from the average color of the universe
through application of the golden ratio, simple contrast ratios,
and simple multiples, using the LCh color model.

See the snow repository for syntax highlighting color logic.

installation

If you don’t have a preferred plugin management method, consider vim-plug, which can be installed (on *nix systems) with:

curl -fLo ~/.vim/autoload/plug.vim –create-dirs \
  https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

With vim-plug, cosmic_latte can be installed by adding the following to the top of your vimrc:

call plug#begin('~/.vim/plugged')
Plug 'nightsense/cosmic_latte'
call plug#end()

…then restarting vim, followed by running :PlugUpdate (at the vim command line).

activation

To activate the light version of cosmic_latte:

set background=light
colorscheme cosmic_latte

Or the dark version:

set background=dark
colorscheme cosmic_latte

To set the version automatically based on vim launch time:

if strftime('%H') >= 7 && strftime('%H') < 19
  set background=light
else
  set background=dark
endif
colorscheme cosmic_latte

…which activates the light version during the day (defined here as 7AM-7PM), dark version at night.

Be sure to set colorscheme after background, otherwise some theme colors may not be applied.

status line themes

Themes for airline and lightline can be activated with the following vimrc code:

airline lightline let g:airline_theme='cosmic_latte_light' let g:lightline = { 'colorscheme': 'cosmic_latte_light' } let g:airline_theme='cosmic_latte_dark' let g:lightline = { 'colorscheme': 'cosmic_latte_dark' }

Status line themes can be added to the time-based snippet above:

if strftime('%H') >= 7 && strftime('%H') < 19
  set background=light
  let g:lightline = { 'colorscheme': 'cosmic_latte_light' }
else
  set background=dark
  let g:lightline = { 'colorscheme': 'cosmic_latte_dark' }
endif
colorscheme cosmic_latte

terminal vim

colors

Terminals/multiplexers with true-color support can precisely display the theme colors.

In most cases, the only required vimrc setting is:

set termguicolors

In some cases (see :h xterm-true-color for explanation) it may be necessary to add:

let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"

If termguicolors is not set, terminal vim will fall back to a rough approximation of the theme, drawing from the terminal emulator's 256-color palette (if present).

The fallback version of cosmic_latte defines colors using numbers in the range 0-255 (as opposed to 6-character hex codes, whose range of 224 values provides "true color"). Terminal emulators with 256-color support understand this encoding, though they vary in the exact color associated with each number. The closest thing to a standard 256-color *nix palette is that used by xterm, the default X Windows terminal emulator.

cursor shape

To set mode-specific cursor shapes in terminal vim, see the Vim Tips Wiki.

For instance, to set cursor shapes in vte-compatible terminals:

let &t_SI = "\<Esc>[6 q"
let &t_SR = "\<Esc>[4 q"
let &t_EI = "\<Esc>[2 q"

…which sets the cursor to a vertical line for insert mode, underline for replace mode, and block for normal mode.

shell

colors

Many terminal emulators (including iTerm2, GNOME Terminal, Pantheon Terminal, MATE Terminal, Xfce Terminal, LXTerminal, Terminator, Guake, Alacritty, and kitty) can be themed by sourcing the color-setting shell scripts included with cosmic_latte. You can download these scripts directly to a folder of your choosing, and source them from there; or, if cosmic_latte is already installed as a vim plugin, you can source them from the vim plugin path (which varies by plugin management method).

For instance, if you use vim-plug and want to apply the dark cosmic_latte theme to your bash or zsh shell, add the following to ~/.bashrc or ~/.zshrc:

[ -n "$PS1" ] && sh ~/.vim/plugged/cosmic_latte/shell/cosmic_latte_dark.sh

Or for the fish shell, add to ~/.config/fish/config.fish:

if status –is-interactive
  sh ~/.vim/plugged/cosmic_latte/shell/cosmic_latte_dark.sh
end

If you use vundle, replace plugged in the above paths with bundle.

Replace dark with light for the light theme.

dircolors

Color output (for distinguishing file types) of the ls command can be themed by sourcing the included "dircolors" file. The path to this file will depend on your vim plugin management method.

For instance, if you use vim-plug and want to apply the cosmic_latte dircolors to your bash or zsh shell, add the following to ~/.bashrc or ~/.zshrc:

eval `dircolors ~/.vim/plugged/cosmic_latte/shell/dircolors`

Or for the fish shell, add to ~/.config/fish/config.fish:

eval (dircolors -c ~/.vim/plugged/cosmic_latte/shell/dircolors)

If you use vundle, replace plugged in the above paths with bundle.

fish syntax

Again, the script path will depend on your plugin management method.

For the dark theme in a vim-plug setup, add to ~/.config/fish/config.fish:

source ~/.vim/plugged/cosmic_latte/shell/cosmic_latte_dark.fish

other themes

emacs

  • put these files somewhere in your load-path: dash.el + cosmic_latte_light.el | cosmic_latte_dark.el
    • for instance, you could put them in ~/.emacs.d/load
    • and put (add-to-list 'load-path "~/.emacs.d/load") in your init.el
  • put these files in ~/.emacs.d/themes: cosmic_latte_light-theme.el | cosmic_latte_dark-theme.el
  • put (add-to-list 'custom-theme-load-path "~/.emacs.d/themes") in your init.el
  • load cosmic_latte manually with M-x load-theme
    • or automatically with (load-theme 'cosmic_latte_light' t) in your init.el, for the light version
    • or (load-theme 'cosmic_latte_dark' t) for the dark version

This emacs theme is, for now, simply a find/replace conversion of bbatsov/solarized-emacs.

TextMate | Sublime Text

  • download theme file (light | dark)
  • for TextMate: double-click the file to install and activate it
    • the theme will become available in Preferences > Fonts & Colors
  • for Sublime Text:
    • find your Packages folder by opening Sublime Text and navigating: Preferences > Browse Packages…
      • e.g. ~/.config/sublime-text-3/Packages/User/
    • place theme file in Packages folder
    • activate from the list at: Preferences > Color Scheme…

This theme is, for now, simply a find/replace conversion of deplorableword/textmate-solarized.

Atom

  • add contents of theme file (light | dark) to your styles.less
    • you can open this file from Atom by navigating: Edit > Preferences > Themes > "your stylesheet"
    • alternatively, save the theme file somewhere else and add an @import to styles.less
      • e.g. @import "/home/username/.atom/cosmic_latte_light.less";

These themes are based on One Light/Dark Syntax.

terminals

  • iterm2
    • download theme file (light | dark)
    • launch iTerm and navigate: iTerm > Preferences > Profiles > Colors > Presets… > Import…
    • select downloaded file, then select cosmic_latte theme from Preset… menu
  • kitty
    • add contents of theme file (light | dark) to ~/.config/kitty/kitty.conf, or download theme file and source from kitty.conf (e.g. include ~/path/to/theme/cosmic_latte-light.conf)
  • konsole
    • download theme file (light | dark) to ~/.local/share/konsole, retaining file extension .colorscheme
    • launch Konsole and navigate: Settings > Edit Current Profile… > Appearance
    • select cosmic_latte theme from Color Schemes & Background pane
  • st
  • xresources

misc


68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d6133316633342e7376673f7374796c653d666c61742d737175617265     68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d616465253230776974682d507974686f6e2d3330363939382e7376673f7374796c653d666c61742d737175617265     68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d616465253230776974682d666973682d6432323332612e7376673f7374796c653d666c61742d737175617265     68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d616465253230776974682d436f6c6f7274656d706c6174652d3030376630302e7376673f7374796c653d666c61742d737175617265     68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6d656574732532307374616e646172642d342e3525334131253230726561646162696c697479253230636f6e74726173742d3030356139632e7376673f7374796c653d666c61742d737175617265

The 4.5:1 W3C contrast ratio standard for readability is met by all text-background combinations, with the exception of some transient highlighting (e.g. cursorline/column), which nonetheless well exceeds the minimal ISO 3:1 standard. image credits: other credits:

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK