Giter Site home page Giter Site logo

vim-one's Introduction

Logo

Light and dark vim colorscheme, shamelessly stolen from atom (another excellent text editor). One supports true colors and falls back gracefully and automatically if your environment does not support this feature.

Vim Airline theme

Add the following line to your ~/.vimrc or ~/.config/nvim/init.vim

let g:airline_theme='one'

As for the colorscheme, this theme comes with light and dark flavors.

List of enhanced language support

Pull requests are more than welcome here. I have created few issues to provide a bare bone roadmap for this color scheme.

Stable

  • Asciidoc
  • CSS and Sass
  • Cucumber features
  • Elixir
  • Go
  • Haskell
  • HTML
  • JavaScript, JSON
  • Markdown
  • PureScript (thanks: Arthur Xavier)
  • Ruby
  • Rust (thanks: Erasin)
  • Vim
  • XML

In progress

  • Jade
  • PHP
  • Python
  • Switch to estilo in progress, not stable at all and does not reflect all the capabilities of the current mainstream version

Installation

You can use your preferred Vim Package Manager to install One.

Usage

One comes in two flavors: light and dark.

colorscheme one
set background=dark " for the dark version
" set background=light " for the light version

set background has to be called after setting the colorscheme, this explains the issue #21 where Vim tries to determine the best background when ctermbg for the Normal highlight is defined.

Italic support

Some terminals do not support italic, cf. #3.

If your terminal does support italic, you can set the g:one_allow_italics variable to 1 in your .vimrc or .config/nvim/init.vim:

set background=light        " for the light version
let g:one_allow_italics = 1 " I love italic for comments
colorscheme one

iTerm2 can support italic, follow the instructions given in this blog post by Alex Pearce. Make sure to read the update if you are using tmux version 2.1 or above.

True color support

To benefit from the true color support make sure to add the following lines in your .vimrc or .config/nvim/init.vim

"Credit joshdick
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
  if (has("nvim"))
    "For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
    let $NVIM_TUI_ENABLE_TRUE_COLOR=1
  endif
  "For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
  "Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
  " < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
  if (has("termguicolors"))
    set termguicolors
  endif
endif


set background=dark " for the dark version
" set background=light " for the light version
colorscheme one

Tmux support

To get true color working in tmux, ensure that the $TERM environment variable is set to xterm-256color. Inside the .tmux.conf file we need to override this terminal and also set the default terminal as 256 color.

# Add truecolor support
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Default terminal is 256 colors
set -g default-terminal "screen-256color"

Note that this only works for Neovim (tested on 0.1.5). For some reason Vim (7.5.2334) doesn't play nice. See blog post by Anton Kalyaev for more details on setting up tmux.

For Vim inside tmux, you can add the following snippet in your ~/.vimrc

