Skip to content

Commit

Permalink
Merge pull request #53 from barrientosvctor/develop
Browse files Browse the repository at this point in the history
New features and fixes
  • Loading branch information
barrientosvctor authored Jan 8, 2025
2 parents ba2b8fd + 5aa16e0 commit 7f36890
Show file tree
Hide file tree
Showing 24 changed files with 1,243 additions and 379 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.luacheckcache
test/plenary
79 changes: 79 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# 👥 Contributing

If you're reading this file. Surely you want to contribute to the development of
this colorscheme, so thank you so much for considering it!

Any issue or pull request is welcome. In this section, I will guide you to make
your first contribution.

- Before these instructions, it's recommended to before create an issue about
your change to talk about it.

- All branches must be based from `develop` branch. So, make sure to include
the `develop` branch when forking this repository. Then, you need to
create a new branch based on this one.

```shell
$ git switch develop
$ git checkout -b branch-name
```

- Make sure to pull the latest commits from `develop` branch to your branch
before making a commit.

- All pull requests must go from your branch to `develop` branch.

## Making a new abyss variant

Make sure to follow these rulements if you want to contribute creating a new
variant (palette) for abyss.

Note: All files related to their new variant, must be named as the variant's
name.

- Create a new file on `colors/*.vim`.
- Create a new file for Lualine, Vim-airline/Lightline themes of their variant.
- Create a new file on `lua/abyss/palettes/*.lua` (The name of the palette will
be used for naming the colorscheme in use `vim.g.colors_name`).
- Add and test your new variant against the test cases for variants in its file:
`test/abyss/palette_spec.lua`

## Merging the pull request

Your pull request should pass all code reviews (if there is) to
merge it to `develop` . These code reviews are GitHub workflows.

Also make sure you don't include any `CHANGELOG.md` in your pull request so you
don't have conflicts with the original file in the `main` branch.

## How should you write your commits?

Refer to [release-please-action](https://github.com/googleapis/release-please-action?tab=readme-ov-file#how-should-i-write-my-commits) section.

## Syntax highlight groups

If you want to contribute about wrong syntax highlighting on colorscheme. This
section will help you to determine what highlight group is being applied to a
specific piece of syntax. It'll output the highlight group for the value under
the cursor.

### Treesitter highlighting

Neovim has included a command with these characteristics. Just type: `:Inspect`.

### Vim highlighting

Add this function to your vimrc:

```vim
function! SynStack()
for i1 in synstack(line("."), col("."))
let i2 = synIDtrans(i1)
let n1 = synIDattr(i1, "name")
let n2 = synIDattr(i2, "name")
echo n1 "->" n2
endfor
endfunction
map <F2> <cmd>call SynStack()<cr>
```
143 changes: 80 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ Unofficial port for (Neo)Vim inspired by the Abyss theme from Visual Studio Code

https://github.com/barrientosvctor/abyss.nvim/assets/113469901/7d20f6f0-c438-4ac1-9838-7c1d49f412b9

## 🎨 Themes

### Abyss
Original Abyss theme inspired by VS Code

<img align="center" src="https://github.com/barrientosvctor/abyss.nvim/blob/main/previews/abyss_python.png" width="85%">
<img align="center" src="https://github.com/barrientosvctor/abyss.nvim/blob/main/previews/abyss_go.png" width="85%">

### Abyss Boreal
A cool toned theme inspired by the Northern Lights and Minnesota North Woods

<img align="center" src="https://github.com/barrientosvctor/abyss.nvim/blob/main/previews/abyssboreal_python.png" width="85%">
<img align="center" src="https://github.com/barrientosvctor/abyss.nvim/blob/main/previews/abyssboreal_go.png" width="85%">

## ⚡️ Requeriments
* [Neovim](https://github.com/neovim/neovim) >= **0.8.0** or [Vim 9](https://www.vim.org/) with lua >= **5.1**.

Expand Down Expand Up @@ -113,6 +127,7 @@ require('abyss').setup({
bold = false, -- Toggle bold for function names, keywords and booleans
transparent_background = false, -- Toggle transparency on neovim background
treesitter = true -- Enable treesitter highlighting. No need to configuration. Default value: (Neovim = true), (Vim = false)
palette = "abyss" -- Changes the Abyss palette. Available palettes's name on lua/abyss/palettes
overrides = {} -- Override the default colorscheme highlight to a any else. Default value: nil
})
```
Expand All @@ -133,7 +148,7 @@ You can be able to use all of [nvim_set_hl()](https://neovim.io/doc/user/api.htm
function properties to override the colorscheme colors.

```lua
local c = require('abyss.colors')
local c = require('abyss.palettes.abyss')

require('abyss').setup({
overrides = {
Expand Down Expand Up @@ -161,6 +176,7 @@ require('abyss').setup({
* [nvim-notify](https://github.com/rcarriga/nvim-notify)
* [Dashboard](https://github.com/glepnir/dashboard-nvim)
* [Which-key](https://github.com/folke/which-key.nvim)
* [Aerial](https://github.com/stevearc/aerial.nvim)

## 🚀 Usage

Expand All @@ -176,16 +192,78 @@ colorscheme abyss
vim.cmd.colorscheme 'abyss'
```

### Lualine

Abyss.nvim also includes a [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim) theme, you can use it setting up into lualine setup options:

```lua
require('lualine').setup {
options = {
theme = 'abyss'
theme = 'abyss' -- Available themes: "abyss", "abyss-boreal"
}
}
```

### Vim Airline

#### Abyss

> Vim Script
```vim
let g:airline_theme = "abyss"
```

> Lua
```lua
vim.g.airline_theme = "abyss"
```

#### Abyss Boreal

> Vim Script
```vim
let g:airline_theme = "abyss_boreal"
```

> Lua
```lua
vim.g.airline_theme = "abyss_boreal"
```

### Vim Lightline

#### Abyss

> Vim Script
```vim
let g:lightline = {'colorscheme': 'abyss'}
```

> Lua
```lua
vim.g.lightline = {colorscheme: 'abyss'}
```

#### Abyss Boreal

> Vim Script
```vim
let g:lightline = {'colorscheme': 'abyss_boreal'}
```

> Lua
```lua
vim.g.lightline = {colorscheme: 'abyss_boreal'}
```

## 📝 Notes

- If you have Bufferline.nvim installed in your dotfiles, bufferline should be loaded after setting up abyss.nvim or it will highlight incorrectly. I'll provide you examples about this using [Packer.nvim](https://github.com/wbthomason/packer.nvim) and [Lazy.nvim](https://github.com/folke/lazy.nvim)
Expand Down Expand Up @@ -232,67 +310,6 @@ use {

</details>

## 👥 Contributing

Any issue or pull request is welcome. In this section, I will guide you to make
your first contribution.

- Before these instructions, it's recommended to before create an issue about
your change to talk about it.

- All branches must be based from `develop` branch. So, you need to
create a new branch based on this one.

```shell
$ git switch develop
$ git checkout -b branch-name
```

- Make sure to pull the latest commits from `develop` branch to your branch
before make a commit.

- All pull requests must go from your branch to `develop` branch.

### Merging the pull request

Your pull request should pass all code reviews (if there is) to
merge it to `develop` . These code reviews are GitHub workflows.

Also make sure you don't include any `CHANGELOG.md` in your pull request so you
don't have conflicts with the original file in the `main` branch.

### How should you write your commits?

Refer to [release-please-action](https://github.com/googleapis/release-please-action?tab=readme-ov-file#how-should-i-write-my-commits) section.

### Syntax highlight groups

If you want to contribute about wrong syntax highlighting on colorscheme. This
section will help you to determine what highlight group is being applied to a
specific piece of syntax. It'll output the highlight group for the value under
the cursor.

#### Treesitter highlighting

Neovim has included a command with these characteristics. Just type: `:Inspect`.

#### Vim highlighting

Add this function to your vimrc:

```vim
function! SynStack()
for i1 in synstack(line("."), col("."))
let i2 = synIDtrans(i1)
let n1 = synIDattr(i1, "name")
let n2 = synIDattr(i2, "name")
echo n1 "->" n2
endfor
endfunction
map <F2> <cmd>call SynStack()<cr>
```

## 🤗 Acknowledgements

- [nightfox](https://github.com/EdenEast/nightfox.nvim) -> codebase for vim support
64 changes: 64 additions & 0 deletions autoload/airline/themes/abyss_boreal.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
let g:airline#themes#abyss_boreal#palette = {}

let s:statusline_bg = "#406385"
let s:darkgreen = "#005d55"
let s:white = "#A3D7DA"
let s:fg = "#8c63c9"
let s:shinyblue = "#1f45db"
let s:red = "#ff002f"
let s:black_inactive = "#202020"
let s:yellow = "#d9bb62"
let s:darkyellow = "#808000"
let s:darkred = "#470b1b"

let s:Normal_a = [s:white, s:statusline_bg, 255, 17] " guifg, guibg, ctermfg, ctermbg
let s:Normal_b = [s:fg, s:statusline_bg, 245, 17] " guifg, guibg, ctermfg, ctermbg
let s:Normal_c = [s:fg, s:statusline_bg, 245, 17] " guifg, guibg, ctermfg, ctermbg

let s:Visual_a = [s:shinyblue, s:statusline_bg, 105, 17] " guifg, guibg, ctermfg, ctermbg
let s:Visual_b = [s:fg, s:statusline_bg, 245, 17] " guifg, guibg, ctermfg, ctermbg
let s:Visual_c = [s:fg, s:statusline_bg, 245, 17] " guifg, guibg, ctermfg, ctermbg

let s:Replace_a = [s:red, s:statusline_bg, 9, 17] " guifg, guibg, ctermfg, ctermbg
let s:Replace_b = [s:fg, s:statusline_bg, 245, 17] " guifg, guibg, ctermfg, ctermbg
let s:Replace_c = [s:fg, s:statusline_bg, 245, 17] " guifg, guibg, ctermfg, ctermbg

let s:Insert_a = [s:darkgreen, s:statusline_bg, 2, 17] " guifg, guibg, ctermfg, ctermbg
let s:Insert_b = [s:fg, s:statusline_bg, 245, 17] " guifg, guibg, ctermfg, ctermbg
let s:Insert_c = [s:fg, s:statusline_bg, 245, 17] " guifg, guibg, ctermfg, ctermbg

let s:Inactive_a = [s:fg, s:black_inactive, 245, 0] " guifg, guibg, ctermfg, ctermbg
let s:Inactive_b = [s:fg, s:black_inactive, 245, 0] " guifg, guibg, ctermfg, ctermbg
let s:Inactive_c = [s:fg, s:black_inactive, 245, 0] " guifg, guibg, ctermfg, ctermbg

let s:Warning = [s:yellow, s:statusline_bg, 11, 17] " guifg, guibg, ctermfg, ctermbg
let s:Error = [s:red, s:statusline_bg, 9, 17] " guifg, guibg, ctermfg, ctermbg

let s:IWarning = [s:darkyellow, s:statusline_bg, 3, 17] " guifg, guibg, ctermfg, ctermbg
let s:IError = [s:darkred, s:statusline_bg, 1, 17] " guifg, guibg, ctermfg, ctermbg

let g:airline#themes#abyss_boreal#palette.normal = airline#themes#generate_color_map(s:Normal_a, s:Normal_b, s:Normal_c)
let g:airline#themes#abyss_boreal#palette.normal.airline_warning = s:Warning
let g:airline#themes#abyss_boreal#palette.normal.airline_error = s:Error

let g:airline#themes#abyss_boreal#palette.insert = airline#themes#generate_color_map(s:Insert_a, s:Insert_b, s:Insert_c)
let g:airline#themes#abyss_boreal#palette.insert.airline_warning = s:Warning
let g:airline#themes#abyss_boreal#palette.insert.airline_error = s:Error

let g:airline#themes#abyss_boreal#palette.visual = airline#themes#generate_color_map(s:Visual_a, s:Visual_b, s:Visual_c)
let g:airline#themes#abyss_boreal#palette.visual.airline_warning = s:Warning
let g:airline#themes#abyss_boreal#palette.visual.airline_error = s:Error

let g:airline#themes#abyss_boreal#palette.replace = airline#themes#generate_color_map(s:Replace_a, s:Replace_b, s:Replace_c)
let g:airline#themes#abyss_boreal#palette.replace.airline_warning = s:Warning
let g:airline#themes#abyss_boreal#palette.replace.airline_error = s:Error

let g:airline#themes#abyss_boreal#palette.inactive = airline#themes#generate_color_map(s:Inactive_a, s:Inactive_b, s:Inactive_c)
let g:airline#themes#abyss_boreal#palette.inactive.airline_warning = s:IWarning
let g:airline#themes#abyss_boreal#palette.inactive.airline_error = s:IError

let g:airline#themes#abyss_boreal#palette.normal.airline_term = s:Normal_c
let g:airline#themes#abyss_boreal#palette.insert.airline_term = s:Insert_c
let g:airline#themes#abyss_boreal#palette.replace.airline_term = s:Replace_c
let g:airline#themes#abyss_boreal#palette.visual.airline_term = s:Visual_c
let g:airline#themes#abyss_boreal#palette.inactive.airline_term = s:Inactive_c
35 changes: 35 additions & 0 deletions autoload/lightline/colorscheme/abyss_boreal.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
let s:statusline_bg = "#406385"
let s:darkgreen = "#005d55"
let s:white = "#A3D7DA"
let s:fg = "#8c63c9"
let s:shinyblue = "#2277ff"
let s:red = "#ff002f"
let s:black_inactive = "#202020"

let s:p = {'normal': {}, 'inactive': {}, 'insert': {}, 'replace': {}, 'visual': {}, 'tabline': {}}
let s:p.normal.left = [ [ s:white, s:statusline_bg, 255, 17, "bold" ] ]
let s:p.normal.right = [ [ s:fg, s:statusline_bg, 245, 17 ] ]
let s:p.normal.middle = [ [ s:fg, s:statusline_bg, 245, 17 ] ]

let s:p.inactive.left = [ [ s:fg, s:black_inactive, 245, 0, "bold" ] ]
let s:p.inactive.right = [ [ s:fg, s:black_inactive, 245, 0 ] ]
let s:p.inactive.middle = [ [ s:fg, s:black_inactive, 245, 0 ] ]

let s:p.insert.left = [ [ s:darkgreen, s:statusline_bg, 2, 17, "bold" ] ]
let s:p.insert.right = [ [ s:fg, s:statusline_bg, 245, 17 ] ]
let s:p.insert.middle = [ [ s:fg, s:statusline_bg, 245, 17 ] ]

let s:p.replace.left = [ [ s:red, s:statusline_bg, 9, 17, "bold" ] ]
let s:p.replace.right = [ [ s:fg, s:statusline_bg, 245, 17 ] ]
let s:p.replace.middle = [ [ s:fg, s:statusline_bg, 245, 17 ] ]

let s:p.visual.left = [ [ s:shinyblue, s:statusline_bg, 105, 17, "bold" ] ]
let s:p.visual.right = [ [ s:fg, s:statusline_bg, 245, 17 ] ]
let s:p.visual.middle = [ [ s:fg, s:statusline_bg, 245, 17 ] ]

let s:p.tabline.left = [ [ s:white, s:statusline_bg, 255, 17, "bold" ] ]
let s:p.tabline.right = [ [ s:red, s:statusline_bg, 9, 17 ] ]
let s:p.tabline.middle = [ [ s:white, s:statusline_bg, 255, 17 ] ]
let s:p.tabline.tabsel = [ [ s:statusline_bg, s:white, 17, 255 ] ]

let g:lightline#colorscheme#abyss_boreal#palette = lightline#colorscheme#fill(s:p)
1 change: 1 addition & 0 deletions colors/abyss-boreal.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lua require("abyss").setup { palette = "abyss-boreal" }
2 changes: 1 addition & 1 deletion colors/abyss.vim
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lua require("abyss").setup {}
lua require("abyss").setup { palette = "abyss" }
Loading

0 comments on commit 7f36890

Please sign in to comment.