Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions config/completion/cmp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
};
};
extraConfigLua = ''
luasnip = require("luasnip")
local luasnip = require("luasnip")
kind_icons = {
Text = "󰊄",
Method = "",
Expand Down Expand Up @@ -149,15 +149,6 @@
}
})

-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})

-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
sources = cmp.config.sources({
Expand Down
2 changes: 0 additions & 2 deletions config/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
./keys.nix
./languages
./lsp
./none-ls
./pluginmanagers
./sets
./snippets
Expand All @@ -42,7 +41,6 @@
keys.enable = true;
languages.enable = true;
lsp.enable = lib.mkDefault true;
none-ls.enable = lib.mkDefault false;
sets.enable = lib.mkDefault true;
pluginmanagers.enable = lib.mkDefault true;
snippets.enable = lib.mkDefault true;
Expand Down
7 changes: 6 additions & 1 deletion config/languages/jdtls.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }:
{
lib,
config,
pkgs,
...
}:
{
options = {
jdtls.enable = lib.mkEnableOption "Enable jdtls module";
Expand Down
8 changes: 1 addition & 7 deletions config/languages/treesitter-nvim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
indent = {
enable = true;
};
autopairs = {
enable = true;
};
folding = {
enable = true;
};
ensure_installed = [
"bash"
"c"
Expand All @@ -45,7 +39,7 @@
"toml"
"yaml"
];
auto_install = true;
auto_install = false;
incremental_selection = {
enable = true;
keymaps = {
Expand Down
2 changes: 0 additions & 2 deletions config/lsp/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
./conform.nix
./fidget.nix
./lsp-nvim.nix
./lspsaga.nix
./trouble.nix
];

Expand All @@ -19,7 +18,6 @@
conform.enable = lib.mkDefault true;
fidget.enable = lib.mkDefault true;
lsp-nvim.enable = lib.mkDefault true;
lspsaga.enable = lib.mkDefault false;
trouble.enable = lib.mkDefault true;
};
}
99 changes: 39 additions & 60 deletions config/lsp/lsp-nvim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,6 @@
action = "open_float";
desc = "Line Diagnostics";
};
"[d" = {
action = "goto_next";
desc = "Next Diagnostic";
};
"]d" = {
action = "goto_prev";
desc = "Previous Diagnostic";
};
};
};
onAttach = ''
Expand All @@ -183,60 +175,47 @@
};
};
extraConfigLua = ''
local _border = "rounded"

require('lspconfig.ui.windows').default_options = {
border = _border
}

vim.lsp.handlers["textDocument/hover"] = function(err, result, ctx, config)
config = vim.tbl_deep_extend("force", config or {}, { border = _border })
return vim.lsp.handlers.hover(err, result, ctx, config)
end

vim.lsp.handlers["textDocument/signatureHelp"] = function(err, result, ctx, config)
config = vim.tbl_deep_extend("force", config or {}, { border = _border })
return vim.lsp.handlers.signature_help(err, result, ctx, config)
end
require("lspconfig.ui.windows").default_options = { border = "rounded" }

vim.diagnostic.config({
float = { border = "rounded" },
virtual_text = {
prefix = "",
},
signs = true,
underline = true,
update_in_insert = true,
})
vim.lsp.config("*", {
handlers = {
["textDocument/hover"] = function(err, result, ctx, config)
vim.lsp.handlers.hover(err, result, ctx, vim.tbl_extend("force", config or {}, { border = "rounded" }))
end,
["textDocument/signatureHelp"] = function(err, result, ctx, config)
vim.lsp.handlers.signature_help(err, result, ctx, vim.tbl_extend("force", config or {}, { border = "rounded" }))
end,
},
})

-- vim.api.nvim_create_autocmd("LspAttach", {
-- group = vim.api.nvim_create_augroup("UserLspConfig", {}),
-- callback = function(args)
-- local client = vim.lsp.get_client_by_id(args.data.client_id)
-- if client.server_capabilities.inlayHintProvider then
-- vim.lsp.inlay_hint.enable(false)
-- end
-- vim.bo[args.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
--
-- local opts = { buffer = args.buf }
-- vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
-- vim.keymap.set("n", "gr", vim.lsp.buf.references, opts)
-- vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
-- vim.keymap.set("n", "gI", vim.lsp.buf.implementation, opts)
-- vim.keymap.set("n", "gT", vim.lsp.buf.type_definition, opts)
-- vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
-- vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts)
-- vim.keymap.set("n", "<space>cw", vim.lsp.buf.workspace_symbol, opts)
-- vim.keymap.set("n", "<space>cr", vim.lsp.buf.rename, opts)
-- vim.keymap.set({ "n", "v" }, "<space>ca", vim.lsp.buf.code_action, opts)
-- vim.keymap.set("n", "<space>cf", function()
-- vim.lsp.buf.format({ async = true })
-- end, opts)
-- vim.keymap.set("n", "<space>cd", vim.diagnostic.open_float, opts)
-- vim.keymap.set("n", "[d", vim.diagnostic.goto_next, opts)
-- vim.keymap.set("n", "]d", vim.diagnostic.goto_prev, opts)
-- end,
-- })
vim.diagnostic.config({
float = { border = "rounded" },
virtual_text = { prefix = "" },
signs = true,
underline = true,
update_in_insert = true,
})
'';

keymaps = [
{
mode = "n";
key = "[d";
action.__raw = "function() vim.diagnostic.jump({ count = 1, float = true }) end";
options = {
silent = true;
desc = "Next Diagnostic";
};
}
{
mode = "n";
key = "]d";
action.__raw = "function() vim.diagnostic.jump({ count = -1, float = true }) end";
options = {
silent = true;
desc = "Previous Diagnostic";
};
}
];
};
}
Loading