add: update config (tuning speed)

This commit is contained in:
asep.komarudin 2024-04-09 05:51:53 +07:00
parent 83ef9398c8
commit 22b81afe5f
8 changed files with 131 additions and 122 deletions

View file

@ -38,10 +38,13 @@
"nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "734ebad31c81c6198dfe102aa23280937c937c42" },
"nvim-ts-rainbow2": { "branch": "master", "commit": "b3120cd5ae9ca524af9cb602f41e12e301fa985f" },
"nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" },
"nvim-web-devicons": { "branch": "master", "commit": "a55b801b7ef5719ca25692c3a0a5447fdfb692ed" },
"onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
"promise-async": { "branch": "main", "commit": "38a4575da9497326badd3995e768b4ccf0bb153e" },
"smart-splits.nvim": { "branch": "master", "commit": "f6fcb79527872e9330c554915af2ca511c388390" },
"statuscol.nvim": { "branch": "main", "commit": "d954893262a57a92e46edd87de67e2b3fe72305e" },
"telescope.nvim": { "branch": "master", "commit": "d26b666b45e5dde23332e4bde1227677f2d92e31" },
"toggleterm.nvim": { "branch": "main", "commit": "193786e0371e3286d3bc9aa0079da1cd41beaa62" },
"vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" },

View file

