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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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