diff --git a/nvim2/.config/nvim/after/plugin/comment.lua b/nvim2/.config/nvim/after/plugin/comment.lua new file mode 100644 index 0000000..a844323 --- /dev/null +++ b/nvim2/.config/nvim/after/plugin/comment.lua @@ -0,0 +1 @@ +require('Comment').setup() diff --git a/nvim2/.config/nvim/after/plugin/lsp.lua b/nvim2/.config/nvim/after/plugin/lsp.lua new file mode 100644 index 0000000..8d8592f --- /dev/null +++ b/nvim2/.config/nvim/after/plugin/lsp.lua @@ -0,0 +1,48 @@ +local lsp = require("lsp-zero") + +lsp.preset("recommended") + +lsp.ensure_installed({ + "tsserver", + "eslint", + "lua_ls", + "rust_analyzer", + "pyright", +}) + +local cmp = require("cmp") +local cmp_select = { behavior = cmp.SelectBehavior.Select } +local cmp_mappings = lsp.defaults.cmp_mappings({ + [""] = cmp.mapping.select_prev_item(cmp_select), + [""] = cmp.mapping.select_next_item(cmp_select), + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.complete(), +}) + +lsp.set_preferences({ + sign_icons = {} +}) + +lsp.setup_nvim_cmp({ + mapping = cmp_mappings +}) + +lsp.on_attach(function(client, bufnr) + local opts = { buffer = bufnr, remap = false } + + vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts) + vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts) + vim.keymap.set("n", "vws", function() vim.lsp.buf.workspace_symbol() end, opts) + vim.keymap.set("n", "vd", function() vim.diagnostic.open_float() end, opts) + vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts) + vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts) + vim.keymap.set("n", "vca", function() vim.lsp.buf.code_action() end, opts) + vim.keymap.set("n", "vrr", function() vim.lsp.buf.references() end, opts) + vim.keymap.set("n", "vrn", function() vim.lsp.buf.rename() end, opts) + vim.keymap.set("i", "", function() vim.lsp.buf.signature_help() end, opts) + vim.keymap.set("n", "", function() + vim.lsp.buf.format { async = true } + end, opts) +end) + +lsp.setup() diff --git a/nvim2/.config/nvim/after/plugin/lualine.lua b/nvim2/.config/nvim/after/plugin/lualine.lua new file mode 100644 index 0000000..9814cae --- /dev/null +++ b/nvim2/.config/nvim/after/plugin/lualine.lua @@ -0,0 +1 @@ +require("lualine").setup() diff --git a/nvim2/.config/nvim/after/plugin/presence.lua b/nvim2/.config/nvim/after/plugin/presence.lua new file mode 100644 index 0000000..d7dcc05 --- /dev/null +++ b/nvim2/.config/nvim/after/plugin/presence.lua @@ -0,0 +1,23 @@ +require("presence").setup({ + -- General options + auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`) + neovim_image_text = "Neovim", -- Text displayed when hovered over the Neovim image + main_image = "file", -- Main image display (either "neovim" or "file") + client_id = "793271441293967371", -- Use your own Discord application client id (not recommended) + log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error") + debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(, true)`) + enable_line_number = false, -- Displays the current line number instead of the current project + blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches + buttons = false, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "