aboutsummaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
Diffstat (limited to '.config')
-rw-r--r--.config/nvim/lua/keybinds.lua20
-rw-r--r--.config/nvim/lua/lsp.lua90
-rw-r--r--.config/nvim/lua/plugins.lua4
3 files changed, 64 insertions, 50 deletions
diff --git a/.config/nvim/lua/keybinds.lua b/.config/nvim/lua/keybinds.lua
index 0846a1c..ac3b9d3 100644
--- a/.config/nvim/lua/keybinds.lua
+++ b/.config/nvim/lua/keybinds.lua
@@ -1,5 +1,7 @@
-local telescope = require('telescope.builtin')
+local telescope = require("telescope.builtin")
local wk = require("which-key")
+local ufo = require("ufo")
+local renamer = require("renamer")
local nt_api = require("nvim-tree.api")
vim.g.mapleader = " "
@@ -16,15 +18,17 @@ vim.keymap.set("n", "<Leader><CR>", vim.lsp.buf.code_action)
vim.keymap.set("n", "<Leader>K", vim.lsp.buf.hover)
vim.keymap.set("n", "<Leader>D", vim.lsp.buf.definition)
vim.keymap.set("n", "<Leader>F", vim.lsp.buf.formatting)
+vim.keymap.set("n", "<Leader>d", vim.diagnostic.open_float)
vim.keymap.set("n", "<Leader>f", telescope.find_files)
vim.keymap.set("n", "<Leader><TAB>", telescope.buffers)
-vim.api.nvim_command("nnoremap <buffer> <Leader>, :TroubleToggle<CR>")
+vim.keymap.set("n", "<Leader>m", ":MinimapToggle<CR>")
+vim.keymap.set("n", "<Leader>,", ":TroubleToggle<CR>")
-vim.keymap.set("n", "<Leader>[", require("ufo").openAllFolds)
-vim.keymap.set("n", "<Leader>]", require("ufo").closeAllFolds)
-vim.keymap.set("n", "<Leader>r", require("renamer").rename)
+vim.keymap.set("n", "<Leader>[", ufo.openAllFolds)
+vim.keymap.set("n", "<Leader>]", ufo.closeAllFolds)
+vim.keymap.set("n", "<Leader>r", renamer.rename)
vim.opt.whichwrap = "<,>,h,l,[,]"
@@ -40,7 +44,7 @@ wk.register({
["]"] = "Close folds";
["r"] = "Rename";
["n"] = "Show file tree";
-}, {
- prefix = "<leader>";
-});
+ ["m"] = "Toggle Minimap";
+ ["d"] = "Show diagnostics";
+}, { prefix = "<leader>" });
diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua
index 49a6534..82bed0c 100644
--- a/.config/nvim/lua/lsp.lua
+++ b/.config/nvim/lua/lsp.lua
@@ -46,8 +46,8 @@ cmp.setup.cmdline(":", {
-- Setup lspconfig.
local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp
- .protocol
- .make_client_capabilities())
+ .protocol
+ .make_client_capabilities())
require("lspconfig")["denols"].setup { capabilities = capabilities }
local lspkind = require("lspkind")
@@ -65,95 +65,103 @@ cmp.setup {
}
local on_attach = function(client, bufnr)
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
+ require("lsp-inlayhints").setup()
+ require("lsp-inlayhints").on_attach(client, bufnr)
end
---Enable (broadcasting) snippet capability for completion
+-- Enable (broadcasting) snippet capability for completion
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
local lsputils = require("lspconfig").util
-require("lspconfig").tsserver.setup({
- on_attach = on_attach,
- root_dir = lsputils.root_pattern("package.json", "tsconfig.json", "jsconfig.json")
+require("lspconfig").tsserver.setup({
+ on_attach = on_attach;
+ root_dir = lsputils.root_pattern("package.json", "tsconfig.json",
+ "jsconfig.json");
})
require("lspconfig").denols.setup {
on_attach = on_attach;
- init_options = {
- enable = true;
- unstable = true;
- config = "./deno.jsonc";
- };
+ init_options = { enable = true; unstable = true; config = "./deno.jsonc" };
root_dir = vim.loop.cwd;
}
-require('lspconfig').rust_analyzer.setup({})
+require("lspconfig").rust_analyzer.setup({
+ root_dir = vim.loop.cwd;
+ on_attach = on_attach;
+})
-require('lspconfig').sqls.setup({
+require("lspconfig").sqls.setup({
on_attach = function(client, bufnr)
- require('sqls').on_attach(client, bufnr)
- end
+ require("sqls").on_attach(client, bufnr)
+ on_attach(client, bufnr)
+ end;
})
+-- neovim-bin
+require"lspconfig".omnisharp.setup {
+ cmd = { "omnisharp" };
-require'lspconfig'.omnisharp.setup {
- cmd = { "omnisharp" },
-
+ on_attach = on_attach;
-- Enables support for reading code style, naming convention and analyzer
-- settings from .editorconfig.
- enable_editorconfig_support = true,
-
+ enable_editorconfig_support = true;
+
-- If true, MSBuild project system will only load projects for files that
-- were opened in the editor. This setting is useful for big C# codebases
-- and allows for faster initialization of code navigation features only
-- for projects that are relevant to code that is being edited. With this
-- setting enabled OmniSharp may load fewer projects and may thus display
-- incomplete reference lists for symbols.
- enable_ms_build_load_projects_on_demand = false,
-
+ enable_ms_build_load_projects_on_demand = false;
+
-- Enables support for roslyn analyzers, code fixes and rulesets.
- enable_roslyn_analyzers = false,
-
+ enable_roslyn_analyzers = false;
+
-- Specifies whether 'using' directives should be grouped and sorted during
-- document formatting.
- organize_imports_on_format = false,
-
+ organize_imports_on_format = false;
+
-- Enables support for showing unimported types and unimported extension
-- methods in completion lists. When committed, the appropriate using
-- directive will be added at the top of the current file. This option can
-- have a negative impact on initial completion responsiveness,
-- particularly for the first few completion sessions after opening a
-- solution.
- enable_import_completion = false,
-
+ enable_import_completion = false;
+
-- Specifies whether to include preview versions of the .NET SDK when
-- determining which version to use for project loading.
- sdk_include_prereleases = true,
-
+ sdk_include_prereleases = true;
+
-- Only run analyzers against open files when 'enableRoslynAnalyzers' is
-- true
- analyze_open_documents_only = false,
+ analyze_open_documents_only = false;
}
-require('lspconfig').marksman.setup({
+require("lspconfig").marksman.setup({
root_dir = vim.loop.cwd;
+ on_attach = on_attach;
})
-require('lspconfig').jsonls.setup({
- capabilities = capabilities,
- cmd = { "vscode-json-languageserver", "--stdio" }
+require("lspconfig").jsonls.setup({
+ capabilities = capabilities;
+ cmd = { "vscode-json-languageserver"; "--stdio" };
+ on_attach = on_attach;
})
-require('lspconfig').html.setup({
- capabilities = capabilities,
- cmd = { "vscode-html-languageserver", "--stdio" }
+require("lspconfig").html.setup({
+ capabilities = capabilities;
+ cmd = { "vscode-html-languageserver"; "--stdio" };
+ on_attach = on_attach;
})
-require('lspconfig').cssls.setup({
- capabilities = capabilities,
+require("lspconfig").cssls.setup({
+ capabilities = capabilities;
+ on_attach = on_attach;
})
vim.diagnostic.config({
- virtual_text = true;
+ virtual_text = false;
signs = true;
underline = true;
update_in_insert = false;
diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua
index 217a098..8ea0f91 100644
--- a/.config/nvim/lua/plugins.lua
+++ b/.config/nvim/lua/plugins.lua
@@ -53,13 +53,15 @@ local PKGS = {
{ url = "https://github.com/onsails/lspkind.nvim.git" };
{ url = "https://github.com/folke/trouble.nvim.git" };
{ url = "https://github.com/folke/lsp-colors.nvim.git" };
- { url = "https://github.com/nanotee/sqls.nvim.git"};
+ { url = "https://github.com/nanotee/sqls.nvim.git" };
+ { url = "https://github.com/lvimuser/lsp-inlayhints.nvim.git" };
-- Dev container
{ url = "https://codeberg.org/esensar/nvim-dev-container.git" };
-- Games
{ url = "https://github.com/alec-gibson/nvim-tetris.git" };
+ { url = "https://github.com/seandewar/nvimesweeper.git" };
}
local function clone_paq()