From 384c0b5768293b3f27192bd42e4739e26e31c37f Mon Sep 17 00:00:00 2001 From: "asep.komarudin" Date: Fri, 14 Jun 2024 08:40:35 +0700 Subject: [PATCH] enc: lua format custem --- lua/_vscode/functions.lua | 160 ++++++------ lua/_vscode/mappings.lua | 4 +- lua/config/lazy_lib.lua | 8 +- lua/custom/autocmd.lua | 6 +- lua/custom/dashboard.lua | 10 +- lua/custom/null-ls.lua | 10 +- lua/plugins/_default.lua | 8 +- lua/plugins/alpha.lua | 2 +- lua/plugins/breadcrumb.lua | 4 +- lua/plugins/bufferline.lua | 4 +- lua/plugins/cmp.lua | 18 +- lua/plugins/cmp_cmdline.lua | 296 ++++++++++----------- lua/plugins/coderunner.lua | 84 +++--- lua/plugins/colorizer.lua | 46 ++-- lua/plugins/comment.lua | 20 +- lua/plugins/dap.lua | 40 +-- lua/plugins/database.lua | 6 +- lua/plugins/dressing.lua | 64 ++--- lua/plugins/gitsigns.lua | 144 +++++------ lua/plugins/indentblankline.lua | 74 +++--- lua/plugins/lsp.lua | 92 +++---- lua/plugins/lspprogress.lua | 8 +- lua/plugins/lualine.lua | 8 +- lua/plugins/mini-animate.lua | 12 +- lua/plugins/neoscroll.lua | 2 +- lua/plugins/notify.lua | 6 +- lua/plugins/nvimtree.lua | 2 +- lua/plugins/nvimufo.lua | 24 +- lua/plugins/plenary.lua | 4 +- lua/plugins/rainbowdelimiter.lua | 2 +- lua/plugins/scrollview.lua | 22 +- lua/plugins/smartsplit.lua | 38 +-- lua/plugins/snippets.lua | 36 +-- lua/plugins/telescope.lua | 2 +- lua/plugins/toggleterm.lua | 94 +++---- lua/plugins/transparant.lua | 24 +- lua/plugins/treesitter.lua | 372 +++++++++++++-------------- lua/plugins/vertcolumn.lua | 4 +- lua/plugins/webdevicon.lua | 38 +-- lua/plugins/whichkey.lua | 202 +++++++-------- lua/plugins/yanky.lua | 34 +-- lua/user/alpha.lua | 36 +-- lua/user/breadcrumb.lua | 82 +++--- lua/user/catppuccin.lua | 88 +++---- lua/user/chat_gpt.lua | 4 +- lua/user/colorscheme.lua | 2 +- lua/user/dapui.lua | 118 ++++----- lua/user/dashboard.lua | 6 +- lua/user/format_onsave.lua | 10 +- lua/user/functions.lua | 4 +- lua/user/impatient.lua | 2 +- lua/user/jaq.lua | 120 ++++----- lua/user/keymaps.lua | 6 +- lua/user/mason-null-ls.lua | 12 +- lua/user/mason_dap.lua | 20 +- lua/user/options.lua | 8 +- lua/user/snippets.lua | 4 +- lua/user/startify.lua | 8 +- lua/user/tokyonight.lua | 114 ++++---- lua/user/tokyonight_transparant.lua | 70 ++--- lua/user/utils/bufferline.lua | 70 ++--- lua/user/utils/formatter.lua | 6 +- lua/user/utils/linter.lua | 16 +- lua/user/utils/lsp.lua | 20 +- lua/user/utils/lualine_component.lua | 8 +- lua/user/utils/lualine_template.lua | 2 +- lua/user/utils/whichkey.lua | 18 +- lua/user/winbar.lua | 12 +- 68 files changed, 1450 insertions(+), 1450 deletions(-) diff --git a/lua/_vscode/functions.lua b/lua/_vscode/functions.lua index 4e67a5b..b2fbb16 100644 --- a/lua/_vscode/functions.lua +++ b/lua/_vscode/functions.lua @@ -1,265 +1,265 @@ function Active_whichkey() - VSCodeNotify("whichkey.show") + VSCodeNotify("whichkey.show") end function Top_screen() - Cmd("call 3_reveal('top', 0)") + Cmd("call 3_reveal('top', 0)") end function Bottom_screen() - Cmd("call 3_reveal('bottom', 0)") + Cmd("call 3_reveal('bottom', 0)") end function Move_to_top_screen() - Cmd("call 3_moveCursor('top')") + Cmd("call 3_moveCursor('top')") end function Move_to_bottom_screen() - Cmd("call 3_moveCursor('bottom')") + Cmd("call 3_moveCursor('bottom')") end function Scroll_line_down() - VSCodeCall("scrollLineDown") + VSCodeCall("scrollLineDown") end function Scroll_line_up() - VSCodeCall("scrollLineUp") + VSCodeCall("scrollLineUp") end function Vscode_ctrl_d() - VSCodeNotify("vscode-neovim.ctrl-d") + VSCodeNotify("vscode-neovim.ctrl-d") end function Vscode_ctrl_u() - VSCodeNotify("vscode-neovim.ctrl-u") + VSCodeNotify("vscode-neovim.ctrl-u") end function Move_to_bottom_screen__center_screen() - Move_to_bottom_screen() - Center_screen() + Move_to_bottom_screen() + Center_screen() end function Move_to_top_screen__center_screen() - Move_to_top_screen() - Center_screen() + Move_to_top_screen() + Center_screen() end function Trim_trailing_whitespace() - VSCodeCall("editor.action.trimTrailingWhitespace") + VSCodeCall("editor.action.trimTrailingWhitespace") end function Save() - VSCodeCall("workbench.action.files.save") + VSCodeCall("workbench.action.files.save") end function Save_no_format() - VSCodeCall("workbench.action.files.saveWithoutFormatting") + VSCodeCall("workbench.action.files.saveWithoutFormatting") end function Trim__save__no_format() - Trim_trailing_whitespace() - Save_no_format() + Trim_trailing_whitespace() + Save_no_format() end function Trim__save__no_highlight() - Trim_trailing_whitespace() - Save() - Remove_highlighting() + Trim_trailing_whitespace() + Save() + Remove_highlighting() end function Format() - VSCodeCall("editor.action.formatDocument") - print("formatted!") + VSCodeCall("editor.action.formatDocument") + print("formatted!") end function Trim__save__format() - Trim_trailing_whitespace() - Format() - Save() + Trim_trailing_whitespace() + Format() + Save() end function Reveal_definition_aside() - VSCodeNotify("editor.action.revealDefinitionAside") + VSCodeNotify("editor.action.revealDefinitionAside") end function Go_to_implementation() - VSCodeNotify("editor.action.goToImplementation") + VSCodeNotify("editor.action.goToImplementation") end function Go_to_reference() - VSCodeNotify("editor.action.goToReferences") + VSCodeNotify("editor.action.goToReferences") end function Rename_symbol() - VSCodeNotify("editor.action.rename") + VSCodeNotify("editor.action.rename") end function Outdent() - ---@diagnostic disable-next-line: unused-local - for i = 1, vim.v.count1 do - VSCodeNotify("editor.action.outdentLines") - end + ---@diagnostic disable-next-line: unused-local + for i = 1, vim.v.count1 do + VSCodeNotify("editor.action.outdentLines") + end end function Indent() - ---@diagnostic disable-next-line: unused-local - for i = 1, vim.v.count1 do - VSCodeNotify("editor.action.indentLines") - end + ---@diagnostic disable-next-line: unused-local + for i = 1, vim.v.count1 do + VSCodeNotify("editor.action.indentLines") + end end function Outdent_vis() - VSCodeNotify("editor.action.outdentLines", false) + VSCodeNotify("editor.action.outdentLines", false) end function Indent_vis() - VSCodeNotify("editor.action.indentLines", false) + VSCodeNotify("editor.action.indentLines", false) end function Comment() - VSCodeNotify("editor.action.commentLine") + VSCodeNotify("editor.action.commentLine") end function Convert_to_spaces() - VSCodeNotify("editor.action.indentationToSpaces") + VSCodeNotify("editor.action.indentationToSpaces") end function Convert_to_tabs() - VSCodeNotify("editor.action.indentationToTabs") + VSCodeNotify("editor.action.indentationToTabs") end function Indent_with_spaces() - VSCodeNotify("editor.action.indentUsingSpaces") + VSCodeNotify("editor.action.indentUsingSpaces") end function Indent_with_tabs() - VSCodeNotify("editor.action.indentUsingTabs") + VSCodeNotify("editor.action.indentUsingTabs") end function CloseEditor() - VSCodeNotify("workbench.action.closeActiveEditor") + VSCodeNotify("workbench.action.closeActiveEditor") end function UndoCloseEditor() - VSCodeNotify("workbench.action.reopenClosedEditor") + VSCodeNotify("workbench.action.reopenClosedEditor") end function Git_stage_file() - Trim_trailing_whitespace() - Save() - VSCodeNotify("git.stage") + Trim_trailing_whitespace() + Save() + VSCodeNotify("git.stage") end function Git_unstage_file() - Save() - VSCodeNotify("git.unstage") + Save() + VSCodeNotify("git.unstage") end function Git_revert_change() - VSCodeNotify("git.revertSelectedRanges") + VSCodeNotify("git.revertSelectedRanges") end function Git_stage_change() - VSCodeNotify("git.stageSelectedRanges") + VSCodeNotify("git.stageSelectedRanges") end function Git_unstage_change() - VSCodeNotify("git.unstageSelectedRanges") + VSCodeNotify("git.unstageSelectedRanges") end function Git_open_changes() - VSCodeNotify("git.openChange") + VSCodeNotify("git.openChange") end function Git_open_all_changes() - VSCodeNotify("git.openAllChanges") + VSCodeNotify("git.openAllChanges") end function Accept_merge_both() - VSCodeNotify("merge-conflict.accept.both") + VSCodeNotify("merge-conflict.accept.both") end function Accept_merge_all_both() - VSCodeNotify("merge-conflict.accept.all-both") + VSCodeNotify("merge-conflict.accept.all-both") end function Accept_merge_current() - VSCodeNotify("merge-conflict.accept.current") + VSCodeNotify("merge-conflict.accept.current") end function Accept_merge_all_current() - VSCodeNotify("merge-conflict.accept.all-current") + VSCodeNotify("merge-conflict.accept.all-current") end function Accept_merge_incoming() - VSCodeNotify("merge-conflict.accept.incoming") + VSCodeNotify("merge-conflict.accept.incoming") end function Accept_merge_all_incoming() - VSCodeNotify("merge-conflict.accept.all-incoming") + VSCodeNotify("merge-conflict.accept.all-incoming") end function Accept_merge_selection() - VSCodeNotify("merge-conflict.accept.selection") + VSCodeNotify("merge-conflict.accept.selection") end function Codesnap() - VSCodeNotify("codesnap.start", true) + VSCodeNotify("codesnap.start", true) end function Comment_vis() - VSCodeNotify("editor.action.commentLine", false) + VSCodeNotify("editor.action.commentLine", false) end function Toggle_breakpoint() - VSCodeNotify("editor.debug.action.toggleBreakpoint") + VSCodeNotify("editor.debug.action.toggleBreakpoint") end function Copy_path() - VSCodeNotify("copyFilePath") + VSCodeNotify("copyFilePath") end function Copy_relative_path() - VSCodeNotify("copyRelativeFilePath") + VSCodeNotify("copyRelativeFilePath") end function Active_whichkey() - VSCodeNotify("whichkey.show") + VSCodeNotify("whichkey.show") end function Navigation_down() - VSCodeNotify("workbench.action.navigateDown") + VSCodeNotify("workbench.action.navigateDown") end function Navigation_up() - VSCodeNotify("workbench.action.navigateUp") + VSCodeNotify("workbench.action.navigateUp") end function Navigation_left() - VSCodeNotify("workbench.action.navigateLeft") + VSCodeNotify("workbench.action.navigateLeft") end function Navigation_right() - VSCodeNotify("workbench.action.navigateRight") + VSCodeNotify("workbench.action.navigateRight") end function Select_all() - VSCodeNotify("editor.action.selectAll") + VSCodeNotify("editor.action.selectAll") end function Copy_clipboard() - VSCodeNotify("editor.action.clipboardCopyAction") + VSCodeNotify("editor.action.clipboardCopyAction") end function Paste_clipboard() - VSCodeNotify("editor.action.clipboardPasteAction") + VSCodeNotify("editor.action.clipboardPasteAction") end function Save() - VSCodeNotify("workbench.action.files.save") - VSCodeNotify("workbench.action.files.saveAll") + VSCodeNotify("workbench.action.files.save") + VSCodeNotify("workbench.action.files.saveAll") end function Close() - VSCodeNotify("workbench.action.closeActiveEditor") + VSCodeNotify("workbench.action.closeActiveEditor") end diff --git a/lua/_vscode/mappings.lua b/lua/_vscode/mappings.lua index 7f1b6c6..4b6f0cf 100644 --- a/lua/_vscode/mappings.lua +++ b/lua/_vscode/mappings.lua @@ -47,7 +47,7 @@ Map({ "n", "v" }, "zj", Git_stage_change) -- Map({ "n", "v" }, "zb", Vscode_ctrl_u) vim.api.nvim_exec( - [[ + [[ " THEME CHANGER function! SetCursorLineNrColorInsert(mode) " Insert mode: blue @@ -70,5 +70,5 @@ vim.api.nvim_exec( autocmd ModeChanged [vV\x16]*:* call VSCodeNotify('nvim-theme.normal') augroup END ]], - false + false ) diff --git a/lua/config/lazy_lib.lua b/lua/config/lazy_lib.lua index f96738e..4b5ad4b 100644 --- a/lua/config/lazy_lib.lua +++ b/lua/config/lazy_lib.lua @@ -1,4 +1,4 @@ -local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then -- bootstrap lazy.nvim -- stylua: ignore @@ -15,8 +15,8 @@ local icons = require("user.icons").ui vim.opt.rtp:prepend(vim.env.LAZY or lazypath) vim.g.mapleader = " " vim.g.maplocalleader = " " -vim.diagnostic.config { virtual_lines = false } -require("lazy").setup { +vim.diagnostic.config({ virtual_lines = false }) +require("lazy").setup({ spec = { { import = "plugins.themes" }, { import = "plugins" }, @@ -57,4 +57,4 @@ require("lazy").setup { }, }, }, -} +}) diff --git a/lua/custom/autocmd.lua b/lua/custom/autocmd.lua index 21da11f..1157549 100644 --- a/lua/custom/autocmd.lua +++ b/lua/custom/autocmd.lua @@ -1,8 +1,8 @@ local transparent_mode = pcode.transparent_mode or 0 if transparent_mode ~= nil then if transparent_mode == 1 then - vim.cmd "TransparentDisable" - vim.cmd "TransparentEnable" + vim.cmd("TransparentDisable") + vim.cmd("TransparentEnable") end end @@ -12,7 +12,7 @@ local _get_folder_name = function() return " " .. str:lower():gsub("^%l", string.upper) .. " " end -local term_program = vim.fn.getenv "TERM_PROGRAM" +local term_program = vim.fn.getenv("TERM_PROGRAM") if term_program == "WezTerm" then -- vim.cmd('silent !wezterm cli set-tab-title "' .. _get_folder_name() .. '"') -- create autocmd on insertEnter diff --git a/lua/custom/dashboard.lua b/lua/custom/dashboard.lua index 79e9a1d..5f7a993 100644 --- a/lua/custom/dashboard.lua +++ b/lua/custom/dashboard.lua @@ -3,11 +3,11 @@ -- 2. Ubah dashboard sesuai keinginan dan kebutuhan vim.g.pcode_header1 = { - [[ _ __ __ ]], - [[ ___ ___ (____ / /__ _______ ___/ ___ ]], - [[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]], - [[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]], - [[ /_/ |___/ ]], + [[ _ __ __ ]], + [[ ___ ___ (____ / /__ _______ ___/ ___ ]], + [[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]], + [[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]], + [[ /_/ |___/ ]], } -- vim.g.pcode_header2 = { diff --git a/lua/custom/null-ls.lua b/lua/custom/null-ls.lua index b2ee400..3e33eba 100644 --- a/lua/custom/null-ls.lua +++ b/lua/custom/null-ls.lua @@ -2,10 +2,10 @@ local null_ls = require("null-ls") local formatting = null_ls.builtins.formatting local diagnostics = null_ls.builtins.diagnostics local m = { - sources = { - formatting.stylua, -- tambahkan di bawah sini - --diagnostics.flake8, -- tambahkan di bawah sini - --formatting.blade_formatter.with({ filetypes = { "blade", "php" } }), - }, + sources = { + formatting.stylua, -- tambahkan di bawah sini + --diagnostics.flake8, -- tambahkan di bawah sini + --formatting.blade_formatter.with({ filetypes = { "blade", "php" } }), + }, } return m diff --git a/lua/plugins/_default.lua b/lua/plugins/_default.lua index 52e853e..50e9b82 100644 --- a/lua/plugins/_default.lua +++ b/lua/plugins/_default.lua @@ -1,6 +1,6 @@ local opts, _ = pcall(require, "user.options") if opts then - require "user.options" + require("user.options") end -- local key, _ = pcall(require, "user.keymaps") -- if key then @@ -8,11 +8,11 @@ end -- end local cmd, _ = pcall(require, "user.autocommands") if cmd then - require "user.autocommands" + require("user.autocommands") end local onsave, _ = pcall(require, "user.format_onsave") if onsave then - require "user.format_onsave" + require("user.format_onsave") end -vim.g.pcode_icons = require "user.icons" +vim.g.pcode_icons = require("user.icons") return {} diff --git a/lua/plugins/alpha.lua b/lua/plugins/alpha.lua index 927a7d6..bcf77d9 100644 --- a/lua/plugins/alpha.lua +++ b/lua/plugins/alpha.lua @@ -5,7 +5,7 @@ return { lazy = true, event = "VimEnter", config = function() - require "user.alpha" + require("user.alpha") end, }, } diff --git a/lua/plugins/breadcrumb.lua b/lua/plugins/breadcrumb.lua index 1919118..6fd285a 100644 --- a/lua/plugins/breadcrumb.lua +++ b/lua/plugins/breadcrumb.lua @@ -4,7 +4,7 @@ return { dependencies = "neovim/nvim-lspconfig", event = "InsertEnter", config = function() - require "user.breadcrumb" - require "user.winbar" + require("user.breadcrumb") + require("user.winbar") end, } diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua index 65ede75..97d8d3d 100644 --- a/lua/plugins/bufferline.lua +++ b/lua/plugins/bufferline.lua @@ -38,7 +38,7 @@ return { vim.opt.termguicolors = true - bufferline.setup { + bufferline.setup({ options = { color_icons = true, numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, @@ -174,6 +174,6 @@ return { bg = { attribute = "bg", highlight = "Normal" }, }, }, - } + }) end, } diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 6aa7d92..eac57ee 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -18,12 +18,12 @@ return { version = false, -- last release is way too old event = "InsertEnter", opts = function() - local cmp = require "cmp" - local luasnip = require "luasnip" + local cmp = require("cmp") + local luasnip = require("luasnip") local check_backspace = function() - local col = vim.fn.col "." - 1 - return col == 0 or vim.fn.getline("."):sub(col, col):match "%s" + local col = vim.fn.col(".") - 1 + return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") end return { @@ -35,12 +35,12 @@ return { require("luasnip").lsp_expand(args.body) end, }, - mapping = cmp.mapping.preset.insert { + mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.scroll_docs(4), [""] = cmp.mapping.complete(), [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm { select = true }, -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() @@ -69,14 +69,14 @@ return { "i", "s", }), - }, - sources = cmp.config.sources { + }), + sources = cmp.config.sources({ { name = "nvim_lsp" }, { name = "luasnip" }, { name = "buffer" }, { name = "path" }, { name = "nvim_lua" }, - }, + }), formatting = { fields = { "kind", "abbr", "menu" }, format = function(entry, vim_item) diff --git a/lua/plugins/cmp_cmdline.lua b/lua/plugins/cmp_cmdline.lua index 780f8a2..c67800c 100644 --- a/lua/plugins/cmp_cmdline.lua +++ b/lua/plugins/cmp_cmdline.lua @@ -1,152 +1,152 @@ return { - -- for auto complate commond mode - -- { - -- "gelguy/wilder.nvim", - -- lazy = true, - -- event = "VeryLazy", - -- config = function() - -- local wilder = require("wilder") - -- wilder.setup({ modes = { ":", "/", "?" } }) - -- wilder.set_option( - -- "renderer", - -- wilder.popupmenu_renderer({ - -- highlighter = wilder.basic_highlighter(), - -- left = { " ", wilder.popupmenu_devicons() }, - -- right = { " ", wilder.popupmenu_scrollbar() }, - -- }) - -- ) - -- end, - -- }, - { - "folke/noice.nvim", - lazy = true, - enabled = true, - dependencies = { - { "MunifTanjim/nui.nvim" }, - }, - -- event = "BufWinEnter", - event = "VeryLazy", - opts = { - messages = { - enabled = false, - }, - notify = { - enabled = false, - }, - lsp = { - progress = { - enabled = false, - }, - hover = { - enabled = false, - }, - signature = { - enabled = false, - }, - }, - }, - keys = { - { - "", - function() - require("noice").redirect(vim.fn.getcmdline()) - end, - mode = "c", - desc = "Redirect Cmdline", - }, - { - "snl", - function() - require("noice").cmd("last") - end, - desc = "Noice Last Message", - }, - { - "snh", - function() - require("noice").cmd("history") - end, - desc = "Noice History", - }, - { - "sna", - function() - require("noice").cmd("all") - end, - desc = "Noice All", - }, - { - "", - function() - if not require("noice.lsp").scroll(4) then - return "" - end - end, - silent = true, - expr = true, - desc = "Scroll forward", - mode = { "i", "n", "s" }, - }, - { - "", - function() - if not require("noice.lsp").scroll(-4) then - return "" - end - end, - silent = true, - expr = true, - desc = "Scroll backward", - mode = { "i", "n", "s" }, - }, - }, - }, - { - "hrsh7th/cmp-cmdline", - event = "VeryLazy", - config = function() - local cmp = require("cmp") - local mapping = { - [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), - [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), - } + -- for auto complate commond mode + -- { + -- "gelguy/wilder.nvim", + -- lazy = true, + -- event = "VeryLazy", + -- config = function() + -- local wilder = require("wilder") + -- wilder.setup({ modes = { ":", "/", "?" } }) + -- wilder.set_option( + -- "renderer", + -- wilder.popupmenu_renderer({ + -- highlighter = wilder.basic_highlighter(), + -- left = { " ", wilder.popupmenu_devicons() }, + -- right = { " ", wilder.popupmenu_scrollbar() }, + -- }) + -- ) + -- end, + -- }, + { + "folke/noice.nvim", + lazy = true, + enabled = true, + dependencies = { + { "MunifTanjim/nui.nvim" }, + }, + -- event = "BufWinEnter", + event = "VeryLazy", + opts = { + messages = { + enabled = false, + }, + notify = { + enabled = false, + }, + lsp = { + progress = { + enabled = false, + }, + hover = { + enabled = false, + }, + signature = { + enabled = false, + }, + }, + }, + keys = { + { + "", + function() + require("noice").redirect(vim.fn.getcmdline()) + end, + mode = "c", + desc = "Redirect Cmdline", + }, + { + "snl", + function() + require("noice").cmd("last") + end, + desc = "Noice Last Message", + }, + { + "snh", + function() + require("noice").cmd("history") + end, + desc = "Noice History", + }, + { + "sna", + function() + require("noice").cmd("all") + end, + desc = "Noice All", + }, + { + "", + function() + if not require("noice.lsp").scroll(4) then + return "" + end + end, + silent = true, + expr = true, + desc = "Scroll forward", + mode = { "i", "n", "s" }, + }, + { + "", + function() + if not require("noice.lsp").scroll(-4) then + return "" + end + end, + silent = true, + expr = true, + desc = "Scroll backward", + mode = { "i", "n", "s" }, + }, + }, + }, + { + "hrsh7th/cmp-cmdline", + event = "VeryLazy", + config = function() + local cmp = require("cmp") + local mapping = { + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), + [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), + } - -- Use buffer source for `/`. - cmp.setup.cmdline("/", { - preselect = "none", - completion = { - completeopt = "menu,preview,menuone,noselect", - }, - mapping = mapping, - sources = { - { name = "buffer" }, - }, - experimental = { - ghost_text = true, - native_menu = false, - }, - }) + -- Use buffer source for `/`. + cmp.setup.cmdline("/", { + preselect = "none", + completion = { + completeopt = "menu,preview,menuone,noselect", + }, + mapping = mapping, + sources = { + { name = "buffer" }, + }, + experimental = { + ghost_text = true, + native_menu = false, + }, + }) - -- Use cmdline & path source for ':'. - cmp.setup.cmdline(":", { - preselect = "none", - completion = { - completeopt = "menu,preview,menuone,noselect", - }, - mapping = mapping, - sources = cmp.config.sources({ - { name = "path" }, - }, { - { name = "cmdline" }, - }), - experimental = { - ghost_text = true, - native_menu = false, - }, - }) - end, - }, + -- Use cmdline & path source for ':'. + cmp.setup.cmdline(":", { + preselect = "none", + completion = { + completeopt = "menu,preview,menuone,noselect", + }, + mapping = mapping, + sources = cmp.config.sources({ + { name = "path" }, + }, { + { name = "cmdline" }, + }), + experimental = { + ghost_text = true, + native_menu = false, + }, + }) + end, + }, } diff --git a/lua/plugins/coderunner.lua b/lua/plugins/coderunner.lua index dca10e3..f079ef9 100644 --- a/lua/plugins/coderunner.lua +++ b/lua/plugins/coderunner.lua @@ -1,54 +1,54 @@ --typescript = "deno run", -- cpp="gcc $fileName -lstdc++ -o $fileNameWithoutExt && $fileNameWithoutExt" local rfile = { - java = "cd $dir && javac $fileName && java $fileNameWithoutExt", - python = "python3 -u", - typescript = "ts-node $dir/$fileName", - rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt", - cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt", - scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css", - javascript = 'node "$dir/$fileName"', + java = "cd $dir && javac $fileName && java $fileNameWithoutExt", + python = "python3 -u", + typescript = "ts-node $dir/$fileName", + rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt", + cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt", + scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css", + javascript = 'node "$dir/$fileName"', } local runscript = pcode.coderunner or {} rfile = vim.tbl_deep_extend("force", runscript, rfile) return { - "CRAG666/code_runner.nvim", - lazy = true, - cmd = { "RunCode", "RunFile", "RunProject", "RunClose" }, - opts = { - -- put here the commands by filetype - filetype = rfile, - -- mode = "term", - mode = "float", - focus = true, - startinsert = true, - term = { - --position = "vert", - position = "bot", - size = 50, - }, - float = { - -- Key that close the code_runner floating window - close_key = "", - -- Window border (see ':h nvim_open_win') - border = "rounded", + "CRAG666/code_runner.nvim", + lazy = true, + cmd = { "RunCode", "RunFile", "RunProject", "RunClose" }, + opts = { + -- put here the commands by filetype + filetype = rfile, + -- mode = "term", + mode = "float", + focus = true, + startinsert = true, + term = { + --position = "vert", + position = "bot", + size = 50, + }, + float = { + -- Key that close the code_runner floating window + close_key = "", + -- Window border (see ':h nvim_open_win') + border = "rounded", - -- Num from `0 - 1` for measurements - height = 0.8, - width = 0.8, - x = 0.5, - y = 0.5, + -- Num from `0 - 1` for measurements + height = 0.8, + width = 0.8, + x = 0.5, + y = 0.5, - -- Highlight group for floating window/border (see ':h winhl') - border_hl = "FloatBorder", - float_hl = "Normal", + -- Highlight group for floating window/border (see ':h winhl') + border_hl = "FloatBorder", + float_hl = "Normal", - -- Transparency (see ':h winblend') - blend = 0, - }, - }, - config = function(_, opts) - require("code_runner").setup(opts) - end, + -- Transparency (see ':h winblend') + blend = 0, + }, + }, + config = function(_, opts) + require("code_runner").setup(opts) + end, } diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua index eacd2b1..850a9e1 100644 --- a/lua/plugins/colorizer.lua +++ b/lua/plugins/colorizer.lua @@ -1,25 +1,25 @@ return { - "NvChad/nvim-colorizer.lua", - lazy = true, - event = { "BufRead", "InsertEnter", "BufNewFile" }, - opts = { - user_default_options = { - RGB = true, -- #RGB hex codes - RRGGBB = true, -- #RRGGBB hex codes - names = true, -- "Name" codes like Blue - RRGGBBAA = true, -- #RRGGBBAA hex codes - rgb_fn = true, -- CSS rgb() and rgba() functions - hsl_fn = true, -- CSS hsl() and hsla() functions - css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB - css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn - -- Available modes: foreground, background - mode = "background", -- Set the display mode. - tailwind = true, - }, - filetypes = { - "*", -- Highlight all files, but customize some others. - css = { rgb_fn = true }, -- Enable parsing rgb(...) functions in css. - html = { names = false }, -- Disable parsing "names" like Blue or Gray - }, - }, + "NvChad/nvim-colorizer.lua", + lazy = true, + event = { "BufRead", "InsertEnter", "BufNewFile" }, + opts = { + user_default_options = { + RGB = true, -- #RGB hex codes + RRGGBB = true, -- #RRGGBB hex codes + names = true, -- "Name" codes like Blue + RRGGBBAA = true, -- #RRGGBBAA hex codes + rgb_fn = true, -- CSS rgb() and rgba() functions + hsl_fn = true, -- CSS hsl() and hsla() functions + css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn + -- Available modes: foreground, background + mode = "background", -- Set the display mode. + tailwind = true, + }, + filetypes = { + "*", -- Highlight all files, but customize some others. + css = { rgb_fn = true }, -- Enable parsing rgb(...) functions in css. + html = { names = false }, -- Disable parsing "names" like Blue or Gray + }, + }, } diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua index 00ba463..6d37cbe 100644 --- a/lua/plugins/comment.lua +++ b/lua/plugins/comment.lua @@ -1,12 +1,12 @@ return { - "numToStr/Comment.nvim", - lazy = true, - opts = function() - return { - pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), - } - end, - config = function(_, opts) - require("Comment").setup(opts) - end, + "numToStr/Comment.nvim", + lazy = true, + opts = function() + return { + pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), + } + end, + config = function(_, opts) + require("Comment").setup(opts) + end, } diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua index d260a1c..501692a 100644 --- a/lua/plugins/dap.lua +++ b/lua/plugins/dap.lua @@ -1,22 +1,22 @@ return { - { - "rcarriga/nvim-dap-ui", - lazy = true, - event = "BufRead", - dependencies = "mfussenegger/nvim-dap", - enabled = vim.fn.has("win32") == 0, - config = function() - require("user.dapui") - end, - }, - { - "jay-babu/mason-nvim-dap.nvim", - lazy = true, - event = "BufRead", - dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" }, - enabled = vim.fn.has("win32") == 0, - config = function() - require("user.mason_dap") - end, - }, + { + "rcarriga/nvim-dap-ui", + lazy = true, + event = "BufRead", + dependencies = "mfussenegger/nvim-dap", + enabled = vim.fn.has("win32") == 0, + config = function() + require("user.dapui") + end, + }, + { + "jay-babu/mason-nvim-dap.nvim", + lazy = true, + event = "BufRead", + dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" }, + enabled = vim.fn.has("win32") == 0, + config = function() + require("user.mason_dap") + end, + }, } diff --git a/lua/plugins/database.lua b/lua/plugins/database.lua index 16df78a..41d1bb6 100644 --- a/lua/plugins/database.lua +++ b/lua/plugins/database.lua @@ -14,11 +14,11 @@ if pcode.database then end, config = function() local function db_completion() - require("cmp").setup.buffer { + require("cmp").setup.buffer({ sources = { { name = "vim-dadbod-completion" } }, - } + }) end - vim.g.db_ui_save_location = vim.fn.stdpath "config" .. require("plenary.path").path.sep .. "db_ui" + vim.g.db_ui_save_location = vim.fn.stdpath("config") .. require("plenary.path").path.sep .. "db_ui" vim.api.nvim_create_autocmd("FileType", { pattern = { diff --git a/lua/plugins/dressing.lua b/lua/plugins/dressing.lua index ad00f44..c881169 100644 --- a/lua/plugins/dressing.lua +++ b/lua/plugins/dressing.lua @@ -1,34 +1,34 @@ return { - "stevearc/dressing.nvim", - lazy = true, - init = function() - ---@diagnostic disable-next-line: duplicate-set-field - vim.ui.select = function(...) - require("lazy").load({ plugins = { "dressing.nvim" } }) - return vim.ui.select(...) - end - ---@diagnostic disable-next-line: duplicate-set-field - vim.ui.input = function(...) - require("lazy").load({ plugins = { "dressing.nvim" } }) - return vim.ui.input(...) - end - end, - opts = { - input = { - title_pos = "center", - relative = "editor", - default_prompt = "➤ ", - win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" }, - prefer_width = 30, - max_width = { 140, 0.9 }, - min_width = { 50, 0.2 }, - }, - select = { - backend = { "telescope", "builtin" }, - builtin = { win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" } }, - }, - }, - config = function(_, opts) - require("dressing").setup(opts) - end, + "stevearc/dressing.nvim", + lazy = true, + init = function() + ---@diagnostic disable-next-line: duplicate-set-field + vim.ui.select = function(...) + require("lazy").load({ plugins = { "dressing.nvim" } }) + return vim.ui.select(...) + end + ---@diagnostic disable-next-line: duplicate-set-field + vim.ui.input = function(...) + require("lazy").load({ plugins = { "dressing.nvim" } }) + return vim.ui.input(...) + end + end, + opts = { + input = { + title_pos = "center", + relative = "editor", + default_prompt = "➤ ", + win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" }, + prefer_width = 30, + max_width = { 140, 0.9 }, + min_width = { 50, 0.2 }, + }, + select = { + backend = { "telescope", "builtin" }, + builtin = { win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" } }, + }, + }, + config = function(_, opts) + require("dressing").setup(opts) + end, } diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index 0b7531a..dd82377 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -1,75 +1,75 @@ local icons = vim.g.pcode_icons return { - "lewis6991/gitsigns.nvim", - lazy = true, - enabled = vim.fn.executable("git") == 1, - ft = "gitcommit", - event = "BufRead", - opts = { - signs = { - add = { - hl = "GitSignsAdd", - text = icons.ui.BoldLineLeft, - numhl = "GitSignsAddNr", - linehl = "GitSignsAddLn", - }, - change = { - hl = "GitSignsChange", - text = icons.ui.BoldLineLeft, - numhl = "GitSignsChangeNr", - linehl = "GitSignsChangeLn", - }, - delete = { - hl = "GitSignsDelete", - text = icons.ui.Triangle, - numhl = "GitSignsDeleteNr", - linehl = "GitSignsDeleteLn", - }, - topdelete = { - hl = "GitSignsDelete", - text = icons.ui.Triangle, - numhl = "GitSignsDeleteNr", - linehl = "GitSignsDeleteLn", - }, - changedelete = { - hl = "GitSignsChange", - text = icons.ui.BoldLineLeft, - numhl = "GitSignsChangeNr", - linehl = "GitSignsChangeLn", - }, - }, - signcolumn = true, - numhl = false, - linehl = false, - word_diff = false, - watch_gitdir = { - interval = 1000, - follow_files = true, - }, - attach_to_untracked = true, - current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - ignore_whitespace = false, - }, - current_line_blame_formatter = ", - ", - sign_priority = 6, - status_formatter = nil, -- Use default - update_debounce = 200, - max_file_length = 40000, - preview_config = { - -- Options passed to nvim_open_win - border = "rounded", - style = "minimal", - relative = "cursor", - row = 0, - col = 1, - }, - yadm = { enable = false }, - }, - config = function(_, opts) - require("gitsigns").setup(opts) - end, + "lewis6991/gitsigns.nvim", + lazy = true, + enabled = vim.fn.executable("git") == 1, + ft = "gitcommit", + event = "BufRead", + opts = { + signs = { + add = { + hl = "GitSignsAdd", + text = icons.ui.BoldLineLeft, + numhl = "GitSignsAddNr", + linehl = "GitSignsAddLn", + }, + change = { + hl = "GitSignsChange", + text = icons.ui.BoldLineLeft, + numhl = "GitSignsChangeNr", + linehl = "GitSignsChangeLn", + }, + delete = { + hl = "GitSignsDelete", + text = icons.ui.Triangle, + numhl = "GitSignsDeleteNr", + linehl = "GitSignsDeleteLn", + }, + topdelete = { + hl = "GitSignsDelete", + text = icons.ui.Triangle, + numhl = "GitSignsDeleteNr", + linehl = "GitSignsDeleteLn", + }, + changedelete = { + hl = "GitSignsChange", + text = icons.ui.BoldLineLeft, + numhl = "GitSignsChangeNr", + linehl = "GitSignsChangeLn", + }, + }, + signcolumn = true, + numhl = false, + linehl = false, + word_diff = false, + watch_gitdir = { + interval = 1000, + follow_files = true, + }, + attach_to_untracked = true, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + }, + current_line_blame_formatter = ", - ", + sign_priority = 6, + status_formatter = nil, -- Use default + update_debounce = 200, + max_file_length = 40000, + preview_config = { + -- Options passed to nvim_open_win + border = "rounded", + style = "minimal", + relative = "cursor", + row = 0, + col = 1, + }, + yadm = { enable = false }, + }, + config = function(_, opts) + require("gitsigns").setup(opts) + end, } diff --git a/lua/plugins/indentblankline.lua b/lua/plugins/indentblankline.lua index aa2d800..d2833ff 100644 --- a/lua/plugins/indentblankline.lua +++ b/lua/plugins/indentblankline.lua @@ -1,39 +1,39 @@ return { - "lukas-reineke/indent-blankline.nvim", - -- version = "3.5.4", - event = { "BufRead", "InsertEnter", "BufNewFile" }, - lazy = true, - opts = { - indent = { - char = "│", - tab_char = "│", - }, - scope = { enabled = false }, - exclude = { - buftypes = { - "nofile", - "prompt", - "quickfix", - "terminal", - }, - filetypes = { - "help", - "alpha", - "dashboard", - "neo-tree", - "Trouble", - "trouble", - "lazy", - "mason", - "notify", - "toggleterm", - "lazyterm", - "NvimTree", - "aerial", - "neogitstatus", - "startify", - }, - }, - }, - main = "ibl", + "lukas-reineke/indent-blankline.nvim", + -- version = "3.5.4", + event = { "BufRead", "InsertEnter", "BufNewFile" }, + lazy = true, + opts = { + indent = { + char = "│", + tab_char = "│", + }, + scope = { enabled = false }, + exclude = { + buftypes = { + "nofile", + "prompt", + "quickfix", + "terminal", + }, + filetypes = { + "help", + "alpha", + "dashboard", + "neo-tree", + "Trouble", + "trouble", + "lazy", + "mason", + "notify", + "toggleterm", + "lazyterm", + "NvimTree", + "aerial", + "neogitstatus", + "startify", + }, + }, + }, + main = "ibl", } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index f4a1003..3033d54 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -1,48 +1,48 @@ return { - { - "neovim/nvim-lspconfig", - lazy = true, - event = "BufRead", - cmd = { - "LspInfo", - "LspInstall", - "LspUninstall", - }, - config = function() - require("lspconfig.ui.windows").default_options.border = "rounded" - end, - }, - { - "williamboman/mason.nvim", - lazy = true, - dependencies = { "williamboman/mason-lspconfig.nvim" }, - cmd = { - "Mason", - "MasonInstall", - "MasonUninstall", - "MasonUninstallAll", - "MasonLog", - }, - config = function() - require("user.lsp") - end, - }, - { - "jayp0521/mason-null-ls.nvim", - lazy = true, - dependencies = { - "nvimtools/none-ls.nvim", - dependencies = { - "nvimtools/none-ls-extras.nvim", - lazy = true, - }, - config = function() - require("user.lsp.null-lscfg") - end, - }, - event = "InsertEnter", - opts = function() - require("user.mason-null-ls") - end, - }, + { + "neovim/nvim-lspconfig", + lazy = true, + event = "BufRead", + cmd = { + "LspInfo", + "LspInstall", + "LspUninstall", + }, + config = function() + require("lspconfig.ui.windows").default_options.border = "rounded" + end, + }, + { + "williamboman/mason.nvim", + lazy = true, + dependencies = { "williamboman/mason-lspconfig.nvim" }, + cmd = { + "Mason", + "MasonInstall", + "MasonUninstall", + "MasonUninstallAll", + "MasonLog", + }, + config = function() + require("user.lsp") + end, + }, + { + "jayp0521/mason-null-ls.nvim", + lazy = true, + dependencies = { + "nvimtools/none-ls.nvim", + dependencies = { + "nvimtools/none-ls-extras.nvim", + lazy = true, + }, + config = function() + require("user.lsp.null-lscfg") + end, + }, + event = "InsertEnter", + opts = function() + require("user.mason-null-ls") + end, + }, } diff --git a/lua/plugins/lspprogress.lua b/lua/plugins/lspprogress.lua index 403e343..ff407ef 100644 --- a/lua/plugins/lspprogress.lua +++ b/lua/plugins/lspprogress.lua @@ -41,12 +41,12 @@ if fidget then tag = "legacy", event = "BufRead", config = function() - require("fidget").setup { + require("fidget").setup({ window = { blend = 0, relative = "editor", }, - } + }) end, } elseif lualine then @@ -57,7 +57,7 @@ elseif lualine then branch = "main", event = { "BufRead" }, config = function() - require("lsp-progress").setup { + require("lsp-progress").setup({ client_format = function(client_name, spinner, series_messages) return #series_messages > 0 and (spinner .. " " .. ambilKataDariKiri(table.concat(series_messages, ", "), 4) .. "...") @@ -69,7 +69,7 @@ elseif lualine then and (sign .. " " .. ambilKataDariKiri(table.concat(client_messages, " "), 4) .. "...") or sign end, - } + }) end, } else diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index f8fcac5..2413c88 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -3,7 +3,7 @@ return { "nvim-lualine/lualine.nvim", event = { "InsertEnter", "BufRead", "BufNewFile" }, config = function() - local component = require "user.utils.lualine_component" + local component = require("user.utils.lualine_component") local colors = component.colors -- check config for theme @@ -43,7 +43,7 @@ return { bubbles_theme = vim.fn.fnamemodify("auto", ":t") end - local gettheme = require "user.utils.lualine_template" + local gettheme = require("user.utils.lualine_template") local theme_option = pcode.lualinetheme or "rounded" local theme = gettheme.rounded(bubbles_theme) if theme_option == "rounded" then @@ -61,13 +61,13 @@ return { elseif theme_option == "default" then theme = {} end - require("lualine").setup { + require("lualine").setup({ options = theme.options, sections = theme.sections, inactive_sections = theme.inactive_sections, tabline = theme.tabline, extensions = theme.extensions, - } + }) end, }, } diff --git a/lua/plugins/mini-animate.lua b/lua/plugins/mini-animate.lua index 24e80ed..3657daa 100644 --- a/lua/plugins/mini-animate.lua +++ b/lua/plugins/mini-animate.lua @@ -8,7 +8,7 @@ if not vim.g.neovide and pcode.minianimate and true or false then opts = function() -- don't use animate when scrolling with the mouse local mouse_scrolled = false - for _, scroll in ipairs { "Up", "Down" } do + for _, scroll in ipairs({ "Up", "Down" }) do local key = "" vim.keymap.set({ "", "i" }, key, function() mouse_scrolled = true @@ -16,14 +16,14 @@ if not vim.g.neovide and pcode.minianimate and true or false then end, { expr = true }) end - local animate = require "mini.animate" + local animate = require("mini.animate") return { resize = { - timing = animate.gen_timing.linear { duration = 100, unit = "total" }, + timing = animate.gen_timing.linear({ duration = 100, unit = "total" }), }, scroll = { - timing = animate.gen_timing.linear { duration = 150, unit = "total" }, - subscroll = animate.gen_subscroll.equal { + 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 @@ -31,7 +31,7 @@ if not vim.g.neovide and pcode.minianimate and true or false then end return total_scroll > 1 end, - }, + }), }, } end, diff --git a/lua/plugins/neoscroll.lua b/lua/plugins/neoscroll.lua index 87887a1..3d5acf2 100644 --- a/lua/plugins/neoscroll.lua +++ b/lua/plugins/neoscroll.lua @@ -3,6 +3,6 @@ return { event = "VeryLazy", lazy = true, config = function() - require("neoscroll").setup {} + require("neoscroll").setup({}) end, } diff --git a/lua/plugins/notify.lua b/lua/plugins/notify.lua index af629f1..54cdb9f 100644 --- a/lua/plugins/notify.lua +++ b/lua/plugins/notify.lua @@ -6,7 +6,7 @@ return { { "un", function() - require("notify").dismiss { silent = true, pending = true } + require("notify").dismiss({ silent = true, pending = true }) end, desc = "Delete all Notifications", }, @@ -22,10 +22,10 @@ return { }, -- event = "BufWinEnter", config = function() - local notify = require "notify" + local notify = require("notify") -- this for transparency -- notify.setup { background_colour = "#000000", render = "compact" } - notify.setup { render = "compact" } + notify.setup({ render = "compact" }) -- this overwrites the vim notify function vim.notify = notify.notify end, diff --git a/lua/plugins/nvimtree.lua b/lua/plugins/nvimtree.lua index 60be97d..0d493a6 100644 --- a/lua/plugins/nvimtree.lua +++ b/lua/plugins/nvimtree.lua @@ -210,7 +210,7 @@ return { }, config = function(_, opts) require("nvim-tree").setup(opts) - local api = require "nvim-tree.api" + local api = require("nvim-tree.api") api.events.subscribe(api.events.Event.FileCreated, function(file) vim.cmd("edit " .. file.fname) end) diff --git a/lua/plugins/nvimufo.lua b/lua/plugins/nvimufo.lua index 53c2104..f7993d0 100644 --- a/lua/plugins/nvimufo.lua +++ b/lua/plugins/nvimufo.lua @@ -20,8 +20,8 @@ if pcode.nvimufo then { "luukvbaal/statuscol.nvim", config = function() - local builtin = require "statuscol.builtin" - require("statuscol").setup { + local builtin = require("statuscol.builtin") + require("statuscol").setup({ setopt = true, relculright = true, segments = { @@ -33,7 +33,7 @@ if pcode.nvimufo then }, { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" }, }, - } + }) end, }, }, @@ -65,7 +65,7 @@ if pcode.nvimufo then -- 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("Comment")), "fg")) -- start ini bagian code support comment dan import local ftMap = { vim = "indent", @@ -75,7 +75,7 @@ if pcode.nvimufo then local function customizeSelector(bufnr) local function handleFallbackException(err, providerName) - if type(err) == "string" and err:match "UfoFallbackException" then + if type(err) == "string" and err:match("UfoFallbackException") then return require("ufo").getFolds(bufnr, providerName) else return require("promise").reject(err) @@ -92,7 +92,7 @@ if pcode.nvimufo then end) end - require("ufo").setup { + require("ufo").setup({ open_fold_hl_timeout = 150, close_fold_kinds_for_ft = { -- default = { "imports", "comment" }, @@ -127,21 +127,21 @@ if pcode.nvimufo then -- 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 + if start_line:find("^%s*%/%*") then is_comment = true -- cara commentar dengan awalan