diff --git a/lua/core/functions.lua b/lua/core/functions.lua index 5fe9e22..6e2da4f 100644 --- a/lua/core/functions.lua +++ b/lua/core/functions.lua @@ -11,19 +11,25 @@ vim.api.nvim_create_user_command('ReloadConfig', function() end, {}) -- Copy relative path -vim.api.nvim_create_user_command('CRpath', function() +vim.api.nvim_create_user_command('CopyRelativePath', function() local path = vim.fn.expand('%') vim.fn.setreg('+', path) vim.notify('Copied "' .. path .. '" to the clipboard!') end, {}) -- Copy absolute path -vim.api.nvim_create_user_command('CApath', function() +vim.api.nvim_create_user_command('CopyAbsolutePath', function() local path = vim.fn.expand('%:p') vim.fn.setreg('+', path) vim.notify('Copied "' .. path .. '" to the clipboard!') end, {}) +vim.api.nvim_create_user_command('CopyFileName', function() + local path = vim.fn.expand('%:t') + vim.fn.setreg('+', path) + vim.notify('Copied "' .. path .. '" to the clipboard!') +end, {}) + -- Switch to git root or file parent dir vim.api.nvim_create_user_command('RootDir', function() local root = require('lib.util').get_root_dir() diff --git a/lua/core/keys.lua b/lua/core/keys.lua index dc5ab9d..179bf20 100644 --- a/lua/core/keys.lua +++ b/lua/core/keys.lua @@ -206,7 +206,7 @@ map('i', '', function() return vim.fn['codeium#Clear']() end, { expr = true -- Oil Explorer -map('n', 'e', function() +map('n', 'E', function() require("oil").toggle_float() end, { desc = icons.documents.OpenFolder .. 'Oil File Explorer' }) diff --git a/lua/lib/icons.lua b/lua/lib/icons.lua index 6a8d404..da4298a 100644 --- a/lua/lib/icons.lua +++ b/lua/lib/icons.lua @@ -108,13 +108,14 @@ return { History = ' ', Home = ' ', Incoming = ' ', + Jump = ' ', Keyboard = ' ', Ligthbulb = '󰌵 ', List = '', Lock = ' ', Minus = '‒ ', Music = '󰝚 ', - NeoVim = ' ', + Neovim = ' ', NewFile = ' ', None = ' ', Note = ' ', @@ -140,6 +141,7 @@ return { Save = '󰆓 ', Search = ' ', Separator = '▊ ', + SeparatorLight = '▍', SignIn = ' ', SignOut = ' ', Sleep = '󰒲 ', diff --git a/lua/plugins/lang/cmp.lua b/lua/plugins/lang/cmp.lua index 3fd4283..9ca1946 100644 --- a/lua/plugins/lang/cmp.lua +++ b/lua/plugins/lang/cmp.lua @@ -37,31 +37,31 @@ local max_count = 15 --   פּ ﯟ   some other good icons local kind_icons = { - Text = "", - Method = "m", - Function = "", - Constructor = "", - Field = "", - Variable = "", - Class = "", + Text = "", + Method = " '", + Function = "󰊕", + Constructor = "󰈏", + Field = "", + Variable = "", + Class = "", Interface = "", Module = "", Property = "", Unit = "", - Value = "", - Enum = "", - Keyword = "", + Value = " ", + Enum = " ", + Keyword = "", Snippet = "", - Color = "", - File = "", + Color = "", + File = " ", Reference = "", - Folder = "", - EnumMember = "", - Constant = "", + Folder = "", + EnumMember = "", + Constant = "", Struct = "", Event = "", - Operator = "", - TypeParameter = "", + Operator = "", + TypeParameter = "", } cmp.setup({ @@ -134,6 +134,7 @@ cmp.setup({ { name = 'luasnip', keyword_length = 2 }, { name = 'buffer', keyword_length = 3 }, { name = 'codeium'}, + { name = 'lazydev', group_index = 0 }, }, confirm_opts = { behavior = cmp.ConfirmBehavior.Replace, diff --git a/lua/plugins/lang/neodev.lua b/lua/plugins/lang/neodev.lua deleted file mode 100644 index d316e6c..0000000 --- a/lua/plugins/lang/neodev.lua +++ /dev/null @@ -1,15 +0,0 @@ -local neodev = require('neodev') - -neodev.setup({ - library = { - enabled = true, - runtime = true, - types = true, - plugins = true, -- installed opt or start plugins in packpath - -- you can also specify the list of plugins to make available as a workspace library - -- plugins = { "nvim-treesitter", "plenary.nvim", "telescope.nvim" }, - }, - setup_jsonls = true, - lspconfig = true, - pathStrict = true, -}) diff --git a/lua/plugins/lazy.lua b/lua/plugins/lazy.lua index fb69861..94843c9 100644 --- a/lua/plugins/lazy.lua +++ b/lua/plugins/lazy.lua @@ -51,7 +51,7 @@ lazy.setup({ loaded = icons.ui.CircleSmall, not_loaded = icons.ui.CircleSmallEmpty, plugin = icons.ui.Package, - runtime = icons.ui.NeoVim, + runtime = icons.ui.Neovim, source = icons.ui.Code, start = icons.ui.Play, task = icons.ui.Check, diff --git a/lua/plugins/list.lua b/lua/plugins/list.lua index 81a3192..4d7bbdd 100644 --- a/lua/plugins/list.lua +++ b/lua/plugins/list.lua @@ -165,9 +165,8 @@ local plugins = { event = { 'BufReadPre', 'BufNewFile' }, }, { - 'folke/neodev.nvim', - ft = { 'lua', 'vim' }, - config = load_config('lang.neodev'), + 'folke/lazydev.nvim', + ft = 'lua', }, { 'nvimdev/lspsaga.nvim', @@ -274,30 +273,6 @@ local plugins = { end, desc = 'Flash Treesitter', }, - { - 'r', - mode = 'o', - function() - require('flash').remote() - end, - desc = 'Remote Flash', - }, - { - 'R', - mode = { 'o', 'x' }, - function() - require('flash').treesitter_search() - end, - desc = 'Treesitter Search', - }, - { - '', - mode = { 'c' }, - function() - require('flash').toggle() - end, - desc = 'Toggle Flash Search', - }, }, }, { @@ -451,6 +426,12 @@ local plugins = { dependencies = { 'stevearc/dressing.nvim' }, cmd = 'Nerdy', }, + { + -- 'chentoast/marks.nvim', + '2kabhishek/markit.nvim', + config = load_config('tools.marks'), + event = { 'BufReadPre', 'BufNewFile' }, + }, -- Git { @@ -537,7 +518,7 @@ if util.is_present('gem') then keys = { { 'rc', - mode = { 'n', 'x', 'o' }, + mode = { 'n' }, function() vim.cmd('RorCommands') end, diff --git a/lua/plugins/lock.json b/lua/plugins/lock.json index cfec700..a608647 100644 --- a/lua/plugins/lock.json +++ b/lua/plugins/lock.json @@ -25,18 +25,19 @@ "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" }, "lazy.nvim": { "branch": "main", "commit": "ad30030b6abca7dac5a493c58b4d183b3fe93202" }, + "lazydev.nvim": { "branch": "main", "commit": "39eb1f81eaddafc14f2b5ed2e1463068a35d8f90" }, "live-server.nvim": { "branch": "main", "commit": "f6f00a3f541251f0320910bb0d03c4ae14ee6d10" }, "lsp_lines.nvim": { "branch": "main", "commit": "dbfd8e96ec2696e1ceedcd23fd70e842256e3dea" }, "lspsaga.nvim": { "branch": "main", "commit": "4e9d6162863d2f532751db91a1193cfe1f3a4361" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, + "markit.nvim": { "branch": "main", "commit": "6df58709124283c82275e67e512a9cfde4904b3d" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" }, "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, "mini.ai": { "branch": "main", "commit": "ee9446a17c160aba6a04ff22097389c41872c878" }, "mini.comment": { "branch": "main", "commit": "a4b7e46deb9ad2feb8902cc5dbf087eced112ee5" }, "mini.surround": { "branch": "main", "commit": "a1b590cc3b676512de507328d6bbab5e43794720" }, - "neodev.nvim": { "branch": "main", "commit": "1f4ebcc10852518166ce165e57d425a4265a10d4" }, "neotest": { "branch": "master", "commit": "6f35d797882c6ce0ab7c87dc86561512dc3d7aba" }, "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, "neotest-rspec": { "branch": "main", "commit": "48573d5882cbe8d8bcd3b735d9ee7705168b1b87" }, diff --git a/lua/plugins/tools/flash.lua b/lua/plugins/tools/flash.lua index 7b2a988..f7cffa4 100644 --- a/lua/plugins/tools/flash.lua +++ b/lua/plugins/tools/flash.lua @@ -2,14 +2,56 @@ local flash = require('flash') local icons = require('lib.icons') flash.setup({ + -- exact, fuzzy, regex, custom function + mode = 'fuzzy', + -- behave like `incsearch` + incremental = true, + + jump = { + -- save location in the jumplist + jumplist = true, + -- automatically jump when there is only one match + autojump = true, + }, + label = { + rainbow = { + enabled = true, + -- number between 1 and 9 + shade = 4, + }, + }, prompt = { enabled = true, prefix = { { icons.ui.Separator .. icons.ui.Rocket .. icons.ui.ChevronRight .. ' ', 'FlashPromptIcon' } }, win_config = { relative = 'editor', width = 1, height = 1, row = 1, col = 0, zindex = 1000 }, }, modes = { + search = { + enabled = true, + }, char = { + enabled = false, jump_labels = false, }, }, }) + +vim.api.nvim_create_user_command('FlashDiagnostics', function() + require('flash').jump({ + matcher = function(win) + return vim.tbl_map(function(diag) + return { + pos = { diag.lnum + 1, diag.col }, + end_pos = { diag.end_lnum + 1, diag.end_col - 1 }, + } + end, vim.diagnostic.get(vim.api.nvim_win_get_buf(win))) + end, + action = function(match, state) + vim.api.nvim_win_call(match.win, function() + vim.api.nvim_win_set_cursor(match.win, match.pos) + vim.diagnostic.open_float() + end) + state:restore() + end, + }) +end, {}) diff --git a/lua/plugins/tools/gitsigns.lua b/lua/plugins/tools/gitsigns.lua index b0ed801..f90ac6a 100644 --- a/lua/plugins/tools/gitsigns.lua +++ b/lua/plugins/tools/gitsigns.lua @@ -82,8 +82,6 @@ gitsigns.setup({ return '' end, { expr = true, desc = 'Previous Change' }) - map({ 'v' }, 'ga', ':Gitsigns stage_hunk', { desc = 'Stage Hunk' }) - map({ 'v' }, 'gr', ':Gitsigns reset_hunk', { desc = 'Reset Hunk' }) map('n', 'gB', function() gs.blame_line({ full = true }) end, { desc = 'Blame With Preview' }) diff --git a/lua/plugins/tools/marks.lua b/lua/plugins/tools/marks.lua new file mode 100644 index 0000000..04e3d3b --- /dev/null +++ b/lua/plugins/tools/marks.lua @@ -0,0 +1,37 @@ +local marks = require('marks') +local icons = require('lib.icons') + +marks.setup({ + default_mappings = true, + builtin_marks = { '.', '<', '>', '^' }, + cyclic = true, + force_write_shada = false, + sign_priority = { lower = 10, upper = 15, builtin = 8, bookmark = 20 }, + excluded_filetypes = {}, + excluded_buftypes = { 'nofile' }, + -- supports up to 10 bookmark groups + bookmark_1 = { + sign = icons.ui.Flag, + virt_text = 'flag', + annotate = false, + }, + bookmark_2 = { + sign = icons.ui.Eye, + virt_text = 'watch', + annotate = false, + }, + bookmark_3 = { + sign = icons.ui.Star, + virt_text = 'star', + annotate = false, + }, + bookmark_4 = { + sign = icons.ui.Bug, + virt_text = 'bug', + annotate = false, + }, + mappings = { + set = 'M', + toggle_mark = 'm', + }, +}) diff --git a/lua/plugins/tools/telescope.lua b/lua/plugins/tools/telescope.lua index 5919f8e..8baf71d 100644 --- a/lua/plugins/tools/telescope.lua +++ b/lua/plugins/tools/telescope.lua @@ -161,6 +161,7 @@ telescope.setup({ require('telescope').load_extension('fzf') require('telescope').load_extension('menufacture') require('telescope').load_extension('undo') +telescope.load_extension('marks_nvim') require('telescope').load_extension('harpoon') require('telescope').load_extension('notify') require('telescope').load_extension('noice') diff --git a/lua/plugins/tools/which-key.lua b/lua/plugins/tools/which-key.lua index d994c25..5225bf5 100644 --- a/lua/plugins/tools/which-key.lua +++ b/lua/plugins/tools/which-key.lua @@ -41,9 +41,9 @@ local setup = { winblend = 10, }, layout = { - height = { min = 4, max = 24 }, + height = { min = 5, max = 26 }, width = { min = 20, max = 50 }, - spacing = 3, + spacing = 6, align = 'center', }, ignore_missing = false, @@ -116,26 +116,6 @@ local opts = { } local mappings = { - [','] = { 'b#', icons.ui.History .. 'Recent' }, - q = { 'q', icons.ui.Close .. 'Quit' }, - Q = { 'qa!', icons.ui.Power .. 'Force Quit!' }, - w = { 'w', icons.ui.Save .. 'Save' }, - x = { 'x', icons.ui.Pencil .. 'Write and Quit' }, - S = { 'ASToggle', icons.ui.Save .. 'AutoSave Toggle' }, - c = { - name = icons.ui.NeoVim .. 'Config', - c = { 'CccConvert', 'Convert Color' }, - d = { 'RootDir', 'Root Directory' }, - e = { 'e $MYVIMRC', 'Edit Config' }, - f = { 'lua vim.lsp.buf.format({async = true})', 'Format File' }, - F = { 'retab', 'Fix Tabs' }, - i = { vim.show_pos, 'Inspect Position' }, - l = { ':g/^\\s*$/d', 'Clean Empty Lines' }, - n = { 'set relativenumber!', 'Relative Numbers' }, - p = { 'CccPick', 'Pick Color' }, - r = { 'Telescope reloader', 'Reload Module' }, - R = { 'ReloadConfig', 'Reload Configs' }, - }, b = { name = icons.ui.Bug .. 'Debug', b = { 'DapToggleBreakpoint', 'Breakpoint' }, @@ -150,13 +130,21 @@ local mappings = { x = { 'DapTerminate', 'Exit' }, }, c = { - name = icons.kind.Property .. 'QuickFix', - o = {"copen","Open quickfix list"}, - c = {"cclose","Close quickfix list"}, - f = {"cfirst","Go to first item in quickfix list"}, - l = {"clast","Go to last item in quickfix list"}, - n = {"cnext","Go to next item in quickfix list"}, - p = {"cprev","Go to previous item in quickfix list"}, + name = icons.ui.Neovim .. 'Code', + d = { 'RootDir', 'Root Directory' }, + f = { 'lua vim.lsp.buf.format({async = true})', 'Format File' }, + F = { 'retab', 'Fix Tabs' }, + r = { 'Telescope reloader', 'Reload Module' }, + R = { 'ReloadConfig', 'Reload Configs' }, + o = { 'Dashboard', 'Dashboard' }, + c = { 'CccHighlighterToggle', 'Highlight Colors' }, + h = { 'Hardtime toggle', 'Hardtime' }, + l = { ':g/^\\s*$/d', 'Clean Empty Lines' }, + m = { 'MarkdownPreviewToggle', 'Markdown Preview' }, + n = { 'Telescope notify', 'Notifications' }, + p = { 'CccPick', 'Pick Color' }, + P = { 'CccConvert', 'Convert Color' }, + x = { '%SnipRun', 'Run File' }, }, d = { name = icons.ui.Database .. 'Database', @@ -167,50 +155,46 @@ local mappings = { S = { 'lua require("dbee").store("json", "buffer", { extra_arg = 0 })', 'To JSON' }, t = { 'lua require("dbee").store("table", "buffer", { extra_arg = 0 })', 'To Table' }, }, - E = { - name = icons.documents.OpenFolder .. 'Explorer', - e = { 'NvimTreeToggle', 'File Explorer' }, - f = { 'NvimTreeFindFileToggle', 'Toggle file explorer on current file' }, - r = { 'NvimTreeRefresh', 'Refresh file explorer' }, + e = { + name = icons.ui.Pencil .. 'Edit', + a = { 'b#', 'Alternate File' }, + c = { 'e $MYVIMRC', 'Config' }, + d = { 'lua require("telescope.builtin").find_files({cwd = vim.fn.stdpath("config")})', 'Config Dir' }, + E = { 'NvimTreeToggle', 'Explorer' }, + f = { 'gf', 'File Under Cursor' }, + l = { 'e ~/.config/shell/local.sh', 'Local Config' }, + m = { 'e README.md', 'Readme' }, + n = { 'enew', 'New File' }, + z = { 'e $ZDOTDIR/.zshrc', 'Zsh Config' }, }, f = { name = icons.ui.Telescope .. 'Find', - b = { 'Telescope buffers', 'Buffers' }, a = { 'lua require("telescope").extensions.menufacture.find_files()', 'All Files' }, - d = { 'Telescope file_browser', 'Browse Folders' }, - e = { 'Oil', 'Dir Editor' }, + b = { 'Telescope buffers', 'Buffers' }, + c = { 'Telescope git_bcommits', 'File Commits' }, f = { 'lua require("telescope").extensions.menufacture.git_files()', 'Find files' }, g = { 'lua require("telescope").extensions.menufacture.live_grep()', 'Find Text' }, - G = { 'lua require("telescope").extensions.menufacture.grep_string()', 'Find Word' }, - h = { 'Telescope help_tags', 'Help' }, - H = { 'Telescope man_pages', 'Man Pages' }, - k = { 'Telescope commands', 'Commands' }, - K = { 'Telescope keymaps', 'Keymaps' }, - l = { 'Telescope resume', 'Last Search' }, - L = { 'Telescope loclist', 'Location List' }, - n = { 'enew', 'New File' }, + l = { 'Telescope loclist', 'Location List' }, r = { 'Telescope oldfiles', 'Recent Files' }, - p = { 'Telescope', 'Panel' }, - s = { 'Telescope live_grep grep_open_files=true', 'Find in Open Files' }, - t = { 'lua require("telescope").extensions.flutter.commands()', 'Flutter Tools' }, + p = { 'Telescope resume', 'Last Search' }, + q = { 'Telescope quickfix', 'Quickfix' }, + s = { 'Telescope current_buffer_fuzzy_find', 'Fuzzy Find in File' }, + S = { 'Telescope live_grep grep_open_files=true', 'Find in Open Files' }, + t = { 'Telescope', 'Panel' }, u = { 'Telescope undo', 'Undo History' }, - U = { 'Telescope colorscheme', 'Colorscheme' }, - ['"'] = { 'Telescope registers', 'Registers' }, - ['.'] = { 'Telescope symbols', 'Emojis' }, - [','] = { 'Nerdy', 'Nerd Glyphs' }, + w = { 'lua require("telescope").extensions.menufacture.grep_string()', 'Find Word' }, }, g = { name = icons.git.Octoface .. 'Git', a = { 'Gitsigns stage_hunk', 'Stage Hunk' }, A = { 'Gitsigns stage_buffer', 'Stage Buffer' }, - b = { 'Gitsigns blame_line', 'Blame' }, + b = { "lua require('gitsigns').blame_line({full = true})", 'Blame' }, B = { 'Telescope git_branches', 'Branches' }, - c = { 'Telescope git_bcommits', 'File Commits' }, - C = { 'Telescope git_commits', 'Commits' }, - f = { 'Git', 'Fugitive' }, - F = { 'CoAuthor', 'Find Co Author' }, + c = { 'Git', 'Git Console' }, + C = { 'CoAuthor', 'Co-Authors' }, d = { 'Gitsigns preview_hunk', 'Preview Hunk' }, D = { 'Gitsigns diffthis HEAD', 'Diff' }, + f = { 'Telescope git_commits', 'Find Commits' }, g = { 'Fterm lazygit', 'Lazygit' }, j = { 'Gitsigns next_hunk', 'Next Hunk' }, k = { 'Gitsigns prev_hunk', 'Prev Hunk' }, @@ -232,42 +216,111 @@ local mappings = { u = { 'Gitsigns undo_stage_hunk', 'Undo Stage Hunk' }, v = { 'Gitsigns select_hunk', 'Select Hunk' }, }, - h = { name = icons.ui.Bookmark .. 'Harpoon' }, + h = { + name = icons.ui.Question .. 'Help', + h = { 'Telescope help_tags', 'Help Pages' }, + i = { vim.show_pos, 'Inspect Position' }, + k = { 'Lspsaga hover_doc', 'Hover Doc' }, + m = { 'Telescope man_pages', 'Man Pages' }, + }, + i = { + name = icons.ui.Download .. 'Insert', + d = { "put =strftime('## %a %d %b %r')", 'Date' }, + e = { 'Telescope symbols', 'Emojis' }, + f = { "put =expand('%:t')", 'File Name' }, + n = { 'Nerdy', 'Nerd Glyphs' }, + p = { 'put %', 'Relative Path' }, + P = { 'put %:p', 'Absolute Path' }, + r = { 'Telescope registers', 'Registers' }, + t = { "put =strftime('## %r')", 'Time' }, + }, + j = { + name = icons.ui.Jump .. 'Jump', + c = { '*', 'Word' }, + d = { 'FlashDiagnostics', 'Diagnostics' }, + f = { 'Telescope jumplist', 'Jumplist' }, + h = { '', 'Backward' }, + j = { "lua require('flash').remote()", 'Remote' }, + k = { "lua require('flash').treesitter()", 'Treesitter' }, + l = { '', 'Forward' }, + n = { + "lua require('flash').jump({search = { forward = true, wrap = false, multi_window = false },})", + 'Search Forward', + }, + N = { + "lua require('flash').jump({search = { forward = false, wrap = false, multi_window = false },})", + 'Search Backward', + }, + p = { "lua require('flash').jump({continue = true})", 'Previous Jump' }, + s = { "lua require('flash').jump()", 'Search' }, + t = { "lua require('flash').treesitter_search()", 'Remote Treesitter' }, + w = { 'lua require("flash").jump({ pattern = vim.fn.expand("")})', 'Current Word' }, + }, + k = { + name = icons.ui.Keyboard .. 'Keys', + k = { 'Telescope keymaps', 'Keymaps' }, + c = { 'Telescope commands', 'Commands' }, + h = { 'Telescope command_history', 'Command History' }, + s = { 'Telescope search_history', 'Search History' }, + }, l = { - name = icons.ui.Gear .. 'LSP', + name = icons.kind.TypeParameter .. 'LSP', a = { 'Lspsaga code_action', 'Code Action' }, d = { 'Lspsaga peek_definition', 'Peek Definition' }, - D = { 'Lspsaga goto_definition', 'Goto Definition' }, f = { 'Lspsaga finder', 'Finder' }, - F = { 'Telescope lsp_references', 'References' }, + F = { 'Telescope lsp_references layout_strategy=vertical', 'References' }, + g = { 'Lspsaga goto_definition', 'Goto Definition' }, h = { 'Lspsaga hover_doc', 'Hover' }, - i = { 'Telescope diagnostics', 'Diagnostics' }, - I = { 'Lspsaga show_workspace_diagnostics', 'Workspace Diagnostics' }, + i = { 'LspInfo', 'LSP Info' }, j = { 'Lspsaga diagnostic_jump_next', 'Next Diagnostic' }, k = { 'Lspsaga diagnostic_jump_prev', 'Prev Diagnostic' }, - l = { "lua require('lsp_lines').toggle()", 'Toggle LSP Lines' }, - L = { 'LspInfo', 'LSP Info' }, + l = { 'Telescope diagnostics layout_strategy=vertical', 'File Diagnostics' }, + L = { 'Lspsaga show_workspace_diagnostics', 'Workspace Diagnostics' }, o = { 'Lspsaga outline', 'Outline' }, p = { 'Telescope lsp_incoming_calls', 'Incoming Calls' }, P = { 'Telescope lsp_outgoing_calls', 'Outgoing Calls' }, r = { 'Lspsaga rename', 'Rename' }, R = { 'Lspsaga project_replace', 'Replace' }, - s = { 'Telescope lsp_document_symbols', 'Document Symbols' }, + s = { 'Telescope lsp_document_symbols theme=get_ivy', 'Document Symbols' }, S = { 'Telescope lsp_dynamic_workspace_symbols', 'Workspace Symbols' }, t = { 'Lspsaga peek_type_definition', 'Peek Type Definition' }, T = { 'Lspsaga goto_type_definition', 'Goto Type Definition' }, }, m = { - name = icons.kind.Field .. 'Modes', - c = { 'CccHighlighterToggle', 'Highlight Colors' }, - d = { 'Dashboard', 'Dashboard' }, - h = { 'Hardtime toggle', 'Hardtime' }, - m = { 'MarkdownPreviewToggle', 'Markdown Preview' }, - n = { 'Telescope notify', 'Notifications' }, - r = { '%SnipRun', 'Run File' }, - s = { 'set spell!', 'Spellcheck' }, - z = { 'ZenMode', 'ZenMode' }, - Z = { 'Twilight', 'Twilight' }, + name = icons.ui.Bookmark .. 'Marks', + b = { "lua require('telescope').extensions.marks_nvim.bookmarks_list_all()", 'Bookmarks' }, + D = { "lua require('marks').delete_buf()", 'Delete Buffer' }, + d = { "lua require('marks').delete_line()", 'Delete Line' }, + P = { "lua require('marks').preview()", 'Preview' }, + x = { "lua require('marks').delete_bookmark()", 'Delete Bookmark' }, + h = { "lua require('marks').next_bookmark()", 'Next Bookmark' }, + j = { "lua require('marks').next()", 'Next' }, + k = { "lua require('marks').prev()", 'Previous' }, + l = { "lua require('marks').prev_bookmark()", 'Previous Bookmark' }, + m = { 'Telescope marks', 'All Marks' }, + s = { "lua require('marks').set_next()", 'Set Next' }, + t = { "lua require('marks').toggle()", 'Toggle' }, + + ['1'] = { "lua require('marks').toggle_bookmark1()", 'Toggle Bookmark 0' }, + ['2'] = { "lua require('marks').toggle_bookmark2()", 'Toggle Bookmark 2' }, + ['3'] = { "lua require('marks').toggle_bookmark3()", 'Toggle Bookmark 3' }, + ['4'] = { "lua require('marks').toggle_bookmark4()", 'Toggle Bookmark 4' }, + + n = { + name = 'Next Bookmark Group', + ['1'] = { "lua require('marks').next_bookmark1()", 'Next Bookmark 1' }, + ['2'] = { "lua require('marks').next_bookmark2()", 'Next Bookmark 2' }, + ['3'] = { "lua require('marks').next_bookmark3()", 'Next Bookmark 3' }, + ['4'] = { "lua require('marks').next_bookmark4()", 'Next Bookmark 4' }, + }, + + p = { + name = 'Previous Bookmark Group', + ['1'] = { "lua require('marks').prev_bookmark1()", 'Previous Bookmark 1' }, + ['2'] = { "lua require('marks').prev_bookmark2()", 'Previous Bookmark 2' }, + ['3'] = { "lua require('marks').prev_bookmark3()", 'Previous Bookmark 3' }, + ['4'] = { "lua require('marks').prev_bookmark4()", 'Previous Bookmark 4' }, + }, }, n = { name = icons.ui.Note .. 'Notes', @@ -276,10 +329,6 @@ local mappings = { f = { 'TdoFiles', 'All Notes' }, g = { 'TdoFind', 'Find Notes' }, h = { 'Tdo -1', "Yesterday's Todo" }, - j = { "put =strftime('%a %d %b %r')", 'Insert Human Date' }, - J = { "put =strftime('%F')", 'Insert Date' }, - k = { "put =strftime('%r')", 'Insert Human Time' }, - K = { "put =strftime('%F-%H-%M')", 'Insert Time' }, l = { 'Tdo 1', "Tomorrow's Todo" }, n = { 'TdoNote', 'New Note' }, s = { @@ -289,6 +338,13 @@ local mappings = { t = { 'TdoTodos', 'Incomplete Todos' }, x = { 'TdoToggle', 'Toggle Todo' }, }, + o = { + name = icons.ui.Gear .. 'Options', + c = { 'Telescope colorscheme', 'Colorscheme' }, + h = { 'Telescope highlights', 'Highlight Colors' }, + n = { 'set relativenumber!', 'Relative Numbers' }, + o = { 'Telescope vim_options', 'All Options' }, + }, p = { name = icons.ui.Package .. 'Packages', c = { 'Lazy check', 'Check' }, @@ -303,8 +359,16 @@ local mappings = { u = { 'Lazy update', 'Update' }, x = { 'Lazy clean', 'Clean' }, }, + q = { + name = icons.ui.Close .. 'Quit', + a = { 'qall', 'Quit All' }, + b = { 'bw', 'Close Buffer' }, + d = { 'bdelete', 'Delete Buffer' }, + f = { 'qall!', 'Force Quit' }, + q = { 'q', 'Quit' }, + }, r = { - name = icons.diagnostics.Hint .. 'Refactor', + name = icons.ui.Code .. 'Refactor', b = { "lua require('spectre').open_file_search()", 'Replace Buffer' }, e = { "lua require('refactoring').refactor('Extract Block')", 'Extract Block' }, f = { "lua require('refactoring').refactor('Extract Block To File')", 'Extract To File' }, @@ -323,23 +387,6 @@ local mappings = { v = { "lua require('refactoring').refactor('Extract Variable')", 'Extract Variable' }, w = { "lua require('spectre').open_visual({select_word=true})", 'Replace Word' }, }, - t = { - name = icons.ui.Terminal .. 'Terminal', - ['`'] = { 'Sterm', 'Horizontal Terminal' }, - n = { 'Sterm node', 'Node' }, - p = { 'Sterm bpython', 'Python' }, - r = { 'Sterm irb', 'Ruby' }, - s = { 'Sterm', 'Horizontal Terminal' }, - t = { 'Fterm', 'Terminal' }, - v = { 'Vterm', 'Vertical Terminal' }, - }, - T = { - name = icons.ui.Test .. 'Test', - f = { 'lua require("neotest").run.run(vim.fn.expand("%"))', 'Run Test' }, - F = { 'lua require("neotest").run.run()', 'Run Current Test' }, - o = { 'Neotest output-panel', 'Test Output' }, - O = { 'Neotest summary', 'Test Summary' }, - }, s = { name = icons.ui.Windows .. 'Split', [','] = { 'NavigatorPrevious', 'Previous Split' }, @@ -352,23 +399,54 @@ local mappings = { j = { 'j', 'Move Down' }, k = { 'k', 'Move Up' }, l = { 'l', 'Move Right' }, - L = { 'tablast', 'Last Tab' }, - o = { 'tabnext', 'Next Tab' }, - O = { 'tabprevious', 'Previous Tab' }, p = { 'p', 'Previous Window' }, - q = { 'bw', 'Close Current Buf' }, s = { 'split', 'Horizontal Split File' }, - t = { 'tabnew', 'New Tab' }, v = { 'vsplit', 'Vertical Split File' }, - W = { "lua require'utils'.sudo_write()", 'Force Write' }, - w = { 'w', 'Write' }, - x = { 'x', 'Write and Quit' }, }, + t = { + name = icons.ui.Terminal .. 'Terminal', + ['`'] = { 'Sterm', 'Horizontal Terminal' }, + n = { 'Sterm node', 'Node' }, + p = { 'Sterm bpython', 'Python' }, + r = { 'Sterm irb', 'Ruby' }, + s = { 'Sterm', 'Horizontal Terminal' }, + t = { 'Fterm', 'Terminal' }, + v = { 'Vterm', 'Vertical Terminal' }, + }, + u = { + name = icons.ui.Test .. 'Test', + f = { 'lua require("neotest").run.run(vim.fn.expand("%"))', 'Run Test' }, + F = { 'lua require("neotest").run.run()', 'Run Current Test' }, + o = { 'Neotest output-panel', 'Test Output' }, + O = { 'Neotest summary', 'Test Summary' }, + }, + v = { + name = icons.ui.Star .. 'Select', + p = { 'vip', 'Paragraph' }, + P = { 'vap', 'Around Para' }, + q = { 'viq', 'Quote' }, + Q = { 'vaq', 'Around Quote' }, + b = { 'vib', 'Bracket' }, + B = { 'vab', 'Around Bracket' }, + }, + w = { + name = icons.kind.File .. 'Writing', + f = { "lua require'utils'.sudo_write()", 'Force Write' }, + j = { ']s', 'Next Misspell' }, + k = { '[s', 'Prev Misspell' }, + c = { 'set spell!', 'Spellcheck' }, + s = { 'Telescope spell_suggest', 'Suggestions' }, + t = { 'Twilight', 'Twilight' }, + w = { 'w', 'Write' }, + z = { 'ZenMode', 'ZenMode' }, + }, + x = { 'x', icons.ui.SignOut .. 'Save and Quit' }, y = { name = icons.ui.Clipboard .. 'Yank', - f = { '%y+', 'Copy Whole File' }, - p = { 'CRpath', 'Copy Relative Path' }, - P = { 'CApath', 'Copy Absolute Path' }, + a = { '%y+', 'Copy Whole File' }, + f = { 'CopyFileName', 'File Name' }, + p = { 'CopyRelativePath', 'Relative Path' }, + P = { 'CopyAbsolutePath', 'Absolute Path' }, g = { 'lua require"gitlinker".get_buf_range_url()', 'Copy Git URL' }, }, } @@ -383,12 +461,54 @@ local vopts = { } local vmappings = { + a = { + name = icons.ui.Copilot .. 'AI', + c = { 'CopilotChatToggle', 'Copilot Chat' }, + d = { 'CopilotChatDocs', 'Docs' }, + e = { 'CopilotChatExplain', 'Explain' }, + f = { 'CopilotChatFix', 'Fix' }, + F = { 'CopilotChatFixDiagnostic', 'Fix Diagnostic' }, + g = { 'CopilotChatCommit', 'Commit' }, + G = { 'CopilotChatCommitStaged', 'Commit Staged' }, + o = { 'CopilotChatOptimize', 'Optimize' }, + r = { 'CopilotChatReview', 'Review' }, + t = { 'CopilotChatTests', 'Tests' }, + }, + c = { + name = icons.ui.Neovim .. 'Code', + s = { ':sort', 'Sort Asc' }, + S = { ':sort!', 'Sort Desc' }, + u = { ':!uniq', 'Unique' }, + }, + g = { + name = icons.git.Octoface .. 'Git', + a = { 'Gitsigns stage_hunk', 'Stage Hunk' }, + r = { 'Gitsigns reset_hunk', 'Reset Hunk' }, + }, + j = { + name = icons.ui.Jump .. 'Jump', + d = { 'FlashDiagnostics', 'Diagnostics' }, + j = { "lua require('flash').remote()", 'Remote' }, + k = { "lua require('flash').treesitter()", 'Treesitter' }, + n = { + "lua require('flash').jump({search = { forward = true, wrap = false, multi_window = false },})", + 'Search Forward', + }, + N = { + "lua require('flash').jump({search = { forward = false, wrap = false, multi_window = false },})", + 'Search Backward', + }, + p = { "lua require('flash').jump({continue = true})", 'Previous Jump' }, + s = { "lua require('flash').jump()", 'Search' }, + t = { "lua require('flash').treesitter_search()", 'Remote Treesitter' }, + w = { 'lua require("flash").jump({ pattern = vim.fn.expand("")})', 'Current Word' }, + }, l = { - name = icons.ui.Gear .. 'LSP', + name = icons.kind.TypeParameter .. 'LSP', a = 'Lspsaga range_code_action', }, r = { - name = icons.diagnostics.Hint .. 'Refactor', + name = icons.ui.Code .. 'Refactor', r = { "lua require('telescope').extensions.refactoring.refactors()", 'Refactor Commands' }, e = { "lua require('refactoring').refactor('Extract Function')", 'Extract Function' }, f = { "lua require('refactoring').refactor('Extract Function To File')", 'Extract To File' }, @@ -396,9 +516,6 @@ local vmappings = { i = { "lua require('refactoring').refactor('Inline Variable')", 'Inline Variable' }, }, s = { "'<,'>SnipRun", icons.ui.Play .. 'Run Code' }, - q = { 'q', icons.ui.Close .. 'Quit' }, - Q = { 'qa!', icons.ui.Power .. 'Force Quit!' }, - x = { 'x', icons.ui.Pencil .. 'Write and Quit' }, y = { name = icons.ui.Clipboard .. 'Yank', g = { 'lua require"gitlinker".get_buf_range_url("v")', 'Copy Git URL' }, diff --git a/lua/plugins/ui/onedark.lua b/lua/plugins/ui/onedark.lua index 6534f1f..f0275b9 100644 --- a/lua/plugins/ui/onedark.lua +++ b/lua/plugins/ui/onedark.lua @@ -7,7 +7,7 @@ onedark.setup({ ending_tildes = false, cmp_itemkind_reverse = false, - toggle_style_key = 'ct', + toggle_style_key = 'ot', toggle_style_list = { 'dark', 'darker', 'cool', 'warm', 'warmer', 'deep', 'light' }, -- Options are italic, bold, underline, none and combos 'italic,bold'