Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ray-x/guihua.lua

A GUI library for Neovim plugin developers
https://github.com/ray-x/guihua.lua

fuzzy-search lua neovim-plugin ui

Last synced: 9 days ago
JSON representation

A GUI library for Neovim plugin developers

Awesome Lists containing this project

README

        

![guihua](https://github.com/ray-x/files/blob/master/img/guihua/guihua_800.png)
Guihua: A Lua Gui and util library for nvim plugins

- Provide floating windows
- A modified wrapper for fzy
- TextView, ListView, Preview etc

* Listview
![listview](https://github.com/ray-x/files/blob/master/img/guihua/listview.png)

* Listview with fzy finder
![listview](https://github.com/ray-x/files/blob/master/img/navigator/fzy_reference.jpg?raw=true)

* Neovim multigrid external buffer/terminal

![multigrid](https://user-images.githubusercontent.com/1681295/133234734-93817aaa-23a3-4c28-b164-b129be449dee.jpg)

* Neovim vim.ui.input and vim.ui.select patch

This cool screen shows an external terminal running lazygit and an external floating window running guihua listview

More screen shot please refer to [Navigator.lua](https://github.com/ray-x/navigator.lua)

Please refer to test file of how to use it

Lua OOP is powered by [middleclass](https://github.com/kikito/middleclass)
fzy is powered by [romgrk fzy-lua-native](https://github.com/romgrk/fzy-lua-native) with modified version of sorter/quicksort to sort list of tables

# Install

Plugin has implementation of fzy with both ffi and native lua. If you like to try ffi please run make

## Packer

```lua
use {'ray-x/guihua.lua', run = 'cd lua/fzy && make'}
```

## Setup

```lua
-- default mapping
maps = {
close_view = '',
send_qf = '',
save = '',
jump_to_list = 'k',
jump_to_preview = 'j',
prev = '',
next = '',
pageup = '',
pagedown = '',
confirm = '',
split = '',
vsplit = '',
tabnew = '',
}

-- default icons for panel
-- will be tbl_deep_extend() if you override any of those
local icons = {
panel_icons = {
section_separator = '─', --'',
line_num_left = ':', --'',
line_num_right = '', --',

range_left = '', --'',
range_right = '',
inner_node = '', --├○',
folded = '◉',
unfolded = '○',

outer_node = '', -- '╰○',
bracket_left = '', -- ⟪',
bracket_right = '', -- '⟫',
},
syntax_icons = {
var = ' ', -- "👹", -- Vampaire
method = 'ƒ ', -- "🍔", -- mac
['function'] = ' ', -- "🤣", -- Fun
['arrow_function'] = ' ', -- "🤣", -- Fun
parameter = '', -- Pi
associated = '🤝',
namespace = '🚀',
type = ' ',
field = '🏈',
interface = '',
module = '📦',
flag = '🎏',
}
}

--
require('guihua.maps').setup({
maps = {
close_view = '',
}
})
```

## Plug

```vim
Plug 'ray-x/guihua.lua', {'do': 'cd lua/fzy && make' }
```

Usage: check the test files on how the api is used.