diff --git a/lazy-lock.json b/lazy-lock.json index af02829..c15bc6c 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -6,6 +6,7 @@ "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "code_runner.nvim": { "branch": "main", "commit": "6c5bfe44a6c7523350cd706e6b3b8101166eed99" }, @@ -15,7 +16,7 @@ "friendly-snippets": { "branch": "main", "commit": "d0610077b6129cf9f7f78afbe3a1425d60f6e2f1" }, "gitsigns.nvim": { "branch": "main", "commit": "76927d14d3fbd4ba06ccb5246e79d93b5442c188" }, "indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" }, - "lazy.nvim": { "branch": "main", "commit": "eab487c2520f0fe9e54eb5e3ea0606e20512492e" }, + "lazy.nvim": { "branch": "main", "commit": "ad30030b6abca7dac5a493c58b4d183b3fe93202" }, "lsp-progress.nvim": { "branch": "main", "commit": "55a04895ea20c365b670051a3128265d43bdfa3d" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "9ae570e206360e47d30b4c35a4550c165f4ea7b7" }, @@ -38,7 +39,7 @@ "nvim-scrollview": { "branch": "main", "commit": "c29c5f69d37040a1fac88cbea7f5e6f06f0aff4d" }, "nvim-tree.lua": { "branch": "master", "commit": "2bc725a3ebc23f0172fb0ab4d1134b81bcc13812" }, "nvim-treesitter": { "branch": "master", "commit": "979beffc1a86e7ba19bd6535c0370d8e1aaaad3c" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "5d60748e863a53442590e5767b2be216db32943a" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "fd41b7ccc5490a3a99c734d1ee418b68d06c48a9" }, "nvim-ts-autotag": { "branch": "main", "commit": "bcf3146864262ef2d3c877beba3e222b5c73780d" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "cb064386e667def1d241317deed9fd1b38f0dc2e" }, "nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" }, diff --git a/lua/custom/autocmd.lua b/lua/custom/autocmd.lua index 833e39a..53a55fa 100644 --- a/lua/custom/autocmd.lua +++ b/lua/custom/autocmd.lua @@ -29,17 +29,6 @@ vim.api.nvim_create_autocmd("ExitPre", { desc = "Set cursor back to beam when leaving Neovim.", }) -vim.api.nvim_create_autocmd("FileType", { - pattern = { - "NvimTree", - "lazy", - "mason", - }, - callback = function() - require("ufo").detach() - vim.opt_local.foldenable = false - end, -}) -- config for vim-visual-multi color selection vim.g.VM_Mono_hl = "DiffText" diff --git a/lua/custom/default.lua b/lua/custom/default.lua index faa7d06..43c2f10 100644 --- a/lua/custom/default.lua +++ b/lua/custom/default.lua @@ -111,4 +111,10 @@ vim.g.pcode_cmptag = false --https://github.com/quangnguyen30192/cmp-nvim-tags -- 0 = normal -- 1 = float -vim.g.pcode_nvimtree_isfloat = 1 +vim.g.pcode_nvimtree_isfloat = 0 + +vim.g.pcode_tailwindcolorizer = true +vim.g.pcode_codeium = true +vim.g.pcode_nvimufo = true +vim.g.pcode_indentscope = true +vim.g.pvode_minianimate = true diff --git a/lua/custom/plugins/codeium.lua b/lua/custom/plugins/codeium.lua deleted file mode 100644 index 6f1fa39..0000000 --- a/lua/custom/plugins/codeium.lua +++ /dev/null @@ -1,22 +0,0 @@ -vim.g.codeium_disable_bindings = 1 -return { - "Exafunction/codeium.vim", - enabled = true, - -- event = "BufEnter", - event = "InsertEnter", - config = function() - -- Change '' here to any keycode you like. - vim.keymap.set("i", "", function() - return vim.fn["codeium#Accept"]() - end, { expr = true, silent = true }) - vim.keymap.set("i", "", function() - return vim.fn["codeium#CycleCompletions"](1) - end, { expr = true, silent = true }) - vim.keymap.set("i", "", function() - return vim.fn["codeium#CycleCompletions"](-1) - end, { expr = true, silent = true }) - vim.keymap.set("i", "", function() - return vim.fn["codeium#Clear"]() - end, { expr = true, silent = true }) - end, -} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index 57ffda5..7303ba9 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -1,153 +1,153 @@ local icons = vim.g.pcode_icons return { - --- masukan plugin tambahan disini - -- { - -- "folke/trouble.nvim", - -- event = "BufRead", - -- cmd = { "TroubleToggle", "Trouble" }, - -- opts = { use_diagnostic_signs = true }, - -- keys = { - -- { - -- "xx", - -- "TroubleToggle document_diagnostics", - -- desc = "Document Diagnostics (Trouble)", - -- }, - -- { - -- "xX", - -- "TroubleToggle workspace_diagnostics", - -- desc = "Workspace Diagnostics (Trouble)", - -- }, - -- }, - -- }, - { - "echasnovski/mini.indentscope", - version = false, -- wait till new 0.7.0 release to put it back on semver - event = "BufReadPre", - opts = { - -- symbol = "▏", - -- symbol = "│", - symbol = icons.ui.LineMiddle, - options = { try_as_border = true }, - }, - config = function(_, opts) - vim.api.nvim_create_autocmd("FileType", { - pattern = { "help", "alpha", "dashboard", "NvimTree", "Trouble", "lazy", "mason" }, - callback = function() - vim.b.miniindentscope_disable = true - end, - }) - require("mini.indentscope").setup(opts) - end, - }, - { - "hrsh7th/cmp-nvim-lua", - enabled = false, - }, - -- { - -- "gbprod/yanky.nvim", - -- event = "BufReadPre", - -- config = function() - -- require("user.yanky") - -- end, - -- }, - -- { - -- "is0n/jaq-nvim", - -- event = "BufRead", - -- config = function() - -- require("user.jaq") - -- end, - -- }, - -- better todo coloring and icon - -- { - -- "folke/todo-comments.nvim", - -- event = { "BufReadPost", "BufNewFile" }, - -- config = function() - -- require("todo-comments").setup() - -- end, - -- }, - -- mini scrollview - -- { - -- "karb94/neoscroll.nvim", - -- event = "BufRead", - -- config = function() - -- require("user.neoscroll") - -- end, - -- }, + --- masukan plugin tambahan disini + -- { + -- "folke/trouble.nvim", + -- event = "BufRead", + -- cmd = { "TroubleToggle", "Trouble" }, + -- opts = { use_diagnostic_signs = true }, + -- keys = { + -- { + -- "xx", + -- "TroubleToggle document_diagnostics", + -- desc = "Document Diagnostics (Trouble)", + -- }, + -- { + -- "xX", + -- "TroubleToggle workspace_diagnostics", + -- desc = "Workspace Diagnostics (Trouble)", + -- }, + -- }, + -- }, + -- { + -- "echasnovski/mini.indentscope", + -- version = false, -- wait till new 0.7.0 release to put it back on semver + -- event = "BufReadPre", + -- opts = { + -- -- symbol = "▏", + -- -- symbol = "│", + -- symbol = icons.ui.LineMiddle, + -- options = { try_as_border = true }, + -- }, + -- config = function(_, opts) + -- vim.api.nvim_create_autocmd("FileType", { + -- pattern = { "help", "alpha", "dashboard", "NvimTree", "Trouble", "lazy", "mason" }, + -- callback = function() + -- vim.b.miniindentscope_disable = true + -- end, + -- }) + -- require("mini.indentscope").setup(opts) + -- end, + -- }, + -- { + -- "hrsh7th/cmp-nvim-lua", + -- enabled = false, + -- }, + -- { + -- "gbprod/yanky.nvim", + -- event = "BufReadPre", + -- config = function() + -- require("user.yanky") + -- end, + -- }, + -- { + -- "is0n/jaq-nvim", + -- event = "BufRead", + -- config = function() + -- require("user.jaq") + -- end, + -- }, + -- better todo coloring and icon + -- { + -- "folke/todo-comments.nvim", + -- event = { "BufReadPost", "BufNewFile" }, + -- config = function() + -- require("todo-comments").setup() + -- end, + -- }, + -- mini scrollview + -- { + -- "karb94/neoscroll.nvim", + -- event = "BufRead", + -- config = function() + -- require("user.neoscroll") + -- end, + -- }, - -- { "ahmedkhalf/project.nvim", commit = "628de7e433dd503e782831fe150bb750e56e55d6", event = "VeryLazy" }, -- - -- additional plugins - -- makes some plugins dot-repeatable like leap - -- { "tpope/vim-repeat", event = "VeryLazy" }, - -- better diagnostics list and others - -- for markdown preview - -- make sure already install npm and yarn - -- { - -- "iamcco/markdown-preview.nvim", - -- event = "VeryLazy", - -- build = "cd app && npm install", - -- init = function() - -- vim.g.mkdp_filetypes = { "markdown" } - -- end, - -- ft = { "markdown" }, - -- cmd = { "MarkdownPreview", "MarkdownPreviewStop", "MarkdownPreviewToggle" }, - -- }, - -- for codeGPT - -- { - -- "jackMort/ChatGPT.nvim", - -- dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim" }, - -- lazy = true, - -- event = "VeryLazy", - -- -- opts = function() - -- -- require("user.chat_gpt") - -- -- end, - -- }, - -- indent detection - -- { - -- "Darazaki/indent-o-matic", - -- event = "VeryLazy", - -- opt = true, - -- cmd = { "IndentOMatic" }, - -- config = function() - -- require("user.indent-o-matic") - -- end, - -- }, - -- Khusus Projek laravel baru di buka - -- { - -- "adalessa/laravel.nvim", - -- dependencies = { - -- "nvim-telescope/telescope.nvim", - -- }, - -- cmd = { "Sail", "Artisan", "Composer" }, - -- keys = { - -- { "pa", ":Artisan" }, - -- }, - -- config = function() - -- require("laravel").setup() - -- require("telescope").load_extension("laravel") - -- end, - -- }, - -- -- - -- { - -- "barrett-ruth/live-server.nvim", - -- build = "yarn global add live-server", - -- config = true, - -- init = function() - -- require("live-server").setup({ - -- -- Arguments passed to live-server via `vim.fn.jobstart()` - -- -- Run `live-server --help` to see list of available options - -- -- For example, to use port 7000 and browser firefox: - -- args = { "--port=7000", "--browser=firefox" }, - -- --args = {}, - -- }) - -- end, - -- }, - -- for install lsp tidak support mason - -- { - -- "williamboman/nvim-lsp-installer", - -- event = "BufRead", - -- lazy = true, - -- config = function() - -- require("user.lsp.config") - -- end, - -- }, + -- { "ahmedkhalf/project.nvim", commit = "628de7e433dd503e782831fe150bb750e56e55d6", event = "VeryLazy" }, -- + -- additional plugins + -- makes some plugins dot-repeatable like leap + -- { "tpope/vim-repeat", event = "VeryLazy" }, + -- better diagnostics list and others + -- for markdown preview + -- make sure already install npm and yarn + -- { + -- "iamcco/markdown-preview.nvim", + -- event = "VeryLazy", + -- build = "cd app && npm install", + -- init = function() + -- vim.g.mkdp_filetypes = { "markdown" } + -- end, + -- ft = { "markdown" }, + -- cmd = { "MarkdownPreview", "MarkdownPreviewStop", "MarkdownPreviewToggle" }, + -- }, + -- for codeGPT + -- { + -- "jackMort/ChatGPT.nvim", + -- dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim" }, + -- lazy = true, + -- event = "VeryLazy", + -- -- opts = function() + -- -- require("user.chat_gpt") + -- -- end, + -- }, + -- indent detection + -- { + -- "Darazaki/indent-o-matic", + -- event = "VeryLazy", + -- opt = true, + -- cmd = { "IndentOMatic" }, + -- config = function() + -- require("user.indent-o-matic") + -- end, + -- }, + -- Khusus Projek laravel baru di buka + -- { + -- "adalessa/laravel.nvim", + -- dependencies = { + -- "nvim-telescope/telescope.nvim", + -- }, + -- cmd = { "Sail", "Artisan", "Composer" }, + -- keys = { + -- { "pa", ":Artisan" }, + -- }, + -- config = function() + -- require("laravel").setup() + -- require("telescope").load_extension("laravel") + -- end, + -- }, + -- -- + -- { + -- "barrett-ruth/live-server.nvim", + -- build = "yarn global add live-server", + -- config = true, + -- init = function() + -- require("live-server").setup({ + -- -- Arguments passed to live-server via `vim.fn.jobstart()` + -- -- Run `live-server --help` to see list of available options + -- -- For example, to use port 7000 and browser firefox: + -- args = { "--port=7000", "--browser=firefox" }, + -- --args = {}, + -- }) + -- end, + -- }, + -- for install lsp tidak support mason + -- { + -- "williamboman/nvim-lsp-installer", + -- event = "BufRead", + -- lazy = true, + -- config = function() + -- require("user.lsp.config") + -- end, + -- }, } diff --git a/lua/custom/plugins/juliana.lua b/lua/custom/plugins/juliana.lua deleted file mode 100644 index 11bc26b..0000000 --- a/lua/custom/plugins/juliana.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - -- "pojokcodeid/nvim-juliana", - -- lazy = false, - -- priority = 1000, - -- opts = {}, - -- config = function() - -- vim.api.nvim_create_autocmd("ColorScheme", { - -- pattern = "*", - -- callback = function() - -- -- get colors - -- local colors = require("nvim-juliana").colors() - -- -- custom hilights - -- local hi = vim.api.nvim_set_hl - -- hi(0, "FoldColumn", { bg = colors.bg2 }) - -- end, - -- }) - -- end, -} diff --git a/lua/custom/plugins/mini-animate.lua b/lua/custom/plugins/mini-animate.lua index b1b1b92..502a249 100644 --- a/lua/custom/plugins/mini-animate.lua +++ b/lua/custom/plugins/mini-animate.lua @@ -1,46 +1,46 @@ local is_neovide = false if vim.g.neovide then - is_neovide = true + is_neovide = true end return { - -- animations - { - "echasnovski/mini.animate", - event = "BufRead", - enabled = not is_neovide, - opts = function() - -- don't use animate when scrolling with the mouse - local mouse_scrolled = false - for _, scroll in ipairs({ "Up", "Down" }) do - local key = "" - vim.keymap.set({ "", "i" }, key, function() - mouse_scrolled = true - return key - end, { expr = true }) - end - - local animate = require("mini.animate") - return { - resize = { - timing = animate.gen_timing.linear({ duration = 100, unit = "total" }), - }, - scroll = { - timing = animate.gen_timing.linear({ duration = 150, unit = "total" }), - subscroll = animate.gen_subscroll.equal({ - predicate = function(total_scroll) - if mouse_scrolled then - mouse_scrolled = false - return false - end - return total_scroll > 1 - end, - }), - }, - } - end, - config = function(_, opts) - require("mini.animate").setup(opts) - end, - }, + -- animations + -- { + -- "echasnovski/mini.animate", + -- event = "BufRead", + -- enabled = not is_neovide, + -- opts = function() + -- -- don't use animate when scrolling with the mouse + -- local mouse_scrolled = false + -- for _, scroll in ipairs({ "Up", "Down" }) do + -- local key = "" + -- vim.keymap.set({ "", "i" }, key, function() + -- mouse_scrolled = true + -- return key + -- end, { expr = true }) + -- end + -- + -- local animate = require("mini.animate") + -- return { + -- resize = { + -- timing = animate.gen_timing.linear({ duration = 100, unit = "total" }), + -- }, + -- scroll = { + -- timing = animate.gen_timing.linear({ duration = 150, unit = "total" }), + -- subscroll = animate.gen_subscroll.equal({ + -- predicate = function(total_scroll) + -- if mouse_scrolled then + -- mouse_scrolled = false + -- return false + -- end + -- return total_scroll > 1 + -- end, + -- }), + -- }, + -- } + -- end, + -- config = function(_, opts) + -- require("mini.animate").setup(opts) + -- end, + -- }, } diff --git a/lua/custom/plugins/nvimufo.lua b/lua/custom/plugins/nvimufo.lua index f3af38f..ec0abef 100644 --- a/lua/custom/plugins/nvimufo.lua +++ b/lua/custom/plugins/nvimufo.lua @@ -1,335 +1,335 @@ function TABLE_CONTAINS(tbl, x) - local found = false - for _, v in pairs(tbl) do - if v == x then - found = true - end - end - return found + local found = false + for _, v in pairs(tbl) do + if v == x then + found = true + end + end + return found end local icons = vim.g.pcode_icons.folding 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, " " }, - text = { builtin.foldfunc }, - condition = { builtin.not_empty, true, builtin.not_empty }, - click = "v:lua.ScFa", - }, - { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" }, - -- { text = { builtin.lnumfunc }, click = "v:lua.ScLa" }, - }, - }) - end, - }, - }, - enabled = true, - lazy = true, - -- event = "BufReadPost", - -- event = { "BufReadPost", "BufRead", "InsertEnter", "BufNewFile" }, - event = "VeryLazy", - 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:]] - -- 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:]] - -- vim.o.fillchars = [[eob: ,fold: ,foldopen:▾,foldsep:│,foldclose:▸]] - vim.opt.fillchars = { - vert = icons.vert, - fold = icons.fold, - eob = icons.eob, - diff = icons.diff, - msgsep = icons.msgsep, - foldopen = icons.foldopen, - foldsep = icons.foldsep, - foldclose = icons.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")) - -- vim.cmd("highlight FoldColumn guifg=" .. vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID("IblIndent")), "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, - close_fold_kinds_for_ft = { - default = { "imports", "comment" }, - json = { "array" }, - c = { "comment", "region" }, - }, - preview = { - win_config = { - border = { "", "─", "", "", "", "─", "", "" }, - -- winhighlight = 'Normal:Normal', - -- winhighlight = 'IncSearch:Folded', - winhighlight = "Normal:UfoPreviewNormal,FloatBorder:UfoPreviewBorder,CursorLine:UfoPreviewCursorLine", - winblend = 0, - }, - mappings = { - scrollU = "", - scrollD = "", - 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" }) - if vim.bo.filetype ~= "json" then - table.insert(result, { suffix, "TSPunctBracket" }) - end - return result - end, - })]] - -- - - -- start ini bagian code support comment dan import - local ftMap = { - vim = "indent", - python = { "indent" }, - git = "", - -- javascriptreact = { "treesitter", "indent" }, - -- typescriptreact = { "treesitter", "indent" }, - } - - local function customizeSelector(bufnr) - local function handleFallbackException(err, providerName) - if type(err) == "string" and err:match("UfoFallbackException") then - return require("ufo").getFolds(bufnr, providerName) - else - return require("promise").reject(err) - end - end - - return require("ufo") - .getFolds(bufnr, "lsp") - :catch(function(err) - return handleFallbackException(err, "treesitter") - end) - :catch(function(err) - return handleFallbackException(err, "indent") - end) - end - - require("ufo").setup({ - open_fold_hl_timeout = 150, - close_fold_kinds_for_ft = { - -- default = { "imports", "comment" }, - -- json = { "array" }, - -- c = { "comment", "region" }, - }, - preview = { - win_config = { - border = { "", "─", "", "", "", "─", "", "" }, - winhighlight = "Normal:Folded", - winblend = 0, - }, - mappings = { - scrollU = "", - scrollD = "", - jumpTop = "[", - jumpBot = "]", - }, - }, - provider_selector = function(bufnr, filetype, buftype) - -- if you prefer treesitter provider rather than lsp, - -- return ftMap[filetype] - -- return ftMap[filetype] or {'treesitter', 'indent'} - return ftMap[filetype] or customizeSelector - - -- refer to ./doc/example.lua for detail - end, - - fold_virt_text_handler = function(virt_text, lnum, end_lnum, width, truncate) - local result = {} - local closed_fold_text = "comments ..." -- Teks yang ingin ditampilkan - local import_fold_text = "import ..." -- Teks yang ingin ditampilkan - local is_comment = false -- Variabel untuk mengecek apakah ini komentar - local is_import = false - local is_bracket = false - - -- Memeriksa apakah baris awal dari fold adalah komentar - local start_line = vim.api.nvim_buf_get_lines(0, lnum - 1, lnum, false)[1] - -- cari comentar dengan awalan /* untuk generaal comment - if start_line:find("^%s*%/%*") then - is_comment = true - -- cara commentar dengan awalan