diff --git a/neovim/.config/nvim/lua/warrenhood/keybinds.lua b/neovim/.config/nvim/lua/warrenhood/keybinds.lua index 85b57f5..2b06bf7 100644 --- a/neovim/.config/nvim/lua/warrenhood/keybinds.lua +++ b/neovim/.config/nvim/lua/warrenhood/keybinds.lua @@ -84,7 +84,7 @@ map("n", "di", ":lua require('dapui').toggle()") -- luasnip vim.cmd [[ " Use Tab to expand and jump through snippets -imap luasnip#expand_or_jumpable() ? 'luasnip-expand-or-jump' : '' +imap luasnip#expand_or_jumpable() ? 'luasnip-expand-or-jump' : '' smap luasnip#jumpable(1) ? 'luasnip-jump-next' : '' " Use Shift-Tab to jump backwards through snippets @@ -101,61 +101,64 @@ if vim.g.neovide then end --- barbar -local barbar_opts = { noremap = true, silent = true } - --- Move to previous/next -map('n', '', 'BufferPrevious', barbar_opts) -map('n', '', 'BufferNext', barbar_opts) --- Re-order to previous/next -map('n', '', 'BufferMovePrevious', barbar_opts) -map('n', '>', 'BufferMoveNext', barbar_opts) --- Goto buffer in position... -map('n', '', 'BufferGoto 1', barbar_opts) -map('n', '', 'BufferGoto 2', barbar_opts) -map('n', '', 'BufferGoto 3', barbar_opts) -map('n', '', 'BufferGoto 4', barbar_opts) -map('n', '', 'BufferGoto 5', barbar_opts) -map('n', '', 'BufferGoto 6', barbar_opts) -map('n', '', 'BufferGoto 7', barbar_opts) -map('n', '', 'BufferGoto 8', barbar_opts) -map('n', '', 'BufferGoto 9', barbar_opts) -map('n', '', 'BufferLast', barbar_opts) --- Pin/unpin buffer -map('n', '', 'BufferPin', barbar_opts) --- Close buffer -map('n', '', 'BufferClose', barbar_opts) --- Wipeout buffer --- :BufferWipeout - --- Close commands --- :BufferCloseAllButCurrent --- :BufferCloseAllButPinned --- :BufferCloseAllButCurrentOrPinned --- :BufferCloseBuffersLeft --- :BufferCloseBuffersRight --- Magic buffer-picking mode -map('n', '', 'BufferPick', barbar_opts) --- Sort automatically by... -map('n', 'bb', 'BufferOrderByBufferNumber', barbar_opts) -map('n', 'bd', 'BufferOrderByDirectory', barbar_opts) -map('n', 'bl', 'BufferOrderByLanguage', barbar_opts) -map('n', 'bw', 'BufferOrderByWindowNumber', barbar_opts) - --- Other: --- :BarbarEnable - enables barbar (enabled by default) --- :BarbarDisable - very bad command, should never be used +-- -- barbar +-- local barbar_opts = { noremap = true, silent = true } +-- +-- -- Move to previous/next +-- map('n', '', 'BufferPrevious', barbar_opts) +-- map('n', '', 'BufferNext', barbar_opts) +-- -- Re-order to previous/next +-- map('n', '', 'BufferMovePrevious', barbar_opts) +-- map('n', '>', 'BufferMoveNext', barbar_opts) +-- -- Goto buffer in position... +-- map('n', '', 'BufferGoto 1', barbar_opts) +-- map('n', '', 'BufferGoto 2', barbar_opts) +-- map('n', '', 'BufferGoto 3', barbar_opts) +-- map('n', '', 'BufferGoto 4', barbar_opts) +-- map('n', '', 'BufferGoto 5', barbar_opts) +-- map('n', '', 'BufferGoto 6', barbar_opts) +-- map('n', '', 'BufferGoto 7', barbar_opts) +-- map('n', '', 'BufferGoto 8', barbar_opts) +-- map('n', '', 'BufferGoto 9', barbar_opts) +-- map('n', '', 'BufferLast', barbar_opts) +-- -- Pin/unpin buffer +-- map('n', '', 'BufferPin', barbar_opts) +-- -- Close buffer +-- map('n', '', 'BufferClose', barbar_opts) +-- -- Wipeout buffer +-- -- :BufferWipeout +-- +-- -- Close commands +-- -- :BufferCloseAllButCurrent +-- -- :BufferCloseAllButPinned +-- -- :BufferCloseAllButCurrentOrPinned +-- -- :BufferCloseBuffersLeft +-- -- :BufferCloseBuffersRight +-- -- Magic buffer-picking mode +-- map('n', '', 'BufferPick', barbar_opts) +-- -- Sort automatically by... +-- map('n', 'bb', 'BufferOrderByBufferNumber', barbar_opts) +-- map('n', 'bd', 'BufferOrderByDirectory', barbar_opts) +-- map('n', 'bl', 'BufferOrderByLanguage', barbar_opts) +-- map('n', 'bw', 'BufferOrderByWindowNumber', barbar_opts) +-- +-- -- Other: +-- -- :BarbarEnable - enables barbar (enabled by default) +-- -- :BarbarDisable - very bad command, should never be used -- Disable arrow keys -local arrows = {'', '', '', ''} -for i=1,#arrows do - map('n', arrows[i], function () end) - map('i', arrows[i], function () end) +local arrows = { '', '', '', '' } +for i = 1, #arrows do + map('n', arrows[i], function() end) + map('i', arrows[i], function() end) end -- Code actions with ctrl + . -map('n', '.', function() vim.lsp.buf.code_action({ apply = true}) end, { desc = 'Code action/Quick fix' }) +map('n', '.', function() vim.lsp.buf.code_action({ apply = true }) end, { desc = 'Code action/Quick fix' }) -- Show telescope commands fuzzy finder map('n', '', function() require('telescope.builtin').commands() end, { desc = 'Show commands' }) + +-- Show diagnostics in floating window +map('n', 'e', function() vim.diagnostic.open_float() end, { desc = 'Show diagnostics' }) diff --git a/neovim/.config/nvim/lua/warrenhood/plugins-config.lua b/neovim/.config/nvim/lua/warrenhood/plugins-config.lua index a54644f..10758a7 100644 --- a/neovim/.config/nvim/lua/warrenhood/plugins-config.lua +++ b/neovim/.config/nvim/lua/warrenhood/plugins-config.lua @@ -2,87 +2,87 @@ require("nvim-tree").setup() -- tree-sitter config -require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" +require 'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" - ensure_installed = { "c", "lua", "rust", "bash", "python", "javascript" }, + ensure_installed = { "c", "lua", "rust", "bash", "python", "javascript" }, - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, - highlight = { - enable = true, + highlight = { + enable = true, - additional_vim_regex_highlighting = false, - }, + additional_vim_regex_highlighting = false, + }, } -- luasnip config require("luasnip").config.set_config({ -- Setting LuaSnip config - -- Enable autotriggered snippets - enable_autosnippets = true, + -- Enable autotriggered snippets + enable_autosnippets = true, - -- Use Tab (or some other key if you prefer) to trigger visual selection - store_selection_keys = "", + -- Use Tab (or some other key if you prefer) to trigger visual selection + store_selection_keys = "", }) -require("luasnip.loaders.from_lua").load({paths = "~/.config/nvim/LuaSnip/"}) +require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/LuaSnip/" }) -- Which-key config require('which-key').setup() require('which-key').register({ - d = { - name = "Debug", - s = { - name = "Step", - c = { "lua require('dap').continue()", "Continue" }, + d = { + name = "Debug", + s = { + name = "Step", + c = { "lua require('dap').continue()", "Continue" }, - v = { "lua require('dap').step_over()", "Step Over" }, - i = { "lua require('dap').step_into()", "Step Into" }, - o = { "lua require('dap').step_out()", "Step Out" }, - }, - h = { - name = "Hover", - h = { "lua require('dap.ui.variables').hover()", "Hover" }, - v = { "lua require('dap.ui.variables').visual_hover()", "Visual Hover" }, - }, - u = { - name = "UI", + v = { "lua require('dap').step_over()", "Step Over" }, + i = { "lua require('dap').step_into()", "Step Into" }, + o = { "lua require('dap').step_out()", "Step Out" }, + }, + h = { + name = "Hover", + h = { "lua require('dap.ui.variables').hover()", "Hover" }, + v = { "lua require('dap.ui.variables').visual_hover()", "Visual Hover" }, + }, + u = { + name = "UI", - h = { "lua require('dap.ui.widgets').hover()", "Hover" }, - f = { "local widgets=require('dap.ui.widgets');widgets.centered_float(widgets.scopes)", "Float" }, - }, - r = { - name = "Repl", - o = { "lua require('dap').repl.open()", "Open" }, + h = { "lua require('dap.ui.widgets').hover()", "Hover" }, + f = { "local widgets=require('dap.ui.widgets');widgets.centered_float(widgets.scopes)", "Float" }, + }, + r = { + name = "Repl", + o = { "lua require('dap').repl.open()", "Open" }, - l = { "lua require('dap').repl.run_last()", "Run Last" }, - }, - b = { - name = "Breakpoints", - c = { + l = { "lua require('dap').repl.run_last()", "Run Last" }, + }, + b = { + name = "Breakpoints", + c = { - "lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))", - "Breakpoint Condition", - }, - m = { - "lua require('dap').set_breakpoint({ nil, nil, vim.fn.input('Log point message: ') })", - "Log Point Message", - }, - t = { "lua require('dap').toggle_breakpoint()", "Create" }, - }, - c = { "lua require('dap').scopes()", "Scopes" }, - i = { "lua require('dap').toggle()", "Toggle" }, - }, + "lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))", + "Breakpoint Condition", + }, + m = { + "lua require('dap').set_breakpoint({ nil, nil, vim.fn.input('Log point message: ') })", + "Log Point Message", + }, + t = { "lua require('dap').toggle_breakpoint()", "Create" }, + }, + c = { "lua require('dap').scopes()", "Scopes" }, + i = { "lua require('dap').toggle()", "Toggle" }, + }, }, { prefix = "" }) @@ -90,3 +90,40 @@ require('which-key').register({ -- indent-blankline setup require('ibl').setup() +-- Marks setup +require('marks').setup({ + -- whether to map keybinds or not. default true + default_mappings = true, + -- which builtin marks to show. default {} + -- builtin_marks = { ".", "<", ">", "^" }, + -- whether movements cycle back to the beginning/end of buffer. default true + cyclic = true, + -- whether the shada file is updated after modifying uppercase marks. default false + force_write_shada = false, + -- how often (in ms) to redraw signs/recompute mark positions. + -- higher values will have better performance but may cause visual lag, + -- while lower values may cause performance penalties. default 150. + refresh_interval = 250, + -- sign priorities for each type of mark - builtin marks, uppercase marks, lowercase + -- marks, and bookmarks. + -- can be either a table with all/none of the keys, or a single number, in which case + -- the priority applies to all marks. + -- default 10. + sign_priority = { lower = 10, upper = 15, builtin = 8, bookmark = 20 }, + -- disables mark tracking for specific filetypes. default {} + excluded_filetypes = {}, + -- disables mark tracking for specific buftypes. default {} + excluded_buftypes = {}, + -- marks.nvim allows you to configure up to 10 bookmark groups, each with its own + -- sign/virttext. Bookmarks can be used to group together positions and quickly move + -- across multiple buffers. default sign is '!@#$%^&*()' (from 0 to 9), and + -- default virt_text is "". + -- bookmark_0 = { + -- sign = "⚑", + -- virt_text = "bookmark_0", + -- -- explicitly prompt for a virtual line annotation when setting a bookmark from this group. + -- -- defaults to false. + -- annotate = false, + -- }, + mappings = {} +}) diff --git a/neovim/.config/nvim/lua/warrenhood/plugins.lua b/neovim/.config/nvim/lua/warrenhood/plugins.lua index b89be83..35c4f7c 100644 --- a/neovim/.config/nvim/lua/warrenhood/plugins.lua +++ b/neovim/.config/nvim/lua/warrenhood/plugins.lua @@ -144,10 +144,10 @@ require("packer").startup(function() use { "jay-babu/mason-nvim-dap.nvim" } -- Tab - use { - 'romgrk/barbar.nvim', - requires = { 'kyazdani42/nvim-web-devicons' }, - } + -- use { + -- 'romgrk/barbar.nvim', + -- requires = { 'kyazdani42/nvim-web-devicons' }, + -- } use { "nvim-neorg/neorg", @@ -177,6 +177,9 @@ require("packer").startup(function() end }) + -- Marks + use("chentoast/marks.nvim") + -- Automatically set up configuration after cloning packer.nvim if packer_bootstrap then