Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sunjon/stylish.nvim
Stylish UI components for Neovim
https://github.com/sunjon/stylish.nvim
Last synced: 3 days ago
JSON representation
Stylish UI components for Neovim
- Host: GitHub
- URL: https://github.com/sunjon/stylish.nvim
- Owner: sunjon
- Created: 2022-01-24T09:29:39.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-02-11T14:57:00.000Z (almost 3 years ago)
- Last Synced: 2024-08-02T13:33:56.741Z (3 months ago)
- Language: Lua
- Size: 85 KB
- Stars: 425
- Watchers: 18
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# stylish.nvim
_A collection of Stylish UI components for Neovim_
Components are rendered using ASCII characters in the terminal. A font that supports glyphs introduced in [Unicode version 13.0](https://unicode.org/versions/Unicode13.0.0/) is required for some effects.
This project is alpha/WIP. Feel free to open issues to contribute ideas.
### stylish.ui.splashlogo (soon™)
### stylish.ui.clock
### stylish.ui.menu
### stylish.ui.graph (soon™)
### stylish.ui.keyboard_stats (soon™)
### stylish.ui.notify (soon™)
## Installation
### [Packer](https://github.com/wbthomason/packer.nvim)
```lua
use 'sunjon/stylish.nvim'
```### [Vim-Plug](https://github.com/junegunn/vim-plug)
```lua
Plug 'sunjon/stylish.nvim'
```## Configuration
### Testing `stylish.ui_menu`
#### Creating Menus:
```lua
vim.cmd [[
amenu Plugin.Fugitive.GFetch :GFetch | amenu Plugin.Fugitive.GPull :GPull | amenu Plugin.Fugitive.GPush :GPush
amenu File.Filetype.One :echo 1 | amenu File.Filetype.Two :echo 2 | amenu File.Filetype.Three :echo 3
amenu Edit.Recent.Foo :echo 'foo' | amenu Edit.Recent.Bar :echo 'bar' | amenu Edit.Recent.Baz :echo 'baz'
amenu Edit.Diff.Revision_1 :echo 'rev_1' | amenu Edit.Diff.Revision_2 :echo 'rev_2' | amenu Edit.Diff.Revision_3 :echo 'rev_3'
]]for i = 1, 16 do
vim.cmd('amenu OverflowList.Test_Thing_' .. i .. ' :echo ' .. i)
end
```See `:h menu` for more details
#### Configuration: Menu
```lua
vim.api.nvim_set_keymap(
'n',
'',
"lua require'stylish'.ui_menu(vim.fn.menu_get(''), {kind=menu, prompt = 'Main Menu', experimental_mouse = true}, function(res) print('### ' ..res) end)",
{ noremap = true, silent = true }
)
```NOTE: `experimental_mouse` only works with Linux and `xwininfo` and `xdotool` installed.
### Testing `stylish.ui_clock`
#### Configuration: Clock
```lua
vim.api.nvim_set_keymap(
'n',
'',
'lua require"stylish".ui_clock()',
{ noremap = true, silent = true }
)
```## TODO:
- [x] vim.ui.menu
- [x] vim.ui.clock (fading not working, no background)
- [ ] vim.ui.select # in development
- [ ] vim.ui.notify # in development
- [ ] vim.ui.input
- [ ] mouse controls
- [ ] animator
- [ ] documentation