[neovim] A few things

- LSPSaga x fugitive: :Gvdiffsplit : now aligned
- Killed hlsearch
- <c-l> remapped
- conditional idelayout
This commit is contained in:
Adam Cooper 2024-01-15 15:27:33 -05:00
parent 8e8ace0109
commit 9b360075c9

View file

@ -31,6 +31,9 @@ vim.opt.termguicolors = true
-- Minimal number of lines kept above and below the cursor
vim.opt.scrolloff = 5
-- Turn off highlight search
vim.opt.hlsearch = false
-- Temporary file locations
vim.opt.backupdir = ".backup/," .. HOME .. "/.backup/,/tmp//"
vim.opt.directory = ".swp/," .. HOME .. "/.swp/,/tmp//"
@ -40,29 +43,26 @@ vim.opt.directory = ".swp/," .. HOME .. "/.swp/,/tmp//"
vim.g.netrw_winsize = 25 -- width of the file explorer
vim.g.netrw_liststyle = 3 -- tree style listing
-- Escape exits terminal mode
-- vim.keymap.set("t", "<Esc>", "<c-\\><c-n>", { noremap = true })
-- Sane vim split naviagation (via Gaslight blog)
vim.keymap.set("n", "<c-j>", "<c-w>j", { noremap = true, desc = 'Go to window below' })
vim.keymap.set("n", "<c-k>", "<c-w>k", { noremap = true, desc = 'Go to window above' })
vim.keymap.set("n", "<c-h>", "<c-w>h", { noremap = true, desc = 'Go to window to the left' })
-- N.B. This conflicts with the NetRW directory refresh command. Use the alternative `:e .`.
vim.keymap.set("n", "<c-l>", "<c-w>l", { noremap = true, desc = 'Go to window to the right' })
-- N.B. This conflicts with the NetRW directory refresh command.
-- vim.keymap.set("n", "<c-l>", "<c-w>l", { noremap = true, desc = 'Go to window to the right' })
vim.keymap.set("t", "<c-j>", "<c-\\><c-n><c-w>j", { noremap = true, desc = 'Go to window below' })
vim.keymap.set("t", "<c-k>", "<c-\\><c-n><c-w>k", { noremap = true, desc = 'Go to window above' })
vim.keymap.set("t", "<c-h>", "<c-\\><c-n><c-w>h", { noremap = true, desc = 'Go to window to the left' })
-- vim.keymap.set("t", "<c-l>", "<c-\\><c-n><c-w>l", { noremap = true, desc = 'Go to window to the right' })
vim.keymap.set("t", "<c-l>", "<c-\\><c-n><c-w>l", { noremap = true, desc = 'Go to window to the right' })
vim.keymap.set(
{"n", "t"},
"<leader>z",
function ()
-- This restores the UI to the saved layout 'idelayout' (if saved on command line)
-- TODO: Wrap the function body in an if statement to verify existence of idelayout
-- (This depends on command line commands' being executed before this $VIMRC is loaded
vim.cmd("exec idelayout")
-- This restores the UI to the saved layout 'idelayout' (if it exists)
if vim.fn.exists("idelayout") ~= 0 then
vim.cmd("exec idelayout")
end
end,
{ desc = "Revert window layout" }
)
@ -212,14 +212,35 @@ require("lazy").setup({
function()
require("dap").step_out()
end,
desc = "Step Out",
desc = "DAP: Step Out",
},
{
"<leader>do",
function()
require("dap").step_over()
end,
desc = "Step Over",
desc = "DAP: Step Over",
},
{
"<leader>db",
function()
require("dap").toggle_breakpoint()
end,
desc = "DAP: Toggle breakpoint",
},
{
"<leader>dc",
function()
require("dap").continue()
end,
desc = "DAP: Continue",
},
{
"<leader>di",
function()
require("dap").step_into()
end,
desc = "DAP: Step Into",
},
{
"<leader>da",
@ -234,7 +255,7 @@ require("lazy").setup({
end
require("dap").continue()
end,
desc = "Run with Args",
desc = "DAP: Run with Args",
},
},
dependencies = {
@ -672,10 +693,10 @@ vim.api.nvim_create_autocmd(
local diffgroup = vim.api.nvim_create_augroup("fugitiveSagaDiffConflict", { clear = true })
vim.api.nvim_create_autocmd(
'BufAdd',
'BufReadCmd',
{
group = diffgroup,
pattern = "fugitive://*", -- TODO: This doesn't seem to work
pattern = "fugitive://*",
callback = function()
vim.api.nvim_set_option_value('winbar', 'fugitive', { scope = 'local' })
end,