1

Neovim: Add lspkind + neogen and remove an old debug print

This commit is contained in:
2024-10-12 19:44:21 +02:00
parent f192ce3299
commit a30f916bdf
2 changed files with 75 additions and 3 deletions

View File

@ -189,7 +189,6 @@ in {
pattern = ["TelescopePreviewerLoaded"]; pattern = ["TelescopePreviewerLoaded"];
callback.__raw = '' callback.__raw = ''
function(args) function(args)
print(vim.inspect(args))
if args.data.bufname:match("*.csv") then if args.data.bufname:match("*.csv") then
vim.wo.wrap = false vim.wo.wrap = false
else else
@ -267,6 +266,13 @@ in {
}; };
}; };
cellular-automaton = {
name = "cellular-automaton";
pkg = pkgs.vimPlugins.cellular-automaton-nvim;
lazy = true;
cmd = ["CellularAutomaton"];
};
# NOTE: In LazyVim require("clang_extensions").setup(opts) is called where opts is the server definition from lspconfig... # NOTE: In LazyVim require("clang_extensions").setup(opts) is called where opts is the server definition from lspconfig...
clangd-extensions = rec { clangd-extensions = rec {
name = "clangd_extensions"; name = "clangd_extensions";
@ -324,6 +330,12 @@ in {
lazy = true; lazy = true;
}; };
_lspkind = {
name = "lspkind";
pkg = pkgs.vimPlugins.lspkind-nvim;
lazy = true;
};
cmp = rec { cmp = rec {
name = "cmp"; name = "cmp";
pkg = pkgs.vimPlugins.nvim-cmp; pkg = pkgs.vimPlugins.nvim-cmp;
@ -337,6 +349,7 @@ in {
_cmp-nvim-lsp _cmp-nvim-lsp
# _cmp-nvim-lsp-signature-help # _cmp-nvim-lsp-signature-help
_cmp-luasnip _cmp-luasnip
_lspkind # Type symbols in completion
]; ];
config = mkDefaultConfig name; config = mkDefaultConfig name;
opts.__raw = let opts.__raw = let
@ -399,6 +412,7 @@ in {
function() function()
local cmp = require("${name}") local cmp = require("${name}")
local luasnip = require("luasnip") local luasnip = require("luasnip")
local lspkind = require("lspkind")
local has_words_before = function() local has_words_before = function()
unpack = unpack or table.unpack unpack = unpack or table.unpack
@ -422,6 +436,20 @@ in {
-- documentation.border = "rounded", -- documentation.border = "rounded",
}, },
formatting = {
format = lspkind.cmp_format({
mode = "symbol", -- Show only symbol annotations
maxwidth = 50,
ellipsis_char = "...",
show_labelDetails = true, -- show labelDetails in menu. Disabled by default
-- The function below will be called before any actual modifications from lspkind
before = function (entry, vim_item)
return vim_item
end
})
},
mapping = cmp.mapping.preset.insert(${mapping}), mapping = cmp.mapping.preset.insert(${mapping}),
} }
end end
@ -779,6 +807,26 @@ in {
cmd = ["LazyGit" "LazyGitConfig" "LazyGitCurrentFile" "LazyGitFilter" "LazyGitFilterCurrentFile"]; cmd = ["LazyGit" "LazyGitConfig" "LazyGitCurrentFile" "LazyGitFilter" "LazyGitFilterCurrentFile"];
}; };
# leetcode = rec {
# name = "leetcode";
# pkg = pkgs.vimUtils.buildVimPlugin {
# name = "leetcode";
# src = pkgs.fetchFromGitHub {
# owner = "kawre";
# repo = "leetcode.nvim";
# rev = "02fb2c855658ad6b60e43671f6b040c812181a1d";
# sha256 = "sha256-YoFRd9Uf+Yv4YM6/l7MVLMjfRqhroSS3RCmZvNowIAo=";
# };
# };
# lazy = true;
# cmd = ["Leet"];
# dependencies = [_notify _nui _plenary telescope treesitter web-devicons];
# config = mkDefaultConfig name;
# opts = {
# lang = "python";
# };
# };
lint = { lint = {
name = "lint"; name = "lint";
pkg = pkgs.vimPlugins.nvim-lint; pkg = pkgs.vimPlugins.nvim-lint;
@ -1094,7 +1142,8 @@ in {
luasnip = { luasnip = {
name = "luasnip"; name = "luasnip";
pkg = pkgs.vimPlugins.luasnip; pkg = pkgs.vimPlugins.luasnip;
lazy = false; lazy = true;
event = ["InsertEnter"];
config = '' config = ''
function(_, opts) function(_, opts)
require("luasnip").config.set_config(opts) require("luasnip").config.set_config(opts)
@ -1221,6 +1270,17 @@ in {
}; };
}; };
neogen = rec {
name = "neogen";
pkg = pkgs.vimPlugins.neogen;
lazy = true;
cmd = ["Neogen"];
config = mkDefaultConfig name;
opts = {
snippet_engine = "luasnip";
};
};
_notify = { _notify = {
name = "notify"; name = "notify";
pkg = pkgs.vimPlugins.nvim-notify; pkg = pkgs.vimPlugins.nvim-notify;
@ -1787,7 +1847,8 @@ in {
ufo = rec { ufo = rec {
name = "ufo"; name = "ufo";
pkg = pkgs.vimPlugins.nvim-ufo; pkg = pkgs.vimPlugins.nvim-ufo;
lazy = false; lazy = true;
event = ["BufReadPost" "BufNewFile"];
dependencies = [ dependencies = [
_promise _promise
]; ];
@ -1818,6 +1879,8 @@ in {
wakatime = { wakatime = {
name = "wakatime"; name = "wakatime";
pkg = pkgs.vimPlugins.vim-wakatime; pkg = pkgs.vimPlugins.vim-wakatime;
lazy = true;
event = ["BufReadPost" "BufNewFile"];
}; };
web-devicons = rec { web-devicons = rec {
@ -1884,6 +1947,7 @@ in {
bbye # Delete buffer without closing the window or split bbye # Delete buffer without closing the window or split
better-escape # Escape to normal mode using "jk" better-escape # Escape to normal mode using "jk"
catppuccin # Colortheme (also add this here to access palettes) catppuccin # Colortheme (also add this here to access palettes)
cellular-automaton # Procrastinate better by watching animations
clangd-extensions clangd-extensions
# blink-cmp # Auto completion popups # TODO: Try this instead of cmp # blink-cmp # Auto completion popups # TODO: Try this instead of cmp
@ -1908,6 +1972,7 @@ in {
jdtls # Eclipse JDT language server integration for Java jdtls # Eclipse JDT language server integration for Java
lastplace # Reopen a file at the last editing position lastplace # Reopen a file at the last editing position
lazygit # Git frontend lazygit # Git frontend
# leetcode # Solve leetcode problems
lint # Lint documents on save lint # Lint documents on save
lspconfig # Language server configurations for different languages lspconfig # Language server configurations for different languages
lualine # Status line lualine # Status line
@ -1918,6 +1983,7 @@ in {
navbuddy # Structural file view navbuddy # Structural file view
neo-tree # File tree sidebar neo-tree # File tree sidebar
neogen # Generate doc comments
noice # Modern UI overhaul, e.g. floating cmdline noice # Modern UI overhaul, e.g. floating cmdline
obsidian # Integration with Obsidian.md obsidian # Integration with Obsidian.md
oil # File manager oil # File manager

View File

@ -747,6 +747,12 @@
action = "<cmd>Telescope lsp_outgoing_calls<cr>"; action = "<cmd>Telescope lsp_outgoing_calls<cr>";
options.desc = "Outgoing Calls"; options.desc = "Outgoing Calls";
} }
{
mode = "n";
key = "<leader>cC";
action = "<cmd>Neogen<cr>";
options.desc = "Generate Doc Comment";
}
# GoTo # GoTo
{ {