set t_8b=^[[48;2;%lu;%lu;%lum
set t_8f=^[[38;2;%lu;%lu;%lum

Note: the ^[ in this snippet is a real escape character. To insert it, press Ctrl-V and then Esc.

I've tested the following setup on a Mac:

  • iTerm2 nightly build
  • Neovim 0.1.4 and 0.1.5-dev
  • Vim 7.4.1952

Customising One without fork

Following a request to be able to customise one without the need to fork, one is now exposing a public function to meet this requirement.

After the colorscheme has been initialised, you can call the following function:

one#highlight(group, fg, bg, attribute)
  • group: Highlight you want to customise for example vimLineComment
  • fg: foreground color for the highlight, without the '#', for example: ff0000
  • bg: background color for the highlight, without the '#', for example: ff0000
  • attribute: bold, italic, underline or any comma separated combination

For example:

call one#highlight('vimLineComment', 'cccccc', '', 'none')

Contributors

A special thank you to the following people

vim-one's People

Contributors

actions-user avatar adrian5 avatar andrepolischuk avatar arthurxavierx avatar ashfinal avatar erasin avatar fatalis avatar geoffharcourt avatar jonsmithers avatar kdheepak avatar lucas1 avatar malramsay64 avatar martybegood avatar nguquen avatar rakr avatar rootulp avatar rwmpelstilzchen avatar salemhilal avatar siegelaaron94 avatar wsdjeg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-one's Issues

Improve C/C++ color scheme

Look in the image, C/C++ comments are shown brighter than onedark does. In my opinion (no an expert on colors schemes), comments should be more obscure, like onedark is showing. (vim one at the left, onedark at the right)

Also there are color difference in C language keywords, like if and return. I think they should have the same color. These are all the C keywords: http://en.cppreference.com/w/c/keyword

constants in C are formatted like strings

"keywords" like NULL, stderr, ... in C are formatted like strings. This is a bit confusing.

screenshot from 2017-02-22 10-00-36

In atom it looks like this:

screenshot from 2017-02-22 10-02-13

Do you mind chaning it?


I also saw, that atom treats struct members differently. Stuff like this:

s->bla = 5;

atom
screenshot from 2017-02-22 10-04-09

vim

screenshot from 2017-02-22 10-04-31


edit: look at the first screenshot. There are even more differences. e.g. the datetypes do not match.

Turecolor support in Tmux

Hi Nice Color scheme.

However, I could get the it working 100% in just Vim, but not in the Vim within Tmux. I tried to put the following lines of code in my .tmux.config, didn't seem working.

set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",screen-256color:Tc"

Any ideas?

Just Vim:

image

Vim within Tmux:

image

Dark theme doesn't work

screen shot 2017-01-17 at 3 01 57 pm
set background=dark
before colorscheme one

doesn't work, please help.
Really want to use this atom dark theme.
Please help.

Color weirdness.

Any idea why the dark theme doesn't fill in all the colors? The light theme works well.
screen shot 2017-06-18 at 4 09 30 pm
screen shot 2017-06-18 at 4 11 22 pm

Highlighted text on search

Hi @rakr,

if I am searching for a word, the suggested text is not highlighted well.
In the example I am search for the word File.

image

image

If you complete the search with CR I get a nice highlight.

image

image

Cyan defined twice in light background

Hi. Thanks for developing this nice color scheme!

I just looked at the source code and found that, in colors/one.vim, cyan (s:hue_1) is defined twice (#0184bc and then #0083be) at lines 269-270.
I guess #0184bc is the original definition of one light, but #0184bc is overwritten by #0083be.
These two colors are too close to distinguish from one another with my eyes, so it actually does not matter.
However, is there any reason to do that or is it just a bug?

Strange background color.

Hello,
I've been trying to figure out what is causing this issue when trying to use your color scheme. Applying the color scheme with set background=dark ends up looking like this.

https://i.imgur.com/jUCpuei.png

I have tried with 2 terminals, gnome-terminal and urxvt. both have 256 color support enabled.

I have tried creating a new vim install in a vm to verify it's not my personal configuration causing an issue.

output of vim --version
https://hastebin.burningsmile.tech/wosocugasi.diff

Thanks,

gVim E254: Cannot allocate color #none

Hi,
I'm getting following errors with gVim on Linux

Error detected while processing function 23_X: line 25:
E254: Cannot allocate color #none

After some investigation I found that changing following lines from
call <sid>X('MatchParen', s:hue_5, 'none', 'underline')
call <sid>X('MatchTag', s:hue_5, 'none', 'underline')
to

call <sid>X('MatchParen', s:hue_5, '', 'underline')
call <sid>X('MatchTag', s:hue_5, '', 'underline')`

fixes errors but gives me ugly background color.
To temporarily fix that I've put following in my .vimrc
hi MatchParen guibg=NONE

I believe initial error is caused by vim receiving #none instead of none as guibg argument.

Inactive tabs in gvim

Hey there,
I really like this scheme, I just noticed a little glitch.
In gvim the background and foreground color of inactive tabs are almost identical
screenshot_20160629_123711

cheers

Maybe need some improvement on VertSplit and Folded background?

Thanks for your wonderful colorscheme, I've made it the default one to my vimrc configuration. ๐Ÿ‘
Good job!

Still I found one or two places which could be improved (at least in my opinion). i.e. VertSplit and Folded background.

As far as I see, Folded background is not necessary. Long โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€”โ€” differs it from other contents, explicitly telling users it is a folded block. VertSplit background actually doesn't help, just makes this colorscheme not so attractive.

As for VertSplit, the absence of bg color makes it different to tell which split is which. And sometimes I disable linenumber display, which simply crowds all splits together and makes things worse.

I've create a PR for this at here #58 . Please try it out and decide to merge or not by yourself.

reloading init.vim swaps colors

I have noticed that the colors rendered can change after the event of a reloading .config/nvim/init.vim.

Here, I am using the following lines in my init.vim file:

  call dein#add('rakr/vim-one')

  syntax on
  colorscheme one
  set background=dark
  let g:one_allow_italics = 1

  let g:airline_theme='one'

I am using neovim and iTerm 2. True colors has been set via set termguicolors in neovim config.

I've included a screen share of the issue. Please let me know if more info is needed:
may-30-2017 15-52-24

Thank you ๐Ÿ™๐Ÿฝ

My first impression:
Just want to thank you guys for making this lovely theme, the colors are just beautiful & made me love my VIM even more.
Worked smoothly out of the box with True colors, what else can you can ask for.. โค๏ธ

screen shot 2017-10-01 at 12 40 28 am

Beautiful !

Showing confusing matching

I'm facing an weird situation here. If I use the colorscheme, and have some code like

if (var == 1) {
}

When I'm on the first (, it shows ) using bold, with black over red. When I'm on {, it shows the } using bold, with black over red. So it makes me feels that I'm on the end char when I'm on the start! Don't know if there are some configuration for that, but on other themes it works ok.

Title color broken

In commit b6e41f2 the color of the Title attribute is changed from 'hue_4 to mono_3. In the following commit 186027a this is 'fixed' by linking groups that were previously linked to Title to String which also has the hue_4 color.

The solution to fixing the readability of the selected tab is solved in b6e41f2 but at the expense of having to change every other attribute that references Title

Add support for Groovy

Hello,

Thank you for the great color scheme. How difficult is it to add support for new languages? Would it be possible to add support for groovy?

Here is a screenshot of what it currently looks like:

image

I'm willing to help if you can give me some pointers!

Vim inside of tmux is broken VIM 8.0

I've been trying to get vim to work inside of tmux, with this color scheme, with no luck. Can you please let me know why this doesn't work, or how I can get it to work on OSX?

Can't use this if it won't allow me to use vim inside of tmux. Not sure that I want to switch to NeoVim yet. Please let me know if this is possible to get working.

set t_8b=^[[48;2;%lu;%lu;%lum
set t_8f=^[[38;2;%lu;%lu;%lum

Thank You.

How to adjust background?

First of all thanks for this colorscheme. I mostly use the one with light background, but sometimes wish to adjust its background brightness. For example make bg a little darker or brighter depending on external illumination. How do I accomplish this? It is not clear from the readme page, should I use public one#highlight function? If yes, then which group?

Undercurl not working

If I use vim-one the underlining does not work. Changing the colorscheme fixes this issue, hence I think it is the problem of vim-one.

I am using NVIM v0.2.0-1171-g4566f7c on Debian in the Konsole terminal.

Italic comment for C++

Hi

really like your "one" color scheme. thank you!

I used Vim with one color scheme to edit a cpp file today, and noticed that the comments are not italic, italic comment works fine with other file types.

italic comment for C++ used to work. not sure what is going wrong, might be vim itself.

Can you have a look please?

Thanks
B

echo g:colors_name output Undefined on set background=dark

Hi @rakr,
I'm a big fan of vim one made by you.

I found something wrong with this color scheme. Somehow the color looks different from the one on the screenshot here.

Look at the colors in the NERDTree section, the colors are clearly little bit different.
Differences

Somehow, if I give the command :colorscheme onedirectly then the color becomes as it should be.
Work temporarily

Another thing is if I use set background = light then the color will be normal.

.vimrc
colorscheme one 
set background = dark

with this settings if i type :colorscheme, it will output colorscheme default. It should output colorscheme one right?

I did another test using :echo g:colors_name

still using the same settings

.vimrc
colorscheme one 
set background = dark

If I run the command :echo g:colors_name
Output
E121: Undefined variable: g:colors_name
E15: Invalid expression: g:colors_name

But if I change the settings to set background = light then if I run command :colorscheme it will output.
colorscheme one
and run command :echo g:colors_name it will output one which is what I expected.

Video version :

Video Version

So, I think there is something wrong with vim one colorscheme and set background = dark

I apologize if my question is too stupid also my English is so bad and bother you. Thank you for the help! ๐Ÿ˜บ

*-256color and gvim support

support gvim (easy -- how could this not be supported?)

support *-256color TERMs (harder because you have to configure palette)

Loading vim-one resets background light

Somehow loading vim-one, specifically executing hi Normal ... inside the script, resets background light even if I set it dark.

Below I describe the method to reproduce this problem.

Reprodcution

NeoVim version

NVIM 0.1.7
Build type: RelWithDebInfo
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -I/tmp/neovim-20161208-67773-1y796t8/neovim-0.1.7/build/config -I/tmp/neovim-20161208-67773-1y796t8/neovim-0.1.7/src -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/usr/include -I/tmp/neovim-20161208-67773-1y796t8/neovim-0.1.7/build/src/nvim/auto -I/tmp/neovim-20161208-67773-1y796t8/neovim-0.1.7/build/include
Compiled by [email protected]

Optional features included (+) or not (-): +acl   +iconv    -jemalloc +tui
For differences from Vim, see :help vim-differences

      ใ‚ทใ‚นใƒ†ใƒ  vimrc: "$VIM/sysinit.vim"
       ็œ็•ฅๆ™‚ใฎ $VIM: "/usr/local/Cellar/neovim/0.1.7/share/nvim"

Minimal configuration

> tree .config/nvim
.config/nvim
โ”œโ”€โ”€ autoload
โ”‚ย ย  โ””โ”€โ”€ plug.vim
โ”œโ”€โ”€ init.vim
โ””โ”€โ”€ plugged
    โ””โ”€โ”€ vim-one
        โ”œโ”€โ”€ README.md
        โ”œโ”€โ”€ autoload
        โ”‚ย ย  โ””โ”€โ”€ airline
        โ”‚ย ย      โ””โ”€โ”€ themes
        โ”‚ย ย          โ””โ”€โ”€ one.vim
        โ”œโ”€โ”€ colors
        โ”‚ย ย  โ””โ”€โ”€ one.vim
        โ””โ”€โ”€ screenshots
            โ”œโ”€โ”€ insert-dark.png
            โ”œโ”€โ”€ insert-light.png
            โ”œโ”€โ”€ logo.png
            โ”œโ”€โ”€ normal-dark.png
            โ”œโ”€โ”€ normal-light.png
            โ”œโ”€โ”€ one.png
            โ”œโ”€โ”€ replace-dark.png
            โ”œโ”€โ”€ replace-light.png
            โ”œโ”€โ”€ visual-dark.png
            โ””โ”€โ”€ visual-light.png

8 directories, 15 files

In init.vim, I put the following:

set tgc  " This line is not necessary for reproduction 
call plug#begin('~/.config/nvim/plugged')
Plug 'rakr/vim-one'
call plug#end()
set bg=dark
colo one

Then I added some debug messages to color/one.vim:

diff --git a/colors/one.vim b/colors/one.vim
index b555a8d..0c1e6ea 100644
--- a/colors/one.vim
+++ b/colors/one.vim
@@ -225,7 +225,9 @@ if has('gui_running') || &t_Co == 88 || &t_Co == 256
       exec 'hi ' . a:group . ' guifg=#' . a:fg . ' ctermfg=' . <SID>rgb(a:fg)
     endif
     if a:bg !=? ''
+      if a:group ==# 'Normal' | echom "Before hi Normal ...:" &bg | endif
       exec 'hi ' . a:group . ' guibg=#' . a:bg . ' ctermbg=' . <SID>rgb(a:bg)
+      if a:group ==# 'Normal' | echom "After hi Normal ...:" &bg | endif
     endif
     if a:attr !=? ''
       exec 'hi ' . a:group . ' gui=' . l:attr . ' cterm=' . l:attr
@@ -334,7 +336,9 @@ if has('gui_running') || &t_Co == 88 || &t_Co == 256
   call <sid>X('WarningMsg',   s:hue_5,         '',               '')
   call <sid>X('TooLong',      s:hue_5,         '',               '')
   call <sid>X('WildMenu',     s:syntax_fg,     s:mono_3,         '')
+  echom "Before call <SID>X('Normal', ...):" &bg
   call <sid>X('Normal',       s:syntax_fg,     s:syntax_bg,      '')
+  echom "After call <SID>X('Normal', ...):" &bg
   call <sid>X('SignColumn',   '',              s:mono_3,         '')
   call <sid>X('Special',      s:hue_2,         '',               '')
   " }}}

Output

> nvim
Before call <SID>X('Normal', ...): dark
Before hi Normal ...: dark
After hi Normal ...: light
After call <SID>X('Normal', ...): light

Wrong triangle colors in airline theme

Thanks for the great atom one theme port, I use your theme as my main theme. ๐Ÿ‘

When using multiple tabs in vim the triangles of the airline tabline get a wrong color:

tabbar

I noticed that the statusline triangles sometimes also get a wrong background color.

Styling Request: More Atom-like Diff Styles

This is more of a personal preference thing, but I'd love to see Diff styling that looks more like the original Atom versions of the theme, with red/green backgrounds rather than foregrounds. The Github Colorscheme for Vim does something similar to this. Thanks!

Atom One:

atom_one_light_diff

atom_one_dark_diff

Vim One

vim_one_light_diff

vim_one_dark_diff

Vim Github Colorscheme

vim_github_diff

Support iterm2 color scheme

Thank you very much for the color scheme. I would say this is the best one for javascript syntax highlight. Is there any chance to make a support for iterm2 color scheme ?

License

I noticed you do not have a license included. Would you like to include one?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.