diff --git a/init.lua b/init.lua index 21f0b6f..0136e59 100644 --- a/init.lua +++ b/init.lua @@ -18,4 +18,6 @@ end dofile(vim.g.base46_cache .. "defaults") vim.opt.rtp:prepend(lazypath) +vim.api.nvim_command "packadd cfilter" +vim.api.nvim_command "packadd justify" require "plugins" diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index a54aeea..a0e4d1b 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -112,7 +112,14 @@ M.customstuffs = { -- Mappings: TODO -- "trim(system('git branch --show-current 2>/dev/null'))" - ["tt"] = { ":call append(line('.') - 1, repeat(' ', indent('.')) . '# TODO-' . trim(system('git branch --show-current 2>/dev/null')) . ': ' . input('Comment >'))", "Add TODO comment + add to quickfix list" }, + -- ["tt"] = { ":call append(line('.') - 1, repeat(' ', indent('.')) . '# TODO-' . trim(system('git branch --show-current 2>/dev/null')) . ': ' . input('Comment >'))", "Add TODO comment + add to quickfix list" }, + ["tt"] = { ":call append(line('.') - 1, repeat(' ', indent('.')) . '# TODO: ' . input('Comment >'))", "Add TODO comment + add to quickfix list" }, + + ["ww"] = { ":lua require('nvim-window').pick()", "Pick window to goto" }, + ["wm"] = { ":WinShift", "Enter move window mode" }, + ["ws"] = { ":WinShift swap", "Swap window, with selection" }, + + ["gg"] = { ":LazyGit", "Open lazygit" }, }, v = { ["n"] = { "nzz", "Next + auto center" }, @@ -328,9 +335,15 @@ M.telescope = { [""] = { " Telescope buffers ", "Find buffers" }, ["fg"] = { " lua require('telescope.builtin').live_grep({default_text=vim.fn.getreg('/')}) ", "Live grep with actual search value as prefix" }, + ["gf"] = { " lua require('telescope.builtin').find_files({default_text=vim.fn.getreg('/')}) ", "Live grep with actual search value as prefix" }, ["ac"] = { ":execute 'vimgrep' input('Pattern >', getreg('/')) '**/*' ", "add search term files in quickfix list" }, - ["qc"] = { " Telescope quickfix ", "Show quickfix list" }, - ["qr"] = { ":execute 'cdo' '%s/' . input('Search term >', getreg('/')) . '/' . input('Replace by >', getreg('')) . '/g | update' ", "Replace pattern in all quickfix list" }, + -- ["qr"] = { ":execute 'cdo' '%s/' . input('Search term >', getreg('/')) . '/' . input('Replace by >', getreg('')) . '/g | update' ", "Replace pattern in all quickfix list" }, + ["qr"] = { ":cdo '%s/' . input('Search term >', getreg('/')) . '/' . input('Replace by >', '') . '/g | update' ", "Replace pattern in all quickfix list" }, + ["br"] = { ":execute '%s/' . input('Search term >', getreg('/')) . '/' . input('Replace by >', '') . '/g | update' ", "Replace pattern in current buffer" }, + + ["ql"] = { " Telescope quickfix ", "Show quickfix list" }, + ["qn"] = { ":cnext", "Jump to next in quickfix list" }, + ["qp"] = { ":cprevious", "Jump to previous in quickfix list" }, ["ll"] = { " Telescope loclist ", "Show loclist list" }, ["ln"] = { ":lnext", "Jump to next in loclist" }, @@ -340,6 +353,8 @@ M.telescope = { ["fo"] = { " Telescope oldfiles ", "Find oldfiles" }, ["fz"] = { " Telescope current_buffer_fuzzy_find ", "Find in current buffer" }, + ["wl"] = { " Telescope workspaces ", "Find workspaces" }, + -- git --- Commits ["gc"] = { " lua require('custom.telescope').my_git_commits()", "Custom Git commits" }, @@ -362,6 +377,10 @@ M.telescope = { -- History ["ch"] = { " Telescope command_history ", "telescope commands history" }, ["/"] = { " Telescope search_history ", "telescope search history" }, + + -- Diaglist: LSP diagnostics in quick/loc list + ["dw"] = { "lua require('diaglist').open_all_diagnostics()", "Open all open buffers diagnostics in quickfix list" }, + ["d0"] = { "lua require('diaglist').open_buffer_diagnostics()", "Open current buffer diagnostics in loclist list" }, }, } diff --git a/lua/plugins/configs/ruff_lsp.lua b/lua/plugins/configs/ruff_lsp.lua index f3ac0a3..9f1e56b 100644 --- a/lua/plugins/configs/ruff_lsp.lua +++ b/lua/plugins/configs/ruff_lsp.lua @@ -40,7 +40,8 @@ require('lspconfig').ruff_lsp.setup { init_options = { settings = { -- Any extra CLI arguments for `ruff` go here. - args = {}, + args = {"--ignore", "E741"}, } + } } diff --git a/lua/plugins/configs/telescope.lua b/lua/plugins/configs/telescope.lua index 5d002b5..7558da6 100644 --- a/lua/plugins/configs/telescope.lua +++ b/lua/plugins/configs/telescope.lua @@ -168,7 +168,7 @@ local options = { } }, - extensions_list = { "themes", "terms", "fzf" }, + extensions_list = { "themes", "terms", "fzf", "macrothis" }, extensions = { fzf = { fuzzy = true, diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 0c794a2..2a982a0 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -236,6 +236,97 @@ local default_plugins = { end, }, + -- Save and load macro / register + { + "desdic/macrothis.nvim", + opts = {}, + keys = { + { "kkd", function() require('macrothis').delete() end, desc = "Delete" }, + { "kke", function() require('macrothis').edit() end, desc = "Edit" }, + { "kkl", function() require('macrothis').load() end, desc = "Load" }, + { "kkn", function() require('macrothis').rename() end, desc = "Rename" }, + { "kkq", function() require('macrothis').quickfix() end, desc = "Run macro on all files in quickfix" }, + { "kkr", function() require('macrothis').run() end, desc = "Run macro" }, + { "kks", function() require('macrothis').save() end, desc = "Save" }, + { "kkx", function() require('macrothis').register() end, desc = "Edit register" }, + { "kkp", function() require('macrothis').copy_register_printable() end, desc = "Copy register as printable" }, + { "kkm", function() require('macrothis').copy_macro_printable() end, desc = "Copy macro as printable" }, + } + }, + + { + "onsails/diaglist.nvim", + lazy=false, + debug=false, + }, + + { + "natecraddock/workspaces.nvim", + lazy=false, + + config = function() + require("workspaces").setup({ + hooks = { + open = {"Telescope find_files"}, + } + }) + end, + }, + + { + "mangelozzi/rgflow.nvim", + lazy=false, + + config = function() + require("rgflow").setup({ + -- Set the default rip grep flags and options for when running a search via + -- RgFlow. Once changed via the UI, the previous search flags are used for + -- each subsequent search (until Neovim restarts). + cmd_flags = "--smart-case --fixed-strings --ignore --max-columns 200", + + -- Mappings to trigger RgFlow functions + default_trigger_mappings = true, + -- These mappings are only active when the RgFlow UI (panel) is open + default_ui_mappings = true, + -- QuickFix window only mapping + default_quickfix_mappings = true, + }) + end, + }, + + { + "yorickpeterse/nvim-window", + lazy=false, + config = function() + require('nvim-window').setup({ + normal_hl = 'Normal', + hint_hl = 'Bold', + border = 'single' + }) + end, + }, + + { + "sindrets/winshift.nvim", + lazy=false, + }, + + { + "kdheepak/lazygit.nvim", + lazy=false, + config = function() + require("lazy").setup({ + { + "kdheepak/lazygit.nvim", + -- optional for floating window border decoration + dependencies = { + "nvim-lua/plenary.nvim", + }, + }, + }) + end, + }, + -- file managing , picker etc { "nvim-tree/nvim-tree.lua", @@ -277,6 +368,7 @@ local default_plugins = { -- Only load whichkey after all the gui { "folke/which-key.nvim", + lazy=false, keys = { "", '"', "'", "`", "c", "v" }, init = function() require("core.utils").load_mappings "whichkey"