Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #5 from ful1e5/dev
Browse files Browse the repository at this point in the history
`dev` branch merge
  • Loading branch information
ful1e5 authored Jun 20, 2021
2 parents bf020a4 + f2bce67 commit 38b6370
Show file tree
Hide file tree
Showing 14 changed files with 229 additions and 162 deletions.
5 changes: 2 additions & 3 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
globals = {
"vim",
}
globals = {"vim"}
max_comment_line_length = false
15 changes: 11 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- `Linting` Github Action init
- `Makefile, .lua-format, .luacheckrc` init
- format .lua code with (lua-format)[https://github.com/Koihik/LuaFormatter]
- `kitty` tabs color changed
- **Warning** on `vim.g` configuration
- Configure plugin in lua using `require('onedark').setup({})` **[fix monsonjeremy/onedark.nvim#5]**
- Minimal config example added inside [README.md#minimal](./README.md#minimal)
- Linting Github Action init
- Format .lua code with [lua-format](https://github.com/Koihik/LuaFormatter)
- **kitty tab** colors are changed
- Init: `Makefile, .lua-format, .luacheckrc`

### Changed

- Removed function `require('onedark').colorscheme()`
- Colorscheme **autoload removed** from `colors/onedark.vim`
- **VertSplit** & **Inactive StatusLine** `fg` color changed to `bg_visual`
- StatusLine bug note inside [README.md#usage](./README.md#-usage)
- Configuration docs updated inside [README.md#configuration](./README.md#-configuration)

## [v0.0.1] - 14 June 2021

Expand Down
128 changes: 80 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
<!-- Branding -->
<p align="center">
<img src="https://i.imgur.com/lNdBu1v.png" alt="onedark.nvim" />
<img src="https://i.imgur.com/lNdBu1v.png" alt="onedark.nvim" />
<br />
Atom's iconic One Dark theme for Neovim, written in Lua
</p>

<!-- Badges -->
<p align="center">
Atom's iconic One Dark theme for Neovim, written in Lua
</p>

<p align="center">
De-attach fork of <b><a href="https://github.com/monsonjeremy/onedark.nvim">monsonjeremy/onedark.nvim</a></b>
<!-- First Row -->
<a href="https://github.com/monsonjeremy/onedark.nvim">
<img alt="monsonjeremy/onedark.nvim" src="https://img.shields.io/badge/Fork%20of-monsonjeremy%2Fonedark.nvim-blue" />
</a>
<a href="https://github.com/ful1e5/onedark.nvim/actions">
<img alt="GitHub Action Linting" src="https://github.com/ful1e5/onedark.nvim/actions/workflows/lint.yml/badge.svg" width="102" />
</a>
</p>

## ✨ Features
Expand Down Expand Up @@ -63,16 +69,18 @@ Enable the colorscheme:

```vim
" Vim Script
colorscheme onedark
lua require('onedark').setup()
```

```lua
-- Lua
vim.cmd[[colorscheme onedark]]
require('onedark').setup()
```

To enable the `onedark` theme for `Lualine`, simply specify it in your lualine settings:

> **📝 NOTE:** Set `lualine` configuration **before** `onedark`.
```lua
require('lualine').setup {
options = {
Expand All @@ -92,42 +100,48 @@ To enable the `onedark` colorscheme for `Lightline`:
let g:lightline = {'colorscheme': 'onedark'}
```

```lua
-- Lua
vim.g.lightline = {colorscheme = "onedark"}
```

## ⚙️ Configuration

> ❗️ configuration needs to be set **BEFORE** loading the color scheme with `colorscheme onedark`
| Option | Default | Description |
| -------------------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| onedark_italic_comments | `true` | Make comments italic |
| onedark_italic_keywords | `true` | Make keywords italic |
| onedark_italic_functions | `false` | Make functions italic |
| onedark_italic_variables | `false` | Make variables and identifiers italic |
| onedark_transparent | `false` | Enable this to disable setting the background color |
| onedark_hide_inactive_statusline | `false` | Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**. |
| onedark_sidebars | `{}` | Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]` |
| onedark_dark_sidebar | `true` | Sidebar like windows like `NvimTree` get a darker background |
| onedark_dark_float | `true` | Float windows like the lsp diagnostics windows get a darker background. |
| onedark_colors | `{}` | You can override specific color groups to use other groups or a hex color |
| Option | Default | Description |
| ---------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| commentStyle | `italic` | Highlight style for comments (check `:help highlight-args` for options) |
| keywordStyle | `italic` | Highlight style for keywords (check `:help highlight-args` for options) |
| functionStyle | `NONE` | Highlight style for functions (check `:help highlight-args` for options) |
| variableStyle | `NONE` | Highlight style for variables and identifiers (check `:help highlight-args` for options) |
| transparent | `false` | Enable this to disable setting the background color |
| hideInactiveStatusline | `false` | Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**. |
| sidebars | `{}` | Set a darker background on sidebar-like windows. For example: `{"qf", "vista_kind", "terminal", "packer"}` |
| darkSidebar | `true` | Sidebar like windows like `NvimTree` get a darker background |
| darkFloat | `true` | Float windows like the lsp diagnostics windows get a darker background. |
| colors | `{}` | You can override specific color groups to use other groups or a hex color |

```lua
-- Example config in Lua
vim.g.onedark_italic_functions = true
vim.g.onedark_sidebars = { "qf", "vista_kind", "terminal", "packer" }

-- Change the "hint" color to the "orange" color, and make the "error" color bright red
vim.g.onedark_colors = { hint = "orange", error = "#ff0000" }
require("onedark").setup({
functionStyle = "italic",
sidebars = {"qf", "vista_kind", "terminal", "packer"},

-- Load the colorscheme
vim.cmd[[colorscheme onedark]]
-- Change the "hint" color to the "orange" color, and make the "error" color bright red
colors = {hint = "orange", error = "#ff0000"}
})
```

```vim
" Example config in VimScript
let g:onedark_italic_functions = 1
let g:onedark_sidebars = [ "qf", "vista_kind", "terminal", "packer" ]
" Load the colorscheme
colorscheme onedark
lua << EOF
require("onedark").setup({
functionStyle = "italic",
sidebars = {"qf", "vista_kind", "terminal", "packer"},
-- Change the "hint" color to the "orange" color, and make the "error" color bright red
colors = {hint = "orange", error = "#ff0000"}
})
EOF
```

### Making `undercurls` work properly in **Tmux**
Expand All @@ -143,7 +157,7 @@ set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{25

## 🌈 Extras

> To generate the configs `:luafile /lua/onedark/extra/init.lua`
> To generate the configs `make extra`
Extra color configs for **Kitty**, and **Alacritty** can be found in [extras](extras/). To use them, refer to their respective documentation.

Expand All @@ -167,11 +181,14 @@ Extra color configs for **Kitty**, and **Alacritty** can be found in [extras](ex

### Normal

```
vim.g.onedark_italic_comments = false
vim.g.onedark_italic_keywords = false
vim.g.onedark_italic_functions = false
vim.g.onedark_italic_variables = false
```lua
require("onedark").setup({
commentStyle = "NONE",
keywordStyle = "NONE",
functionStyle = "NONE",
variableStyle = "NONE"
-- ... your onedark config
})
```

<p align="center">
Expand All @@ -180,17 +197,35 @@ vim.g.onedark_italic_variables = false

### Italic

```
vim.g.onedark_italic_comments = true
vim.g.onedark_italic_keywords = true
vim.g.onedark_italic_functions = true
vim.g.onedark_italic_variables = true
```lua
require("onedark").setup({
commentStyle = "italic",
keywordStyle = "italic",
functionStyle = "italic",
variableStyle = "italic"
-- ... your onedark config
})
```

<p align="center">
<img src="https://imgur.com/oA5PjUb.png" alt="Italic fonts" />
</p>

### Minimal

```lua
require("onedark").setup({
hideInactiveStatusline = true,
darkSidebar = false,
darkFloat = false
-- ... your onedark config
})
```

<p align="center">
<img src="https://imgur.com/VSTW3Hr.png" alt="Minimal" />
</p>

### Telescope

<p align="center">
Expand All @@ -204,8 +239,6 @@ vim.g.onedark_italic_variables = true
- [Wallpaper](https://hdqwalls.com/big-sur-4k-wallpaper)
- [dotfiles](https://github.com/ful1e5/dotfiles)

<!-- Support -->

## Support

<a href="https://www.buymeacoffee.com/Nt7Wg4V" >
Expand All @@ -217,7 +250,6 @@ vim.g.onedark_italic_variables = true
Follow me on **[Twitter](https://twitter.com/ful1e5)**

<!-- Ninja -->

<p align="center">
<h1 align="center">(◣_◢)</h1>
</p>
Expand Down
2 changes: 0 additions & 2 deletions colors/onedark.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ lua package.loaded['onedark.theme'] = nil
lua package.loaded['onedark.colors'] = nil
lua package.loaded['onedark.util'] = nil
lua package.loaded['onedark.config'] = nil

lua require('onedark').colorscheme()
2 changes: 0 additions & 2 deletions extras/alacritty_onedark_.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@ colors:
indexed_colors:
- { index: 16, color: '0xd19a66' }
- { index: 17, color: '0xf65866' }


79 changes: 39 additions & 40 deletions extras/kitty_onedark_.conf
Original file line number Diff line number Diff line change
@@ -1,40 +1,39 @@
# onedark colors for Kitty

background #282c34
foreground #abb2bf
selection_background #393f4a
selection_foreground #abb2bf
url_color #98c379
cursor #abb2bf

# Tabs
active_tab_background #61afef
active_tab_foreground #282c34
inactive_tab_background #abb2bf
inactive_tab_foreground #282c34
#tab_bar_background #20232A

# normal
color0 #20232A
color1 #e86671
color2 #98c379
color3 #e0af68
color4 #61afef
color5 #c678dd
color6 #56b6c2
color7 #798294

# bright
color8 #5c6370
color9 #e86671
color10 #98c379
color11 #e0af68
color12 #61afef
color13 #c678dd
color14 #56b6c2
color15 #abb2bf

# extended colors
color16 #d19a66
color17 #f65866

# onedark colors for Kitty

background #282c34
foreground #abb2bf
selection_background #393f4a
selection_foreground #abb2bf
url_color #98c379
cursor #abb2bf

# Tabs
active_tab_background #61afef
active_tab_foreground #282c34
inactive_tab_background #abb2bf
inactive_tab_foreground #282c34
#tab_bar_background #20232A

# normal
color0 #20232A
color1 #e86671
color2 #98c379
color3 #e0af68
color4 #61afef
color5 #c678dd
color6 #56b6c2
color7 #798294

# bright
color8 #5c6370
color9 #e86671
color10 #98c379
color11 #e0af68
color12 #61afef
color13 #c678dd
color14 #56b6c2
color15 #abb2bf

# extended colors
color16 #d19a66
color17 #f65866
4 changes: 2 additions & 2 deletions lua/lualine/themes/onedark.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local config = require("onedark.config")
local colors = require("onedark.colors").setup(config)
local configModule = require("onedark.config")
local colors = require("onedark.colors").setup(configModule.config)

local onedark = {}

Expand Down
7 changes: 3 additions & 4 deletions lua/onedark/colors.lua
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
local util = require("onedark.util")
local configModule = require("onedark.config")

local M = {}

---@param config Config
---@return ColorScheme
function M.setup(config)
config = config or require("onedark.config")
config = config or configModule.config

-- Color Palette
---@class ColorScheme
local colors = {}

colors = {
local colors = {
none = "NONE",
bg = "#282c34",
bg2 = "#21252b",
Expand Down
Loading

0 comments on commit 38b6370

Please sign in to comment.