diff --git a/config/nvim/lua/config/autocmds.lua b/config/nvim/lua/config/autocmds.lua index 5d030632..7d4edd50 100644 --- a/config/nvim/lua/config/autocmds.lua +++ b/config/nvim/lua/config/autocmds.lua @@ -126,7 +126,7 @@ ac("BufWritePre", { if args.match:match("^%w%w+://") then return end - local file = vim.loop.fs_realpath(args.match) or args.match + local file = vim.uv.fs_realpath(args.match) or args.match vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p") end, }) diff --git a/config/nvim/lua/config/keymaps.lua b/config/nvim/lua/config/keymaps.lua index 61d3331c..3633afd1 100644 --- a/config/nvim/lua/config/keymaps.lua +++ b/config/nvim/lua/config/keymaps.lua @@ -2,7 +2,6 @@ local map = vim.keymap.set local api = vim.api local o = vim.opt -local Util = require("lazyvim.util") local lazy = require("lazy") -- Search current word @@ -11,36 +10,11 @@ local searching_brave = function() end map("n", "?", searching_brave, { noremap = true, silent = true, desc = "Search current word on brave search" }) --- Lazy options -map("n", "l", "") -map("n", "ll", "Lazy", { desc = "Lazy" }) --- stylua: ignore start -map("n", "ld", function() vim.fn.system({ "xdg-open", "https://lazyvim.org" }) end, { desc = "LazyVim Docs" }) -map("n", "lr", function() vim.fn.system({ "xdg-open", "https://github.com/LazyVim/LazyVim" }) end, { desc = "LazyVim Repo" }) -map("n", "lx", "LazyExtras", { desc = "Extras" }) -map("n", "lc", function() Util.news.changelog() end, { desc = "LazyVim Changelog" }) +-- return to dir +map("n", "pv", vim.cmd.Ex) -map("n", "lu", function() lazy.update() end, { desc = "Lazy Update" }) -map("n", "lC", function() lazy.check() end, { desc = "Lazy Check" }) -map("n", "ls", function() lazy.sync() end, { desc = "Lazy Sync" }) --- stylua: ignore end - --- Disable LazyVim bindings -map("n", "L", "") -map("n", "fT", "") - --- Identation -map("n", "<", "<<", { desc = "Deindent" }) -map("n", ">", ">>", { desc = "Indent" }) - --- Save without formatting -map("n", "", "noautocmd w", { desc = "Save without formatting" }) - --- Cursor navigation on insert mode -map("i", "", "", { desc = "Move cursor left" }) -map("i", "", "", { desc = "Move cursor left" }) -map("i", "", "", { desc = "Move cursor left" }) -map("i", "", "", { desc = "Move cursor left" }) +-- Exit insert mode without hitting Esc +map("i", "jj", "", { desc = "Esc" }) -- End of the word backwards map("n", "E", "ge") @@ -67,7 +41,7 @@ map("n", "n", "nzzzv") map("n", "N", "Nzzzv") -- Toggle statusline -map("n", "uS", function() +map("n", "sl", function() if o.laststatus:get() == 0 then o.laststatus = 3 else @@ -84,34 +58,36 @@ map("n", "u", function() end end, { desc = "Toggle Tabline" }) + +-- Shift arrows to select +map('i', '', 'lvj') +map('v', '', 'j') +map('n', '', 'vj') + +map('i', '', 'vk') +map('v', '', 'k') +map('n', '', 'vk') + +map('i', '', 'vl') +map('v', '', 'l') +map('n', '', 'vl') + +map('i', '', 'vh') +map('v', '', 'h') +map('n', '', 'vh') + + +-- " Ctrl-C, Ctrl-V option for copy/paste +map('v', '', '"+yi') +map('i', '', '"+yi') +map('v', '', '"+c') +map('v', '', 'c"+p') +map('i', '', '"+pa') + -- Comment box map("n", "]/", "/\\S\\zs\\s*╭zt", { desc = "Next block comment" }) map("n", "[/", "?\\S\\zs\\s*╭zt", { desc = "Prev block comment" }) --- Plugin Info -map("n", "cif", "LazyFormatInfo", { desc = "Formatting" }) -map("n", "cic", "ConformInfo", { desc = "Conform" }) -local linters = function() - local linters_attached = require("lint").linters_by_ft[vim.bo.filetype] - local buf_linters = {} - - if not linters_attached then - vim.notify("No linters attached", vim.log.levels.WARN, { title = "Linter" }) - return - end - - for _, linter in pairs(linters_attached) do - table.insert(buf_linters, linter) - end - - local unique_client_names = table.concat(buf_linters, ", ") - local linters = string.format("%s", unique_client_names) - - vim.notify(linters, vim.log.levels.INFO, { title = "Linter" }) -end -map("n", "ciL", linters, { desc = "Lint" }) -map("n", "cir", "LazyRoot", { desc = "Root" }) - -- U for redo map("n", "U", "", { desc = "Redo" }) @@ -119,11 +95,8 @@ map("n", "U", "", { desc = "Redo" }) map("n", "", "_", { desc = "First character of Line" }) map("n", "", "$", { desc = "Last character of Line" }) --- Copy whole text to clipboard -map("n", "", ":%y+", { desc = "Copy whole text to clipboard", silent = true }) - --- clipboard -map("v", "y", '"+y', { desc = "Yank to clipboard" }) +-- Select & copy to clipboard +map("v", "", '"+y', { desc = "Yank to clipboard" }) -- Duplicate paragraph map('n', 'p', 'yapp', { desc = 'Duplicate Paragraph' }) @@ -137,7 +110,6 @@ map("i", "", "", { desc = "End Of Line" }) map("n", "", "ggG", { desc = "Select all text", silent = true, noremap = true }) -- Paste options -map("i", "", '"', { desc = "Paste on insert mode" }) map("v", "p", '"_dP', { desc = "Paste without overwriting" }) -- Delete and change without yanking @@ -154,13 +126,30 @@ map("n", "dd", function() end end, { noremap = true, expr = true, desc = "Don't yank empty line to clipboard" }) --- Search inside visually highlighted text. Use `silent = false` for it to --- make effect immediately. -map("x", "g/", "/\\%V", { silent = false, desc = "Search inside visual selection" }) +-- Search for highlighted text in buffer +map("v", "//", 'y/"', { desc = "Search for highlighted text" }) --- Search visually selected text (slightly better than builtins in Neovim>=0.8) -map("x", "*", [[y/\V=escape(@", '/\')]]) -map("x", "#", [[y?\V=escape(@", '?\')]]) +-- Visual -- +-- Stay in indent mode +map("v", "<", "", ">gv") + +map({"n", "o", "x"}, "", "^", { desc = "Jump to beginning of line" }) +map({"n", "o", "x"}, "", "g_", { desc = "Jump to end of line" }) + +-- Copy file paths +map("n", "cf", "let @+ = expand(\"%\")", { desc = "Copy File Name" }) +map("n", "cp", "let @+ = expand(\"%:p\")", { desc = "Copy File Path" }) + +-- Dismiss Noice Message +map("n", "nd", "NoiceDismiss", {desc = "Dismiss Noice Message"}) + +-- Replace word under cursor across entire buffer +map("n", "r", [[:%s/\<\>//gI]], + { desc = "Replace word under cursor" }) + +-- Replace all instances of highlighted words +map("v", "rr", '"hy:%s/h//g') -- Dashboard map("n", "fd", function() @@ -170,5 +159,3 @@ map("n", "fd", function() vim.cmd("Dashboard") end end, { desc = "Dashboard" }) - - diff --git a/config/nvim/lua/config/options.lua b/config/nvim/lua/config/options.lua index b320e51f..bf9cb030 100644 --- a/config/nvim/lua/config/options.lua +++ b/config/nvim/lua/config/options.lua @@ -50,3 +50,7 @@ if vim.fn.has("nvim-0.10") == 1 then end o.conceallevel = 2 + +-- LSP Server to use for Python. +-- Set to "basedpyright" to use basedpyright instead of pyright. +vim.g.lazyvim_python_lsp = "basedpyright" diff --git a/config/nvim/lua/plugins/extras/dap/persistent-breakpoints.lua b/config/nvim/lua/plugins/extras/dap/persistent-breakpoints.lua index cdfecc48..1b6c29f2 100644 --- a/config/nvim/lua/plugins/extras/dap/persistent-breakpoints.lua +++ b/config/nvim/lua/plugins/extras/dap/persistent-breakpoints.lua @@ -1,7 +1,7 @@ return { { "Weissle/persistent-breakpoints.nvim", - cond = require("lazyvim.util").has("nvim-dap"), + cond = LazyVim.has("nvim-dap"), event = "LazyFile", keys = { { "dbd", "PBClearAllBreakpoints", desc = "Delete All Breakpoints" }, diff --git a/config/nvim/lua/plugins/extras/dap/telescope.lua b/config/nvim/lua/plugins/extras/dap/telescope.lua index d8ce824c..29950fff 100644 --- a/config/nvim/lua/plugins/extras/dap/telescope.lua +++ b/config/nvim/lua/plugins/extras/dap/telescope.lua @@ -1,8 +1,8 @@ return { "nvim-telescope/telescope-dap.nvim", - cond = require("lazyvim.util").has("nvim-dap"), + cond = LazyVim.has("nvim-dap"), config = function() - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("dap") end) end, diff --git a/config/nvim/lua/plugins/extras/editor/git/worktree.lua b/config/nvim/lua/plugins/extras/editor/git/worktree.lua index 9b44c360..46a3be62 100644 --- a/config/nvim/lua/plugins/extras/editor/git/worktree.lua +++ b/config/nvim/lua/plugins/extras/editor/git/worktree.lua @@ -3,7 +3,7 @@ return { "ThePrimeagen/git-worktree.nvim", opts = {}, config = function() - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("git_worktree") end) end, diff --git a/config/nvim/lua/plugins/extras/editor/marks/bookmarks.lua b/config/nvim/lua/plugins/extras/editor/marks/bookmarks.lua new file mode 100644 index 00000000..6560b39f --- /dev/null +++ b/config/nvim/lua/plugins/extras/editor/marks/bookmarks.lua @@ -0,0 +1,43 @@ +return { + "tomasky/bookmarks.nvim", + config = function() + require("bookmarks").setup({ + save_file = vim.fn.stdpath("state") .. "/bookmarks", + keywords = { + ["@t"] = "󰄵 ", + ["@w"] = " ", + ["@f"] = "󰁨 ", + ["@n"] = " ", + }, + }) + LazyVim.on_load("telescope.nvim", function() + require("telescope").setup({ + extensions = { + repo = { + list = { + fd_opts = { + "--no-ignore-vcs", + }, + search_dirs = { + "~/Repos/", + }, + }, + }, + }, + }) + require("telescope").load_extension("bookmarks") + end) + end, + -- stylua: ignore + keys = { + { "fB", "Telescope bookmarks list", desc = "Bookmarks" }, + { "mm", function() require("bookmarks").bookmark_toggle() end, desc = "Toggle Bookmark" }, + { "ml", function() require("bookmarks").bookmark_ann() end, desc = "Add/Edit Current Line" }, + { "mc", function() require("bookmarks").bookmark_clean() end, desc = "Clear All Bookmarks" }, + { "mn", function() require("bookmarks").bookmark_next() end, desc = "Next Bookmark" }, + { "mp", function() require("bookmarks").bookmark_prev() end, desc = "Previous Bookmark" }, + { "]k", function() require("bookmarks").bookmark_next() end, desc = "Next Bookmark" }, + { "[k", function() require("bookmarks").bookmark_prev() end, desc = "Previous Bookmark" }, + { "mL", function() require("bookmarks").bookmark_list() end, desc = "List Bookmarks" }, + }, +} diff --git a/config/nvim/lua/plugins/extras/editor/marks/grapple.lua b/config/nvim/lua/plugins/extras/editor/marks/grapple.lua index b691a358..f926cce7 100644 --- a/config/nvim/lua/plugins/extras/editor/marks/grapple.lua +++ b/config/nvim/lua/plugins/extras/editor/marks/grapple.lua @@ -28,7 +28,7 @@ return { keys = keys, config = function() require("grapple").setup() - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("grapple") end) end, diff --git a/config/nvim/lua/plugins/extras/editor/marks/harpoon-extended.lua b/config/nvim/lua/plugins/extras/editor/marks/harpoon-extended.lua index 8278fc4d..869f1e50 100644 --- a/config/nvim/lua/plugins/extras/editor/marks/harpoon-extended.lua +++ b/config/nvim/lua/plugins/extras/editor/marks/harpoon-extended.lua @@ -46,7 +46,7 @@ return { end, }) - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("harpoon") end) end, diff --git a/config/nvim/lua/plugins/extras/editor/rest-client.lua b/config/nvim/lua/plugins/extras/editor/rest-client.lua index 003f32df..351c444d 100644 --- a/config/nvim/lua/plugins/extras/editor/rest-client.lua +++ b/config/nvim/lua/plugins/extras/editor/rest-client.lua @@ -52,7 +52,7 @@ return { }, config = function(_, opts) require("rest-nvim").setup(opts) - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("rest") end) end, diff --git a/config/nvim/lua/plugins/extras/editor/telescope/file-browser.lua b/config/nvim/lua/plugins/extras/editor/telescope/file-browser.lua index 3505fc1d..f94479f0 100644 --- a/config/nvim/lua/plugins/extras/editor/telescope/file-browser.lua +++ b/config/nvim/lua/plugins/extras/editor/telescope/file-browser.lua @@ -1,7 +1,7 @@ return { "nvim-telescope/telescope-file-browser.nvim", config = function() - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").setup({ extensions = { file_browser = { diff --git a/config/nvim/lua/plugins/extras/editor/telescope/import.lua b/config/nvim/lua/plugins/extras/editor/telescope/import.lua index d6b1de78..f209407c 100644 --- a/config/nvim/lua/plugins/extras/editor/telescope/import.lua +++ b/config/nvim/lua/plugins/extras/editor/telescope/import.lua @@ -2,7 +2,7 @@ return { "piersolenski/telescope-import.nvim", opts = {}, config = function() - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").setup({ extensions = { import = { diff --git a/config/nvim/lua/plugins/extras/editor/telescope/lazy.lua b/config/nvim/lua/plugins/extras/editor/telescope/lazy.lua index 6aeef49a..752e10a5 100644 --- a/config/nvim/lua/plugins/extras/editor/telescope/lazy.lua +++ b/config/nvim/lua/plugins/extras/editor/telescope/lazy.lua @@ -1,7 +1,7 @@ return { "tsakirist/telescope-lazy.nvim", config = function() - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("lazy") end) end, diff --git a/config/nvim/lua/plugins/extras/editor/telescope/live-grep.lua b/config/nvim/lua/plugins/extras/editor/telescope/live-grep.lua index d7afb701..f3e3bce4 100644 --- a/config/nvim/lua/plugins/extras/editor/telescope/live-grep.lua +++ b/config/nvim/lua/plugins/extras/editor/telescope/live-grep.lua @@ -1,7 +1,7 @@ return { "nvim-telescope/telescope-live-grep-args.nvim", config = function() - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("lazy") end) end, diff --git a/config/nvim/lua/plugins/extras/editor/telescope/luasnip.lua b/config/nvim/lua/plugins/extras/editor/telescope/luasnip.lua index 126d4890..9a45a03d 100644 --- a/config/nvim/lua/plugins/extras/editor/telescope/luasnip.lua +++ b/config/nvim/lua/plugins/extras/editor/telescope/luasnip.lua @@ -1,7 +1,7 @@ return { "benfowler/telescope-luasnip.nvim", config = function() - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("luasnip") end) end, diff --git a/config/nvim/lua/plugins/extras/editor/telescope/media.lua b/config/nvim/lua/plugins/extras/editor/telescope/media.lua index 1482dd8c..54cdceb7 100644 --- a/config/nvim/lua/plugins/extras/editor/telescope/media.lua +++ b/config/nvim/lua/plugins/extras/editor/telescope/media.lua @@ -1,7 +1,7 @@ return { "dharmx/telescope-media.nvim", config = function() - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").setup({ extensions = { media = { diff --git a/config/nvim/lua/plugins/extras/editor/telescope/repo.lua b/config/nvim/lua/plugins/extras/editor/telescope/repo.lua index bd6e0aa3..6b8df91e 100644 --- a/config/nvim/lua/plugins/extras/editor/telescope/repo.lua +++ b/config/nvim/lua/plugins/extras/editor/telescope/repo.lua @@ -15,7 +15,7 @@ return { }, opts = {}, config = function() - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").setup({ extensions = { repo = { diff --git a/config/nvim/lua/plugins/extras/editor/telescope/undotree.lua b/config/nvim/lua/plugins/extras/editor/telescope/undotree.lua index bc840c9e..757cc809 100644 --- a/config/nvim/lua/plugins/extras/editor/telescope/undotree.lua +++ b/config/nvim/lua/plugins/extras/editor/telescope/undotree.lua @@ -3,7 +3,7 @@ return { "debugloop/telescope-undo.nvim", opts = {}, config = function() - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").setup({ extensions = { undo = { diff --git a/config/nvim/lua/plugins/extras/editor/telescope/workspaces.lua b/config/nvim/lua/plugins/extras/editor/telescope/workspaces.lua index b647e10f..51e78aa9 100644 --- a/config/nvim/lua/plugins/extras/editor/telescope/workspaces.lua +++ b/config/nvim/lua/plugins/extras/editor/telescope/workspaces.lua @@ -18,7 +18,7 @@ return { open = { "Telescope find_files" }, }, }) - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("workspaces") end) end, diff --git a/config/nvim/lua/plugins/extras/editor/telescope/zoxide.lua b/config/nvim/lua/plugins/extras/editor/telescope/zoxide.lua index 3c67ea15..5002a24f 100644 --- a/config/nvim/lua/plugins/extras/editor/telescope/zoxide.lua +++ b/config/nvim/lua/plugins/extras/editor/telescope/zoxide.lua @@ -2,7 +2,7 @@ return { { "jvgrootveld/telescope-zoxide", config = function() - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").setup({ extensions = { zoxide = { diff --git a/config/nvim/lua/plugins/extras/editor/terminal/floaterm.lua b/config/nvim/lua/plugins/extras/editor/terminal/floaterm.lua index 2c81304c..50d59848 100644 --- a/config/nvim/lua/plugins/extras/editor/terminal/floaterm.lua +++ b/config/nvim/lua/plugins/extras/editor/terminal/floaterm.lua @@ -9,7 +9,7 @@ return { { "gG", "FloatermNew --name=lazygitbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit", desc = "Lazygit (cwd)" }, { "cen", "FloatermNew --name=node --opener=edit --titleposition=center --wintype=split --height=0.35 node", desc = "Node" }, { "cep", "FloatermNew --name=python --opener=edit --titleposition=center --wintype=split --height=0.35 python", desc = "Python" }, - { "gf", function() + { "gF", function() local git_path = vim.api.nvim_buf_get_name(0) vim.api.nvim_command("FloatermNew --name=lazygitroot --opener=edit --titleposition=center --height=0.85 --width=0.85 lazygit -f " .. vim.trim(git_path)) end, desc = "File History (LazyGit)" }, @@ -27,7 +27,7 @@ return { { "dawsers/telescope-floaterm.nvim", config = function() - require("lazyvim.util").on_load("telescope.nvim", function() + LazyVim.on_load("telescope.nvim", function() require("telescope").load_extension("floaterm") end) end, diff --git a/config/nvim/lua/plugins/extras/editor/terminal/toggleterm.lua b/config/nvim/lua/plugins/extras/editor/terminal/toggleterm.lua index a73c4673..5c57ac1d 100644 --- a/config/nvim/lua/plugins/extras/editor/terminal/toggleterm.lua +++ b/config/nvim/lua/plugins/extras/editor/terminal/toggleterm.lua @@ -1,90 +1,58 @@ return { { - "voldikss/vim-floaterm", - cmd = { "FloatermNew", "FloatermToggle", "FloatermNext", "FloatermPrev", "FloatermLast", "FloatermFirst" }, - --stylua: ignore - keys = { - { "", "FloatermNew --disposable --name=yaziroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= yazi", desc = "Yazi" }, - { "gg", "FloatermNew --name=lazygitroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit", desc = "Lazygit (root dir)" }, - { "gG", "FloatermNew --name=lazygitbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit", desc = "Lazygit (cwd)" }, - { "cen", "FloatermNew --name=node --opener=edit --titleposition=center --wintype=split --height=0.35 node", desc = "Node" }, - { "cep", "FloatermNew --name=python --opener=edit --titleposition=center --wintype=split --height=0.35 python", desc = "Python" }, - { "gF", function() - local git_path = vim.api.nvim_buf_get_name(0) - vim.api.nvim_command("FloatermNew --name=lazygitroot --opener=edit --titleposition=center --height=0.85 --width=0.85 lazygit -f " .. vim.trim(git_path)) - end, desc = "File History (LazyGit)" }, - { "", "FloatermNext", mode = { "t" }, desc = "Next Terminal" }, - { "", "FloatermPrev", mode = { "t" }, desc = "Prev Terminal" }, - { "", "FloatermLast", mode = { "t" }, desc = "Last Terminal" }, - { "", "FloatermFirst", mode = { "t" }, desc = "First Terminal" }, - { [[]], "FloatermToggle", mode = { "n", "t" }, desc = "Toggle Terminal" }, - { "ftf", "FloatermNew --name=floatroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=", desc = "Floating (root dir)" }, - { "ftF", "FloatermNew --name=floatbuffer --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd=", desc = "Floating (cwd)" }, - { "fts", "FloatermNew --name=splitroot --opener=edit --titleposition=center --height=0.35 --wintype=split --cwd=", desc = "Split (root dir)" }, - { "ftS", "FloatermNew --name=splitbuffer --opener=edit --titleposition=center --height=0.35 --wintype=split --cwd=", desc = "Split (cwd)" }, + "akinsho/toggleterm.nvim", + cmd = { + "ToggleTerm", + "ToggleTermSetName", + "ToggleTermToggleAll", + "ToggleTermSendVisualLines", + "ToggleTermSendCurrentLine", + "ToggleTermSendVisualSelection", }, - }, - { - "dawsers/telescope-floaterm.nvim", - config = function() - require("lazyvim.util").on_load("telescope.nvim", function() - require("telescope").load_extension("floaterm") - end) - end, - keys = { - { [[]], "Telescope floaterm", desc = "Terminals" }, - }, - }, - { - "folke/which-key.nvim", opts = { - defaults = { - ["ce"] = { name = "r[e]pl" }, - ["ft"] = { name = "terminals" }, + size = function(term) + if term.direction == "horizontal" then + return 30 + elseif term.direction == "vertical" then + return vim.o.columns * 0.4 + end + end, + open_mapping = [[]], + hide_numbers = true, -- hide the number column in toggleterm buffers + shade_filetypes = {}, + shade_terminals = true, -- NOTE: this option takes priority over highlights specified so if you specify Normal highlights you should set this to false + shading_factor = "-10", -- the percentage by which to lighten terminal background, default: -30 (gets multiplied by -3 if background is light) + start_in_insert = true, + insert_mappings = true, -- whether or not the open mapping applies in insert mode + terminal_mappings = true, -- whether or not the open mapping applies in the opened terminals + persist_size = true, + persist_mode = true, -- if set to true (default) the previous terminal mode will be remembered + direction = "float", + close_on_exit = true, -- close the terminal window when the process exits + -- Change the default shell. Can be a string or a function returning a string + shell = vim.o.shell, + -- This field is only relevant if direction is set to 'float' + float_opts = { + -- The border key is *almost* the same as 'nvim_open_win' + -- see :h nvim_open_win for details on borders however + -- the 'curved' border is a custom border type + -- not natively supported but implemented in this plugin. + border = "curved", + -- like `size`, width and height can be a number or function which is passed the current terminal + highlights = { border = "Normal", background = "Normal" }, + winblend = 3, }, }, - }, - { - "folke/edgy.nvim", - optional = true, - opts = function(_, opts) - table.insert(opts.bottom, { - ft = "floaterm", - title = "Floaterm", - size = { height = 0.4 }, - filter = function(buf, win) - return vim.api.nvim_win_get_config(win).relative == "" - end, - }) - end, - }, - { - "goolord/alpha-nvim", - optional = true, - opts = function(_, dashboard) -- stylua: ignore - local button = dashboard.button("G", "󰊢 " .. " Git", "FloatermNew --disposable --name=lazygitroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit") - button.opts.hl = "AlphaButtons" - button.opts.hl_shortcut = "AlphaShortcut" - table.insert(dashboard.section.buttons.val, 7, button) - return dashboard - end, + keys = { + { [[]], "ToggleTerm", mode = "n", desc = "Toggle Terminal" }, + }, }, { - "nvimdev/dashboard-nvim", - optional = true, - opts = function(_, opts) - local git = { - action = "FloatermNew --disposable --name=lazygitroot --opener=edit --titleposition=center --height=0.85 --width=0.85 --cwd= lazygit", - desc = " Git", - icon = " ", - key = "G", - } - - git.desc = git.desc .. string.rep(" ", 43 - #git.desc) - git.key_format = " %s" - - table.insert(opts.config.center, 7, git) - end, + "ryanmsnyder/toggleterm-manager.nvim", + opts = {}, + keys = { + { "", "Telescope toggleterm_manager", desc = "Terminals" }, + }, }, } diff --git a/config/nvim/lua/plugins/extras/lang/web/typescript-extended.lua b/config/nvim/lua/plugins/extras/lang/web/typescript-extended.lua index 777be410..deea9356 100644 --- a/config/nvim/lua/plugins/extras/lang/web/typescript-extended.lua +++ b/config/nvim/lua/plugins/extras/lang/web/typescript-extended.lua @@ -139,6 +139,7 @@ return { "dmmulroy/tsc.nvim", opts = { auto_start_watch_mode = false, + use_trouble_qflist = true, flags = { watch = false, }, @@ -150,6 +151,11 @@ return { "typescript", "typescriptreact", }, + cmd = { + "TSC", + "TSCOpen", + "TSCClose", + }, }, { "dmmulroy/ts-error-translator.nvim", diff --git a/config/nvim/lua/plugins/extras/lazyvim/flash.lua b/config/nvim/lua/plugins/extras/lazyvim/flash.lua index bc72a7e2..fb78315c 100644 --- a/config/nvim/lua/plugins/extras/lazyvim/flash.lua +++ b/config/nvim/lua/plugins/extras/lazyvim/flash.lua @@ -1,5 +1,12 @@ return { "folke/flash.nvim", + opts = { + modes = { + search = { + enabled = false, + }, + }, + }, keys = { { "s", diff --git a/config/nvim/lua/plugins/extras/lazyvim/lualine.lua b/config/nvim/lua/plugins/extras/lazyvim/lualine.lua index 43324379..3b037acb 100644 --- a/config/nvim/lua/plugins/extras/lazyvim/lualine.lua +++ b/config/nvim/lua/plugins/extras/lazyvim/lualine.lua @@ -33,7 +33,7 @@ return { opts.sections.lualine_a = { { "mode", icon = "" } } opts.sections.lualine_c[4] = { - require("lazyvim.util.lualine").pretty_path({ + LazyVim.lualine.pretty_path({ filename_hl = "Bold", modified_hl = "MatchParen", directory_hl = "Conceal", diff --git a/config/nvim/lua/plugins/extras/lazyvim/spectre.lua b/config/nvim/lua/plugins/extras/lazyvim/spectre.lua index 994f1ccd..59589570 100644 --- a/config/nvim/lua/plugins/extras/lazyvim/spectre.lua +++ b/config/nvim/lua/plugins/extras/lazyvim/spectre.lua @@ -2,7 +2,16 @@ return { { "nvim-pack/nvim-spectre", cmd = "Spectre", - opts = {}, + opts = { + default = { + find = { + cmd = "rg", + }, + replace = { + cmd = "sd", + }, + }, + }, -- stylua: ignore keys = { { "srg", function() require("spectre").toggle() end, desc = "Globally" }, diff --git a/config/nvim/lua/plugins/extras/lazyvim/telescope.lua b/config/nvim/lua/plugins/extras/lazyvim/telescope.lua index f87ec5d5..ffd9761a 100644 --- a/config/nvim/lua/plugins/extras/lazyvim/telescope.lua +++ b/config/nvim/lua/plugins/extras/lazyvim/telescope.lua @@ -1,4 +1,3 @@ -local Util = require("lazyvim.util") local actions = require("telescope.actions") return { @@ -8,39 +7,39 @@ return { keys = { { "ssa", - Util.telescope("lsp_document_symbols", { symbols = { "Class", "Function", "Method", "Constructor", "Interface", "Module", "Struct", "Trait", "Field", "Property", "Enum", "Constant" } }), + LazyVim.telescope("lsp_document_symbols", { symbols = { "Class", "Function", "Method", "Constructor", "Interface", "Module", "Struct", "Trait", "Field", "Property", "Enum", "Constant" } }), desc = "All", }, - { "ssc", Util.telescope("lsp_document_symbols", { symbols = { "Class" } }), desc = "Class" }, - { "ssf", Util.telescope("lsp_document_symbols", { symbols = { "Function" } }), desc = "Function" }, - { "ssm", Util.telescope("lsp_document_symbols", { symbols = { "Method" } }), desc = "Method" }, - { "ssC", Util.telescope("lsp_document_symbols", { symbols = { "Constructor" } }), desc = "Constructor" }, - { "sse", Util.telescope("lsp_document_symbols", { symbols = { "Enum" } }), desc = "Enum" }, - { "ssi", Util.telescope("lsp_document_symbols", { symbols = { "Interface" } }), desc = "Interface" }, - { "ssM", Util.telescope("lsp_document_symbols", { symbols = { "Module" } }), desc = "Module" }, - { "sss", Util.telescope("lsp_document_symbols", { symbols = { "Struct" } }), desc = "Struct" }, - { "sst", Util.telescope("lsp_document_symbols", { symbols = { "Trait" } }), desc = "Trait" }, - { "ssF", Util.telescope("lsp_document_symbols", { symbols = { "Field" } }), desc = "Field" }, - { "ssp", Util.telescope("lsp_document_symbols", { symbols = { "Property" } }), desc = "Property" }, - { "ssv", Util.telescope("lsp_document_symbols", { symbols = { "Variable", "Parameter" } }), desc = "Variable" }, + { "ssc", LazyVim.telescope("lsp_document_symbols", { symbols = { "Class" } }), desc = "Class" }, + { "ssf", LazyVim.telescope("lsp_document_symbols", { symbols = { "Function" } }), desc = "Function" }, + { "ssm", LazyVim.telescope("lsp_document_symbols", { symbols = { "Method" } }), desc = "Method" }, + { "ssC", LazyVim.telescope("lsp_document_symbols", { symbols = { "Constructor" } }), desc = "Constructor" }, + { "sse", LazyVim.telescope("lsp_document_symbols", { symbols = { "Enum" } }), desc = "Enum" }, + { "ssi", LazyVim.telescope("lsp_document_symbols", { symbols = { "Interface" } }), desc = "Interface" }, + { "ssM", LazyVim.telescope("lsp_document_symbols", { symbols = { "Module" } }), desc = "Module" }, + { "sss", LazyVim.telescope("lsp_document_symbols", { symbols = { "Struct" } }), desc = "Struct" }, + { "sst", LazyVim.telescope("lsp_document_symbols", { symbols = { "Trait" } }), desc = "Trait" }, + { "ssF", LazyVim.telescope("lsp_document_symbols", { symbols = { "Field" } }), desc = "Field" }, + { "ssp", LazyVim.telescope("lsp_document_symbols", { symbols = { "Property" } }), desc = "Property" }, + { "ssv", LazyVim.telescope("lsp_document_symbols", { symbols = { "Variable", "Parameter" } }), desc = "Variable" }, { "sSa", - Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Class", "Function", "Method", "Constructor", "Interface", "Module", "Struct", "Trait", "Field", "Property", "Enum", "Constant" } }), + LazyVim.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Class", "Function", "Method", "Constructor", "Interface", "Module", "Struct", "Trait", "Field", "Property", "Enum", "Constant" } }), desc = "All", }, - { "sSc", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Class" } }), desc = "Class" }, - { "sSf", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Function" } }), desc = "Function" }, - { "sSm", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Method" } }), desc = "Method" }, - { "sSC", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Constructor" } }), desc = "Constructor" }, - { "sSe", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Enum" } }), desc = "Enum" }, - { "sSi", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Interface" } }), desc = "Interface" }, - { "sSM", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Module" } }), desc = "Module" }, - { "sSs", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Struct" } }), desc = "Struct" }, - { "sSt", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Trait" } }), desc = "Trait" }, - { "sSF", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Field" } }), desc = "Field" }, - { "sSp", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Property" } }), desc = "Property" }, - { "sSv", Util.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Variable", "Parameter" } }), desc = "Variable" }, - { "sA", Util.telescope("treesitter"), desc = "Treesitter Symbols" }, + { "sSc", LazyVim.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Class" } }), desc = "Class" }, + { "sSf", LazyVim.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Function" } }), desc = "Function" }, + { "sSm", LazyVim.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Method" } }), desc = "Method" }, + { "sSC", LazyVim.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Constructor" } }), desc = "Constructor" }, + { "sSe", LazyVim.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Enum" } }), desc = "Enum" }, + { "sSi", LazyVim.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Interface" } }), desc = "Interface" }, + { "sSM", LazyVim.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Module" } }), desc = "Module" }, + { "sSs", LazyVim.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Struct" } }), desc = "Struct" }, + { "sSt", LazyVim.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Trait" } }), desc = "Trait" }, + { "sSF", LazyVim.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Field" } }), desc = "Field" }, + { "sSp", LazyVim.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Property" } }), desc = "Property" }, + { "sSv", LazyVim.telescope("lsp_dynamic_workspace_symbols", { symbols = { "Variable", "Parameter" } }), desc = "Variable" }, + { "sA", LazyVim.telescope("treesitter"), desc = "Treesitter Symbols" }, { "gf", "Telescope git_bcommits", desc = "File History" }, { "gS", "Telescope git_stash", desc = "stash" }, { "gb", "Telescope git_branches", desc = "branches" }, diff --git a/config/nvim/lua/plugins/extras/ui/zen-mode.lua b/config/nvim/lua/plugins/extras/ui/zen-mode.lua index 0dd42202..f90439be 100644 --- a/config/nvim/lua/plugins/extras/ui/zen-mode.lua +++ b/config/nvim/lua/plugins/extras/ui/zen-mode.lua @@ -1,4 +1,3 @@ -local Util = require("lazyvim.util") local executeCommandIfExists = function(command) if vim.fn.exists(command) ~= 0 then vim.cmd(command) @@ -18,7 +17,7 @@ return { executeCommandIfExists(":LspLensOff") executeCommandIfExists(":NvimContextVtDisable") executeCommandIfExists(":IBLDisable") - Util.toggle.inlay_hints() + LazyVim.toggle.inlay_hints() executeCommandIfExists(":Gitsigns toggle_current_line_blame") executeCommandIfExists(":CccHighlighterDisable") end, @@ -29,7 +28,7 @@ return { executeCommandIfExists(":LspLensOn") executeCommandIfExists(":NvimContextVtEnable") executeCommandIfExists(":IBLEnable") - Util.toggle.inlay_hints() + LazyVim.toggle.inlay_hints() executeCommandIfExists(":Gitsigns toggle_current_line_blame") executeCommandIfExists(":CccHighlighterEnable") end,