Skip to content

Commit

Permalink
Merge pull request #16 from barrientosvctor/develop
Browse files Browse the repository at this point in the history
ci: add pipelines
  • Loading branch information
barrientosvctor authored May 13, 2024
2 parents df4c6a7 + 35faaab commit fd22b00
Show file tree
Hide file tree
Showing 20 changed files with 1,084 additions and 398 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true

[Makefile]
indent_style = tab
tab_width = 8
63 changes: 63 additions & 0 deletions .github/workflows/neovim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: Neovim
run-name: Neovim checks

on:
pull_request:
paths:
- "lua/*"
- "test/*"
- "colors/*"
branches: ["main", "develop"]
push:
paths:
- "lua/*"
- "test/*"
- "colors/*"
branches: main

jobs:
ubuntu:
name: Ubuntu
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install Neovim
uses: MunifTanjim/setup-neovim-action@v1
with:
tag: nightly
- name: Run neovim
run: |
nvim --version
nvim --headless -u test/init.lua +q
macos:
name: Macos
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- name: Install Neovim
run: |
wget -q https://github.com/neovim/neovim/releases/download/nightly/nvim-macos-x86_64.tar.gz
xattr -c ./nvim-macos-x86_64.tar.gz
tar xzvf nvim-macos-x86_64.tar.gz &> /dev/null
ln -s $(pwd)/nvim-macos-x86_64/bin/nvim /usr/local/bin/nvim
- name: Run neovim
run: |
nvim --version
nvim --headless -u test/init.lua +q
windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Neovim
run: |
C:\msys64\usr\bin\wget.exe -q https://github.com/neovim/neovim/releases/download/nightly/nvim-win64.zip
7z x nvim-win64.zip
Add-Content $env:GITHUB_PATH ".\nvim-win64\bin\"
- name: Run neovim
run: |
nvim --version
nvim --headless -u test/init.lua +q
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Tests
run-name: Abyss.nvim tests

on:
pull_request:
paths:
- "lua/*"
- "test/*"
- "colors/*"
branches: ["main", "develop"]
push:
paths:
- "lua/*"
- "test/*"
- "colors/*"
branches: main

jobs:
build:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Neovim
uses: MunifTanjim/setup-neovim-action@v1
with:
tag: nightly

- name: Install plenary
run: |
git clone --depth 1 https://github.com/nvim-lua/plenary.nvim test/plenary
- name: Run tests
run: |
nvim --version
[ ! -d test ] && exit 0
nvim --headless --noplugin -u test/minimal_init.vim -c "PlenaryBustedDirectory ./test/abyss { minimal_init = './test/minimal_init.vim', sequential = true}"
66 changes: 66 additions & 0 deletions .github/workflows/vim.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: Vim
run-name: Vim checks

on:
pull_request:
paths:
- "lua/*"
- "test/*"
- "colors/*"
branches: ["main", "develop"]
push:
paths:
- "lua/*"
- "test/*"
- "colors/*"
branches: main

jobs:
ubuntu:
name: Ubuntu
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install Vim
shell: bash
run: |
sudo apt-get update
sudo apt-get install vim-gtk lua5.4
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
- name: Run vim
run: |
vim --version
vim -u test/init.vim
macos:
name: Macos
runs-on: macos-latest

steps:
- uses: actions/checkout@v4
- name: Install Vim
run: |
brew install vim
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
- name: Run vim
run: |
vim --version
vim -u test/init.vim
windows:
name: Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install Vim
run: |
choco install vim
C:\msys64\usr\bin\wget.exe -q https://downloads.sourceforge.net/project/luabinaries/5.4.2/Tools%20Executables/lua-5.4.2_Win64_bin.zip
7z x lua-5.4.2_Win64_bin.zip
move lua54.dll C:\Windows\System32\
iwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |`
ni $HOME/vimfiles/autoload/plug.vim -Force
- name: Run vim
run: |
vim --version
gvim -u test/init.vim
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
STYLUA_PKG = stylua
BASE_STYLUA_FLAGS = --config-path .stylua.toml --no-editorconfig --glob "**/*.lua"
BASE_STYLUA_FLAGS = --config-path .stylua.toml --glob "**/*.lua"

check:
help: ## Prints help for targets with comments
@cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

check: ## Output the diff in files where code style is not applied
$(STYLUA_PKG) $(BASE_STYLUA_FLAGS) --check .

fmt:
fmt: ## Format all lua files according to stylua.toml directives
$(STYLUA_PKG) $(BASE_STYLUA_FLAGS) .

lint:
lint: ## Run the lua linter
luacheck lua
148 changes: 142 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
# abyss.nvim
Neovim colorscheme inspired by Abyss theme in Visual Studio Code.
(Neo)vim colorscheme inspired by Abyss theme in Visual Studio Code.

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

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

## 📦 Installation

You can use any package manager you like, in these examples I'm using [Packer.nvim](https://github.com/wbthomason/packer.nvim) and [Lazy.nvim](https://github.com/folke/lazy.nvim)
You can use any package manager you like.

### Packer.nvim
**I highly recommend updating abyss.nvim when a release/tag comes out, since it is possible that there are development commits before that that can cause unexpected errors when using the colorscheme. To do this, make sure to specify a tag in your preferred package manager (if it supports it) before downloading the colorscheme.**

<table>
<tr>
<td> <b>Package manager</b> </td> <td> <b>Installation</b> </td>
</tr>

<!-- Packer.nvim -->
</tr>
<tr>
<td> <a href="https://github.com/wbthomason/packer.nvim">packer.nvim</a> </td>
<td>

```lua
use {
Expand All @@ -24,7 +35,14 @@ use {
}
```

### Lazy.nvim
</td>
</tr>

<!-- Lazy.nvim -->
</tr>
<tr>
<td> <a href="https://github.com/folke/lazy.nvim">lazy.nvim</a> </td>
<td>

```lua
{
Expand All @@ -35,6 +53,51 @@ use {
}
```

</td>
</tr>

<!-- Vim-plug -->
</tr>
<tr>
<td> <a href="https://github.com/junegunn/vim-plug">Vim-plug</a> </td>
<td>

```vim
Plug 'barrientosvctor/abyss.nvim'
```

</td>
</tr>

<!-- Vundle.vim -->
</tr>
<tr>
<td> <a href="https://github.com/VundleVim/Vundle.vim">Vundle.vim</a> </td>
<td>

```vim
Plugin 'barrientosvctor/abyss.nvim'
```

</td>
</tr>

<!-- Vim pack -->
</tr>
<tr>
<td> Vim's built-in package manager </td>
<td>

```shell
mkdir -p ~/.vim/pack/colors/start
cd ~/.vim/pack/colors/start
git clone https://github.com/barrientosvctor/abyss.nvim.git
```

</td>
</tr>
</table>

## 💻 Setup

Abyss.nvim has options to customize your colorscheme instance according to your preferences.
Expand All @@ -47,11 +110,22 @@ require('abyss').setup({
italic = false, -- Toggle italic for function names, keywords, strings and booleans
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)
overrides = {} -- Override the default colorscheme highlight to a any else. Default value: nil
})
```

### Overriding highlights
### Vim Script with Lua

```vim
lua << EOF
require("abyss").setup {
" your setup options
}
EOF
```

### Overwriting highlights

You can be able to use all of [nvim_set_hl()](https://neovim.io/doc/user/api.html#nvim_set_hl())
function properties to override the colorscheme colors.
Expand Down Expand Up @@ -155,3 +229,65 @@ 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.

### 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
Loading

0 comments on commit fd22b00

Please sign in to comment.