mirror of
				https://github.com/WarrenHood/dotfiles.git
				synced 2025-11-04 01:38:41 +00:00 
			
		
		
		
	Update neovim config
This commit is contained in:
		
							parent
							
								
									a18cee6715
								
							
						
					
					
						commit
						5d4b1f6dcc
					
				| 
						 | 
				
			
			@ -84,7 +84,7 @@ map("n", "<Leader>di", ":lua require('dapui').toggle()<CR>")
 | 
			
		|||
-- luasnip
 | 
			
		||||
vim.cmd [[
 | 
			
		||||
" Use Tab to expand and jump through snippets
 | 
			
		||||
imap <silent><expr> <C-k> luasnip#expand_or_jumpable() ? '<Plug>luasnip-expand-or-jump' : '<Tab>' 
 | 
			
		||||
imap <silent><expr> <C-k> luasnip#expand_or_jumpable() ? '<Plug>luasnip-expand-or-jump' : '<Tab>'
 | 
			
		||||
smap <silent><expr> <C-k> luasnip#jumpable(1) ? '<Plug>luasnip-jump-next' : '<Tab>'
 | 
			
		||||
 | 
			
		||||
" 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', '<A-,>', '<Cmd>BufferPrevious<CR>', barbar_opts)
 | 
			
		||||
map('n', '<A-.>', '<Cmd>BufferNext<CR>', barbar_opts)
 | 
			
		||||
-- Re-order to previous/next
 | 
			
		||||
map('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', barbar_opts)
 | 
			
		||||
map('n', '<A->>', '<Cmd>BufferMoveNext<CR>', barbar_opts)
 | 
			
		||||
-- Goto buffer in position...
 | 
			
		||||
map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', barbar_opts)
 | 
			
		||||
map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', barbar_opts)
 | 
			
		||||
map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', barbar_opts)
 | 
			
		||||
map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', barbar_opts)
 | 
			
		||||
map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', barbar_opts)
 | 
			
		||||
map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', barbar_opts)
 | 
			
		||||
map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', barbar_opts)
 | 
			
		||||
map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', barbar_opts)
 | 
			
		||||
map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', barbar_opts)
 | 
			
		||||
map('n', '<A-0>', '<Cmd>BufferLast<CR>', barbar_opts)
 | 
			
		||||
-- Pin/unpin buffer
 | 
			
		||||
map('n', '<A-p>', '<Cmd>BufferPin<CR>', barbar_opts)
 | 
			
		||||
-- Close buffer
 | 
			
		||||
map('n', '<A-c>', '<Cmd>BufferClose<CR>', barbar_opts)
 | 
			
		||||
-- Wipeout buffer
 | 
			
		||||
--                 :BufferWipeout
 | 
			
		||||
 | 
			
		||||
-- Close commands
 | 
			
		||||
--                 :BufferCloseAllButCurrent
 | 
			
		||||
--                 :BufferCloseAllButPinned
 | 
			
		||||
--                 :BufferCloseAllButCurrentOrPinned
 | 
			
		||||
--                 :BufferCloseBuffersLeft
 | 
			
		||||
--                 :BufferCloseBuffersRight
 | 
			
		||||
-- Magic buffer-picking mode
 | 
			
		||||
map('n', '<C-p>', '<Cmd>BufferPick<CR>', barbar_opts)
 | 
			
		||||
-- Sort automatically by...
 | 
			
		||||
map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', barbar_opts)
 | 
			
		||||
map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', barbar_opts)
 | 
			
		||||
map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', barbar_opts)
 | 
			
		||||
map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', 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', '<A-,>', '<Cmd>BufferPrevious<CR>', barbar_opts)
 | 
			
		||||
-- map('n', '<A-.>', '<Cmd>BufferNext<CR>', barbar_opts)
 | 
			
		||||
-- -- Re-order to previous/next
 | 
			
		||||
-- map('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', barbar_opts)
 | 
			
		||||
-- map('n', '<A->>', '<Cmd>BufferMoveNext<CR>', barbar_opts)
 | 
			
		||||
-- -- Goto buffer in position...
 | 
			
		||||
-- map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', barbar_opts)
 | 
			
		||||
-- map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', barbar_opts)
 | 
			
		||||
-- map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', barbar_opts)
 | 
			
		||||
-- map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', barbar_opts)
 | 
			
		||||
-- map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', barbar_opts)
 | 
			
		||||
-- map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', barbar_opts)
 | 
			
		||||
-- map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', barbar_opts)
 | 
			
		||||
-- map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', barbar_opts)
 | 
			
		||||
-- map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', barbar_opts)
 | 
			
		||||
-- map('n', '<A-0>', '<Cmd>BufferLast<CR>', barbar_opts)
 | 
			
		||||
-- -- Pin/unpin buffer
 | 
			
		||||
-- map('n', '<A-p>', '<Cmd>BufferPin<CR>', barbar_opts)
 | 
			
		||||
-- -- Close buffer
 | 
			
		||||
-- map('n', '<A-c>', '<Cmd>BufferClose<CR>', barbar_opts)
 | 
			
		||||
-- -- Wipeout buffer
 | 
			
		||||
-- --                 :BufferWipeout
 | 
			
		||||
--
 | 
			
		||||
-- -- Close commands
 | 
			
		||||
-- --                 :BufferCloseAllButCurrent
 | 
			
		||||
-- --                 :BufferCloseAllButPinned
 | 
			
		||||
-- --                 :BufferCloseAllButCurrentOrPinned
 | 
			
		||||
-- --                 :BufferCloseBuffersLeft
 | 
			
		||||
-- --                 :BufferCloseBuffersRight
 | 
			
		||||
-- -- Magic buffer-picking mode
 | 
			
		||||
-- map('n', '<C-p>', '<Cmd>BufferPick<CR>', barbar_opts)
 | 
			
		||||
-- -- Sort automatically by...
 | 
			
		||||
-- map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', barbar_opts)
 | 
			
		||||
-- map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', barbar_opts)
 | 
			
		||||
-- map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', barbar_opts)
 | 
			
		||||
-- map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', barbar_opts)
 | 
			
		||||
--
 | 
			
		||||
-- -- Other:
 | 
			
		||||
-- -- :BarbarEnable - enables barbar (enabled by default)
 | 
			
		||||
-- -- :BarbarDisable - very bad command, should never be used
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- Disable arrow keys
 | 
			
		||||
local arrows = {'<Up>', '<Down>', '<Left>', '<Right>'}
 | 
			
		||||
for i=1,#arrows do
 | 
			
		||||
    map('n', arrows[i], function () end)
 | 
			
		||||
    map('i', arrows[i], function () end)
 | 
			
		||||
local arrows = { '<Up>', '<Down>', '<Left>', '<Right>' }
 | 
			
		||||
for i = 1, #arrows do
 | 
			
		||||
    map('n', arrows[i], function() end)
 | 
			
		||||
    map('i', arrows[i], function() end)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- Code actions with ctrl + .
 | 
			
		||||
map('n', '<Leader>.', function() vim.lsp.buf.code_action({ apply = true}) end, { desc = 'Code action/Quick fix' })
 | 
			
		||||
map('n', '<Leader>.', function() vim.lsp.buf.code_action({ apply = true }) end, { desc = 'Code action/Quick fix' })
 | 
			
		||||
 | 
			
		||||
-- Show telescope commands fuzzy finder
 | 
			
		||||
map('n', '<Leader><Leader>', function() require('telescope.builtin').commands() end, { desc = 'Show commands' })
 | 
			
		||||
 | 
			
		||||
-- Show diagnostics in floating window
 | 
			
		||||
map('n', '<Leader>e', function() vim.diagnostic.open_float() end, { desc = 'Show diagnostics' })
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 = "<Tab>",
 | 
			
		||||
    -- Use Tab (or some other key if you prefer) to trigger visual selection
 | 
			
		||||
    store_selection_keys = "<Tab>",
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
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 = { "<cmd>lua require('dap').continue()<CR>", "Continue" },
 | 
			
		||||
    d = {
 | 
			
		||||
        name = "Debug",
 | 
			
		||||
        s = {
 | 
			
		||||
            name = "Step",
 | 
			
		||||
            c = { "<cmd>lua require('dap').continue()<CR>", "Continue" },
 | 
			
		||||
 | 
			
		||||
			v = { "<cmd>lua require('dap').step_over()<CR>", "Step Over" },
 | 
			
		||||
			i = { "<cmd>lua require('dap').step_into()<CR>", "Step Into" },
 | 
			
		||||
			o = { "<cmd>lua require('dap').step_out()<CR>", "Step Out" },
 | 
			
		||||
		},
 | 
			
		||||
		h = {
 | 
			
		||||
			name = "Hover",
 | 
			
		||||
			h = { "<cmd>lua require('dap.ui.variables').hover()<CR>", "Hover" },
 | 
			
		||||
			v = { "<cmd>lua require('dap.ui.variables').visual_hover()<CR>", "Visual Hover" },
 | 
			
		||||
		},
 | 
			
		||||
		u = {
 | 
			
		||||
			name = "UI",
 | 
			
		||||
            v = { "<cmd>lua require('dap').step_over()<CR>", "Step Over" },
 | 
			
		||||
            i = { "<cmd>lua require('dap').step_into()<CR>", "Step Into" },
 | 
			
		||||
            o = { "<cmd>lua require('dap').step_out()<CR>", "Step Out" },
 | 
			
		||||
        },
 | 
			
		||||
        h = {
 | 
			
		||||
            name = "Hover",
 | 
			
		||||
            h = { "<cmd>lua require('dap.ui.variables').hover()<CR>", "Hover" },
 | 
			
		||||
            v = { "<cmd>lua require('dap.ui.variables').visual_hover()<CR>", "Visual Hover" },
 | 
			
		||||
        },
 | 
			
		||||
        u = {
 | 
			
		||||
            name = "UI",
 | 
			
		||||
 | 
			
		||||
			h = { "<cmd>lua require('dap.ui.widgets').hover()<CR>", "Hover" },
 | 
			
		||||
			f = { "local widgets=require('dap.ui.widgets');widgets.centered_float(widgets.scopes)<CR>", "Float" },
 | 
			
		||||
		},
 | 
			
		||||
		r = {
 | 
			
		||||
			name = "Repl",
 | 
			
		||||
			o = { "<cmd>lua require('dap').repl.open()<CR>", "Open" },
 | 
			
		||||
            h = { "<cmd>lua require('dap.ui.widgets').hover()<CR>", "Hover" },
 | 
			
		||||
            f = { "local widgets=require('dap.ui.widgets');widgets.centered_float(widgets.scopes)<CR>", "Float" },
 | 
			
		||||
        },
 | 
			
		||||
        r = {
 | 
			
		||||
            name = "Repl",
 | 
			
		||||
            o = { "<cmd>lua require('dap').repl.open()<CR>", "Open" },
 | 
			
		||||
 | 
			
		||||
			l = { "<cmd>lua require('dap').repl.run_last()<CR>", "Run Last" },
 | 
			
		||||
		},
 | 
			
		||||
		b = {
 | 
			
		||||
			name = "Breakpoints",
 | 
			
		||||
			c = {
 | 
			
		||||
            l = { "<cmd>lua require('dap').repl.run_last()<CR>", "Run Last" },
 | 
			
		||||
        },
 | 
			
		||||
        b = {
 | 
			
		||||
            name = "Breakpoints",
 | 
			
		||||
            c = {
 | 
			
		||||
 | 
			
		||||
				"<cmd>lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>",
 | 
			
		||||
				"Breakpoint Condition",
 | 
			
		||||
			},
 | 
			
		||||
			m = {
 | 
			
		||||
				"<cmd>lua require('dap').set_breakpoint({ nil, nil, vim.fn.input('Log point message: ') })<CR>",
 | 
			
		||||
				"Log Point Message",
 | 
			
		||||
			},
 | 
			
		||||
			t = { "<cmd>lua require('dap').toggle_breakpoint()<CR>", "Create" },
 | 
			
		||||
		},
 | 
			
		||||
		c = { "<cmd>lua require('dap').scopes()<CR>", "Scopes" },
 | 
			
		||||
		i = { "<cmd>lua require('dap').toggle()<CR>", "Toggle" },
 | 
			
		||||
	},
 | 
			
		||||
                "<cmd>lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>",
 | 
			
		||||
                "Breakpoint Condition",
 | 
			
		||||
            },
 | 
			
		||||
            m = {
 | 
			
		||||
                "<cmd>lua require('dap').set_breakpoint({ nil, nil, vim.fn.input('Log point message: ') })<CR>",
 | 
			
		||||
                "Log Point Message",
 | 
			
		||||
            },
 | 
			
		||||
            t = { "<cmd>lua require('dap').toggle_breakpoint()<CR>", "Create" },
 | 
			
		||||
        },
 | 
			
		||||
        c = { "<cmd>lua require('dap').scopes()<CR>", "Scopes" },
 | 
			
		||||
        i = { "<cmd>lua require('dap').toggle()<CR>", "Toggle" },
 | 
			
		||||
    },
 | 
			
		||||
 | 
			
		||||
}, { prefix = "<leader>" })
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -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 = {}
 | 
			
		||||
})
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue