From 0750e72b695f119df169b5249b280d1e71121a36 Mon Sep 17 00:00:00 2001 From: Wynd Date: Sat, 3 Aug 2024 23:38:33 +0300 Subject: [PATCH] Added minimap and a keybind for showing only errors in trouble --- .config/btop/btop.conf | 2 +- .config/nvim/README.md | 54 ++++++++++++------------ .config/nvim/lazy-lock.json | 4 +- .config/nvim/lua/nvwynd/autocmds.lua | 16 ++++--- .config/nvim/lua/nvwynd/keymaps.lua | 11 ++++- .config/nvim/lua/nvwynd/options.lua | 2 +- .config/nvim/lua/nvwynd/plugins/lsp.lua | 8 ++++ .config/nvim/lua/nvwynd/plugins/ui.lua | 2 +- .config/nvim/lua/nvwynd/plugins/util.lua | 37 +++++++++++++--- .zshrc | 1 + 10 files changed, 94 insertions(+), 43 deletions(-) diff --git a/.config/btop/btop.conf b/.config/btop/btop.conf index 3e59f52..6708d08 100644 --- a/.config/btop/btop.conf +++ b/.config/btop/btop.conf @@ -54,7 +54,7 @@ update_ms = 1000 #* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct", #* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly. -proc_sorting = "memory" +proc_sorting = "cpu lazy" #* Reverse sorting order, True or False. proc_reversed = False diff --git a/.config/nvim/README.md b/.config/nvim/README.md index 27d284a..ef0db50 100644 --- a/.config/nvim/README.md +++ b/.config/nvim/README.md @@ -2,37 +2,39 @@ ## plugins used -- [dressing.nvim](https://github.com/stevearc/dressing.nvim.git) -- [lspkind.nvim](https://github.com/onsails/lspkind.nvim.git) +- [nvim-surround](https://github.com/kylechui/nvim-surround.git) +- [mini.pairs](https://github.com/echasnovski/mini.pairs.git) +- [lazy.nvim](https://github.com/folke/lazy.nvim.git) +- [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim.git) +- [conform.nvim](https://github.com/stevearc/conform.nvim.git) - [plenary.nvim](https://github.com/nvim-lua/plenary.nvim.git) -- [cmp-nvim-lsp](https://github.com/hrsh7th/cmp-nvim-lsp.git) +- [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim.git) +- [vim-cool](https://github.com/romainl/vim-cool.git) +- [nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons.git) +- [nui.nvim](https://github.com/MunifTanjim/nui.nvim.git) +- [dressing.nvim](https://github.com/stevearc/dressing.nvim.git) +- [image.nvim](https://github.com/3rd/image.nvim.git) +- [nvim-notify](https://github.com/rcarriga/nvim-notify.git) - [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig.git) +- [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim.git) +- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter.git) +- [twilight.nvim](https://github.com/folke/twilight.nvim.git) +- [lsp-zero.nvim](https://github.com/VonHeikemen/lsp-zero.nvim.git) +- [lazydev.nvim](https://github.com/folke/lazydev.nvim.git) +- [luvit-meta](https://github.com/Bilal2453/luvit-meta.git) +- [nvim-cmp](https://github.com/hrsh7th/nvim-cmp.git) +- [lspkind.nvim](https://github.com/onsails/lspkind.nvim.git) +- [cmp-nvim-lsp](https://github.com/hrsh7th/cmp-nvim-lsp.git) +- [mini.map](https://github.com/echasnovski/mini.map.git) - [cmp-path](https://github.com/hrsh7th/cmp-path.git) - [cmp-buffer](https://github.com/hrsh7th/cmp-buffer.git) - [LuaSnip](https://github.com/L3MON4D3/LuaSnip.git) -- [lsp-zero.nvim](https://github.com/VonHeikemen/lsp-zero.nvim.git) -- [cmp_luasnip](https://github.com/saadparwaiz1/cmp_luasnip.git) -- [luvit-meta](https://github.com/Bilal2453/luvit-meta.git) -- [catppuccin](https://github.com/catppuccin/nvim.git) -- [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter.git) -- [nvim-autopairs](https://github.com/windwp/nvim-autopairs.git) -- [nvim-ts-autotag](https://github.com/windwp/nvim-ts-autotag.git) -- [Comment.nvim](https://github.com/numToStr/Comment.nvim.git) -- [todo-comments.nvim](https://github.com/folke/todo-comments.nvim.git) -- [nvim-surround](https://github.com/kylechui/nvim-surround.git) -- [neo-tree.nvim](https://github.com/nvim-neo-tree/neo-tree.nvim.git) -- [nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons.git) -- [nui.nvim](https://github.com/MunifTanjim/nui.nvim.git) -- [conform.nvim](https://github.com/stevearc/conform.nvim.git) -- [image.nvim](https://github.com/3rd/image.nvim.git) -- [twilight.nvim](https://github.com/folke/twilight.nvim.git) -- [trouble.nvim](https://github.com/folke/trouble.nvim.git) - [zen-mode.nvim](https://github.com/folke/zen-mode.nvim.git) - [which-key.nvim](https://github.com/folke/which-key.nvim.git) -- [lazy.nvim](https://github.com/folke/lazy.nvim.git) -- [telescope.nvim](https://github.com/nvim-telescope/telescope.nvim.git) -- [lazydev.nvim](https://github.com/folke/lazydev.nvim.git) -- [nvim-notify](https://github.com/rcarriga/nvim-notify.git) -- [lualine.nvim](https://github.com/nvim-lualine/lualine.nvim.git) -- [nvim-cmp](https://github.com/hrsh7th/nvim-cmp.git) +- [nvim-ts-autotag](https://github.com/windwp/nvim-ts-autotag.git) +- [cmp_luasnip](https://github.com/saadparwaiz1/cmp_luasnip.git) +- [trouble.nvim](https://github.com/folke/trouble.nvim.git) +- [Comment.nvim](https://github.com/numToStr/Comment.nvim.git) +- [catppuccin](https://github.com/catppuccin/nvim.git) +- [todo-comments.nvim](https://github.com/folke/todo-comments.nvim.git) - [fidget.nvim](https://github.com/j-hui/fidget.nvim.git) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 79b086a..cf1c75c 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -16,9 +16,10 @@ "lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, "lualine.nvim": { "branch": "master", "commit": "6a40b530539d2209f7dc0492f3681c8c126647ad" }, "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, + "mini.pairs": { "branch": "main", "commit": "927d19cbdd0e752ab1c7eed87072e71d2cd6ff51" }, + "minimap.vim": { "branch": "master", "commit": "395378137e6180762d5b963ca9ad5ac2db5d3283" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" }, "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, - "nvim-autopairs": { "branch": "master", "commit": "78a4507bb9ffc9b00f11ae0ac48243d00cb9194d" }, "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, "nvim-lspconfig": { "branch": "master", "commit": "cf97d2485fc3f6d4df1b79a3ea183e24c272215e" }, "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, @@ -31,6 +32,7 @@ "todo-comments.nvim": { "branch": "main", "commit": "313b04e5b02d29ab9275c9295ff5e2b73921b0eb" }, "trouble.nvim": { "branch": "main", "commit": "4453fea6bb597830fbd58d2c484612f37b97bd8c" }, "twilight.nvim": { "branch": "main", "commit": "da4fe0a9e1397ecd9b012c52fb34313fbd3b862f" }, + "vim-cool": { "branch": "master", "commit": "662e7b11064cbeedad17c45d2fe926e78d3cd0b6" }, "which-key.nvim": { "branch": "main", "commit": "af4ded85542d40e190014c732fa051bdbf88be3d" }, "zen-mode.nvim": { "branch": "main", "commit": "21976479c7a0146b05a42707cf91c86b1e510945" } } \ No newline at end of file diff --git a/.config/nvim/lua/nvwynd/autocmds.lua b/.config/nvim/lua/nvwynd/autocmds.lua index 3231a6d..ca1633a 100644 --- a/.config/nvim/lua/nvwynd/autocmds.lua +++ b/.config/nvim/lua/nvwynd/autocmds.lua @@ -1,13 +1,19 @@ +local autocmd = vim.api.nvim_create_autocmd +local user_command = vim.api.nvim_create_user_command + -- used for when lazyness takes over and I'm using a mouse to click around in neo-tree -- if insert mode is active then neo-tree won't behave as expected, so we want to stop it -vim.api.nvim_create_autocmd("BufEnter", { - pattern = { "*neo-tree*" }, +autocmd("BufEnter", { + pattern = { "*" }, callback = function() - vim.cmd("stopinsert") + local filetype = vim.filetype.match({ buf = 0 }) + if filetype == nil then + vim.cmd("stopinsert") + end end, }) -vim.api.nvim_create_user_command("ListPlugins", function() +user_command("ListPlugins", function() local plugins = require("lazy").plugins() local f, err = io.open("plugins", "w+") @@ -23,7 +29,7 @@ vim.api.nvim_create_user_command("ListPlugins", function() end end, {}) -vim.api.nvim_create_user_command("CountWords", function() +user_command("CountWords", function() local words = vim.fn.wordcount()["words"] print("Words: " .. words) end, {}) diff --git a/.config/nvim/lua/nvwynd/keymaps.lua b/.config/nvim/lua/nvwynd/keymaps.lua index 2333b63..c02636a 100644 --- a/.config/nvim/lua/nvwynd/keymaps.lua +++ b/.config/nvim/lua/nvwynd/keymaps.lua @@ -50,10 +50,13 @@ map("n", "ws", require("telescope.builtin").lsp_dynamic_workspace_symbol map("n", "ds", require("telescope.builtin").lsp_document_symbols, { desc = "[D]ocument [S]ymbols" }) map("n", "rn", vim.lsp.buf.rename, { desc = "[R]e[n]ame" }) --- nvimtree +-- neo-tree map("n", "n", "Neotree toggle", { desc = "Toggle Filetree Window" }) map("n", "e", "Neotree focus", { desc = "Focus Filetree Window" }) +-- minimap +map("n", "m", MiniMap.toggle, { desc = "Toggle Minimap" }) + -- comment -- _ represents the / key here local comment_api = require("Comment.api") @@ -68,6 +71,12 @@ end, { desc = "Toggle Comment" }) -- trouble map("n", "td", "Trouble diagnostics toggle", { desc = "[T]rouble [D]iagnostics" }) +map( + "n", + "te", + "Trouble diagnostics toggle filter.severity=vim.diagnostic.severity.ERROR", + { desc = "[T]rouble [E]rrors" } +) map("n", "tt", "Trouble todo toggle", { desc = "[T]rouble [T]odo" }) -- whichkey diff --git a/.config/nvim/lua/nvwynd/options.lua b/.config/nvim/lua/nvwynd/options.lua index ead8a76..c8c8b00 100644 --- a/.config/nvim/lua/nvwynd/options.lua +++ b/.config/nvim/lua/nvwynd/options.lua @@ -20,7 +20,7 @@ o.numberwidth = 2 o.undofile = true -- sync clipboard between OS and Neovim. o.clipboard = "unnamedplus" -o.hlsearch = false +o.hlsearch = true o.incsearch = true o.scrolloff = 8 o.updatetime = 50 diff --git a/.config/nvim/lua/nvwynd/plugins/lsp.lua b/.config/nvim/lua/nvwynd/plugins/lsp.lua index 727b810..ff813c5 100644 --- a/.config/nvim/lua/nvwynd/plugins/lsp.lua +++ b/.config/nvim/lua/nvwynd/plugins/lsp.lua @@ -21,6 +21,14 @@ return { capabilities = capabilities, settings = { ["rust-analyzer"] = { + cargo = { + buildScripts = { + enable = true, + }, + }, + procMacro = { + enable = true, + }, checkOnSave = { command = "clippy", }, diff --git a/.config/nvim/lua/nvwynd/plugins/ui.lua b/.config/nvim/lua/nvwynd/plugins/ui.lua index e3d975f..48fe529 100644 --- a/.config/nvim/lua/nvwynd/plugins/ui.lua +++ b/.config/nvim/lua/nvwynd/plugins/ui.lua @@ -39,7 +39,7 @@ return { dependencies = { "nvim-tree/nvim-web-devicons" }, opts = { options = { - disabled_filetypes = { "neo-tree" }, + disabled_filetypes = { "neo-tree", "minimap" }, globalstatus = true, }, sections = { diff --git a/.config/nvim/lua/nvwynd/plugins/util.lua b/.config/nvim/lua/nvwynd/plugins/util.lua index d1bf6d3..5753f70 100644 --- a/.config/nvim/lua/nvwynd/plugins/util.lua +++ b/.config/nvim/lua/nvwynd/plugins/util.lua @@ -1,11 +1,4 @@ return { - { - "windwp/nvim-autopairs", - event = "InsertEnter", - config = true, - opts = {}, - }, - { "windwp/nvim-ts-autotag", opts = {}, @@ -28,4 +21,34 @@ return { event = "VeryLazy", opts = {}, }, + + { + "echasnovski/mini.pairs", + version = false, + opts = {}, + }, + + { + "echasnovski/mini.map", + version = false, + init = function() + local mini = require("mini.map") + mini.setup({ + integrations = { + mini.gen_integration.builtin_search(), + mini.gen_integration.diagnostic(), + }, + window = { + focusable = true, + width = 20, + winblend = 0, + }, + }) + end, + }, + + { + "romainl/vim-cool", + init = function() end, + }, } diff --git a/.zshrc b/.zshrc index 10d3ba7..b77cacb 100644 --- a/.zshrc +++ b/.zshrc @@ -79,6 +79,7 @@ alias untar="tar -xvzf" alias myip="curl http://ipecho.net/plain; echo" alias diskspace="df -ht ext4" alias since="days_since" +alias ytd="yt-dlp -x --audio-format wav" # git shortcuts alias glo="git log --pretty='format:%C(yellow)%as %C(blue)%cn %C(green)%h %C(reset)%s' --no-merges"