feat: setup nvim-cmp, go, removed redundancy

This commit is contained in:
2025-05-29 22:06:07 -07:00
parent 877b8075bf
commit eb87b8d807
8 changed files with 105 additions and 51 deletions

View File

@@ -1,17 +1,23 @@
{
"LuaSnip": { "branch": "master", "commit": "faf3c94a44508cec1b961406d36cc65113ff3b98" },
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
"cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" },
"cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" },
"conform.nvim": { "branch": "master", "commit": "6feb2f28f9a9385e401857b21eeac3c1b66dd628" },
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
"harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" },
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"luau-lsp.nvim": { "branch": "main", "commit": "f81c6c713e4598abc484cbeabca918475d176c54" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "3856bbb0da214d1f2f3d5a2dd3fea26591f930f9" },
"mason.nvim": { "branch": "main", "commit": "9eaedb864cdadc29c6eb7d761a6c0d8aee26c91b" },
"mini.nvim": { "branch": "main", "commit": "14ce72476995255fc5cb919da8067f65865e1225" },
"nvim-lspconfig": { "branch": "master", "commit": "562487bc108bf73c2493f9e701b9334b48163216" },
"nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "87888865fa1ce1928a25b9abbea8c8f7839bf522" },
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
"mini.nvim": { "branch": "main", "commit": "d90adc96b68b310cf17d8ebcc8e2e4626c6bb8cc" },
"neovim": { "branch": "main", "commit": "6b9840790cc7acdfadde07f308d34b62dd9cc675" },
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
"nvim-lspconfig": { "branch": "master", "commit": "d45702594afc661a9dfa95e96acf18c56006d4d9" },
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
"nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" },
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
"rose-pine": { "branch": "main", "commit": "6b9840790cc7acdfadde07f308d34b62dd9cc675" },
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
"vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }
}

View File

@@ -6,6 +6,11 @@ return {
"williamboman/mason-lspconfig.nvim",
"j-hui/fidget.nvim",
"lopi-py/luau-lsp.nvim",
"hrsh7th/nvim-cmp",
"hrsh7th/cmp-cmdline",
"hrsh7th/cmp-path",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-nvim-lsp",
},
config = function()
require("mason").setup()
@@ -23,24 +28,53 @@ return {
"gopls",
"templ",
},
handlers = {
function(server)
require("lspconfig")[server].setup({})
end,
luau_lsp = function()
require("luau-lsp").setup({
fflags = {
enable_new_solver = true,
},
platform = {
type = "roblox",
},
types = {
roblox_security_level = "PluginSecurity",
automatic_enable = {
exclude = { "luau_lsp" },
},
})
local cmp = require("cmp")
cmp.setup({
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
}, {
{ name = "buffer" },
}),
})
local capabilities = require("cmp_nvim_lsp").default_capabilities()
vim.lsp.config("*", {
capabilities = capabilities,
})
cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
},
})
cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "path" },
}, {
{ name = "cmdline" },
}),
matching = { disallow_symbol_nonprefix_matching = false },
})
end,
},

View File

@@ -0,0 +1,5 @@
return {
{
"L3MON4D3/LuaSnip",
},
}

View File

@@ -3,7 +3,6 @@ return {
"echasnovski/mini.nvim",
version = false,
config = function()
require("mini.completion").setup()
require("mini.fuzzy").setup()
require("mini.pairs").setup()
require("mini.comment").setup()

View File

@@ -1,7 +1,6 @@
return {
{
"rose-pine/neovim",
name = "rose-pine",
config = function()
require("rose-pine").setup({
styles = {

View File

@@ -1,7 +1,8 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = {
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = {
"c",
"lua",
@@ -17,8 +18,9 @@ return {
"zig",
"svelte",
"html",
"templ",
"go",
},
sync_install = true,
auto_install = true,
highlight = {
enable = true,
@@ -27,6 +29,7 @@ return {
indent = {
enable = true,
},
},
})
end,
},
}

View File

@@ -41,6 +41,11 @@
bluetui
go
templ
bun
air
tailwindcss_4
gnumake
watchman
];
programs.nix-ld.enable = lib.mkDefault true;
programs.zsh.enable = lib.mkDefault true;

View File

@@ -20,6 +20,9 @@ in
envExtra =
''
export PATH="$PATH:$HOME/.rokit/bin"
export GOPATH="$HOME/go"
export GOBIN="$HOME/go/bin"
export PATH="$GOBIN:$PATH"
''
+ "\n"
+ aliases;