diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 7e7a6e1..1ae37d2 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,37 +1,38 @@ { - "LuaSnip": { "branch": "master", "commit": "2737edc9e674e537dc0a97e3405658d57d2d31ed" }, - "aerial.nvim": { "branch": "master", "commit": "247df216704cbe3cfa68e2ae5515c3485e281364" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "aerial.nvim": { "branch": "master", "commit": "4c959cf65c5420d54b24b61a77b681dcfca0bc57" }, "color-picker.nvim": { "branch": "master", "commit": "06cb5f853535dea529a523e9a0e8884cdf9eba4d" }, + "conform.nvim": { "branch": "master", "commit": "70019124aa4f2e6838be9fbd2007f6d13b27a96d" }, "coq.artifacts": { "branch": "artifacts", "commit": "a1ffcee295905171d87b40ee456001d45b10329b" }, - "coq.thirdparty": { "branch": "3p", "commit": "a827c2ab76d7c803976765cac597c79a2a5b34f6" }, - "coq_nvim": { "branch": "coq", "commit": "db12581bea4e83b8d8142c15daa9632d796636cf" }, - "crates.nvim": { "branch": "main", "commit": "8bf8358ee326d5d8c11dcd7ac0bcc9ff97dbc785" }, - "everforest-nvim": { "branch": "main", "commit": "7c57941d5ef5a150f307b9295c00a59e95d78587" }, - "fzf-lua": { "branch": "main", "commit": "ce1e24f2a48089b65deefcb0a71a9856839002b5" }, - "gitsigns.nvim": { "branch": "main", "commit": "4daf7022f1481edf1e8fb9947df13bb07c18e89a" }, - "lazy.nvim": { "branch": "main", "commit": "b1134ab82ee4279e31f7ddf7e34b2a99eb9b7bc9" }, - "lsp-zero.nvim": { "branch": "v3.x", "commit": "ab2a3413646fedd77aa0eab4214a6473e62f6a64" }, + "coq.thirdparty": { "branch": "3p", "commit": "12ce499eddf83b524e0540f6fa2e49dcaec6060c" }, + "coq_nvim": { "branch": "coq", "commit": "976012b0c13763a47edbd55492ba53b03b498cdd" }, + "crates.nvim": { "branch": "main", "commit": "bd35b13e94a292ee6e32c351e05ca2202dc9f070" }, + "everforest-nvim": { "branch": "main", "commit": "616864c0c534b1eaf650ef913512dcde80ababfb" }, + "fzf-lua": { "branch": "main", "commit": "af6ecbd7f421e7894127a9e94b40e13172fbfb13" }, + "gitsigns.nvim": { "branch": "main", "commit": "68114837e81ca16d06514c3a997c9102d1b25c15" }, + "lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "97d9f1d3ad205dece6bcafd1d71cf1507608f3c7" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, - "nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" }, + "mini.nvim": { "branch": "main", "commit": "890db26e37bb28d8a95f05570dd0d9fa757b698b" }, + "noice.nvim": { "branch": "main", "commit": "eaed6cc9c06aa2013b5255349e4f26a6b17ab70f" }, + "nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-lspconfig": { "branch": "master", "commit": "d01864641c6e43c681c3e9f6cf4745c75fdd9dcc" }, - "nvim-possession": { "branch": "main", "commit": "fcc6e00ffb13b7c7945560af8bf025184f795c95" }, - "nvim-treesitter": { "branch": "master", "commit": "425b58968340bd5b4621c2a0d626c73556516d3d" }, - "nvim-treesitter-context": { "branch": "master", "commit": "a2a334900d3643de585ac5c6140b03403454124f" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "3e450cd85243da99dc23ebbf14f9c70e9a0c26a4" }, - "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, + "nvim-lint": { "branch": "master", "commit": "dfa45de973c3ce7bd1b9a6d346f896a68ad07e44" }, + "nvim-lspconfig": { "branch": "master", "commit": "88157521e890fe7fdf18bee22438875edd6300a6" }, + "nvim-notify": { "branch": "master", "commit": "a3020c2cf4dfc4c4f390c4a21e84e35e46cf5d17" }, + "nvim-possession": { "branch": "main", "commit": "d82907c1fc40d249c6db0c01fb6c6938a0d07dee" }, + "nvim-treesitter": { "branch": "master", "commit": "6df6e80417b58abe377c90f5e3f7fe94cf7dfc55" }, + "nvim-treesitter-context": { "branch": "master", "commit": "d0dd7ce5a9d0be1f28086e818e52fdc5c78975df" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, + "nvim-web-devicons": { "branch": "master", "commit": "5740b7382429d20b6ed0bbdb0694185af9507d44" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "smart-open.nvim": { "branch": "0.2.x", "commit": "7770b01ce4d551c143d7ec8589879320796621b9" }, - "sqlite.lua": { "branch": "master", "commit": "d0ffd703b56d090d213b497ed4eb840495f14a11" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, + "sqlite.lua": { "branch": "master", "commit": "cf482586c4f24e197375235a6e310b9b9e80ba83" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" }, "telescope-fzy-native.nvim": { "branch": "master", "commit": "282f069504515eec762ab6d6c89903377252bf5b" }, "telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" }, + "trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" }, "undotree": { "branch": "main", "commit": "eab459ab87dd249617b5f7187bb69e614a083047" }, - "vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, - "which-key.nvim": { "branch": "main", "commit": "68e37e12913a66b60073906f5d3f14dee0de19f2" }, + "which-key.nvim": { "branch": "main", "commit": "1f8d414f61e0b05958c342df9b6a4c89ce268766" }, "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" } } diff --git a/.config/nvim/lua/plug_init/conform_init.lua b/.config/nvim/lua/plug_init/conform_init.lua new file mode 100644 index 0000000..2966275 --- /dev/null +++ b/.config/nvim/lua/plug_init/conform_init.lua @@ -0,0 +1,28 @@ +require("conform").setup({ + vim.api.nvim_create_autocmd({ "BufWritePre", "InsertLeave" }, { + pattern = "*", + callback = function(args) + require("conform").format({ bufnr = args.buf }) + end, + }), + formatters_by_ft = { + lua = { "stylua" }, + rust = { "rustfmt", lsp_format = "fallback" }, + -- Conform will run multiple formatters sequentially + python = { "ruff", "autopep8" }, + gdscript = { "gdtoolkit" }, + bash = { "shellharden" }, + javascript = { "prettier" }, + typescript = { "prettier" }, + markdown = { "prettier" }, + css = { "prettier" }, + html = { "prettier" }, + json = { "prettier" }, + yaml = { "prettier" }, + }, + format_on_save = { + timeout_ms = 700, + lsp_format = "fallback", + }, + log_level = vim.log.levels.DEBUG, +}) diff --git a/.config/nvim/lua/plug_init/init.lua b/.config/nvim/lua/plug_init/init.lua index d80f2cd..3cc96dc 100644 --- a/.config/nvim/lua/plug_init/init.lua +++ b/.config/nvim/lua/plug_init/init.lua @@ -3,9 +3,7 @@ require("plug_init.lazy_path") require("lazy").setup("plugins") --require("onedarkpro").setup({ -- filetypes = { --- all = true --- }, --- options = { +-- all = true }, options = { -- transparency = true -- } --}) @@ -14,22 +12,26 @@ require("everforest").load() require("plug_init.which_key_init") require("plug_init.lualine_init") require("plug_init.aerial_init") -require("plug_init.crates_init") require("plug_init.wilder_init") require("plug_init.telescope_init") -require("plug_init.nvim_possession_init") -require("plug_init.treesitter_init") ---require("plug_init.noice_init") -require("plugins.lsp_config") -require("plug_init.lsp_init") require("plug_init.smart-open_init") require("plug_init.gitsigns") -require("colorizer").setup { - 'css', - 'scss', - 'javascript', - html = { - mode = 'foreground', - } -} +require("plug_init.mini_init") +require("plug_init.nvim_possession_init") +require("plug_init.treesitter_init") +require("plug_init.conform_init") +require("plug_init.crates_init") require("plug_init.color-picker_init") +require("plug_init.lsp_init") +--require("plug_init.noice_init") +require("plugins.lsp_config") +require("plugins.coq_nvim") +require("plugins.trouble") +require("colorizer").setup({ + "css", + "scss", + "javascript", + html = { + mode = "foreground", + }, +}) diff --git a/.config/nvim/lua/plug_init/lsp_init.lua b/.config/nvim/lua/plug_init/lsp_init.lua index 14cbab0..8c29727 100644 --- a/.config/nvim/lua/plug_init/lsp_init.lua +++ b/.config/nvim/lua/plug_init/lsp_init.lua @@ -1,63 +1,64 @@ -local lsp_zero = require('lsp-zero') -lsp_zero.extend_lspconfig() ------------- +vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", {}), + callback = function(ev) + -- integrated by default now? + -- vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) + -- vim.keymap.set('n', "]d", vim.diagnostic.goto_next) + -- vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) + --vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) + --vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) + -- + --vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, opts) + --vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, opts) - vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('UserLspConfig', {}), - callback = function(ev) - -- Enable completion triggered by - vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' - vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) - vim.keymap.set('n', "]d", vim.diagnostic.goto_next) - vim.keymap.set('n', 'le', vim.diagnostic.open_float) - vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) - vim.keymap.set('n', 'rr', vim.lsp.buf.rename, opts) - vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) - vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) - vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, opts) - vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, opts) - vim.keymap.set('n', 'i', function() - vim.lsp.buf.format { async = true } - end, opts) - end, - }) - ------------------ -lsp_zero.on_attach(function(client, bufnr) - -- see :help lsp-zero-keybindings - -- to learn the available actions - lsp_zero.default_keymaps({buffer = bufnr}) -end) - -require('lspconfig').lua_ls.setup(lsp_zero.nvim_lua_ls()) - -require('lspconfig').rust_analyzer.setup{ - settings = { - ['rust-analyzer'] = { - imports = { - granularity = { - group = "module", - }, - prefix = "self", - }, - cargo = { - buildScripts = { - enable = true, - }, - }, - procMacro = { - enable = true - }, - }, - }, -} -require('mason').setup({}) -require('mason-lspconfig').setup({ - -- Replace the language servers listed here - -- with the ones you want to install - ensure_installed = {'rust_analyzer', 'ruff', 'quick_lint_js', - 'html', 'cssls', 'lua_ls', 'vimls'}, - handlers = { - lsp_zero.default_setup, - }, + -- vim.keymap.set("n", "rr", vim.lsp.buf.rename, opts) + -- vim.keymap.set("n", "le", vim.diagnostic.open_float) + -- vim.keymap.set("n", "i", function() + -- require("conform").format({ async = true }) + -- -- vim.lsp.buf.format { async = true } -- fallback if without conform + -- end, opts) + end, }) + +require("lspconfig").rust_analyzer.setup({ + settings = { + ["rust-analyzer"] = { + imports = { + granularity = { + group = "module", + }, + prefix = "self", + }, + cargo = { + buildScripts = { + enable = true, + }, + }, + procMacro = { + enable = true, + }, + }, + }, +}) +require("mason").setup({}) +require("mason-lspconfig").setup({ + -- Replace the language servers listed here + -- with the ones you want to install + ensure_installed = { "rust_analyzer", "ruff", "quick_lint_js", "html", "cssls", "lua_ls", "vimls" }, +}) + +require("lint").linters_by_ft = { + cpp = { "cpplint" }, + gdscript = { "gdtoolkit" }, + gitcommit = { "commitlint" }, + markdown = {}, + python = { "ruff" }, +} +require("lint").config = function() + local lint = require("lint") + vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { + callback = function() + lint.try_lint() + end, + }) +end diff --git a/.config/nvim/lua/plug_init/lualine_init.lua b/.config/nvim/lua/plug_init/lualine_init.lua index 3cf9303..a35b949 100644 --- a/.config/nvim/lua/plug_init/lualine_init.lua +++ b/.config/nvim/lua/plug_init/lualine_init.lua @@ -11,10 +11,10 @@ require('lualine').setup { }, ignore_focus = {}, always_divide_middle = false, - globalstatus = false, + globalstatus = true, refresh = { - statusline = 1000, - tabline = 2000, + statusline = 200, + tabline = 200, winbar = 20000, }, symbols = { @@ -37,13 +37,25 @@ require('lualine').setup { -- cond = require("noice").api.status.search.has, -- color = { fg = "#ff9e64" }, -- }, + 'pwd', + 'filename', }, lualine_x = { - -- { - -- require("noice").api.status.command.get, - -- cond = require("noice").api.status.command.has, - -- color = { fg = "#ff9e64" }, - -- }, + { + require("noice").api.status.command.get, + cond = require("noice").api.status.command.has, + color = { fg = "#ff9e64" }, + }, + { + require("noice").api.statusline.mode.get, + cond = require("noice").api.statusline.mode.has, + color = { fg = "#ff9e64" }, + }, + { + require("noice").api.status.search.get, + cond = require("noice").api.status.search.has, + color = { fg = "#ff9e64" }, + }, 'filesize', 'filetype', 'require"lsp-status".status()' @@ -66,8 +78,8 @@ require('lualine').setup { 'tabs', mode = 2, path = 1, - max_length = 60, - tab_max_length = 13, + max_length = 320, + tab_max_length = 40, use_mode_colors = true, }, }, diff --git a/.config/nvim/lua/plug_init/mini_init.lua b/.config/nvim/lua/plug_init/mini_init.lua new file mode 100644 index 0000000..a765bff --- /dev/null +++ b/.config/nvim/lua/plug_init/mini_init.lua @@ -0,0 +1,14 @@ +require("mini.surround").setup({}) --surround strings with objects in one go (parens etc.) +require("mini.pairs").setup({}) --put down parens etc in pairs +require("mini.ai").setup({}) --selection with textobjects, such as "indside quotes, parens etc" +require("mini.bracketed").setup({}) -- move to textobjects with brackets +require("mini.jump2d").setup({}) -- jump to any point with Enter+ 2 letters in 2d matrix +require("mini.files").setup({}) -- floating file manager in vim editor style +require("mini.comment").setup({}) -- block comments etc + +-- sugar ↓↓↓↓↓↓ +require("mini.indentscope").setup({}) -- show indent scope + +-- potentially interesting +--require("mini.align").setup({}) -- split lines in multiple sections, align these to rules, look into it more +--require("mini.git").setup({}) -- git shortcuts, but collisions with gitsigns diff --git a/.config/nvim/lua/plug_init/noice_init.lua b/.config/nvim/lua/plug_init/noice_init.lua index ddc01fe..de34b46 100644 --- a/.config/nvim/lua/plug_init/noice_init.lua +++ b/.config/nvim/lua/plug_init/noice_init.lua @@ -1,18 +1,41 @@ require("noice").setup({ - lsp = { + { + cmdline = { + enabled = true, -- enables the Noice cmdline UI + view = "cmdline", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom + opts = {}, -- global options for the cmdline. See section on views + ---@type table + format = { + -- conceal: (default=true) This will hide the text in the cmdline that matches the pattern. + -- view: (default is cmdline view) + -- opts: any options passed to the view + -- icon_hl_group: optional hl_group for the icon + -- title: set to anything or empty string to hide + cmdline = { pattern = "^:", icon = "", lang = "vim" }, + search_down = { kind = "search", pattern = "^/", icon = " ", lang = "regex" }, + search_up = { kind = "search", pattern = "^%?", icon = " ", lang = "regex" }, + filter = { pattern = "^:%s*!", icon = "$", lang = "bash" }, + lua = { pattern = { "^:%s*lua%s+", "^:%s*lua%s*=%s*", "^:%s*=%s*" }, icon = "", lang = "lua" }, + help = { pattern = "^:%s*he?l?p?%s+", icon = "" }, + input = { view = "cmdline_input", icon = "󰥻 " }, -- Used by input() + -- lua = false, -- to disable a format, set to `false` + }, + }, + }, + -- lsp = { -- override markdown rendering so that **cmp** and other plugins use **Treesitter** -- override = { -- ["vim.lsp.util.convert_input_to_markdown_lines"] = true, -- ["vim.lsp.util.stylize_markdown"] = true, -- ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp -- }, - }, - -- you can enable a preset for easier configuration - -- presets = { - -- --bottom_search = cmdline, -- use a classic bottom cmdline for search - -- command_palette = true, -- position the cmdline and popupmenu together - -- long_message_to_split = true, -- long messages will be sent to a split - -- inc_rename = false, -- enables an input dialog for inc-rename.nvim - -- lsp_doc_border = false, -- add a border to hover docs and signature help -- }, + -- you can enable a preset for easier configuration + --presets = { + --bottom_search = cmdline, -- use a classic bottom cmdline for search + --command_palette = true, -- position the cmdline and popupmenu together + --long_message_to_split = true, -- long messages will be sent to a split + --inc_rename = false, -- enables an input dialog for inc-rename.nvim + --lsp_doc_border = false, -- add a border to hover docs and signature help + --}, }) diff --git a/.config/nvim/lua/plug_init/smart-open_init.lua b/.config/nvim/lua/plug_init/smart-open_init.lua index 3a1d14c..7942b1c 100644 --- a/.config/nvim/lua/plug_init/smart-open_init.lua +++ b/.config/nvim/lua/plug_init/smart-open_init.lua @@ -2,7 +2,7 @@ local wk = require("which-key") require("telescope").load_extension("smart_open") require("smart-open").setup({ - lazy = true, + lazy = false, wk.add({ { "", "Telescope smart_open", desc="Smart open" }, }) diff --git a/.config/nvim/lua/plug_init/vim_init.lua b/.config/nvim/lua/plug_init/vim_init.lua index 93253c8..79ed911 100644 --- a/.config/nvim/lua/plug_init/vim_init.lua +++ b/.config/nvim/lua/plug_init/vim_init.lua @@ -3,8 +3,8 @@ vim.opt.showmatch = true vim.opt.hlsearch = true vim.opt.incsearch = false vim.opt.tabstop = 4 -vim.opt.softtabstop = 4 -vim.opt.expandtab = true -- spaces not tabs +vim.opt.softtabstop = -1 -- use shiftwidth value +vim.opt.expandtab = false -- tabs not spaces vim.opt.shiftwidth = 4 vim.opt.autoindent = true vim.opt.relativenumber = true @@ -17,12 +17,13 @@ vim.opt.wrap = false vim.opt.mouse = "" vim.opt.termguicolors = true -- enable truecolor vim.opt.undofile = true -vim.opt.undodir = os.getenv("HOME").."/.local/share/nvim/undodir" -vim.opt.updatetime = 50 +vim.opt.undodir = os.getenv("HOME") .. "/.local/share/nvim/undodir" +vim.opt.updatetime = 30 vim.opt.colorcolumn = "79" vim.opt.cmdheight = 0 -- remove the last interface line under statusline +vim.opt.showmode = false -- stop noice from showing mode, lualine will show mode anyway --- -vim.g.netrw_preview = 1 +vim.g.netrw_preview = 1 vim.g.netrw_liststyle = 3 vim.g.netrw_winsize = 25 -- @@ -41,12 +42,12 @@ vim.keymap.set("v", "J", ":m '>+1gv=gv") vim.keymap.set("v", "K", ":m '<-2gv=gv") -- replace highlighted area without adding to register -vim.keymap.set("x", "p", "\"_dP") +vim.keymap.set("x", "p", '"_dP') --- copy to system clipboard -vim.keymap.set("n", "y", "\"+y") -vim.keymap.set("v", "y", "\"+y") -vim.keymap.set("n", "Y", "\"+Y") +-- copy to system clipboard +vim.keymap.set("n", "y", '"+y') +vim.keymap.set("v", "y", '"+y') +vim.keymap.set("n", "Y", '"+Y') -- open side panel explorer -vim.keymap.set("n", "e", ":Lexplore") +--vim.keymap.set("n", "e", ":Lexplore") -- now via whichkey diff --git a/.config/nvim/lua/plug_init/which_key_init.lua b/.config/nvim/lua/plug_init/which_key_init.lua index 33f4549..ed19c96 100644 --- a/.config/nvim/lua/plug_init/which_key_init.lua +++ b/.config/nvim/lua/plug_init/which_key_init.lua @@ -1,7 +1,7 @@ local wk = require("which-key") wk.add({ - { "c", group = "crates" }, + { "c", group = "crates" }, { "cA", desc = "Upgrade all crates" }, { "cC", desc = "Open crates.io" }, { "cD", desc = "Open documentation" }, @@ -18,76 +18,84 @@ wk.add({ { "cv", desc = "Show versions popup" }, { "cx", desc = "Expand plain crate to inline table" }, - { "f", group = "Telescope" }, - { "fb", "Telescope buffers", desc = "Find Buffer" }, - { "fd", "Telescope lsp_document_symbols", desc = "Find LSP Symbols" }, - { "ff", "Telescope find_files", desc = "Find File" }, - { "fh", "Telescope help_tags", desc = "Find Help" }, - { "fr", "Telescope oldfiles", desc = "Open Recent File", remap = true }, - { "fs", "Telescope live_grep", desc = "Live Grep" }, - { "fw", "Telescope grep_string", desc = "Find string under cursor" }, + --{ "e", "Lexplore", desc = "Files Sidebar" }, + { "e", "lua MiniFiles.open()", desc = "Files w/ Mini" }, + { "f", group = "Telescope" }, + { "fb", "Telescope buffers", desc = "Find Buffer" }, + { "fd", "Telescope lsp_document_symbols", desc = "Find LSP Symbols" }, + { "ff", "Telescope find_files", desc = "Find File" }, + { "fh", "Telescope help_tags", desc = "Find Help" }, + { "fr", "Telescope oldfiles", desc = "Open Recent File", remap = true }, + { "fs", "Telescope live_grep", desc = "Live Grep" }, + { "fw", "Telescope grep_string", desc = "Find string under cursor" }, - { "g", group = "Gitsigns" }, - { "gB", "Gitsigns blame", desc = "Toggle Blame Sidebar" }, - { "gb", "Gitsigns blameline", desc = "Show Blame Inline" }, - { "gh", group = "hunks" }, - { "ghl", "Gitsigns setloclist", desc = "List file Changes" }, - { "ghn", "Gitsigns nav_hunk", desc = "Nav Hunk" }, - { "gr", group = "reset" }, - { "grb", "Gitsigns reset_buffer", desc = "Reset Buffer" }, - { "grh", "Gitsigns reset_hunk", desc = "Reset Hunk" }, - { "gd", "Gitsigns toggle_deleted", desc = "Toggle deleted lines" }, - { "gs", group = "stage" }, - { "gsb", "Gitsigns stage_buffer", desc = "Stage Buffer" }, - { "gsh", "Gitsigns stage_hunk", desc = "Stage Hunk" }, - { "gu", "Gitsigns undo_stage_hunk", desc = "Undo Stage Hunk" }, + { "g", group = "Gitsigns" }, + { "gB", "Gitsigns blame", desc = "Toggle Blame Sidebar" }, + { "gb", "Gitsigns blameline", desc = "Show Blame Inline" }, + { "gh", group = "hunks" }, + { "ghl", "Gitsigns setloclist", desc = "List file Changes" }, + { "ghn", "Gitsigns nav_hunk", desc = "Nav Hunk" }, + { "gr", group = "reset" }, + { "grb", "Gitsigns reset_buffer", desc = "Reset Buffer" }, + { "grh", "Gitsigns reset_hunk", desc = "Reset Hunk" }, + { "gd", "Gitsigns toggle_deleted", desc = "Toggle deleted lines" }, + { "gs", group = "stage" }, + { "gsb", "Gitsigns stage_buffer", desc = "Stage Buffer" }, + { "gsh", "Gitsigns stage_hunk", desc = "Stage Hunk" }, + { "gu", "Gitsigns undo_stage_hunk", desc = "Undo Stage Hunk" }, - { "i", desc = "Auto format file with linter(?), also on F3" }, - { "le", desc = "Open diagnostic float" }, - { "K", desc = "Show definition" }, - { "n", "nohl", desc = "Stop highlighting search results" }, + { + "i", + function() + require("conform").format({ async = true }) + end, + desc = "Auto format file with linter(?), also on F3", + }, + { "le", vim.diagnostic.open_float, desc = "Open diagnostic float" }, + { "K", desc = "Show definition" }, + { "n", "nohl", desc = "Stop highlighting search results" }, - { "r", group = "Rename" }, - { "rr", desc = "Rename Variable" }, + { "r", group = "Rename" }, + { "rr", vim.lsp.buf.rename, opts, desc = "Rename Variable" }, - { "s", group = "Sessions" }, - { "sd", desc = "Delete Session" }, - { "sl", desc = "Load Session" }, - { "sn", desc = "New Session" }, - { "su", desc = "Update Session" }, + { "s", group = "Sessions" }, + { "sd", desc = "Delete Session" }, + { "sl", desc = "Load Session" }, + { "sn", desc = "New Session" }, + { "su", desc = "Update Session" }, - { "t", group = "tabs" }, - { "ta", "tabnew", desc = "Add new Tab" }, - { "tc", "tabclose", desc = "Close Tab" }, - { "tf", "tabfirst", desc = "First Tab" }, - { "tl", "tablast", desc = "Last Tab" }, - { "tm", group = "Move Tab" }, - { "tmf", "tabmove 0", desc = "Move Tab to First" }, - { "tmi", ":tabmove ", desc = "Input position to move Tab to" }, - { "tml", "tabmove $", desc = "Move Tab to Last" }, - { "tn", "tabnext", desc = "Next Tab" }, - { "tp", "tabprevious", desc = "Previous Tab" }, + { "t", group = "tabs" }, + { "ta", "tabnew", desc = "Add new Tab" }, + { "tc", "tabclose", desc = "Close Tab" }, + { "tf", "tabfirst", desc = "First Tab" }, + { "tl", "tablast", desc = "Last Tab" }, + { "tm", group = "Move Tab" }, + { "tmf", "tabmove 0", desc = "Move Tab to First" }, + { "tmi", ":tabmove ", desc = "Input position to move Tab to" }, + { "tml", "tabmove $", desc = "Move Tab to Last" }, + { "tn", "tabnext", desc = "Next Tab" }, + { "tp", "tabprevious", desc = "Previous Tab" }, - { "u", desc = "Toggle undo-tree" }, - { "w", group = "Workspaces + Whichkey" }, - { "wa", desc = "Add workspace folder" }, - { "wr", desc = "Remove workspace folder" }, - { "ww", "WhichKey", desc = "Show keybindings" }, - { "y", desc = "Copy to system clipboard" }, - { "Y", desc = "Copy line to system clipboard" }, + { "u", desc = "Toggle undo-tree" }, + { "w", group = "Workspaces + Whichkey" }, + { "wa", desc = "Add workspace folder" }, + { "wr", desc = "Remove workspace folder" }, + { "ww", "WhichKey", desc = "Show keybindings" }, + { "y", desc = "Copy to system clipboard" }, + { "Y", desc = "Copy line to system clipboard" }, }) wk.add({ - { "K", desc = "Show definition" }, - { "[", group = "jump backward" }, + { "K", desc = "Show definition" }, + { "[", group = "jump backward" }, { "[c", desc = "Previous diff change" }, { "[d", desc = "Previous Diagnostic" }, - { "[h", "Gitsigns prev_hunk", desc = "Previous changed git block" }, - { "]", group = "jump forward" }, + { "[h", "Gitsigns prev_hunk", desc = "Previous changed git block" }, + { "]", group = "jump forward" }, { "]c", desc = "Next diff change" }, { "]d", desc = "Next Diagnostic" }, - { "]h", "Gitsigns next_hunk", desc = "Next changed git block" }, - { "g", group = "lsp functions" }, + { "]h", "Gitsigns next_hunk", desc = "Next changed git block" }, + { "g", group = "lsp functions" }, { "gD", desc = "go to declaration" }, { "gd", desc = "go to definition" }, { "gi", desc = "show implementations" }, diff --git a/.config/nvim/lua/plugins/crates.lua b/.config/nvim/lua/plugins/crates.lua index 72295e4..1437e64 100644 --- a/.config/nvim/lua/plugins/crates.lua +++ b/.config/nvim/lua/plugins/crates.lua @@ -1,7 +1,7 @@ return { 'saecki/crates.nvim', event = { "BufRead Cargo.toml" }, - lazy = true, + verylazy = true, config = function() require('crates').setup() end, diff --git a/.config/nvim/lua/plugins/lsp_config.lua b/.config/nvim/lua/plugins/lsp_config.lua index fbb1401..8a8f46a 100644 --- a/.config/nvim/lua/plugins/lsp_config.lua +++ b/.config/nvim/lua/plugins/lsp_config.lua @@ -1,32 +1,41 @@ return { - -- LSP Support - { - 'VonHeikemen/lsp-zero.nvim', - branch = "v3.x", - lazy = true, - config = false, - }, - { - "neovim/nvim-lspconfig", - dependencies = { - {"hrsh7th/cmp-nvim-lsp"}, - }, + -- LSP Support + -- { + -- 'VonHeikemen/lsp-zero.nvim', + -- branch = "v3.x", + -- lazy = true, + -- config = false, + -- }, + { + "neovim/nvim-lspconfig", + -- dependencies = { + -- {"hrsh7th/cmp-nvim-lsp"}, + -- }, lazy = true, - }, - { - "williamboman/mason.nvim", + }, + { + "williamboman/mason.nvim", lazy = true, - }, - { - "williamboman/mason-lspconfig.nvim", + }, + { + "williamboman/mason-lspconfig.nvim", lazy = true, - }, - -- Autocompletion - { - "hrsh7th/nvim-cmp", - dependencies = { - {"L3MON4D3/LuaSnip"} - }, - lazy = true, - }, + }, + { + "mfussenegger/nvim-lint", + lazy = false, + }, + -- supposedly faster formatter + { + "stevearc/conform.nvim", + opts = {}, + }, + -- Autocompletion + -- { + -- "hrsh7th/nvim-cmp", + -- dependencies = { + -- {"L3MON4D3/LuaSnip"} + -- }, + -- lazy = true, + -- }, } diff --git a/.config/nvim/lua/plugins/peanuts.lua b/.config/nvim/lua/plugins/peanuts.lua index 70e211e..e9fca99 100644 --- a/.config/nvim/lua/plugins/peanuts.lua +++ b/.config/nvim/lua/plugins/peanuts.lua @@ -1,53 +1,58 @@ return { - -- not deps - --{ "xiyaowong/transparent.nvim" }, - -- { "olimorris/onedarkpro.nvim" }, - { "neanias/everforest-nvim" }, - { "ibhagwan/fzf-lua", lazy = true }, - { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", lazy=true}, - { "nvim-treesitter/nvim-treesitter-context", lazy=true }, - { "nvim-telescope/telescope.nvim", tag = "0.1.2", - dependencies = { - "nvim-lua/plenary.nvim" - }, - lazy = true, - }, - { "nvim-lualine/lualine.nvim", - dependencies = { 'nvim-tree/nvim-web-devicons' }, - lazy = false - }, - { "stevearc/aerial.nvim" }, - -- { - -- "folke/noice.nvim", - -- event = "VeryLazy", - -- opts = {}, - -- dependencies = { - -- "MunifTanjim/nui.nvim", - -- --OPTIONAL: - -- -- `nvim-notify` is only needed, if you want to use the notification view. - -- -- If not available, we use `mini` as the fallback - -- --"rcarriga/nvim-notify", - -- } - -- }, - { - "danielfalk/smart-open.nvim", - branch = "0.2.x", - lazy = true, - dependencies = { - "kkharji/sqlite.lua", - -- Only required if using match_algorithm fzf - { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, - -- Optional. If installed, native fzy will be used when match_algorithm is fzy - { "nvim-telescope/telescope-fzy-native.nvim" }, - }, - }, - { "gelguy/wilder.nvim", lazy = true }, - { "tpope/vim-fugitive", lazy = true }, - { "norcalli/nvim-colorizer.lua", verylazy = true }, - { "ziontee113/color-picker.nvim", verylazy = true }, - { "lewis6991/gitsigns.nvim", verylazy = true }, - { "MunifTanjim/nui.nvim", verylazy = true }, --dependency for telescope - --{ "elkowar/yuck.vim", verylazy = true },--helper for eww widget configuration - -- optional - { "nvim-treesitter/nvim-treesitter-textobjects", lazy = true }, + -- not deps + --{ "xiyaowong/transparent.nvim" }, + -- { "olimorris/onedarkpro.nvim" }, + { "neanias/everforest-nvim" }, + { "ibhagwan/fzf-lua", lazy = true }, + { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate", lazy = true }, + { "nvim-treesitter/nvim-treesitter-context", lazy = true }, + { + "nvim-telescope/telescope.nvim", + tag = "0.1.2", + dependencies = { + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + }, + lazy = true, + }, + { + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + lazy = false, + }, + { "stevearc/aerial.nvim" }, + { + "folke/noice.nvim", + event = "VeryLazy", + opts = {}, + dependencies = { + "MunifTanjim/nui.nvim", + --OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + "rcarriga/nvim-notify", + }, + }, + { + "echasnovski/mini.nvim", + version = false, + }, + { + "danielfalk/smart-open.nvim", + branch = "0.2.x", + lazy = true, + dependencies = { + "kkharji/sqlite.lua", + -- Only required if using match_algorithm fzf + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + -- Optional. If installed, native fzy will be used when match_algorithm is fzy + { "nvim-telescope/telescope-fzy-native.nvim" }, + }, + }, + { "gelguy/wilder.nvim", lazy = true }, + { "norcalli/nvim-colorizer.lua", verylazy = true }, + { "ziontee113/color-picker.nvim", verylazy = true }, + { "lewis6991/gitsigns.nvim", verylazy = true }, + -- optional + { "nvim-treesitter/nvim-treesitter-textobjects", lazy = true }, } diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua new file mode 100644 index 0000000..da1f027 --- /dev/null +++ b/.config/nvim/lua/plugins/trouble.lua @@ -0,0 +1,37 @@ +return { + "folke/trouble.nvim", + opts = {}, + cmd = "Trouble", + keys = { + { + "xx", + "Trouble diagnostics toggle", + desc = "Diagnostics (Trouble)", + }, + { + "xX", + "Trouble diagnostics toggle filter.buf=0", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "cs", + "Trouble symbols toggle focus=false", + desc = "Symbols (Trouble)", + }, + { + "cl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "xL", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "xQ", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, + }, +} diff --git a/.config/nvim/lua/plugins/which-key.lua b/.config/nvim/lua/plugins/which-key.lua index 39db282..21738f9 100644 --- a/.config/nvim/lua/plugins/which-key.lua +++ b/.config/nvim/lua/plugins/which-key.lua @@ -1,9 +1,9 @@ return { - "folke/which-key.nvim", - event = "VeryLazy", - init = function() - vim.o.timeout = true - vim.o.timeoutlen = 100 - end, - opts = {} + "folke/which-key.nvim", + event = "VeryLazy", + init = function() + vim.o.timeout = true + vim.o.timeoutlen = 50 + end, + opts = {}, }