From 89ab8c246f00ce499b238ec28e3951caa0ea570d Mon Sep 17 00:00:00 2001 From: Solomon Laing Date: Fri, 20 Oct 2023 20:00:22 +1030 Subject: [PATCH] updates to nvim, mainly lsp and plugin removal --- .bash_profile | 1 + .config/bash/.bashrc | 1 + .config/nvim/lua/lazyvim/plugins/alpha.lua | 92 ++++++------- .config/nvim/lua/lazyvim/plugins/cmp.lua | 2 + .config/nvim/lua/lazyvim/plugins/git.lua | 12 +- .config/nvim/lua/lazyvim/plugins/lsp/init.lua | 27 +++- .config/nvim/lua/lazyvim/plugins/noice.lua | 35 ++++- .config/nvim/lua/lazyvim/plugins/utility.lua | 122 +++++++++--------- .config/nvim/lua/lazyvim/plugins/whichkey.lua | 12 -- 9 files changed, 175 insertions(+), 129 deletions(-) diff --git a/.bash_profile b/.bash_profile index ee6c79b..474e960 100644 --- a/.bash_profile +++ b/.bash_profile @@ -5,3 +5,4 @@ [[ -f ~/.config/shell/profile ]] && . ~/.config/shell/profile [[ -f ~/.bashrc ]] && . ~/.bashrc +. "/home/solomon/.local/share/cargo/env" diff --git a/.config/bash/.bashrc b/.config/bash/.bashrc index fece65d..c4e1304 100644 --- a/.config/bash/.bashrc +++ b/.config/bash/.bashrc @@ -101,3 +101,4 @@ PROMPT_COMMAND=set_prompt #THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! export SDKMAN_DIR="$HOME/.sdkman" [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" +. "/home/solomon/.local/share/cargo/env" diff --git a/.config/nvim/lua/lazyvim/plugins/alpha.lua b/.config/nvim/lua/lazyvim/plugins/alpha.lua index de04535..6eb1272 100644 --- a/.config/nvim/lua/lazyvim/plugins/alpha.lua +++ b/.config/nvim/lua/lazyvim/plugins/alpha.lua @@ -1,48 +1,48 @@ return { - { - "goolord/alpha-nvim", - event = "VimEnter", - config = function() - local dashboard = require("alpha.themes.dashboard") - - local function button(sc, txt, key, key_opts) - local b = dashboard.button(sc, txt, key, key_opts) - b.opts.hl_shortcut = "Macro" - return b - end - - local icons = require("lazyvim.config.icons") - - dashboard.section.header.val = { - [[ , __ ___ __. _ __ ` , _ , _ ]], - [[ |' `. .' ` .' \ | / | |' `|' `.]], - [[ | | |----' | | ` / | | | |]], - [[ / | `.___, `._.' \/ / / ' /]], - } - - dashboard.section.buttons.val = { - button("f", icons.documents.Files .. " Find file", ":Telescope find_files "), - button("e", icons.ui.NewFile .. " New file", ":ene startinsert "), - button("r", icons.ui.History .. " Recent files", ":Telescope oldfiles "), - button("t", icons.ui.List .. " Find text", ":Telescope live_grep "), - button("c", icons.ui.Gear .. " Config", ":e ~/.config/nvim/init.lua "), - button("u", icons.ui.CloudDownload .. " Update", ":Lazy"), - button("q", icons.ui.SignOut .. " Quit", ":qa"), - } - - dashboard.section.footer.val = { - [[┬┌┐┌┬┌─┬ ┌─┐┌┬┐┌┐ ┬ ┌─┐┌┬┐┌─┐┌─┐┌┬┐]], - [[││││├┴┐│ ├┤ │ ├┴┐│ │ │ │ │ │ ││││]], - [[┴┘└┘┴ ┴┴─┘└─┘ ┴ └─┘┴─┘└─┘ ┴o└─┘└─┘┴ ┴]], - } - - dashboard.section.header.opts.hl = "Include" - dashboard.section.buttons.opts.hl = "Macro" - dashboard.section.footer.opts.hl = "Type" - - dashboard.opts.opts.noautocmd = true - - require("alpha").setup(dashboard.opts) - end, - }, + -- { + -- "goolord/alpha-nvim", + -- event = "VimEnter", + -- config = function() + -- local dashboard = require("alpha.themes.dashboard") + -- + -- local function button(sc, txt, key, key_opts) + -- local b = dashboard.button(sc, txt, key, key_opts) + -- b.opts.hl_shortcut = "Macro" + -- return b + -- end + -- + -- local icons = require("lazyvim.config.icons") + -- + -- dashboard.section.header.val = { + -- [[ , __ ___ __. _ __ ` , _ , _ ]], + -- [[ |' `. .' ` .' \ | / | |' `|' `.]], + -- [[ | | |----' | | ` / | | | |]], + -- [[ / | `.___, `._.' \/ / / ' /]], + -- } + -- + -- dashboard.section.buttons.val = { + -- button("f", icons.documents.Files .. " Find file", ":Telescope find_files "), + -- button("e", icons.ui.NewFile .. " New file", ":ene startinsert "), + -- button("r", icons.ui.History .. " Recent files", ":Telescope oldfiles "), + -- button("t", icons.ui.List .. " Find text", ":Telescope live_grep "), + -- button("c", icons.ui.Gear .. " Config", ":e ~/.config/nvim/init.lua "), + -- button("u", icons.ui.CloudDownload .. " Update", ":Lazy"), + -- button("q", icons.ui.SignOut .. " Quit", ":qa"), + -- } + -- + -- dashboard.section.footer.val = { + -- [[┬┌┐┌┬┌─┬ ┌─┐┌┬┐┌┐ ┬ ┌─┐┌┬┐┌─┐┌─┐┌┬┐]], + -- [[││││├┴┐│ ├┤ │ ├┴┐│ │ │ │ │ │ ││││]], + -- [[┴┘└┘┴ ┴┴─┘└─┘ ┴ └─┘┴─┘└─┘ ┴o└─┘└─┘┴ ┴]], + -- } + -- + -- dashboard.section.header.opts.hl = "Include" + -- dashboard.section.buttons.opts.hl = "Macro" + -- dashboard.section.footer.opts.hl = "Type" + -- + -- dashboard.opts.opts.noautocmd = true + -- + -- require("alpha").setup(dashboard.opts) + -- end, + -- }, } diff --git a/.config/nvim/lua/lazyvim/plugins/cmp.lua b/.config/nvim/lua/lazyvim/plugins/cmp.lua index 72b3d87..573d065 100644 --- a/.config/nvim/lua/lazyvim/plugins/cmp.lua +++ b/.config/nvim/lua/lazyvim/plugins/cmp.lua @@ -6,6 +6,7 @@ return { "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", "hrsh7th/cmp-emoji", "saadparwaiz1/cmp_luasnip", }, @@ -34,6 +35,7 @@ return { { name = "luasnip" }, { name = "buffer" }, { name = "path" }, + { name = "cmdline" }, { name = "emoji" }, }), formatting = { diff --git a/.config/nvim/lua/lazyvim/plugins/git.lua b/.config/nvim/lua/lazyvim/plugins/git.lua index 3fa69f3..8ad9ee5 100644 --- a/.config/nvim/lua/lazyvim/plugins/git.lua +++ b/.config/nvim/lua/lazyvim/plugins/git.lua @@ -4,12 +4,12 @@ return { event = "BufReadPre", opts = { signs = { - add = { text = "▎" }, - change = { text = "▎" }, - delete = { text = "契" }, - topdelete = { text = "契" }, - changedelete = { text = "▎" }, - untracked = { text = "▎" }, + add = { text = "a" }, + change = { text = "c" }, + delete = { text = "d" }, + topdelete = { text = "td" }, + changedelete = { text = "cd" }, + untracked = { text = "u" }, }, on_attach = function(buffer) local gs = package.loaded.gitsigns diff --git a/.config/nvim/lua/lazyvim/plugins/lsp/init.lua b/.config/nvim/lua/lazyvim/plugins/lsp/init.lua index ff2297a..19222c0 100644 --- a/.config/nvim/lua/lazyvim/plugins/lsp/init.lua +++ b/.config/nvim/lua/lazyvim/plugins/lsp/init.lua @@ -14,7 +14,7 @@ return { -- options for vim.diagnostic.config() diagnostics = { underline = true, - update_in_insert = false, + update_in_insert = true, virtual_text = { spacing = 4, prefix = "●" }, severity_sort = true, }, @@ -40,6 +40,17 @@ return { }, }, }, + rust_analyzer = { + capabilities = capabilities, + on_attach = on_attach, + cmd = { + + "rustup", + "run", + "stable", + "rust-analyzer", + }, + }, }, setup = { -- additional setup can be added here. @@ -183,4 +194,18 @@ return { end end, }, + { + "simrat39/rust-tools.nvim", + opts = { + server = { + on_attach = function(_, bufnr) + local rt = require("rust-tools") + -- Hover actions + vim.keymap.set("n", "", rt.hover_actions.hover_actions, { buffer = bufnr }) + -- Code action groups + vim.keymap.set("n", "a", rt.code_action_group.code_action_group, { buffer = bufnr }) + end, + }, + }, + }, } diff --git a/.config/nvim/lua/lazyvim/plugins/noice.lua b/.config/nvim/lua/lazyvim/plugins/noice.lua index 1e97df6..1dc1571 100644 --- a/.config/nvim/lua/lazyvim/plugins/noice.lua +++ b/.config/nvim/lua/lazyvim/plugins/noice.lua @@ -4,15 +4,44 @@ return { event = "VeryLazy", opts = { lsp = { + progress = { + enabled = true, + }, + hover = { + enabled = true, + }, + signature = { + enabled = true, + }, + message = { + enabled = true, + }, override = { ["vim.lsp.util.convert_input_to_markdown_lines"] = true, ["vim.lsp.util.stylize_markdown"] = true, }, }, + cmdline = { + enabled = false, + }, + messages = { + enabled = false, + }, + popupmenu = { + enabled = true, + }, + notify = { + enabled = false, + }, + smart_move = { + enabled = true, + }, presets = { - bottom_search = true, - command_palette = true, - long_message_to_split = true, + bottom_search = false, + command_palette = false, + long_message_to_split = false, + inc_rename = false, + lsp_doc_border = false, }, }, -- stylua: ignore diff --git a/.config/nvim/lua/lazyvim/plugins/utility.lua b/.config/nvim/lua/lazyvim/plugins/utility.lua index df0a9f9..cdfd9f6 100644 --- a/.config/nvim/lua/lazyvim/plugins/utility.lua +++ b/.config/nvim/lua/lazyvim/plugins/utility.lua @@ -22,35 +22,35 @@ return { { "folke/neodev.nvim", }, - { - "rcarriga/nvim-notify", - opts = { - -- Animation style (see below for details) - stages = "static", - - -- Render function for notifications. See notify-render() - render = "default", - - -- Default timeout for notifications - timeout = 2000, - - -- For stages that change opacity this is treated as the highlight behind the window - -- Set this to either a highlight group or an RGB hex value e.g. "#000000" - background_colour = "Normal", - - -- Minimum width for notification windows - minimum_width = 10, - - -- Icons for the different levels - icons = { - ERROR = icons.diagnostics.Error, - WARN = icons.diagnostics.Warning, - INFO = icons.diagnostics.Information, - DEBUG = icons.ui.Bug, - TRACE = icons.ui.Pencil, - }, - }, - }, + -- { + -- "rcarriga/nvim-notify", + -- opts = { + -- -- Animation style (see below for details) + -- stages = "static", + -- + -- -- Render function for notifications. See notify-render() + -- render = "default", + -- + -- -- Default timeout for notifications + -- timeout = 2000, + -- + -- -- For stages that change opacity this is treated as the highlight behind the window + -- -- Set this to either a highlight group or an RGB hex value e.g. "#000000" + -- background_colour = "Normal", + -- + -- -- Minimum width for notification windows + -- minimum_width = 10, + -- + -- -- Icons for the different levels + -- icons = { + -- ERROR = icons.diagnostics.Error, + -- WARN = icons.diagnostics.Warning, + -- INFO = icons.diagnostics.Information, + -- DEBUG = icons.ui.Bug, + -- TRACE = icons.ui.Pencil, + -- }, + -- }, + -- }, { "echasnovski/mini.bufremove", event = "VeryLazy", @@ -60,38 +60,38 @@ return { { "bD", function() require("mini.bufremove").delete(0, true) end, desc = "Delete Buffer (Force)" }, }, }, - { - "ghillb/cybu.nvim", - event = "VeryLazy", - keys = { - { "bl", "CybuNext", desc = "Next Buffer" }, - { "bh", "CybuPrev", desc = "Prev Buffer" }, - }, - opts = { - position = { - relative_to = "win", -- win, editor, cursor - anchor = "topright", -- topleft, topcenter, topright, - -- centerleft, center, centerright, - -- bottomleft, bottomcenter, bottomright - -- vertical_offset = 10, -- vertical offset from anchor in lines - -- horizontal_offset = 0, -- vertical offset from anchor in columns - -- max_win_height = 5, -- height of cybu window in lines - -- max_win_width = 0.5, -- integer for absolute in columns - -- float for relative to win/editor width - }, - display_time = 1750, -- time the cybu window is displayed - style = { - separator = " ", -- string used as separator - prefix = "…", -- string used as prefix for truncated paths - padding = 1, -- left & right padding in number of spaces - hide_buffer_id = true, - devicons = { - enabled = true, -- enable or disable web dev icons - colored = true, -- enable color for web dev icons - }, - }, - }, - }, + -- { + -- "ghillb/cybu.nvim", + -- event = "VeryLazy", + -- keys = { + -- { "bl", "CybuNext", desc = "Next Buffer" }, + -- { "bh", "CybuPrev", desc = "Prev Buffer" }, + -- }, + -- opts = { + -- position = { + -- relative_to = "win", -- win, editor, cursor + -- anchor = "topright", -- topleft, topcenter, topright, + -- -- centerleft, center, centerright, + -- -- bottomleft, bottomcenter, bottomright + -- -- vertical_offset = 10, -- vertical offset from anchor in lines + -- -- horizontal_offset = 0, -- vertical offset from anchor in columns + -- -- max_win_height = 5, -- height of cybu window in lines + -- -- max_win_width = 0.5, -- integer for absolute in columns + -- -- float for relative to win/editor width + -- }, + -- display_time = 1750, -- time the cybu window is displayed + -- style = { + -- separator = " ", -- string used as separator + -- prefix = "…", -- string used as prefix for truncated paths + -- padding = 1, -- left & right padding in number of spaces + -- hide_buffer_id = true, + -- devicons = { + -- enabled = true, -- enable or disable web dev icons + -- colored = true, -- enable color for web dev icons + -- }, + -- }, + -- }, + -- }, { "mbbill/undotree", cmd = { "UndotreeToggle" }, diff --git a/.config/nvim/lua/lazyvim/plugins/whichkey.lua b/.config/nvim/lua/lazyvim/plugins/whichkey.lua index 55cf001..6ec2b6a 100644 --- a/.config/nvim/lua/lazyvim/plugins/whichkey.lua +++ b/.config/nvim/lua/lazyvim/plugins/whichkey.lua @@ -92,18 +92,6 @@ return { f = { name = "+file", n = { "enew", "New File" }, - t = { - function() - utils.float_term(nil, { cwd = utils.get_root() }) - end, - "Terminal (rood dir)", - }, - T = { - function() - utils.float_term() - end, - "Terminal (cwd)", - }, }, q = {