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