From 7b46aae1a1ed9f26cae133c38c3e68c06e6a950f Mon Sep 17 00:00:00 2001 From: aleidk Date: Fri, 22 Mar 2024 10:46:03 -0300 Subject: [PATCH] Add a couple of plugins to nvim --- chezmoi/dot_config/kitty/kitty.conf | 4 +- .../dot_config/nvim/lua/aleidk/options.lua | 2 +- .../dot_config/nvim/lua/aleidk/plugins/ai.lua | 28 +++---- .../nvim/lua/aleidk/plugins/colorscheme.lua | 1 + .../nvim/lua/aleidk/plugins/init.lua | 12 ++- .../nvim/lua/aleidk/plugins/key-help.lua | 7 +- .../nvim/lua/aleidk/plugins/lualine.lua | 3 + .../nvim/lua/aleidk/plugins/sessions.lua | 3 +- .../nvim/lua/aleidk/plugins/task-runner.lua | 39 +++++++++ .../nvim/lua/aleidk/plugins/telescope.lua | 4 - .../nvim/lua/aleidk/plugins/zen.lua | 81 +++++++++++++++++++ .../dot_config/nvim/original_lazy-lock.json | 7 +- 12 files changed, 163 insertions(+), 28 deletions(-) create mode 100644 chezmoi/dot_config/nvim/lua/aleidk/plugins/task-runner.lua create mode 100644 chezmoi/dot_config/nvim/lua/aleidk/plugins/zen.lua diff --git a/chezmoi/dot_config/kitty/kitty.conf b/chezmoi/dot_config/kitty/kitty.conf index e9629f6..935aa25 100644 --- a/chezmoi/dot_config/kitty/kitty.conf +++ b/chezmoi/dot_config/kitty/kitty.conf @@ -1355,7 +1355,7 @@ confirm_os_window_close 0 #: See rc_custom_auth for details. -# allow_remote_control no +allow_remote_control socket-only #: Allow other programs to control kitty. If you turn this on, other #: programs can control all aspects of kitty, including sending text @@ -1384,7 +1384,7 @@ confirm_os_window_close 0 #: yes #: Remote control requests are always accepted. -# listen_on none +listen_on unix:/tmp/kitty #: Listen to the specified socket for remote control connections. Note #: that this will apply to all kitty instances. It can be overridden diff --git a/chezmoi/dot_config/nvim/lua/aleidk/options.lua b/chezmoi/dot_config/nvim/lua/aleidk/options.lua index c465fd7..f9f573a 100644 --- a/chezmoi/dot_config/nvim/lua/aleidk/options.lua +++ b/chezmoi/dot_config/nvim/lua/aleidk/options.lua @@ -27,7 +27,7 @@ opt.number = true -- Print line number opt.pumblend = 10 -- Popup blend opt.pumheight = 10 -- Maximum number of entries in a popup opt.relativenumber = true -- Relative line numbers -opt.scrolloff = 8 -- Lines of context +opt.scrolloff = 1000 -- Lines of context opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" } opt.shiftround = true -- Round indent opt.shiftwidth = 2 -- Size of an indent diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/ai.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/ai.lua index 1dd2b60..8cdadc0 100644 --- a/chezmoi/dot_config/nvim/lua/aleidk/plugins/ai.lua +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/ai.lua @@ -186,21 +186,21 @@ return { "nvim-telescope/telescope.nvim", }, keys = { - { "pp", "ChatGPT", desc = "ChatGPT" }, - { "pe", "ChatGPTEditWithInstruction", desc = "Edit with instruction", mode = { "n", "v" } }, - { "pa", "ChatGPTActAs", desc = "Act as", mode = { "n", "v" } }, - { "pg", "ChatGPTRun grammar_correction", desc = "Grammar Correction", mode = { "n", "v" } }, - { "pT", "ChatGPTRun translate", desc = "Translate", mode = { "n", "v" } }, - { "pk", "ChatGPTRun keywords", desc = "Keywords", mode = { "n", "v" } }, - { "pd", "ChatGPTRun docstring", desc = "Docstring", mode = { "n", "v" } }, - { "pt", "ChatGPTRun add_tests", desc = "Add Tests", mode = { "n", "v" } }, - { "po", "ChatGPTRun optimize_code", desc = "Optimize Code", mode = { "n", "v" } }, - { "ps", "ChatGPTRun summarize", desc = "Summarize", mode = { "n", "v" } }, - { "pf", "ChatGPTRun fix_bugs", desc = "Fix Bugs", mode = { "n", "v" } }, - { "px", "ChatGPTRun explain_code", desc = "Explain Code", mode = { "n", "v" } }, - { "pr", "ChatGPTRun roxygen_edit", desc = "Roxygen Edit", mode = { "n", "v" } }, + { "ap", "ChatGPT", desc = "ChatGPT" }, + { "ae", "ChatGPTEditWithInstruction", desc = "Edit with instruction", mode = { "n", "v" } }, + { "aa", "ChatGPTActAs", desc = "Act as", mode = { "n", "v" } }, + { "ag", "ChatGPTRun grammar_correction", desc = "Grammar Correction", mode = { "n", "v" } }, + { "aT", "ChatGPTRun translate", desc = "Translate", mode = { "n", "v" } }, + { "ak", "ChatGPTRun keywords", desc = "Keywords", mode = { "n", "v" } }, + { "ad", "ChatGPTRun docstring", desc = "Docstring", mode = { "n", "v" } }, + { "at", "ChatGPTRun add_tests", desc = "Add Tests", mode = { "n", "v" } }, + { "ao", "ChatGPTRun optimize_code", desc = "Optimize Code", mode = { "n", "v" } }, + { "as", "ChatGPTRun summarize", desc = "Summarize", mode = { "n", "v" } }, + { "af", "ChatGPTRun fix_bugs", desc = "Fix Bugs", mode = { "n", "v" } }, + { "ax", "ChatGPTRun explain_code", desc = "Explain Code", mode = { "n", "v" } }, + { "ar", "ChatGPTRun roxygen_edit", desc = "Roxygen Edit", mode = { "n", "v" } }, { - "pl", + "al", "ChatGPTRun code_readability_analysis", desc = "Code Readability Analysis", mode = { "n", "v" }, diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/colorscheme.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/colorscheme.lua index 1209bc6..cda161e 100644 --- a/chezmoi/dot_config/nvim/lua/aleidk/plugins/colorscheme.lua +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/colorscheme.lua @@ -12,6 +12,7 @@ return { -- Change colors.none if not using a transparent background mason = true, neogit = true, noice = true, + hop = true, lsp_trouble = true, indent_blankline = { enabled = true, diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/init.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/init.lua index aa4ea3c..a9f418b 100644 --- a/chezmoi/dot_config/nvim/lua/aleidk/plugins/init.lua +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/init.lua @@ -1,7 +1,17 @@ return { -- Detect tabstop and shiftwidth automatically "tpope/vim-sleuth", - + { + "mbbill/undotree", + config = function() + vim.g.undotree_WindowLayout = 2 + vim.g.undotree_ShortIndicators = 1 + vim.g.undotree_SetFocusWhenToggle = 1 + end, + keys = { + { "fu", vim.cmd.UndotreeToggle, desc = "Undo tree" }, + }, + }, { -- Highlight word under cursor "RRethy/vim-illuminate", diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/key-help.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/key-help.lua index 6c57be3..de9be4e 100644 --- a/chezmoi/dot_config/nvim/lua/aleidk/plugins/key-help.lua +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/key-help.lua @@ -57,9 +57,10 @@ return { { mode = "n", keys = "u", desc = "+UI & Config" }, { mode = "n", keys = "un", desc = "+Noice" }, { mode = "n", keys = "w", desc = "+Workspace" }, - { mode = "n", keys = "p", desc = "+ChatGPT" }, - { mode = "v", keys = "p", desc = "+ChatGPT" }, - { mode = "n", keys = "p", desc = "+ChatGPT" }, + { mode = "n", keys = "p", desc = "+Run stuff" }, + { mode = "n", keys = "a", desc = "+ChatGPT" }, + { mode = "v", keys = "a", desc = "+ChatGPT" }, + { mode = "n", keys = "a", desc = "+ChatGPT" }, }, -- Clue window settings diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/lualine.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/lualine.lua index 81c8889..c2fe5e0 100644 --- a/chezmoi/dot_config/nvim/lua/aleidk/plugins/lualine.lua +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/lualine.lua @@ -66,6 +66,9 @@ return { hint = icons.diagnostics.Hint, }, }, + { + "overseer", + }, { -- Macro recording status function() diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/sessions.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/sessions.lua index 0c2907b..aba169d 100644 --- a/chezmoi/dot_config/nvim/lua/aleidk/plugins/sessions.lua +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/sessions.lua @@ -5,9 +5,10 @@ return { ---@diagnostic disable-next-line: missing-fields require("auto-session").setup({ log_level = "error", - auto_session_suppress_dirs = { "~/", "~/Downloads", "/" }, + auto_session_suppress_dirs = { "~/", "~/Downloads", "/", "~/.config/**" }, bypass_session_save_file_types = { "NeogitStatus", + "Lazy", }, }) end, diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/task-runner.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/task-runner.lua new file mode 100644 index 0000000..7b3d44c --- /dev/null +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/task-runner.lua @@ -0,0 +1,39 @@ +return { + "stevearc/overseer.nvim", + keys = { + { "pp", "OverseerToggle", desc = "Toggle task runner" }, + { "pr", "OverseerRun", desc = "Run task" }, + { "pf", "OverseerQuickAction open float", desc = "Display current tasks" }, + { "pm", "OverseerTaskAction", desc = "Manage current tasks" }, + }, + opts = { + task_list = { + direction = "bottom", + bindings = { + ["?"] = "ShowHelp", + ["g?"] = "ShowHelp", + [""] = "RunAction", + [""] = "Edit", + ["o"] = "Open", + [""] = "OpenVsplit", + [""] = "OpenSplit", + [""] = "OpenFloat", + [""] = "OpenQuickFix", + [""] = "TogglePreview", + ["p"] = "TogglePreview", + [""] = "IncreaseAllDetail", + [""] = "DecreaseAllDetail", + ["L"] = "IncreaseDetail", + ["H"] = "DecreaseDetail", + ["["] = "DecreaseWidth", + ["]"] = "IncreaseWidth", + ["{"] = "PrevTask", + ["}"] = "NextTask", + [""] = "ScrollOutputUp", + [""] = "ScrollOutputDown", + ["q"] = "Close", + ["d"] = "OverseerQuickAction dispose", + }, + }, + }, +} diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/telescope.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/telescope.lua index cb980a2..880cfb8 100644 --- a/chezmoi/dot_config/nvim/lua/aleidk/plugins/telescope.lua +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/telescope.lua @@ -13,9 +13,6 @@ return { return vim.fn.executable("make") == 1 end, }, - { - "nvim-telescope/telescope-file-browser.nvim", - }, }, config = function() local actions = require("telescope.actions") @@ -53,7 +50,6 @@ return { -- Enable telescope fzf native, if installed pcall(telescope.load_extension, "fzf") - pcall(telescope.load_extension, "file_browser") -- Find files vim.keymap.set( diff --git a/chezmoi/dot_config/nvim/lua/aleidk/plugins/zen.lua b/chezmoi/dot_config/nvim/lua/aleidk/plugins/zen.lua new file mode 100644 index 0000000..14374e5 --- /dev/null +++ b/chezmoi/dot_config/nvim/lua/aleidk/plugins/zen.lua @@ -0,0 +1,81 @@ +return { + "folke/zen-mode.nvim", + dependencies = { + { + "folke/twilight.nvim", + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, + }, + }, + keys = { + { + "uz", + function() + require("zen-mode").toggle({}) + end, + desc = "Toggle zen mode", + }, + }, + opts = { + window = { + backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal + -- height and width can be: + -- * an absolute number of cells when > 1 + -- * a percentage of the width / height of the editor when <= 1 + -- * a function that returns the width or the height + width = 0.8, -- width of the Zen window + height = 1, -- height of the Zen window + -- by default, no options are changed for the Zen window + -- uncomment any of the options below, or add other vim.wo options you want to apply + options = { + -- signcolumn = "no", -- disable signcolumn + -- number = false, -- disable number column + -- relativenumber = false, -- disable relative numbers + cursorline = false, -- disable cursorline + -- cursorcolumn = false, -- disable cursor column + -- foldcolumn = "0", -- disable fold column + list = false, -- disable whitespace characters + }, + }, + plugins = { + -- disable some global vim options (vim.o...) + -- comment the lines to not apply the options + options = { + enabled = true, + ruler = true, -- disables the ruler text in the cmd line area + showcmd = false, -- disables the command in the last line of the screen + -- you may turn on/off statusline in zen mode by setting 'laststatus' + -- statusline will be shown only if 'laststatus' == 3 + laststatus = 0, -- turn off the statusline in zen mode + }, + twilight = { enabled = true }, -- enable to start Twilight when zen mode opens + gitsigns = { enabled = false }, -- disables git signs + tmux = { enabled = true }, -- disables the tmux statusline + -- this will change the font size on kitty when in zen mode + -- to make this work, you need to set the following kitty options: + -- - allow_remote_control socket-only + -- - listen_on unix:/tmp/kitty + kitty = { + enabled = true, + font = "+8", -- font size increment + }, + -- this will change the font size on alacritty when in zen mode + -- requires Alacritty Version 0.10.0 or higher + -- uses `alacritty msg` subcommand to change font size + alacritty = { + enabled = true, + font = "14", -- font size + }, + -- this will change the font size on wezterm when in zen mode + -- See else also the Plugins/Wezterm section in this projects README + wezterm = { + enabled = true, + -- can be either an absolute font size or the number of incremental steps + font = "+4", -- (10% increase per step) + }, + }, + }, +} diff --git a/chezmoi/dot_config/nvim/original_lazy-lock.json b/chezmoi/dot_config/nvim/original_lazy-lock.json index 3fa623e..2e9fb1a 100644 --- a/chezmoi/dot_config/nvim/original_lazy-lock.json +++ b/chezmoi/dot_config/nvim/original_lazy-lock.json @@ -50,10 +50,10 @@ "nvim-ts-context-commentstring": { "branch": "main", "commit": "92e688f013c69f90c9bbd596019ec10235bc51de" }, "nvim-web-devicons": { "branch": "master", "commit": "5de460ca7595806044eced31e3c36c159a493857" }, "obsidian.nvim": { "branch": "main", "commit": "b101ad8988eb1452dabb6138763877a1794a1966" }, + "overseer.nvim": { "branch": "master", "commit": "b72f6d23ce47ccd427be2341f389c63448278f17" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "pretty-fold.nvim": { "branch": "master", "commit": "a7d8b424abe0eedf50116c460fbe6dfd5783b1d5" }, "smart-splits.nvim": { "branch": "master", "commit": "c8a9173d70cbbd1f6e4a414e49e31df2b32a1362" }, - "telescope-file-browser.nvim": { "branch": "master", "commit": "6e51d0cd6447cf2525412220ff0a2885eef9039c" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, "telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, "tfm.nvim": { "branch": "main", "commit": "0fd23be8d4adebcc65a30b3870c2090b97dc1bc2" }, @@ -61,10 +61,13 @@ "treesj": { "branch": "main", "commit": "070e6761d0b11a55446d988a69908f7a0928dbab" }, "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, "ts-node-action": { "branch": "master", "commit": "f266409809555d7604b1ba894ffad8958670d04f" }, + "twilight.nvim": { "branch": "main", "commit": "8b7b50c0cb2dc781b2f4262a5ddd57571556d1e4" }, + "undotree": { "branch": "master", "commit": "aa93a7e5890dbbebbc064cd22260721a6db1a196" }, "vim-dadbod": { "branch": "master", "commit": "fecf5a3ecfb1869f34252c7c27351de99f01ab0e" }, "vim-dadbod-completion": { "branch": "master", "commit": "bcdf3ff768cc7e544a0f78b0383d8719c2116569" }, "vim-dadbod-ui": { "branch": "master", "commit": "95fd22469507e86b78aa55d868c14108adee2881" }, "vim-fugitive": { "branch": "master", "commit": "cbe9dfa162c178946afa689dd3f42d4ea8bf89c1" }, "vim-illuminate": { "branch": "master", "commit": "3bd2ab64b5d63b29e05691e624927e5ebbf0fb86" }, - "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" } + "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, + "zen-mode.nvim": { "branch": "main", "commit": "78557d972b4bfbb7488e17b5703d25164ae64e6a" } } \ No newline at end of file