Skip to content

Commit d4f11d6

Browse files
committed
readme
1 parent b367231 commit d4f11d6

File tree

2 files changed

+114
-5
lines changed

2 files changed

+114
-5
lines changed

lua/cosmic-ui/rename/handler.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
return function(...)
2+
local utils = require('cosmic-ui.utils')
23
local result
34
local method
45
local err = select(1, ...)

readme.md

Lines changed: 113 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,119 @@
11
<h1 align="center">💫 Cosmic-UI</h1>
22

3-
## Installation
3+
## 🚀 Stellar Features
4+
5+
Cosmic-UI is a simple wrapper around specific vim (and common plugin) functionality in order to provide a quick and easy way to create a Cosmic Neovim experience!
6+
7+
It provides customizable UI defaults as well as utility methods.
8+
9+
- Sane `vim.diagnostics` defaults
10+
- Sets borders around common UI elements
11+
- Signature help
12+
- Hover
13+
- Diagnostics UI
14+
- Pretty diagnostic sign icons
15+
- LSP rename floating window
16+
17+
_Coming soon..._
18+
19+
- Code Actions
20+
- ???
21+
22+
_Why not autocomplete?_
23+
24+
Well.. Not everyone uses autocomplete and on top of that,
25+
there are quite a few common autocompletion plugins that being able to
26+
provide integrations for all of them is unmanagable.
27+
28+
## 🛠 Installation
29+
30+
Without `lsp_signature.nvim`
431

532
```lua
6-
use({
7-
'CosmicNvim/cosmic-ui',
8-
requires = { 'MunifTanjim/nui.nvim', 'nvim-lua/plenary.nvim' },
9-
})
33+
use({
34+
'~/dev/cosmic/cosmic-ui',
35+
requires = { 'MunifTanjim/nui.nvim', 'nvim-lua/plenary.nvim' },
36+
config = function()
37+
-- set up diagnostics
38+
require('cosmic-ui').setup({})
39+
end,
40+
})
41+
```
1042

43+
With `lsp_signature.nvim`
44+
45+
```lua
46+
use({
47+
'~/dev/cosmic/cosmic-ui',
48+
requires = { 'MunifTanjim/nui.nvim', 'nvim-lua/plenary.nvim', 'ray-x/lsp_signature.nvim' },
49+
config = function()
50+
-- set up diagnostics
51+
require('cosmic-ui').setup({})
52+
end,
53+
after = 'nvim-lspconfig',
54+
})
55+
```
56+
57+
If using `lsp_signature.nvim`, you must ensure that `Cosmic-UI` loads _after_ `nvim-lspconfig` (or after LSP servers setup).
58+
59+
<!-- This is because `Cosmic-UI` will initialize `lsp_signature.nvim`, which must be set up after LSP server in order to properly hook into the correct LSP handler. -->
60+
61+
## ⚙️ Configuration
62+
63+
You may override any of the settings below by passing a config object to `.setup`
64+
65+
```lua
66+
{
67+
-- lsp_signature settings
68+
lsp_signature = {
69+
bind = true, -- This is mandatory, otherwise border config won't get registered.
70+
handler_opts = {
71+
border = 'rounded',
72+
},
73+
},
74+
-- icons used for lsp diagnostic signs
75+
icons = {
76+
warn = '',
77+
info = '',
78+
error = '',
79+
hint = '',
80+
},
81+
-- see h: vim.diagnostic.config
82+
diagnostics = {
83+
underline = true,
84+
signs = true,
85+
update_in_insert = false,
86+
severity_sort = true,
87+
float = {
88+
header = false,
89+
source = 'always',
90+
border = 'rounded',
91+
},
92+
virtual_text = {
93+
spacing = 4,
94+
source = 'always',
95+
severity = {
96+
min = vim.diagnostic.severity.HINT,
97+
},
98+
},
99+
},
100+
-- settings for vim.lsp.handlers['textDocument/hover']
101+
hover = {
102+
-- override default handler
103+
handler = vim.lsp.handlers.hover,
104+
-- see h: lsp-handler-configuration
105+
float = {
106+
border = 'rounded',
107+
},
108+
},
109+
-- settings for vim.lsp.handlers['textDocument/signatureHelp']
110+
signature_help = {
111+
-- override default handler
112+
handler = vim.lsp.handlers.signature_help,
113+
-- see h: lsp-handler-configuration
114+
float = {
115+
border = 'rounded',
116+
},
117+
},
118+
}
11119
```

0 commit comments

Comments
 (0)