From 14f8f6825f67b72c5c96050eee64b987a307aa6c Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Thu, 6 Apr 2023 15:40:38 +0200 Subject: [PATCH] eVim 1.0 --- nvim2/.config/nvim/after/plugin/comment.lua | 1 + nvim2/.config/nvim/after/plugin/lsp.lua | 48 +++++ nvim2/.config/nvim/after/plugin/lualine.lua | 1 + nvim2/.config/nvim/after/plugin/presence.lua | 23 +++ .../.config/nvim/after/plugin/treesitter.lua | 16 ++ nvim2/.config/nvim/init.lua | 23 +++ nvim2/.config/nvim/lua/evim/init.lua | 3 + nvim2/.config/nvim/lua/evim/packer.lua | 52 +++++ nvim2/.config/nvim/lua/evim/remap.lua | 21 ++ nvim2/.config/nvim/plugin/packer_compiled.lua | 185 ++++++++++++++++++ 10 files changed, 373 insertions(+) create mode 100644 nvim2/.config/nvim/after/plugin/comment.lua create mode 100644 nvim2/.config/nvim/after/plugin/lsp.lua create mode 100644 nvim2/.config/nvim/after/plugin/lualine.lua create mode 100644 nvim2/.config/nvim/after/plugin/presence.lua create mode 100644 nvim2/.config/nvim/after/plugin/treesitter.lua create mode 100644 nvim2/.config/nvim/init.lua create mode 100644 nvim2/.config/nvim/lua/evim/init.lua create mode 100644 nvim2/.config/nvim/lua/evim/packer.lua create mode 100644 nvim2/.config/nvim/lua/evim/remap.lua create mode 100644 nvim2/.config/nvim/plugin/packer_compiled.lua 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 = "