Skip to content

Commit

Permalink
Merge branch 'joshdick-main'
Browse files Browse the repository at this point in the history
* joshdick-main:
  Lighten up cursor_grey
  Fix misleading example in README. (joshdick#291)
  Update Neovim LSP colors (joshdick#288)
  Add Selection colors for alacritty (joshdick#283)
  Add monsonjeremy/onedark.nvim to relative section (joshdick#282)
  chore: Update old "master" branch refernces to use "main" instead (joshdick#277)
  Overhaul 16-color styling (joshdick#271)
  chore(build): Build/linting infrastructure updates. (joshdick#276)
  chore(plugins): Add list of supported plugins to README, update companion links (joshdick#275)
  feat(plugin): Add support for lewis6991/gitsigns.nvim (joshdick#274)
  fix(nvim-lsp): Make nvim-lsp highlighting consistent with existing related highlighting (joshdick#273)
  fix: prabirshrestha/vim-lsp is not Neovim LSP :) (joshdick#270)
  Improve Neovim LSP highlighting (joshdick#269)
  feat: Add higlight groups for neoclide/coc.nvim (joshdick#268)
  Added navarasu/onedark.nvim to relative section (joshdick#266)
  Add KDE Konsole colorscheme (joshdick#265)
  chore(build): Update dependencies and regenerate lockfile (joshdick#267)
  README.md: Add link to ii14/onedark.nvim in "relatives" section (joshdick#261)
  fix: upgrade termcolors from 0.7.2 to 0.7.3 (joshdick#258)
  Bump lodash from 4.17.20 to 4.17.21 in /build (joshdick#256)
  • Loading branch information
ckolos committed Feb 27, 2022
2 parents ad215dd + 0211431 commit 3773af2
Show file tree
Hide file tree
Showing 30 changed files with 5,292 additions and 1,609 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"env": {
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"rules": {
"no-console": ["off"]
}
}
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
Thank you!
-->

- [ ] I have carefully read and followed the [Installation section of the README](https://github.com/joshdick/onedark.vim#installation)
- [ ] I have searched through the [closed issues](https://github.com/joshdick/onedark.vim/issues?q=is%3Aissue+is%3Aclosed) to see if there is an existing solution for my issue

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Validate Templates
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
build/node_modules
node_modules
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm test
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.org
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"arrowParens": "avoid",
"printWidth": 120,
"singleQuote": true,
"trailingComma": "none"
}
33 changes: 17 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,48 @@ The basic idea is that these files are generated by a build tool that substitute

Here are the locations of the files that are generated by the build system, along with the locations of the corresponding templates they are generated from:

| Theme Location | Template Location |
|----------------------------------------------|------------------------------------------|
| `autoload/onedark.vim` | `build/templates/autoload.template.vim` |
| `term/One Dark.Xresources` | `build/templates/One Dark.Xresources` |
| `term/One Dark.itermcolors` | `build/templates/One Dark.itermcolors` |
| `term/One Dark.terminal` | `build/templates/One Dark.terminal` |
| `term/One Dark.alacritty` | `build/templates/One Dark.alacritty` |
| Theme Location | Template Location |
| --------------------------- | --------------------------------------- |
| `autoload/onedark.vim` | `build/templates/autoload.template.vim` |
| `term/One Dark.Xresources` | `build/templates/One Dark.Xresources` |
| `term/One Dark.itermcolors` | `build/templates/One Dark.itermcolors` |
| `term/One Dark.terminal` | `build/templates/One Dark.terminal` |
| `term/One Dark.alacritty` | `build/templates/One Dark.alacritty` |
| `term/One Dark.colorscheme` | `build/templates/One Dark.colorscheme` |

### Configure It

1) Install [Node.js](https://nodejs.org/en/) (Installing via [nvm](https://github.com/creationix/nvm) or [homebrew](https://brew.sh) are both better options than the official Node.js installer.)
1. Install [Node.js](https://nodejs.org/en/) (Installing via [nvm](https://github.com/creationix/nvm) or [homebrew](https://brew.sh) are both better options than the official Node.js installer.)

2) Run the following from within the root of this repository. This will install the build system's dependencies and will automatically configure a Git pre-commit hook that runs `npm test` (see below).
2. Run the following from within the root of this repository. This will install the build system's dependencies and will automatically configure a Git pre-commit hook that runs `npm test` (see below).

```bash
> cd build
> npm install
```

That's it!

### Use It

The build system consists of a single Node.js script, `build.js`, which supports two commands:
The build system consists of a single Node.js script, `build/build.js`, which supports two commands:

* Running `./build.js` or `npm run build` generates theme files from the templates, **overwriting changes to the theme files without confirmation.**
* Running `./build.js check` or `npm test` checks that the theme files match the template-generated output, **without modifying theme files**. This command ensures that the theme files perfectly match the templates they are generated from, which is useful for detecting changes that were made to generated theme files but that should have been made in the templates. (In addition to running `./build.js check`, `npm test` also runs [eslint](http://eslint.org) linting on the build system code to catch and prevent simple problems with changes to that code.)
- Running `./build/build.js` or `npm run build` generates theme files from the templates, **overwriting changes to the theme files without confirmation.**
- Running `./build/build.js check` or `npm test` checks that the theme files match the template-generated output, **without modifying theme files**. This command ensures that the theme files perfectly match the templates they are generated from, which is useful for detecting changes that were made to generated theme files but that should have been made in the templates.
- In addition to running `./build/build.js check`, `npm test` also runs linting and style checks on certain files to catch and prevent simple problems and stylistic inconsistency. If `npm test` reports any issues, many reported issues can be automatically fixed by running `npm run lint:fix`.)

The basic development workflow looks like this:

1. Make changes to the appropriate template files in `build/templates`, then run `npm run build` from inside the `build` directory.
1. Make changes to the appropriate template files in `build/templates`, then run `npm run build`.

2. Commit your change in Git. `npm test` will automatically run before your commit is finalized. If the test fails, fix any inconsistencies between the template files and theme files (or linting errors in `build.js` if applicable), then try committing again.
2. Commit your changes with Git. `npm test` will automatically run before your commit is finalized. If the test fails, fix any inconsistencies between the template files and theme files (or linting/style errors if applicable), then try committing again.

## Style Guidelines

Please match the existing comment and whitespace style in all template files.

For the "Language-Specific Highlighting" portion of onedark.vim, blocks for each language should be organized alphabetically ("Markdown" comes before "PHP").

Any changes to the JavaScript code in the build system should pass against the included eslint rules; you can manually check for linting errors by running `npm test` from inside the `build` directory.
All code changes should pass against the included linting and style checks. These checks are run via [husky](https://www.npmjs.com/package/husky) and [lint-staged](https://www.npmjs.com/package/lint-staged) when you attempt to commit changes. You can manually check for linting and stylistic issues by running `npm test`, and many reported issues can be automatically fixed by running `npm run lint:fix`.

## Thanks!

Expand Down
94 changes: 60 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
![onedark.vim](https://raw.githubusercontent.com/joshdick/onedark.vim/master/img/readme_header.png)
![onedark.vim](https://raw.githubusercontent.com/joshdick/onedark.vim/main/img/readme_header.png)

A dark Vim/Neovim color scheme for the GUI and 16/256/true-color terminals, based on [FlatColor](https://github.com/MaxSt/FlatColor), with colors inspired by the excellent [One Dark syntax theme](https://github.com/atom/atom/tree/master/packages/one-dark-syntax) for the [Atom text editor](https://atom.io).

## Color Reference

![Color Reference](https://raw.githubusercontent.com/joshdick/onedark.vim/master/img/color_reference.png)
![Color Reference](https://raw.githubusercontent.com/joshdick/onedark.vim/main/img/color_reference.png)

## Breaking Changes

[Pull request #271](https://github.com/joshdick/onedark.vim/pull/271), merged July 11, 2021, contained several breaking changes, especially for 16-color users.

If you are an existing onedark.vim user that is suddenly having issues after this PR was merged, see the [PR description](https://github.com/joshdick/onedark.vim/pull/271) for details.

## Supported Plugins

onedark.vim includes support for the following Vim and Neovim plugins:

- [airblade/vim-gitgutter](https://github.com/airblade/vim-gitgutter)
- [dense-analysis/ale](https://github.com/dense-analysis/ale)
- [easymotion/vim-easymotion](https://github.com/easymotion/vim-easymotion)
- [itchyny/lightline.vim](https://github.com/itchyny/lightline.vim)
- [lewis6991/gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim)
- [mhinz/vim-signify](https://github.com/mhinz/vim-signify)
- [neoclide/coc.nvim](https://github.com/neoclide/coc.nvim)
- [neomake/neomake](https://github.com/neomake/neomake)
- [Neovim LSP](https://neovim.io/doc/user/lsp.html)
- [plasticboy/vim-markdown](https://github.com/plasticboy/vim-markdown)
- [prabirshrestha/vim-lsp](https://github.com/prabirshrestha/vim-lsp)
- [tpope/vim-fugitive](https://github.com/tpope/vim-fugitive)
- [vim-airline/vim-airline](https://github.com/vim-airline/vim-airline)

## Installation

Expand Down Expand Up @@ -59,22 +83,22 @@ A dark Vim/Neovim color scheme for the GUI and 16/256/true-color terminals, base

**Note:** All options should be set **before** the `colorscheme onedark` line in your `~/.vimrc`.

* `g:onedark_hide_endofbuffer`: Set to `1` if you want to hide end-of-buffer filler lines (~) for a cleaner look; `0` otherwise (the default).
- `g:onedark_hide_endofbuffer`: Set to `1` if you want to hide end-of-buffer filler lines (~) for a cleaner look; `0` otherwise (the default).

* `g:onedark_termcolors` **(see [Troubleshooting](#troubleshooting) (below) for more information about this option)**: Set to `256` for 256-color terminals (the default), or set to `16` to use your terminal emulator's native 16 colors.
- `g:onedark_termcolors` **(see [Troubleshooting](#troubleshooting) (below) for more information about this option)**: Set to `256` for 256-color terminals (the default), or set to `16` to use your terminal emulator's native 16 colors.

* `g:onedark_terminal_italics`: Set to `1` if your terminal emulator supports italics; `0` otherwise (the default).
- `g:onedark_terminal_italics`: Set to `1` if your terminal emulator supports italics; `0` otherwise (the default).

## lightline.vim Colorscheme

![lightline-onedark.vim Preview](https://raw.github.com/joshdick/onedark.vim/master/img/preview_lightline.png)
![lightline-onedark.vim Preview](https://raw.github.com/joshdick/onedark.vim/main/img/preview_lightline.png)

This repository includes a companion [lightline.vim](https://github.com/itchyny/lightline.vim) colorscheme for use with onedark.vim.

The lightline.vim colorscheme:

* Depends on `autoload/onedark.vim` for its colors, and must therefore be used in conjunction with it.
* Works with both color modes available in onedark.vim (16 or 256 colors), as specified in the configuration for onedark.vim.
- Depends on `autoload/onedark.vim` for its colors, and must therefore be used in conjunction with it.
- Works with both color modes available in onedark.vim (16 or 256 colors), as specified in the configuration for onedark.vim.

### Installation

Expand All @@ -90,15 +114,15 @@ let g:lightline = {

## vim-airline Theme

![airline-onedark.vim Preview](https://raw.github.com/joshdick/onedark.vim/master/img/preview_airline.png)
![airline-onedark.vim Preview](https://raw.github.com/joshdick/onedark.vim/main/img/preview_airline.png)

This repository includes a companion [vim-airline](https://github.com/vim-airline/vim-airline) theme for use with onedark.vim.

The vim-airline theme:

* Depends on `autoload/onedark.vim` for its colors, and must therefore be used in conjunction with it.
* Works with both color modes available in onedark.vim (16 or 256 colors), as specified in the configuration for onedark.vim.
* Is based on vim-airline's ["tomorrow" theme](https://github.com/vim-airline/vim-airline-themes/blob/master/autoload/airline/themes/tomorrow.vim).
- Depends on `autoload/onedark.vim` for its colors, and must therefore be used in conjunction with it.
- Works with both color modes available in onedark.vim (16 or 256 colors), as specified in the configuration for onedark.vim.
- Is based on vim-airline's ["tomorrow" theme](https://github.com/vim-airline/vim-airline-themes/blob/master/autoload/airline/themes/tomorrow.vim).

### Installation

Expand All @@ -114,7 +138,7 @@ let g:airline_theme='onedark'

### Why do the colors in terminal Vim look totally crazy?

![Broken Colors](https://raw.githubusercontent.com/joshdick/onedark.vim/master/img/broken_colors.png)
![Broken Colors](https://raw.githubusercontent.com/joshdick/onedark.vim/main/img/broken_colors.png)

If Vim looks similar to the screenshot above, you have enabled Vim's 24-bit color terminal support, but your terminal doesn't support 24 bit color. Remove the relevant `~/.vimrc` configuration for enabling 24-bit color support to get things looking better.

Expand All @@ -128,27 +152,27 @@ However, you can use the `g:onedark_termcolors` option to control onedark.vim's

**When Vim/Neovim are configured to use 24-bit color, the `g:onedark_termcolors` option is ignored. However, `g:onedark_termcolors` can still coexist with 24-bit color configuration.** For instance, when tmux 2.1 or earlier and/or older Vim/Neovim versions that don't support 24-bit color are used, the `g:onedark_termcolors` option will take effect.

* **256-color mode** is enabled by default with no additional configuration, but colors are less accurate since they are approximated using a 256-color palette. The background color will appear darker than in the preview image, and most other colors will appear brighter than in the preview image. If you don't want to change your terminal's color palette as described in the 16-color mode section below, and your terminal doesn't support 24-bit color, 256-color mode is your only option.
- **256-color mode** is enabled by default with no additional configuration, but colors are less accurate since they are approximated using a 256-color palette. The background color will appear darker than in the preview image, and most other colors will appear brighter than in the preview image. If you don't want to change your terminal's color palette as described in the 16-color mode section below, and your terminal doesn't support 24-bit color, 256-color mode is your only option.

Although 256-color mode is enabled by default (when not using 24-bit color as described above), you can explicitly enable it by adding the following line to your `~/.vimrc`:
Although 256-color mode is enabled by default (when not using 24-bit color as described above), you can explicitly enable it by adding the following line to your `~/.vimrc`:

```vim
let g:onedark_termcolors=256
```
```vim
let g:onedark_termcolors=256
```

* **16-color mode** is the preferred option, since its colors are more accurate than those of 256-color mode. However, you'll need to set your terminal emulator's color palette to this color scheme's custom 16-color palette, since 16-color mode will cause the color scheme to use your terminal emulator's native 16 colors. If you don't use the custom 16-color palette in your terminal emulator when 16-color mode is enabled, onedark.vim's colors will not display correctly in Vim.
- **16-color mode** is the preferred option, since its colors are more accurate than those of 256-color mode. However, you'll need to set your terminal emulator's color palette to this color scheme's custom 16-color palette, since 16-color mode will cause the color scheme to use your terminal emulator's native 16 colors. If you don't use the custom 16-color palette in your terminal emulator when 16-color mode is enabled, onedark.vim's colors will not display correctly in Vim.

The canonical version of the 16-color palette is an [Xresources](https://en.wikipedia.org/wiki/X_resources) file located in this repository at `term/One Dark.Xresources`. Color schemes for various terminal emulators are also provided in `term/`. (The [iTerm2](https://iterm2.com/) color scheme works with iTerm2 versions 2.9.x and later.) You should be able to easily convert the Xresources color scheme for use with your terminal emulator of choice either by hand, or automatically by using [termcolors](https://github.com/stayradiated/termcolors).
The canonical version of the 16-color palette is an [Xresources](https://en.wikipedia.org/wiki/X_resources) file located in this repository at `term/One Dark.Xresources`. Color schemes for various terminal emulators are also provided in `term/`. (The [iTerm2](https://iterm2.com/) color scheme works with iTerm2 versions 2.9.x and later.) You should be able to easily convert the Xresources color scheme for use with your terminal emulator of choice either by hand, or automatically by using [termcolors](https://github.com/stayradiated/termcolors).

Assuming your terminal emulator is configured to use the custom 16-color palette as described above, add the following line to your `~/.vimrc` to enable 16-color mode:
Assuming your terminal emulator is configured to use the custom 16-color palette as described above, add the following line to your `~/.vimrc` to enable 16-color mode:

```vim
let g:onedark_termcolors=16
```
```vim
let g:onedark_termcolors=16
```

### Why do all comments look like they're highlighted?

![Broken Italics](https://raw.githubusercontent.com/joshdick/onedark.vim/master/img/broken_italics.png)
![Broken Italics](https://raw.githubusercontent.com/joshdick/onedark.vim/main/img/broken_italics.png)

If all comments look like the one in the screenshot above, you have enabled italics in onedark.vim by setting `g:onedark_terminal_italics=1` in your `~/.vimrc`, but your terminal isn't displaying italics correctly. You can either remove the option or [try to fix your terminal](https://github.com/joshdick/onedark.vim/issues/97#issuecomment-299719352). If you're using [iTerm2](http://iterm2.com) on macOS, you might need to [use a special TERMINFO](https://gist.github.com/sos4nt/3187620) to get italics working.

Expand Down Expand Up @@ -213,7 +237,7 @@ You can override colors across all highlights by adding color definitions to the

```vim
let g:onedark_color_overrides = {
\ "black": {"gui": "#2F343F", "cterm": "235", "cterm16": "0" },
\ "background": {"gui": "#2F343F", "cterm": "235", "cterm16": "0" },
\ "purple": { "gui": "#C678DF", "cterm": "170", "cterm16": "5" }
\}
```
Expand All @@ -236,16 +260,18 @@ Several other themes and projects have reused code and/or colors from this proje

If onedark.vim isn't meeting your needs, try one of its relatives!

* [drewtempelmeyer/palenight.vim](https://github.com/drewtempelmeyer/palenight.vim)
* [KeitaNakamura/neodark.vim](https://github.com/KeitaNakamura/neodark.vim)
* [base16-onedark.vim](https://github.com/chriskempson/base16-vim/blob/master/colors/base16-onedark.vim)
* Associated base16 scheme: [tilal6991/base16-onedark-scheme](https://github.com/tilal6991/base16-onedark-scheme)
* [rakr/vim-one](https://github.com/rakr/vim-one)
- [drewtempelmeyer/palenight.vim](https://github.com/drewtempelmeyer/palenight.vim)
- [KeitaNakamura/neodark.vim](https://github.com/KeitaNakamura/neodark.vim)
- [base16-onedark.vim](https://github.com/chriskempson/base16-vim/blob/master/colors/base16-onedark.vim)
- Associated base16 scheme: [tilal6991/base16-onedark-scheme](https://github.com/tilal6991/base16-onedark-scheme)
- [rakr/vim-one](https://github.com/rakr/vim-one)
- For Neovim >= 0.5 with treesitter support: [navarasu/onedark.nvim](https://github.com/navarasu/onedark.nvim) or [monsonjeremy/onedark.nvim](https://github.com/monsonjeremy/onedark.nvim)
- Neovim-only Lua port: [ii14/onedark.nvim](https://github.com/ii14/onedark.nvim)

### Preview images

Preview images were taken using:

* [iTerm2](https://iterm2.com) terminal emulator on macOS
* 13 pt. [PragmataPro Mono](http://www.fsd.it/fonts/pragmatapro.htm#.VlDa1q6rTOY) font
* [vim-polyglot](https://github.com/sheerun/vim-polyglot) plug-in
- [iTerm2](https://iterm2.com) terminal emulator on macOS
- 13 pt. [PragmataPro Mono](http://www.fsd.it/fonts/pragmatapro.htm#.VlDa1q6rTOY) font
- [vim-polyglot](https://github.com/sheerun/vim-polyglot) plug-in
Loading

0 comments on commit 3773af2

Please sign in to comment.