[neovim] Mostly plugin improvements
This commit is contained in:
parent
69bfb70de8
commit
8e8ace0109
1 changed files with 68 additions and 47 deletions
115
neovim/init.lua
115
neovim/init.lua
|
@ -31,6 +31,10 @@ vim.opt.termguicolors = true
|
||||||
-- Minimal number of lines kept above and below the cursor
|
-- Minimal number of lines kept above and below the cursor
|
||||||
vim.opt.scrolloff = 5
|
vim.opt.scrolloff = 5
|
||||||
|
|
||||||
|
-- Temporary file locations
|
||||||
|
vim.opt.backupdir = ".backup/," .. HOME .. "/.backup/,/tmp//"
|
||||||
|
vim.opt.directory = ".swp/," .. HOME .. "/.swp/,/tmp//"
|
||||||
|
|
||||||
-- netrw
|
-- netrw
|
||||||
-- This is the workspace file explorer
|
-- This is the workspace file explorer
|
||||||
vim.g.netrw_winsize = 25 -- width of the file explorer
|
vim.g.netrw_winsize = 25 -- width of the file explorer
|
||||||
|
@ -51,17 +55,6 @@ vim.keymap.set("t", "<c-k>", "<c-\\><c-n><c-w>k", { noremap = true, desc = 'Go t
|
||||||
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-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(
|
|
||||||
{"i", "n", "t", "v"},
|
|
||||||
"<F10>",
|
|
||||||
function ()
|
|
||||||
vim.cmd("nohlsearch")
|
|
||||||
end,
|
|
||||||
{ desc = ":nohlsearch" }
|
|
||||||
)
|
|
||||||
--]]
|
|
||||||
|
|
||||||
vim.keymap.set(
|
vim.keymap.set(
|
||||||
{"n", "t"},
|
{"n", "t"},
|
||||||
"<leader>z",
|
"<leader>z",
|
||||||
|
@ -101,6 +94,10 @@ require("lazy").setup({
|
||||||
vim.cmd.colorscheme("dracula")
|
vim.cmd.colorscheme("dracula")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
{
|
{
|
||||||
"kylechui/nvim-surround",
|
"kylechui/nvim-surround",
|
||||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||||
|
@ -131,9 +128,14 @@ require("lazy").setup({
|
||||||
opts = {},
|
opts = {},
|
||||||
config = function(_, opts) require'lsp_signature'.setup(opts) end
|
config = function(_, opts) require'lsp_signature'.setup(opts) end
|
||||||
},
|
},
|
||||||
{ "rcarriga/nvim-dap-ui", requires = "mfussenegger/nvim-dap" },
|
{
|
||||||
|
"rcarriga/nvim-dap-ui",
|
||||||
|
event = "VeryLazy",
|
||||||
|
requires = "mfussenegger/nvim-dap"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
|
event = "VeryLazy",
|
||||||
config = function()
|
config = function()
|
||||||
local dap = require("dap")
|
local dap = require("dap")
|
||||||
|
|
||||||
|
@ -142,11 +144,11 @@ require("lazy").setup({
|
||||||
|
|
||||||
--[[
|
--[[
|
||||||
for name, sign in pairs(Config.icons.dap) do
|
for name, sign in pairs(Config.icons.dap) do
|
||||||
sign = type(sign) == "table" and sign or { sign }
|
sign = type(sign) == "table" and sign or { sign }
|
||||||
vim.fn.sign_define(
|
vim.fn.sign_define(
|
||||||
"Dap" .. name,
|
"Dap" .. name,
|
||||||
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
|
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
|
@ -284,27 +286,38 @@ require("lazy").setup({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"leoluz/nvim-dap-go",
|
{ "leoluz/nvim-dap-go", event = "VeryLazy" },
|
||||||
"williamboman/mason.nvim",
|
{ "williamboman/mason.nvim", event = "VeryLazy" },
|
||||||
"williamboman/mason-lspconfig.nvim",
|
{ "williamboman/mason-lspconfig.nvim", event = "VeryLazy" },
|
||||||
"nvimdev/lspsaga.nvim",
|
{ "nvimdev/lspsaga.nvim", event = "VeryLazy" },
|
||||||
"nvim-lualine/lualine.nvim",
|
{
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-telescope/telescope.nvim",
|
||||||
"nvim-lua/plenary.nvim",
|
event = "VeryLazy",
|
||||||
{ "nvim-telescope/telescope.nvim", branch = "0.1.x" },
|
branch = "0.1.x",
|
||||||
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
|
dependencies = {
|
||||||
"neovim/nvim-lspconfig",
|
"nvim-lua/plenary.nvim",
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
{
|
||||||
"hrsh7th/cmp-buffer",
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
"hrsh7th/cmp-path",
|
build = "cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build",
|
||||||
"hrsh7th/cmp-cmdline",
|
},
|
||||||
"hrsh7th/nvim-cmp",
|
},
|
||||||
"hrsh7th/cmp-vsnip",
|
},
|
||||||
"hrsh7th/vim-vsnip",
|
{
|
||||||
"hrsh7th/cmp-nvim-lsp-signature-help",
|
"hrsh7th/nvim-cmp",
|
||||||
"tpope/vim-fugitive",
|
event = "InsertEnter",
|
||||||
"lewis6991/gitsigns.nvim",
|
dependencies = {
|
||||||
"famiu/bufdelete.nvim",
|
"hrsh7th/cmp-nvim-lsp",
|
||||||
|
"hrsh7th/cmp-buffer",
|
||||||
|
"hrsh7th/cmp-path",
|
||||||
|
"hrsh7th/cmp-cmdline",
|
||||||
|
"hrsh7th/cmp-vsnip",
|
||||||
|
"hrsh7th/vim-vsnip",
|
||||||
|
"hrsh7th/cmp-nvim-lsp-signature-help",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{ "tpope/vim-fugitive", event = "VeryLazy" },
|
||||||
|
{ "lewis6991/gitsigns.nvim", event = "VeryLazy" },
|
||||||
|
{ "famiu/bufdelete.nvim", event = "VeryLazy" },
|
||||||
})
|
})
|
||||||
|
|
||||||
--[[ mason
|
--[[ mason
|
||||||
|
@ -642,24 +655,32 @@ vim.cmd("highlight NonText gui=bold guifg=#999999")
|
||||||
--[[
|
--[[
|
||||||
Resolve conflict between fugitive and LSPSaga, wherein the latter's
|
Resolve conflict between fugitive and LSPSaga, wherein the latter's
|
||||||
breadcrumbs cause a mismatch between the buffer and fugitive's :Git blame
|
breadcrumbs cause a mismatch between the buffer and fugitive's :Git blame
|
||||||
window. To kill the winbar (the top line where the breadcrumbs and this
|
window and :Gvdiffsplit window(s). To kill the winbar (the top line where
|
||||||
blame title live), enter `:set winbar&`.
|
the breadcrumbs and this blame title live), enter `:set winbar&`.
|
||||||
--]]
|
--]]
|
||||||
local group = vim.api.nvim_create_augroup("fugitiveSagaConflict", { clear = true })
|
local blamegroup = vim.api.nvim_create_augroup("fugitiveSagaBlameConflict", { clear = true })
|
||||||
vim.api.nvim_create_autocmd(
|
vim.api.nvim_create_autocmd(
|
||||||
'FileType',
|
'FileType',
|
||||||
{
|
{
|
||||||
group = group,
|
group = blamegroup,
|
||||||
pattern = 'fugitiveblame',
|
pattern = 'fugitiveblame',
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.api.nvim_set_option_value('winbar', 'fugitive: :Git blame', { scope = 'local' })
|
vim.api.nvim_set_option_value('winbar', 'fugitive', { scope = 'local' })
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
local diffgroup = vim.api.nvim_create_augroup("fugitiveSagaDiffConflict", { clear = true })
|
||||||
|
vim.api.nvim_create_autocmd(
|
||||||
|
'BufAdd',
|
||||||
|
{
|
||||||
|
group = diffgroup,
|
||||||
|
pattern = "fugitive://*", -- TODO: This doesn't seem to work
|
||||||
|
callback = function()
|
||||||
|
vim.api.nvim_set_option_value('winbar', 'fugitive', { scope = 'local' })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
-- Switch syntax highlighting on
|
-- Switch syntax highlighting on
|
||||||
vim.cmd("syntax enable")
|
vim.cmd("syntax enable")
|
||||||
|
|
||||||
-- Temporary file locations
|
|
||||||
vim.opt.backupdir = ".backup/," .. HOME .. "/.backup/,/tmp//"
|
|
||||||
vim.opt.directory = ".swp/," .. HOME .. "/.swp/,/tmp//"
|
|
||||||
|
|
Loading…
Reference in a new issue