@ -1,6 +1,6 @@
return {
"akinsho/bufferline.nvim",
event = "VeryLazy",
event = { "BufRead", "InsertEnter", "BufNewFile" },
config = function()
local status_ok, bufferline = pcall(require, "bufferline")
if not status_ok then

View file

@ -1,7 +1,7 @@
return {
{
"nvim-lualine/lualine.nvim",
event = "BufWinEnter",
event = "insertEnter",
config = function()
local hide_in_width = function()
return vim.fn.winwidth(0) > 80
@ -198,7 +198,7 @@ return {
normal = {
a = { fg = colors.black, bg = colors.skyblue_1 },
b = { fg = colors.white, bg = colors.grey },
c = { fg = colors.white, bg = "#393f4a" },
c = { fg = colors.white, bg = "none" },
},
insert = {

View file

@ -1,105 +1,105 @@
return {
-- "kevinhwang91/nvim-ufo",
-- dependencies = {
-- "kevinhwang91/promise-async",
-- {
-- "luukvbaal/statuscol.nvim",
-- config = function()
-- local builtin = require("statuscol.builtin")
-- require("statuscol").setup({
-- -- relculright = true,
-- -- segments = {
-- -- { text = { builtin.foldfunc }, click = "v:lua.ScFa" },
-- -- { text = { "%s" }, click = "v:lua.ScSa" },
-- -- { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
-- -- },
-- setopt = true,
-- relculright = true,
-- segments = {
-- { text = { "%s" }, click = "v:lua.ScSa" },
-- {
-- text = { builtin.foldfunc },
-- condition = { builtin.not_empty, true, builtin.not_empty },
-- click = "v:lua.ScFa",
-- },
-- { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
-- },
-- })
-- end,
-- },
-- },
-- lazy = true,
-- -- event = "BufReadPost",
-- event = "BufWinEnter",
-- config = function()
-- vim.o.foldcolumn = "1" -- '0' is not bad
-- vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
-- vim.o.foldlevelstart = 99
-- vim.o.foldenable = true
-- -- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
-- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
--
-- -- these are "extra", change them as you like
-- vim.keymap.set("n", "zR", require("ufo").openAllFolds)
-- vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
-- vim.cmd("highlight FoldColumn guifg=" .. vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID("Comment")), "fg"))
-- -- Option 3: treesitter as a main provider instead
-- -- Only depend on `nvim-treesitter/queries/filetype/folds.scm`,
-- -- performance and stability are better than `foldmethod=nvim_treesitter#foldexpr()`
-- require("ufo").setup({
-- -- provider_selector = function(bufnr, filetype, buftype)
-- -- return { "treesitter", "indent" }
-- -- end,
-- open_fold_hl_timeout = 150,
--
-- preview = {
-- win_config = {
-- border = { "", "─", "", "", "", "─", "", "" },
-- -- winhighlight = 'Normal:Normal',
-- -- winhighlight = 'IncSearch:Folded',
-- winhighlight = "Normal:UfoPreviewNormal,FloatBorder:UfoPreviewBorder,CursorLine:UfoPreviewCursorLine",
-- winblend = 0,
-- },
-- mappings = {
-- scrollU = "<C-u>",
-- scrollD = "<C-d>",
-- jumpTop = "[",
-- jumpBot = "]",
-- },
-- },
-- provider_selector = function(_, filetype)
-- return { "treesitter", "indent" }
-- end,
-- fold_virt_text_handler = function(virt_text, lnum, end_lnum, width, truncate)
-- local result = {}
-- local _end = end_lnum - 1
-- local final_text = vim.trim(vim.api.nvim_buf_get_text(0, _end, 0, _end, -1, {})[1])
-- local suffix = final_text:format(end_lnum - lnum)
-- local suffix_width = vim.fn.strdisplaywidth(suffix)
-- local target_width = width - suffix_width
-- local cur_width = 0
-- for _, chunk in ipairs(virt_text) do
-- local chunk_text = chunk[1]
-- local chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- if target_width > cur_width + chunk_width then
-- table.insert(result, chunk)
-- else
-- chunk_text = truncate(chunk_text, target_width - cur_width)
-- local hl_group = chunk[2]
-- table.insert(result, { chunk_text, hl_group })
-- chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- -- str width returned from truncate() may less than 2nd argument, need padding
-- if cur_width + chunk_width < target_width then
-- suffix = suffix .. (" "):rep(target_width - cur_width - chunk_width)
-- end
-- break
-- end
-- cur_width = cur_width + chunk_width
-- end
-- table.insert(result, { " ⋯ ", "NonText" })
-- table.insert(result, { suffix, "TSPunctBracket" })
-- return result
-- end,
-- })
-- end,
"kevinhwang91/nvim-ufo",
dependencies = {
"kevinhwang91/promise-async",
{
"luukvbaal/statuscol.nvim",
config = function()
local builtin = require("statuscol.builtin")
require("statuscol").setup({
-- relculright = true,
-- segments = {
-- { text = { builtin.foldfunc }, click = "v:lua.ScFa" },
-- { text = { "%s" }, click = "v:lua.ScSa" },
-- { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
-- },
setopt = true,
relculright = true,
segments = {
{ text = { "%s" }, click = "v:lua.ScSa" },
{
text = { builtin.foldfunc },
condition = { builtin.not_empty, true, builtin.not_empty },
click = "v:lua.ScFa",
},
{ text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
},
})
end,
},
},
lazy = true,
-- event = "BufReadPost",
event = { "BufReadPost", "BufRead", "InsertEnter", "BufNewFile" },
config = function()
vim.o.foldcolumn = "1" -- '0' is not bad
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.o.foldlevelstart = 99
vim.o.foldenable = true
-- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
-- these are "extra", change them as you like
vim.keymap.set("n", "zR", require("ufo").openAllFolds)
vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
vim.cmd("highlight FoldColumn guifg=" .. vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID("Comment")), "fg"))
-- Option 3: treesitter as a main provider instead
-- Only depend on `nvim-treesitter/queries/filetype/folds.scm`,
-- performance and stability are better than `foldmethod=nvim_treesitter#foldexpr()`
require("ufo").setup({
-- provider_selector = function(bufnr, filetype, buftype)
-- return { "treesitter", "indent" }
-- end,
open_fold_hl_timeout = 150,
preview = {
win_config = {
border = { "", "", "", "", "", "", "", "" },
-- winhighlight = 'Normal:Normal',
-- winhighlight = 'IncSearch:Folded',
winhighlight = "Normal:UfoPreviewNormal,FloatBorder:UfoPreviewBorder,CursorLine:UfoPreviewCursorLine",
winblend = 0,
},
mappings = {
scrollU = "<C-u>",
scrollD = "<C-d>",
jumpTop = "[",
jumpBot = "]",
},
},
provider_selector = function(_, filetype)
return { "treesitter", "indent" }
end,
fold_virt_text_handler = function(virt_text, lnum, end_lnum, width, truncate)
local result = {}
local _end = end_lnum - 1
local final_text = vim.trim(vim.api.nvim_buf_get_text(0, _end, 0, _end, -1, {})[1])
local suffix = final_text:format(end_lnum - lnum)
local suffix_width = vim.fn.strdisplaywidth(suffix)
local target_width = width - suffix_width
local cur_width = 0
for _, chunk in ipairs(virt_text) do
local chunk_text = chunk[1]
local chunk_width = vim.fn.strdisplaywidth(chunk_text)
if target_width > cur_width + chunk_width then
table.insert(result, chunk)
else
chunk_text = truncate(chunk_text, target_width - cur_width)
local hl_group = chunk[2]
table.insert(result, { chunk_text, hl_group })
chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- str width returned from truncate() may less than 2nd argument, need padding
if cur_width + chunk_width < target_width then
suffix = suffix .. (" "):rep(target_width - cur_width - chunk_width)
end
break
end
cur_width = cur_width + chunk_width
end
table.insert(result, { "", "NonText" })
table.insert(result, { suffix, "TSPunctBracket" })
return result
end,
})
end,
}

View file

@ -260,7 +260,8 @@ return {
},
{
"lukas-reineke/indent-blankline.nvim",
event = "BufWinEnter",
-- event = "BufWinEnter",
event = { "BufRead", "InsertEnter", "BufNewFile" },
lazy = true,
opts = {
indent = {
@ -321,7 +322,7 @@ return {
-- build = "npm install -g live-server",
-- },
-- for multi cursor select
{ "mg979/vim-visual-multi", event = "BufWinEnter", lazy = true },
{ "mg979/vim-visual-multi", event = { "BufRead", "InsertEnter", "BufNewFile" }, lazy = true },
-- for auto close tag
{
"windwp/nvim-ts-autotag",
@ -348,7 +349,8 @@ return {
{
"NvChad/nvim-colorizer.lua",
lazy = true,
event = "BufWinEnter",
-- event = "BufWinEnter",
event = { "BufRead", "InsertEnter", "BufNewFile" },
opts = function()
require("user.colorizer")
end,
@ -400,7 +402,7 @@ return {
{
"mrjones2014/smart-splits.nvim",
lazy = true,
-- event = "BufRead",
event = { "BufRead", "InsertEnter", "BufNewFile" },
config = function()
require("user.smartspit")
end,
@ -428,7 +430,8 @@ return {
{
"dstein64/nvim-scrollview",
lazy = true,
event = "BufWinEnter",
-- event = "BufWinEnter",
event = { "BufRead", "InsertEnter", "BufNewFile" },
config = function()
require("user.nvimscroll")
end,
@ -454,7 +457,8 @@ return {
lazy = true,
enabled = vim.fn.executable("git") == 1,
ft = "gitcommit",
event = "BufWinEnter",
-- event = "BufWinEnter",
event = "BufRead",
config = function()
require("user.gitsigns")
end,

View file

@ -14,7 +14,8 @@ return {
"nvim-lualine/lualine.nvim",
lazy = true,
-- dependencies = { "kyazdani42/nvim-web-devicons", opt = true },
event = "BufWinEnter",
-- event = "BufWinEnter",
event = { "BufRead", "BufNewFile" },
config = function()
require("user.lualine")
end,
@ -54,7 +55,8 @@ return {
{
"akinsho/bufferline.nvim",
lazy = true,
event = "BufWinEnter",
-- event = "BufWinEnter",
event = { "BufRead", "InsertEnter", "BufNewFile" },
config = function()
require("user.bufferline")
end,

View file

@ -193,7 +193,7 @@ end
-- keymap("t", "<C-k>", "<C-\\><C-N><C-w>k", term_opts)
-- keymap("t", "<C-l>", "<C-\\><C-N><C-w>l", term_opts)
vim.keymap.set("n", "<C-Left>", require("smart-splits").resize_left)
vim.keymap.set("n", "<C-Down>", require("smart-splits").resize_down)
vim.keymap.set("n", "<C-Up", require("smart-splits").resize_up)
vim.keymap.set("n", "<C-Right>", require("smart-splits").resize_right)
-- vim.keymap.set("n", "<C-Left>", require("smart-splits").resize_left)
-- vim.keymap.set("n", "<C-Down>", require("smart-splits").resize_down)
-- vim.keymap.set("n", "<C-Up", require("smart-splits").resize_up)
-- vim.keymap.set("n", "<C-Right>", require("smart-splits").resize_right)

View file

@ -12,7 +12,7 @@ smart_splits.setup({
ignored_buftypes = { "nofile" },
})
-- vim.keymap.set("n", "<C-Left>", require("smart-splits").resize_left)
-- vim.keymap.set("n", "<C-Down>", require("smart-splits").resize_down)
-- vim.keymap.set("n", "<C-Up", require("smart-splits").resize_up)
-- vim.keymap.set("n", "<C-Right>", require("smart-splits").resize_right)
vim.keymap.set("n", "<C-Left>", require("smart-splits").resize_left)
vim.keymap.set("n", "<C-Down>", require("smart-splits").resize_down)
vim.keymap.set("n", "<C-Up", require("smart-splits").resize_up)
vim.keymap.set("n", "<C-Right>", require("smart-splits").resize_right)