chore(nvim): cleanup of some old stuff
This commit is contained in:
parent
3c7012a65e
commit
5576aa4f57
2 changed files with 30 additions and 44 deletions
|
@ -8,18 +8,6 @@ return {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
|
||||||
'nvim-java/nvim-java',
|
|
||||||
ft = "java",
|
|
||||||
config = function()
|
|
||||||
require('java').setup()
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
local capabilities = require('blink.cmp').get_lsp_capabilities(nil, true)
|
|
||||||
lspconfig["jdtls"].setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"smjonas/inc-rename.nvim",
|
"smjonas/inc-rename.nvim",
|
||||||
opts = {
|
opts = {
|
||||||
|
@ -31,6 +19,28 @@ return {
|
||||||
event = "VeryLazy",
|
event = "VeryLazy",
|
||||||
opts = {}
|
opts = {}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"ray-x/go.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"ray-x/guihua.lua",
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
},
|
||||||
|
config = function(lp, opts)
|
||||||
|
require("go").setup(opts)
|
||||||
|
local format_sync_grp = vim.api.nvim_create_augroup("GoFormat", {})
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
pattern = "*.go",
|
||||||
|
callback = function()
|
||||||
|
require('go.format').goimports()
|
||||||
|
end,
|
||||||
|
group = format_sync_grp,
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
event = { "CmdlineEnter" },
|
||||||
|
ft = { "go", 'gomod' },
|
||||||
|
build = ':lua require("go.install").update_all_sync()'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
|
@ -50,7 +60,7 @@ return {
|
||||||
local conform = require("conform")
|
local conform = require("conform")
|
||||||
|
|
||||||
local function jumpWithVirtLineDiags(jumpCount)
|
local function jumpWithVirtLineDiags(jumpCount)
|
||||||
pcall(vim.api.nvim_del_augroup_by_name, "jumpWithVirtLineDiags") -- prevent autocmd for repeated jumps
|
pcall(vim.api.nvim_del_augroup_by_name, "jumpWithVirtLineDiags")
|
||||||
|
|
||||||
vim.diagnostic.jump { count = jumpCount }
|
vim.diagnostic.jump { count = jumpCount }
|
||||||
|
|
||||||
|
@ -60,7 +70,7 @@ return {
|
||||||
virtual_lines = { current_line = true },
|
virtual_lines = { current_line = true },
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.defer_fn(function() -- deferred to not trigger by jump itself
|
vim.defer_fn(function()
|
||||||
vim.api.nvim_create_autocmd("CursorMoved", {
|
vim.api.nvim_create_autocmd("CursorMoved", {
|
||||||
desc = "User(once): Reset diagnostics virtual lines",
|
desc = "User(once): Reset diagnostics virtual lines",
|
||||||
once = true,
|
once = true,
|
||||||
|
|
|
@ -42,38 +42,9 @@ return {
|
||||||
vim.o.foldcolumn = '0'
|
vim.o.foldcolumn = '0'
|
||||||
vim.o.foldlevel = 99
|
vim.o.foldlevel = 99
|
||||||
vim.o.foldlevelstart = 99
|
vim.o.foldlevelstart = 99
|
||||||
vim.o.foldenable = true
|
|
||||||
vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
|
vim.keymap.set('n', 'zR', require('ufo').openAllFolds)
|
||||||
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
|
vim.keymap.set('n', 'zM', require('ufo').closeAllFolds)
|
||||||
require('ufo').setup({
|
require('ufo').setup()
|
||||||
fold_virt_text_handler = function(virtText, lnum, endLnum, width, truncate)
|
|
||||||
local newVirtText = {}
|
|
||||||
local suffix = (' %d '):format(endLnum - lnum)
|
|
||||||
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
|
||||||
local targetWidth = width - sufWidth
|
|
||||||
local curWidth = 0
|
|
||||||
for _, chunk in ipairs(virtText) do
|
|
||||||
local chunkText = chunk[1]
|
|
||||||
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
|
||||||
if targetWidth > curWidth + chunkWidth then
|
|
||||||
table.insert(newVirtText, chunk)
|
|
||||||
else
|
|
||||||
chunkText = truncate(chunkText, targetWidth - curWidth)
|
|
||||||
local hlGroup = chunk[2]
|
|
||||||
table.insert(newVirtText, { chunkText, hlGroup })
|
|
||||||
chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
|
||||||
-- str width returned from truncate() may less than 2nd argument, need padding
|
|
||||||
if curWidth + chunkWidth < targetWidth then
|
|
||||||
suffix = suffix .. (' '):rep(targetWidth - curWidth - chunkWidth)
|
|
||||||
end
|
|
||||||
break
|
|
||||||
end
|
|
||||||
curWidth = curWidth + chunkWidth
|
|
||||||
end
|
|
||||||
table.insert(newVirtText, { suffix, 'MoreMsg' })
|
|
||||||
return newVirtText
|
|
||||||
end
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -90,4 +61,9 @@ return {
|
||||||
require 'colorizer'.setup()
|
require 'colorizer'.setup()
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"echasnovski/mini.diff",
|
||||||
|
opts = {}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue