Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Snikimonkd/cmp-go-pkgs
nvim-cmp source for golang packages path.
https://github.com/Snikimonkd/cmp-go-pkgs
lua neovim neovim-plugin nvim nvim-cmp nvim-plugin
Last synced: 2 months ago
JSON representation
nvim-cmp source for golang packages path.
- Host: GitHub
- URL: https://github.com/Snikimonkd/cmp-go-pkgs
- Owner: Snikimonkd
- License: mit
- Created: 2024-01-07T14:35:18.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-26T20:47:07.000Z (7 months ago)
- Last Synced: 2024-06-27T00:59:51.568Z (7 months ago)
- Topics: lua, neovim, neovim-plugin, nvim, nvim-cmp, nvim-plugin
- Language: Lua
- Homepage:
- Size: 5.86 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim - Snikimonkd/cmp-go-pkgs - Cmp source for Go packages names. (Programming Languages Support / Golang)
- trackawesomelist - Snikimonkd/cmp-go-pkgs (⭐13) - Cmp source for Go packages names. (Recently Updated / [Oct 27, 2024](/content/2024/10/27/README.md))
README
# cmp-go-pkgs
nvim-cmp source for golang packages path.
Loads once on LspAttach event.
Shows only inside import block.
https://github.com/Snikimonkd/cmp-go-pkgs/assets/72211350/4bf7b149-4f72-4f24-a529-794a9201dcf5
## Setup
Setup with [lazy.nvim](https://github.com/folke/lazy.nvim):
```lua
return {
"hrsh7th/nvim-cmp",
dependencies = {
"Snikimonkd/cmp-go-pkgs",
},
config = function()
local cmp = require("cmp")cmp.setup({
sources = {
{ name = "go_pkgs" },
},
matching = { disallow_symbol_nonprefix_matching = false }, -- to use . and / in urls
})
end,
},
```## Lspkind
You can use it with [lspkind](https://github.com/onsails/lspkind.nvim):
```lua
return {
"hrsh7th/nvim-cmp",
dependencies = {
"Snikimonkd/cmp-go-pkgs",
},
config = function()
local cmp = require("cmp")
local lspkind = require("lspkind")cmp.setup({
sources = {
{ name = "go_pkgs" },
},
formatting = {
format = lspkind.cmp_format({
with_text = true,
menu = {
go_pkgs = "[pkgs]",
},
}),
},
})
end,
},
```## Inspiration
(where i stole some code)
https://github.com/ray-x/go.nvim
https://github.com/hrsh7th/cmp-buffer
https://github.com/onsails/lspkind.nvim