chore(nvim): multiple stuff
This commit is contained in:
parent
e34eaf0818
commit
fbb7032478
5 changed files with 38 additions and 67 deletions
|
@ -1,5 +1,4 @@
|
||||||
vim.g.gruvbox_material_better_performance=1
|
vim.g.everforest_better_performance=1
|
||||||
vim.g.gruvbox_material_background="medium"
|
vim.g.everforest_background="hard"
|
||||||
vim.g.gruvbox_material_foreground="material"
|
|
||||||
vim.opt.background="dark"
|
vim.opt.background="dark"
|
||||||
vim.cmd('colorscheme gruvbox-material')
|
vim.cmd('colorscheme everforest')
|
||||||
|
|
|
@ -2,7 +2,9 @@ return {
|
||||||
{
|
{
|
||||||
'saghen/blink.cmp',
|
'saghen/blink.cmp',
|
||||||
lazy = false,
|
lazy = false,
|
||||||
dependencies = 'rafamadriz/friendly-snippets',
|
dependencies = {
|
||||||
|
'rafamadriz/friendly-snippets',
|
||||||
|
},
|
||||||
version = "*",
|
version = "*",
|
||||||
opts = {
|
opts = {
|
||||||
keymap = {
|
keymap = {
|
||||||
|
@ -26,6 +28,7 @@ return {
|
||||||
max_width = 160,
|
max_width = 160,
|
||||||
max_height = 30,
|
max_height = 30,
|
||||||
scrollbar = true,
|
scrollbar = true,
|
||||||
|
show_documentation = false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
completion = {
|
completion = {
|
||||||
|
@ -40,7 +43,7 @@ return {
|
||||||
winblend = 0,
|
winblend = 0,
|
||||||
draw = {
|
draw = {
|
||||||
treesitter = { 'lsp' },
|
treesitter = { 'lsp' },
|
||||||
columns = { { 'kind_icon'}, { 'label' } },
|
columns = { { 'kind_icon' }, { 'label' } },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
documentation = {
|
documentation = {
|
||||||
|
|
|
@ -14,12 +14,7 @@ return {
|
||||||
config = function()
|
config = function()
|
||||||
require('java').setup()
|
require('java').setup()
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
local lsp_defaults = lspconfig.util.default_config
|
local capabilities = require('blink.cmp').get_lsp_capabilities(nil, true)
|
||||||
local capabilities = require('blink.cmp').get_lsp_capabilities(lsp_defaults.capabilities)
|
|
||||||
capabilities.textDocument.foldingRange = {
|
|
||||||
dynamicRegistration = false,
|
|
||||||
lineFoldingOnly = true
|
|
||||||
}
|
|
||||||
lspconfig["jdtls"].setup({
|
lspconfig["jdtls"].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
@ -79,12 +74,7 @@ return {
|
||||||
vim.keymap.set("n", "<space>fo", function() conform.format({ lsp_fallback = true }) end, bufopts)
|
vim.keymap.set("n", "<space>fo", function() conform.format({ lsp_fallback = true }) end, bufopts)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
local lsp_defaults = lspconfig.util.default_config
|
local capabilities = require('blink.cmp').get_lsp_capabilities(nil, true)
|
||||||
local capabilities = require('blink.cmp').get_lsp_capabilities(lsp_defaults.capabilities)
|
|
||||||
capabilities.textDocument.foldingRange = {
|
|
||||||
dynamicRegistration = false,
|
|
||||||
lineFoldingOnly = true
|
|
||||||
}
|
|
||||||
lspconfig["gopls"].setup({
|
lspconfig["gopls"].setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
|
@ -158,17 +148,6 @@ return {
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"jay-babu/mason-nvim-dap.nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
dependencies = {
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
"mfussenegger/nvim-dap",
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
handlers = {}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"mfussenegger/nvim-dap",
|
"mfussenegger/nvim-dap",
|
||||||
},
|
},
|
||||||
|
|
|
@ -26,13 +26,11 @@ return {
|
||||||
dashboard = { enabled = true },
|
dashboard = { enabled = true },
|
||||||
input = { enabled = true },
|
input = { enabled = true },
|
||||||
lazygit = {
|
lazygit = {
|
||||||
enabled = true,
|
|
||||||
vim.keymap.set('n', '<leader>lg', function()
|
vim.keymap.set('n', '<leader>lg', function()
|
||||||
Snacks.lazygit.open()
|
Snacks.lazygit.open()
|
||||||
end)
|
end)
|
||||||
},
|
},
|
||||||
words = {
|
words = {
|
||||||
enabled = true,
|
|
||||||
debounce = 10,
|
debounce = 10,
|
||||||
vim.keymap.set('n', '<leader>gn', function()
|
vim.keymap.set('n', '<leader>gn', function()
|
||||||
Snacks.words.jump(1, true)
|
Snacks.words.jump(1, true)
|
||||||
|
@ -48,11 +46,4 @@ return {
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
"tpope/vim-fugitive",
|
"tpope/vim-fugitive",
|
||||||
-- {
|
|
||||||
-- "nvzone/typr",
|
|
||||||
-- dependencies = {
|
|
||||||
-- "nvzone/volt"
|
|
||||||
-- },
|
|
||||||
-- opts = {}
|
|
||||||
-- }
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,41 +38,40 @@ return {
|
||||||
'kevinhwang91/nvim-ufo',
|
'kevinhwang91/nvim-ufo',
|
||||||
dependencies = 'kevinhwang91/promise-async',
|
dependencies = 'kevinhwang91/promise-async',
|
||||||
config = function()
|
config = function()
|
||||||
vim.o.foldcolumn = '1'
|
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.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)
|
||||||
local 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
|
|
||||||
require('ufo').setup({
|
require('ufo').setup({
|
||||||
fold_virt_text_handler = handler
|
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
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue