diff --git a/lazy-lock.json b/lazy-lock.json index f50ffcb..b1477ad 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -2,7 +2,7 @@ "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, "Eva-Theme.nvim": { "branch": "master", "commit": "568fdba3a2a3088bec2198e7bb8f28d482629e58" }, "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "4bf40748f6fe939bdcb69325918535b1c5edea51" }, + "LuaSnip": { "branch": "master", "commit": "29417eea5b7c4b6beda105ced072855101d9680e" }, "alpha-nvim": { "branch": "main", "commit": "bf3c8bb8c02ed3d9644cc5bbc48e2bdc39349cd7" }, "auto-bufferline.nvim": { "branch": "main", "commit": "f5835a4b62bfb6f6c829f8f050e5102ccf230b3e" }, "auto-conform.nvim": { "branch": "main", "commit": "5f0897235e84bf2f8ff9d634e81678d5bfa63ab8" }, @@ -23,44 +23,48 @@ "dressing.nvim": { "branch": "master", "commit": "6ef1ca479d37d4ff66f13eed44d08912caff483a" }, "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, "gitsigns.nvim": { "branch": "main", "commit": "4daf7022f1481edf1e8fb9947df13bb07c18e89a" }, + "inc-rename.nvim": { "branch": "main", "commit": "8ba77017ca468f3029bf88ef409c2d20476ea66b" }, "indent-blankline.nvim": { "branch": "master", "commit": "04e44b09ee3ff189c69ab082edac1ef7ae2e256c" }, - "laravel.nvim": { "branch": "main", "commit": "e4f39d942352b03396a9df79896b0a8801675199" }, + "laravel.nvim": { "branch": "main", "commit": "2e7c08c0511234d5816166c1204e2240edac99b5" }, "lazy.nvim": { "branch": "main", "commit": "b1134ab82ee4279e31f7ddf7e34b2a99eb9b7bc9" }, "lualine.nvim": { "branch": "master", "commit": "640260d7c2d98779cab89b1e7088ab14ea354a02" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "menu": { "branch": "main", "commit": "9269d8ff5775bb1b9b9cad538d1bcd13fa105fe7" }, + "menu": { "branch": "main", "commit": "657bfc91382c0928453d9a4d0a10ec92db5de2bb" }, "mini.indentscope": { "branch": "main", "commit": "da9af64649e114aa79480c238fd23f6524bc0903" }, - "minty": { "branch": "main", "commit": "6e5c4cfc66e5dbb248ab78293d1c147de0c33a54" }, + "minty": { "branch": "main", "commit": "1b604ed0d741294cfb56c0ce3aa6161e9ae7dd8b" }, "neotest": { "branch": "master", "commit": "6d3d22cdad49999ef774ebe1bc250a4994038964" }, "neotest-phpunit": { "branch": "main", "commit": "baae8dfa0a3aaacd9f0bb6845d6348f5bcdc48bb" }, - "noice.nvim": { "branch": "main", "commit": "5a78b42bec5e775f2db03bf93f6d1e0f3636306c" }, + "noice.nvim": { "branch": "main", "commit": "d80136061820765baf70ace7dfb98a52575edc4a" }, "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, "nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "e614ff5c26d085a3242e26648e90e56ba5476da2" }, - "nvim-dap": { "branch": "master", "commit": "7ff6936010b7222fea2caea0f67ed77f1b7c60dd" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "f134063618a65cad4d7415fddbd96ff7e0c5b4ae" }, + "nvim-dap": { "branch": "master", "commit": "8517126e9323e346f6a99b3b594c5a940b914dcd" }, "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "76d80c3d171224315b61c006502a1e30c213a9ab" }, "nvim-lint": { "branch": "master", "commit": "36da8dd0ddc4f88e0beae234c20e75397326f143" }, - "nvim-lspconfig": { "branch": "master", "commit": "bc6ada4b0892b7f10852c0b8ca7209fd39a6d754" }, + "nvim-lspconfig": { "branch": "master", "commit": "52302604e3c667cfdf33aadf89088e96eb3c5da3" }, "nvim-material-icon": { "branch": "main", "commit": "38fc13fe4811c4bf62533180ff5e7bbd237c5ef5" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" }, "nvim-scrollview": { "branch": "main", "commit": "f7f611330a8f7cd00dc81538fec369611be678ed" }, "nvim-tree.lua": { "branch": "master", "commit": "610a1c189bdb2b9b936169b2ea9d1838f971fa2b" }, - "nvim-treesitter": { "branch": "master", "commit": "509d38fee865eefd38eacf17c8920b68cf67b0fd" }, + "nvim-treesitter": { "branch": "master", "commit": "7dc8aabe86db8c2f23520e8334f7584f83e84342" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "9c74db656c3d0b1c4392fc89a016b1910539e7c0" }, "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, "rainbow-delimiters.nvim": { "branch": "master", "commit": "e0f9b3efe150724af2d2ed59997d5ece373840e3" }, - "smart-splits.nvim": { "branch": "master", "commit": "477a004122ea180b14d3e29544857d572c861668" }, + "refactoring.nvim": { "branch": "master", "commit": "53ed6854e0bba64d467c58e87084dcf8b1c22d36" }, + "smart-splits.nvim": { "branch": "master", "commit": "11600d75e1b57e9fe1f3ca880a917485fc399e8c" }, "telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" }, "tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "a39fa4c92268832f6034306793b8acbfec2a7549" }, "toggleterm.nvim": { "branch": "main", "commit": "5969229c0352ff1ed7f6e24aba9c6554e1842939" }, + "vim-dotenv": { "branch": "master", "commit": "5c51cfcf8d87280d6414e03cd6b253eb70ecb800" }, "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, "virt-column.nvim": { "branch": "master", "commit": "b62b4ef0774d19452d4ed18e473e824c7a756f2f" }, diff --git a/lua/pcode/plugins/cmp.lua b/lua/pcode/plugins/cmp.lua index ffcf97e..bb23ff7 100644 --- a/lua/pcode/plugins/cmp.lua +++ b/lua/pcode/plugins/cmp.lua @@ -86,8 +86,8 @@ return { formatting = { fields = { "kind", "abbr", "menu" }, format = function(entry, vim_item) - vim_item.menu = vim.api.nvim_get_mode().mode == "c" and "" or vim_item.kind - vim_item.kind = string.format("%s", require("pcode.user.icons")["kind"][vim_item.kind]) + vim_item.menu = vim.api.nvim_get_mode().mode == "c" and "" or all_trim(vim_item.kind) + vim_item.kind = string.format("%s", all_trim(require("pcode.user.icons")["kind"][vim_item.kind])) -- vim_item.menu = ({ -- nvim_lsp = "(LSP)", -- luasnip = "(Snippet)", diff --git a/lua/pcode/plugins/cmpcmdline.lua b/lua/pcode/plugins/cmpcmdline.lua index 0e54a02..b36bed8 100644 --- a/lua/pcode/plugins/cmpcmdline.lua +++ b/lua/pcode/plugins/cmpcmdline.lua @@ -1,133 +1,140 @@ return { - { - "folke/noice.nvim", - lazy = true, - enabled = true, - dependencies = { - { "MunifTanjim/nui.nvim" }, - }, - event = "CmdlineEnter", - 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" }), - } + { + "folke/noice.nvim", + lazy = true, + enabled = true, + dependencies = { + { "MunifTanjim/nui.nvim" }, + }, + event = "CmdlineEnter", + opts = { + messages = { + enabled = false, + }, + notify = { + enabled = false, + }, + lsp = { + progress = { + enabled = false, + }, + hover = { + enabled = false, + }, + signature = { + enabled = false, + }, + }, + presets = { + -- Preset ini menyesuaikan bentuk cursor pada mode commond + command_bar_cursor = { + enabled = true, + cursor_shape = "ver30", -- "ver" menandakan bar vertikal, 30 adalah tinggi dalam persen + }, + }, + }, + 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/pcode/plugins/extras/autosave.lua b/lua/pcode/plugins/extras/autosave.lua index 90f3351..cdc58ba 100644 --- a/lua/pcode/plugins/extras/autosave.lua +++ b/lua/pcode/plugins/extras/autosave.lua @@ -1,53 +1,49 @@ return { - "okuuva/auto-save.nvim", - version = "^1.0.0", -- see https://devhints.io/semver, alternatively use '*' to use the latest tagged release - cmd = "ASToggle", -- optional for lazy loading on command - event = { "InsertLeave", "TextChanged" }, -- optional for lazy loading on trigger events - opts = { - enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it) - trigger_events = { -- See :h events - immediate_save = { "BufLeave", "FocusLost" }, -- vim events that trigger an immediate save - defer_save = { "InsertLeave", "TextChanged" }, -- vim events that trigger a deferred save (saves after `debounce_delay`) - cancel_deferred_save = { "InsertEnter" }, -- vim events that cancel a pending deferred save - }, - -- function that takes the buffer handle and determines whether to save the current buffer or not - -- return true: if buffer is ok to be saved - -- return false: if it's not ok to be saved - -- if set to `nil` then no specific condition is applied - condition = nil, - write_all_buffers = false, -- write all buffers when the current one meets `condition` - noautocmd = false, -- do not execute autocmds when saving - lockmarks = false, -- lock marks when saving, see `:h lockmarks` for more details - debounce_delay = 1500, -- delay after which a pending save is executed - -- log debug messages to 'auto-save.log' file in neovim cache directory, set to `true` to enable - debug = false, - }, - config = function(_, opts) - require("auto-save").setup(opts) - local group = vim.api.nvim_create_augroup("autosave", {}) + "okuuva/auto-save.nvim", + version = "^1.0.0", -- see https://devhints.io/semver, alternatively use '*' to use the latest tagged release + cmd = "ASToggle", -- optional for lazy loading on command + event = { "InsertLeave", "TextChanged" }, -- optional for lazy loading on trigger events + opts = { + enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it) + trigger_events = { -- See :h events + immediate_save = { "BufLeave", "FocusLost" }, -- vim events that trigger an immediate save + defer_save = { "InsertLeave", "TextChanged" }, -- vim events that trigger a deferred save (saves after `debounce_delay`) + cancel_deferred_save = { "InsertEnter" }, -- vim events that cancel a pending deferred save + }, + -- function that takes the buffer handle and determines whether to save the current buffer or not + -- return true: if buffer is ok to be saved + -- return false: if it's not ok to be saved + -- if set to `nil` then no specific condition is applied + condition = nil, + write_all_buffers = false, -- write all buffers when the current one meets `condition` + noautocmd = false, -- do not execute autocmds when saving + lockmarks = false, -- lock marks when saving, see `:h lockmarks` for more details + debounce_delay = 1500, -- delay after which a pending save is executed + -- log debug messages to 'auto-save.log' file in neovim cache directory, set to `true` to enable + debug = false, + }, + config = function(_, opts) + require("auto-save").setup(opts) + local group = vim.api.nvim_create_augroup("autosave", {}) - vim.api.nvim_create_autocmd("User", { - pattern = "AutoSaveWritePost", - group = group, - callback = function(opts) - local ftype = vim.bo.filetype - if - opts.data.saved_buffer ~= nil - and ftype ~= "TelescopePrompt" - and not substring(tostring(ftype), "dap") - then - local filename = vim.api.nvim_buf_get_name(opts.data.saved_buffer) - local is_ok = pcall(require, "notify") - if is_ok then - require("notify")("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S")) - else - print("AutoSave: saved " .. filename .. " at " .. vim.fn.strftime("%H:%M:%S")) - end - end - end, - }) - end, - keys = { - { "n", ":ASToggle", desc = "󰨚 Toggle auto-save" }, - }, + vim.api.nvim_create_autocmd("User", { + pattern = "AutoSaveWritePost", + group = group, + callback = function(opts) + local ftype = vim.bo.filetype + if opts.data.saved_buffer ~= nil and ftype ~= "TelescopePrompt" and not substring(tostring(ftype), "dap") then + local filename = vim.api.nvim_buf_get_name(opts.data.saved_buffer) + local is_ok = pcall(require, "notify") + if is_ok then + require("notify")("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S")) + else + print("AutoSave: saved " .. filename .. " at " .. vim.fn.strftime("%H:%M:%S")) + end + end + end, + }) + end, + keys = { + { "n", ":ASToggle", desc = "󰨚 Toggle auto-save" }, + }, } diff --git a/lua/pcode/plugins/extras/bigfiles.lua b/lua/pcode/plugins/extras/bigfiles.lua index 042dc1c..52bf3e5 100644 --- a/lua/pcode/plugins/extras/bigfiles.lua +++ b/lua/pcode/plugins/extras/bigfiles.lua @@ -1,8 +1,8 @@ return { - "LunarVim/bigfile.nvim", - lazy = true, - event = "BufReadPre", - opts = { - file_size = 2, - }, + "LunarVim/bigfile.nvim", + lazy = true, + event = "BufReadPre", + opts = { + file_size = 2, + }, } diff --git a/lua/pcode/plugins/extras/codeium.lua b/lua/pcode/plugins/extras/codeium.lua index 92d5dc2..17e6af2 100644 --- a/lua/pcode/plugins/extras/codeium.lua +++ b/lua/pcode/plugins/extras/codeium.lua @@ -17,10 +17,10 @@ return { vim.keymap.set("i", "", function() return vim.fn["codeium#Accept"]() end, { expr = true, silent = true }) - vim.keymap.set("i", "", function() + vim.keymap.set("i", "", function() return vim.fn["codeium#CycleCompletions"](1) end, { expr = true, silent = true }) - vim.keymap.set("i", "", function() + vim.keymap.set("i", "", function() return vim.fn["codeium#CycleCompletions"](-1) end, { expr = true, silent = true }) vim.keymap.set("i", "", function() diff --git a/lua/pcode/plugins/extras/codeiumnvim.lua b/lua/pcode/plugins/extras/codeiumnvim.lua index 9877fc8..0070991 100644 --- a/lua/pcode/plugins/extras/codeiumnvim.lua +++ b/lua/pcode/plugins/extras/codeiumnvim.lua @@ -1,26 +1,26 @@ return { - -- codeium cmp source - { - "nvim-cmp", - dependencies = { - -- codeium - { - "Exafunction/codeium.nvim", - cmd = "Codeium", - enabled = false, - build = ":Codeium Auth", - opts = { - enable_chat = true, - }, - }, - }, - --@param opts cmp.ConfigSchema - opts = function(_, opts) - table.insert(opts.sources, 1, { - name = "codeium", - group_index = 1, - priority = 100, - }) - end, - }, + -- codeium cmp source + { + "nvim-cmp", + dependencies = { + -- codeium + { + "Exafunction/codeium.nvim", + cmd = "Codeium", + enabled = false, + build = ":Codeium Auth", + opts = { + enable_chat = true, + }, + }, + }, + --@param opts cmp.ConfigSchema + opts = function(_, opts) + table.insert(opts.sources, 1, { + name = "codeium", + group_index = 1, + priority = 100, + }) + end, + }, } diff --git a/lua/pcode/plugins/extras/colorizer.lua b/lua/pcode/plugins/extras/colorizer.lua index eacd2b1..850a9e1 100644 --- a/lua/pcode/plugins/extras/colorizer.lua +++ b/lua/pcode/plugins/extras/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/pcode/plugins/extras/dap.lua b/lua/pcode/plugins/extras/dap.lua index a90f6c6..5c31a83 100644 --- a/lua/pcode/plugins/extras/dap.lua +++ b/lua/pcode/plugins/extras/dap.lua @@ -1,62 +1,62 @@ return { - { - "rcarriga/nvim-dap-ui", - lazy = true, - event = "BufRead", - dependencies = { - { "mfussenegger/nvim-dap", lazy = true }, - { "nvim-neotest/nvim-nio", lazy = true }, - { - "theHamsta/nvim-dap-virtual-text", - opts = { - virt_text_win_col = 80, - }, - }, - }, - config = function() - require("pcode.user.dapui") - end, - keys = { - { "d", "", desc = "  Debug" }, - { "dt", "lua require'dap'.toggle_breakpoint()", desc = "Toggle Breakpoint" }, - { "db", "lua require'dap'.step_back()", desc = "Step Back" }, - { "dc", "lua require'dap'.continue()", desc = "Continue" }, - { "dC", "lua require'dap'.run_to_cursor()", desc = "Run To Cursor" }, - { "dd", "lua require'dap'.disconnect()", desc = "Disconnect" }, - { "dg", "lua require'dap'.session()", desc = "Get Session" }, - { "di", "lua require'dap'.step_into()", desc = "Step Into" }, - { "do", "lua require'dap'.step_over()", desc = "Step Over" }, - { "du", "lua require'dap'.step_out()", desc = "Step Out" }, - { "dp", "lua require'dap'.pause()", desc = "Pause" }, - { "dr", "lua require'dap'.repl.toggle()", desc = "Toggle Repl" }, - { "ds", "lua require'dap'.continue()", desc = "Start" }, - { "dq", "lua require'dap'.close()", desc = "Quit" }, - { "dU", "lua require'dapui'.toggle({reset = true})", desc = "Toggle UI" }, - }, - }, - { - "jay-babu/mason-nvim-dap.nvim", - lazy = true, - event = "BufRead", - dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" }, - opts = function(_, opts) - opts.ensure_installed = opts.ensure_installed or {} - vim.list_extend(opts.ensure_installed, {}) - opts.automatic_setup = true - opts.handlers = { - function(config) - -- all sources with no handler get passed here + { + "rcarriga/nvim-dap-ui", + lazy = true, + event = "BufRead", + dependencies = { + { "mfussenegger/nvim-dap", lazy = true }, + { "nvim-neotest/nvim-nio", lazy = true }, + { + "theHamsta/nvim-dap-virtual-text", + opts = { + virt_text_win_col = 80, + }, + }, + }, + config = function() + require("pcode.user.dapui") + end, + keys = { + { "d", "", desc = "  Debug" }, + { "dt", "lua require'dap'.toggle_breakpoint()", desc = "Toggle Breakpoint" }, + { "db", "lua require'dap'.step_back()", desc = "Step Back" }, + { "dc", "lua require'dap'.continue()", desc = "Continue" }, + { "dC", "lua require'dap'.run_to_cursor()", desc = "Run To Cursor" }, + { "dd", "lua require'dap'.disconnect()", desc = "Disconnect" }, + { "dg", "lua require'dap'.session()", desc = "Get Session" }, + { "di", "lua require'dap'.step_into()", desc = "Step Into" }, + { "do", "lua require'dap'.step_over()", desc = "Step Over" }, + { "du", "lua require'dap'.step_out()", desc = "Step Out" }, + { "dp", "lua require'dap'.pause()", desc = "Pause" }, + { "dr", "lua require'dap'.repl.toggle()", desc = "Toggle Repl" }, + { "ds", "lua require'dap'.continue()", desc = "Start" }, + { "dq", "lua require'dap'.close()", desc = "Quit" }, + { "dU", "lua require'dapui'.toggle({reset = true})", desc = "Toggle UI" }, + }, + }, + { + "jay-babu/mason-nvim-dap.nvim", + lazy = true, + event = "BufRead", + dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" }, + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, {}) + opts.automatic_setup = true + opts.handlers = { + function(config) + -- all sources with no handler get passed here - -- Keep original functionality - require("mason-nvim-dap").default_setup(config) - end, - } - return opts - end, - -- enabled = vim.fn.has("win32") == 0, - config = function(_, opts) - require("mason").setup() - require("mason-nvim-dap").setup(opts) - end, - }, + -- Keep original functionality + require("mason-nvim-dap").default_setup(config) + end, + } + return opts + end, + -- enabled = vim.fn.has("win32") == 0, + config = function(_, opts) + require("mason").setup() + require("mason-nvim-dap").setup(opts) + end, + }, } diff --git a/lua/pcode/plugins/extras/deviconcolor.lua b/lua/pcode/plugins/extras/deviconcolor.lua index 62c1855..600efb7 100644 --- a/lua/pcode/plugins/extras/deviconcolor.lua +++ b/lua/pcode/plugins/extras/deviconcolor.lua @@ -1,7 +1,7 @@ return { - "rachartier/tiny-devicons-auto-colors.nvim", - event = "VeryLazy", - config = function() - require("tiny-devicons-auto-colors").setup() - end, + "rachartier/tiny-devicons-auto-colors.nvim", + event = "VeryLazy", + config = function() + require("tiny-devicons-auto-colors").setup() + end, } diff --git a/lua/pcode/plugins/extras/illuminate.lua b/lua/pcode/plugins/extras/illuminate.lua index abe7e80..6efd303 100644 --- a/lua/pcode/plugins/extras/illuminate.lua +++ b/lua/pcode/plugins/extras/illuminate.lua @@ -1,36 +1,65 @@ local M = { - "RRethy/vim-illuminate", - event = "VeryLazy", + "RRethy/vim-illuminate", + event = "VeryLazy", } -function M.config() - require("illuminate").configure({ - filetypes_denylist = { - "mason", - "harpoon", - "DressingInput", - "NeogitCommitMessage", - "qf", - "dirvish", - "oil", - "minifiles", - "fugitive", - "alpha", - "NvimTree", - "lazy", - "NeogitStatus", - "Trouble", - "netrw", - "lir", - "DiffviewFiles", - "Outline", - "Jaq", - "spectre_panel", - "toggleterm", - "DressingSelect", - "TelescopePrompt", - }, - }) +M.opts = { + delay = 200, + large_file_cutoff = 2000, + large_file_overrides = { + providers = { "lsp" }, + }, + filetypes_denylist = { + "mason", + "harpoon", + "DressingInput", + "NeogitCommitMessage", + "qf", + "dirvish", + "oil", + "minifiles", + "fugitive", + "alpha", + "NvimTree", + "lazy", + "NeogitStatus", + "Trouble", + "netrw", + "lir", + "DiffviewFiles", + "Outline", + "Jaq", + "spectre_panel", + "toggleterm", + "DressingSelect", + "TelescopePrompt", + }, +} + +function M.config(_, opts) + require("illuminate").configure(opts) + local function map(key, dir, buffer) + vim.keymap.set("n", key, function() + require("illuminate")["goto_" .. dir .. "_reference"](false) + end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer }) + end + + map("]]", "next") + map("[[", "prev") + + -- also set it after loading ftplugins, since a lot overwrite [[ and ]] + vim.api.nvim_create_autocmd("FileType", { + callback = function() + local buffer = vim.api.nvim_get_current_buf() + map("]]", "next", buffer) + map("[[", "prev", buffer) + end, + }) end +M.keys = { + { "]]", desc = "Next Reference" }, + { "[[", desc = "Prev Reference" }, +} + return M diff --git a/lua/pcode/plugins/extras/indentscupe.lua b/lua/pcode/plugins/extras/indentscupe.lua index 51b6f93..6bde87b 100644 --- a/lua/pcode/plugins/extras/indentscupe.lua +++ b/lua/pcode/plugins/extras/indentscupe.lua @@ -1,32 +1,32 @@ local icons = require("pcode.user.icons") return { - "echasnovski/mini.indentscope", - version = false, -- wait till new 0.7.0 release to put it back on semver - event = "BufReadPre", - opts = { - symbol = icons.ui.LineMiddle, - options = { try_as_border = true }, - }, - init = function() - vim.api.nvim_create_autocmd("FileType", { - pattern = { - "alpha", - "dashboard", - "fzf", - "help", - "lazy", - "lazyterm", - "mason", - "neo-tree", - "NvimTree", - "notify", - "toggleterm", - "Trouble", - "trouble", - }, - callback = function() - vim.b.miniindentscope_disable = true - end, - }) - end, + "echasnovski/mini.indentscope", + version = false, -- wait till new 0.7.0 release to put it back on semver + event = "BufReadPre", + opts = { + symbol = icons.ui.LineMiddle, + options = { try_as_border = true }, + }, + init = function() + vim.api.nvim_create_autocmd("FileType", { + pattern = { + "alpha", + "dashboard", + "fzf", + "help", + "lazy", + "lazyterm", + "mason", + "neo-tree", + "NvimTree", + "notify", + "toggleterm", + "Trouble", + "trouble", + }, + callback = function() + vim.b.miniindentscope_disable = true + end, + }) + end, } diff --git a/lua/pcode/plugins/extras/liveserver.lua b/lua/pcode/plugins/extras/liveserver.lua index 3950368..c54a910 100644 --- a/lua/pcode/plugins/extras/liveserver.lua +++ b/lua/pcode/plugins/extras/liveserver.lua @@ -1,10 +1,10 @@ return { - "barrett-ruth/live-server.nvim", - build = "npm i -g live-server", - cmd = { "LiveServerStart", "LiveServerStop", "LiveServerToggle" }, - config = true, - keys = { - -- open http://localhost:5555/ jika menggunakan wsl - { "rl", "LiveServerToggle", desc = "LiveServer" }, - }, + "barrett-ruth/live-server.nvim", + build = "npm i -g live-server", + cmd = { "LiveServerStart", "LiveServerStop", "LiveServerToggle" }, + config = true, + keys = { + -- open http://localhost:5555/ jika menggunakan wsl + { "rl", "LiveServerToggle", desc = "LiveServer" }, + }, } diff --git a/lua/pcode/plugins/extras/minianimate.lua b/lua/pcode/plugins/extras/minianimate.lua index 621fc4d..0799b80 100644 --- a/lua/pcode/plugins/extras/minianimate.lua +++ b/lua/pcode/plugins/extras/minianimate.lua @@ -1,40 +1,40 @@ return { - -- animations - { - "echasnovski/mini.animate", - event = "BufRead", - 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 + -- animations + { + "echasnovski/mini.animate", + event = "BufRead", + 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, - }, + 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/pcode/plugins/extras/navic.lua b/lua/pcode/plugins/extras/navic.lua index 0f7766d..e65a5f0 100644 --- a/lua/pcode/plugins/extras/navic.lua +++ b/lua/pcode/plugins/extras/navic.lua @@ -1,35 +1,35 @@ local M = { - "SmiteshP/nvim-navic", - event = "VeryLazy", - dependencies = { - "LunarVim/breadcrumbs.nvim", - opts = {}, - config = true, - }, + "SmiteshP/nvim-navic", + event = "VeryLazy", + dependencies = { + "LunarVim/breadcrumbs.nvim", + opts = {}, + config = true, + }, } function M.config() - local icons = require("pcode.user.icons").kind - for key, value in pairs(icons) do - icons[key] = value .. " " - end - require("nvim-navic").setup({ - icons = icons, - lsp = { - auto_attach = false, - preference = nil, - }, - highlight = false, - separator = " > ", - depth_limit = 0, - depth_limit_indicator = "..", - safe_output = true, - lazy_update_context = false, - click = false, - format_text = function(text) - return text - end, - }) + local icons = require("pcode.user.icons").kind + for key, value in pairs(icons) do + icons[key] = value .. " " + end + require("nvim-navic").setup({ + icons = icons, + lsp = { + auto_attach = false, + preference = nil, + }, + highlight = false, + separator = " > ", + depth_limit = 0, + depth_limit_indicator = "..", + safe_output = true, + lazy_update_context = false, + click = false, + format_text = function(text) + return text + end, + }) end return M diff --git a/lua/pcode/plugins/extras/neoscroll.lua b/lua/pcode/plugins/extras/neoscroll.lua index f7d6b2a..3d5acf2 100644 --- a/lua/pcode/plugins/extras/neoscroll.lua +++ b/lua/pcode/plugins/extras/neoscroll.lua @@ -1,8 +1,8 @@ return { - "karb94/neoscroll.nvim", - event = "VeryLazy", - lazy = true, - config = function() - require("neoscroll").setup({}) - end, + "karb94/neoscroll.nvim", + event = "VeryLazy", + lazy = true, + config = function() + require("neoscroll").setup({}) + end, } diff --git a/lua/pcode/plugins/extras/nvimmenu.lua b/lua/pcode/plugins/extras/nvimmenu.lua index 957f50a..a9dbf00 100644 --- a/lua/pcode/plugins/extras/nvimmenu.lua +++ b/lua/pcode/plugins/extras/nvimmenu.lua @@ -1,33 +1,33 @@ return { - { - "nvchad/menu", - lazy = true, - event = { "VeryLazy" }, - dependencies = { - { "nvchad/volt", lazy = true }, - { - "nvchad/minty", - cmd = { "Shades", "Huefy" }, - lazy = true, - }, - }, - opts = { - mouse = true, - border = true, - }, - config = function(_, opts) - -- Keyboard users - vim.keymap.set("n", "", function() - require("menu").open("default") - end, {}) + { + "nvchad/menu", + lazy = true, + event = { "VeryLazy" }, + dependencies = { + { "nvchad/volt", lazy = true }, + { + "nvchad/minty", + cmd = { "Shades", "Huefy" }, + lazy = true, + }, + }, + opts = { + mouse = true, + border = true, + }, + config = function(_, opts) + -- Keyboard users + vim.keymap.set("n", "", function() + require("menu").open("default") + end, {}) - -- mouse users + nvimtree users! - vim.keymap.set("n", "", function() - vim.cmd.exec('"normal! \\"') + -- mouse users + nvimtree users! + vim.keymap.set("n", "", function() + vim.cmd.exec('"normal! \\"') - local options = vim.bo.ft == "NvimTree" and "nvimtree" or "default" - require("menu").open(options, opts) - end, {}) - end, - }, + local options = vim.bo.ft == "NvimTree" and "nvimtree" or "default" + require("menu").open(options, opts) + end, {}) + end, + }, } diff --git a/lua/pcode/plugins/extras/nvimufo.lua b/lua/pcode/plugins/extras/nvimufo.lua index 478d57c..eb63709 100644 --- a/lua/pcode/plugins/extras/nvimufo.lua +++ b/lua/pcode/plugins/extras/nvimufo.lua @@ -1,107 +1,107 @@ local M = { "kevinhwang91/nvim-ufo" } M.event = "VeryLazy" M.dependencies = { - "kevinhwang91/promise-async", - "luukvbaal/statuscol.nvim", + "kevinhwang91/promise-async", + "luukvbaal/statuscol.nvim", } M.config = function() - local builtin = require("statuscol.builtin") - local cfg = { - setopt = true, - relculright = true, - segments = { + local builtin = require("statuscol.builtin") + local cfg = { + setopt = true, + relculright = true, + segments = { - { text = { builtin.foldfunc, " " }, click = "v:lua.ScFa", hl = "Comment" }, + { text = { builtin.foldfunc, " " }, click = "v:lua.ScFa", hl = "Comment" }, - { text = { "%s" }, click = "v:lua.ScSa" }, - { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" }, - }, - } + { text = { "%s" }, click = "v:lua.ScSa" }, + { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" }, + }, + } - require("statuscol").setup(cfg) + require("statuscol").setup(cfg) - 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.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:▸]] - -- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself - vim.keymap.set("n", "zR", require("ufo").openAllFolds) - vim.keymap.set("n", "zM", require("ufo").closeAllFolds) + -- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself + vim.keymap.set("n", "zR", require("ufo").openAllFolds) + vim.keymap.set("n", "zM", require("ufo").closeAllFolds) - local handler = function(virtText, lnum, endLnum, width, truncate) - local newVirtText = {} - local suffix = (" 󰡏 %d "):format(endLnum - lnum) - local sufWidth = vim.fn.strdisplaywidth(suffix) - local targetWidth = width - sufWidth - local curWidth = 0 - for _, chunk in ipairs(virtText) do - local chunkText = chunk[1] - local chunkWidth = vim.fn.strdisplaywidth(chunkText) - if targetWidth > curWidth + chunkWidth then - table.insert(newVirtText, chunk) - else - chunkText = truncate(chunkText, targetWidth - curWidth) - local hlGroup = chunk[2] - table.insert(newVirtText, { chunkText, hlGroup }) - chunkWidth = vim.fn.strdisplaywidth(chunkText) - -- str width returned from truncate() may less than 2nd argument, need padding - if curWidth + chunkWidth < targetWidth then - suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth) - end - break - end - curWidth = curWidth + chunkWidth - end - table.insert(newVirtText, { suffix, "MoreMsg" }) - return newVirtText - end + local handler = function(virtText, lnum, endLnum, width, truncate) + local newVirtText = {} + local suffix = (" 󰡏 %d "):format(endLnum - lnum) + local sufWidth = vim.fn.strdisplaywidth(suffix) + local targetWidth = width - sufWidth + local curWidth = 0 + for _, chunk in ipairs(virtText) do + local chunkText = chunk[1] + local chunkWidth = vim.fn.strdisplaywidth(chunkText) + if targetWidth > curWidth + chunkWidth then + table.insert(newVirtText, chunk) + else + chunkText = truncate(chunkText, targetWidth - curWidth) + local hlGroup = chunk[2] + table.insert(newVirtText, { chunkText, hlGroup }) + chunkWidth = vim.fn.strdisplaywidth(chunkText) + -- str width returned from truncate() may less than 2nd argument, need padding + if curWidth + chunkWidth < targetWidth then + suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth) + end + break + end + curWidth = curWidth + chunkWidth + end + table.insert(newVirtText, { suffix, "MoreMsg" }) + return newVirtText + end - local ftMap = { - -- typescriptreact = { "lsp", "treesitter" }, - -- python = { "indent" }, - -- git = "", - } + local ftMap = { + -- typescriptreact = { "lsp", "treesitter" }, + -- python = { "indent" }, + -- git = "", + } - require("ufo").setup({ - fold_virt_text_handler = handler, - close_fold_kinds = {}, - -- close_fold_kinds = { "imports", "comment" }, - provider_selector = function(bufnr, filetype, buftype) - -- if you prefer treesitter provider rather than lsp, - -- return ftMap[filetype] or {'treesitter', 'indent'} - return ftMap[filetype] - -- return { "treesitter", "indent" } + require("ufo").setup({ + fold_virt_text_handler = handler, + close_fold_kinds = {}, + -- close_fold_kinds = { "imports", "comment" }, + provider_selector = function(bufnr, filetype, buftype) + -- if you prefer treesitter provider rather than lsp, + -- return ftMap[filetype] or {'treesitter', 'indent'} + return ftMap[filetype] + -- return { "treesitter", "indent" } - -- refer to ./doc/example.lua for detail - end, + -- refer to ./doc/example.lua for detail + end, - preview = { - win_config = { - border = { "", "─", "", "", "", "─", "", "" }, - winhighlight = "Normal:Folded", - winblend = 0, - }, - mappings = { - scrollU = "", - scrollD = "", - jumpTop = "[", - jumpBot = "]", - }, - }, - }) + preview = { + win_config = { + border = { "", "─", "", "", "", "─", "", "" }, + winhighlight = "Normal:Folded", + winblend = 0, + }, + mappings = { + scrollU = "", + scrollD = "", + jumpTop = "[", + jumpBot = "]", + }, + }, + }) - vim.keymap.set("n", "zR", require("ufo").openAllFolds) - vim.keymap.set("n", "zM", require("ufo").closeAllFolds) - vim.keymap.set("n", "zr", require("ufo").openFoldsExceptKinds) - vim.keymap.set("n", "zm", require("ufo").closeFoldsWith) -- closeAllFolds == closeFoldsWith(0) - vim.keymap.set("n", "K", function() - local winid = require("ufo").peekFoldedLinesUnderCursor() - if not winid then - vim.lsp.buf.hover() - end - end) + vim.keymap.set("n", "zR", require("ufo").openAllFolds) + vim.keymap.set("n", "zM", require("ufo").closeAllFolds) + vim.keymap.set("n", "zr", require("ufo").openFoldsExceptKinds) + vim.keymap.set("n", "zm", require("ufo").closeFoldsWith) -- closeAllFolds == closeFoldsWith(0) + vim.keymap.set("n", "K", function() + local winid = require("ufo").peekFoldedLinesUnderCursor() + if not winid then + vim.lsp.buf.hover() + end + end) end return M diff --git a/lua/pcode/plugins/extras/rainbowdelimiters.lua b/lua/pcode/plugins/extras/rainbowdelimiters.lua index 419fced..ebc7c1a 100644 --- a/lua/pcode/plugins/extras/rainbowdelimiters.lua +++ b/lua/pcode/plugins/extras/rainbowdelimiters.lua @@ -1,36 +1,36 @@ return { - "hiphish/rainbow-delimiters.nvim", - lazy = true, - event = "BufRead", - config = function() - -- Modul ini berisi beberapa definisi default - local rainbow_delimiters = require("rainbow-delimiters") - vim.g.rainbow_delimiters = { - strategy = { - [""] = rainbow_delimiters.strategy["global"], - vim = rainbow_delimiters.strategy["local"], - }, - query = { - [""] = "rainbow-delimiters", - -- lua = "rainbow-blocks", - }, - priority = { - [""] = 110, - lua = 210, - }, - highlight = { - "RainbowDelimiterRed", - "RainbowDelimiterYellow", - "RainbowDelimiterBlue", - "RainbowDelimiterOrange", - "RainbowDelimiterGreen", - "RainbowDelimiterViolet", - "RainbowDelimiterCyan", - }, - blacklist = { - "html", - "tsx", - }, - } - end, + "hiphish/rainbow-delimiters.nvim", + lazy = true, + event = "BufRead", + config = function() + -- Modul ini berisi beberapa definisi default + local rainbow_delimiters = require("rainbow-delimiters") + vim.g.rainbow_delimiters = { + strategy = { + [""] = rainbow_delimiters.strategy["global"], + vim = rainbow_delimiters.strategy["local"], + }, + query = { + [""] = "rainbow-delimiters", + -- lua = "rainbow-blocks", + }, + priority = { + [""] = 110, + lua = 210, + }, + highlight = { + "RainbowDelimiterRed", + "RainbowDelimiterYellow", + "RainbowDelimiterBlue", + "RainbowDelimiterOrange", + "RainbowDelimiterGreen", + "RainbowDelimiterViolet", + "RainbowDelimiterCyan", + }, + blacklist = { + "html", + "tsx", + }, + } + end, } diff --git a/lua/pcode/plugins/extras/refactoring.lua b/lua/pcode/plugins/extras/refactoring.lua index 4e611f9..a521863 100644 --- a/lua/pcode/plugins/extras/refactoring.lua +++ b/lua/pcode/plugins/extras/refactoring.lua @@ -1,8 +1,8 @@ return { - -- Incremental rename - { - "smjonas/inc-rename.nvim", - cmd = "IncRename", + -- Incremental rename + { + "smjonas/inc-rename.nvim", + cmd = "IncRename", -- stylua: ignore keys = { {"u","",desc="  Edit"}, @@ -17,27 +17,33 @@ return { expr = true, }, }, - config = true, - }, - - -- Refactoring tool - { - "ThePrimeagen/refactoring.nvim", - keys = { - { - "r", - function() - require("refactoring").select_refactor({ - show_success_message = true, - }) - end, - mode = "v", - noremap = true, - silent = true, - expr = false, - desc = "  Refactoring", - }, - }, - opts = {}, - }, + config = true, + }, + { + "folke/noice.nvim", + optional = true, + opts = { + presets = { inc_rename = true }, + }, + }, + -- Refactoring tool + { + "ThePrimeagen/refactoring.nvim", + keys = { + { + "r", + function() + require("refactoring").select_refactor({ + show_success_message = true, + }) + end, + mode = "v", + noremap = true, + silent = true, + expr = false, + desc = "  Refactoring", + }, + }, + opts = {}, + }, } diff --git a/lua/pcode/plugins/extras/rest.lua b/lua/pcode/plugins/extras/rest.lua index 9e7c052..2b887f0 100644 --- a/lua/pcode/plugins/extras/rest.lua +++ b/lua/pcode/plugins/extras/rest.lua @@ -1,27 +1,27 @@ vim.filetype.add({ - extension = { - ["http"] = "http", - }, + extension = { + ["http"] = "http", + }, }) return { - { - "mistweaverco/kulala.nvim", - ft = "http", - keys = { - { "R", "", desc = " 󰖟 Rest" }, - { "Rs", "lua require('kulala').run()", desc = "Send the request" }, - { "Rt", "lua require('kulala').toggle_view()", desc = "Toggle headers/body" }, - { "Rp", "lua require('kulala').jump_prev()", desc = "Jump to previous request" }, - { "Rn", "lua require('kulala').jump_next()", desc = "Jump to next request" }, - }, - opts = {}, - }, - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - opts.ensure_installed = opts.ensure_installed or {} - vim.list_extend(opts.ensure_installed, { "http", "graphql" }) - return opts - end, - }, + { + "mistweaverco/kulala.nvim", + ft = "http", + keys = { + { "R", "", desc = " 󰖟 Rest" }, + { "Rs", "lua require('kulala').run()", desc = "Send the request" }, + { "Rt", "lua require('kulala').toggle_view()", desc = "Toggle headers/body" }, + { "Rp", "lua require('kulala').jump_prev()", desc = "Jump to previous request" }, + { "Rn", "lua require('kulala').jump_next()", desc = "Jump to next request" }, + }, + opts = {}, + }, + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + opts.ensure_installed = opts.ensure_installed or {} + vim.list_extend(opts.ensure_installed, { "http", "graphql" }) + return opts + end, + }, } diff --git a/lua/pcode/plugins/extras/restnvim.lua b/lua/pcode/plugins/extras/restnvim.lua index e8ac129..3c3b305 100644 --- a/lua/pcode/plugins/extras/restnvim.lua +++ b/lua/pcode/plugins/extras/restnvim.lua @@ -5,42 +5,42 @@ -- manual penggunaan -- https://www.jetbrains.com/help/idea/exploring-http-syntax.html return { - "rest-nvim/rest.nvim", - -- NOTE: Follow https://github.com/rest-nvim/rest.nvim/issues/306 - -- commit = "91badd46c60df6bd9800c809056af2d80d33da4c", - event = "VeryLazy", - enabled = vim.fn.executable("luarocks") == 1, - dependencies = { - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - vim.list_extend(opts.ensure_installed, { "http" }) - end, - }, - }, - config = function() - require("rest-nvim").setup() - vim.api.nvim_create_autocmd("FileType", { - pattern = { "http", "httpResult" }, - callback = function() - local opt = vim.opt - opt.number = false -- Print line number - opt.preserveindent = false -- Preserve indent structure as much as possible - opt.relativenumber = false - end, - }) - end, - ft = "http", - keys = { - { - "rh", - "Rest run", - desc = "Run http request under cursor", - }, - { - "rH", - "Rest last", - desc = "Run last http request", - }, - }, + "rest-nvim/rest.nvim", + -- NOTE: Follow https://github.com/rest-nvim/rest.nvim/issues/306 + -- commit = "91badd46c60df6bd9800c809056af2d80d33da4c", + event = "VeryLazy", + enabled = vim.fn.executable("luarocks") == 1, + dependencies = { + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + vim.list_extend(opts.ensure_installed, { "http" }) + end, + }, + }, + config = function() + require("rest-nvim").setup() + vim.api.nvim_create_autocmd("FileType", { + pattern = { "http", "httpResult" }, + callback = function() + local opt = vim.opt + opt.number = false -- Print line number + opt.preserveindent = false -- Preserve indent structure as much as possible + opt.relativenumber = false + end, + }) + end, + ft = "http", + keys = { + { + "rh", + "Rest run", + desc = "Run http request under cursor", + }, + { + "rH", + "Rest last", + desc = "Run last http request", + }, + }, } diff --git a/lua/pcode/plugins/extras/scrollview.lua b/lua/pcode/plugins/extras/scrollview.lua index ddbc298..73b0543 100644 --- a/lua/pcode/plugins/extras/scrollview.lua +++ b/lua/pcode/plugins/extras/scrollview.lua @@ -1,13 +1,13 @@ return { - "dstein64/nvim-scrollview", - lazy = true, - event = { "BufRead", "InsertEnter", "BufNewFile" }, - opts = { - bg = "LightCyan", - ctermbg = 160, - }, - config = function(_, opts) - require("scrollview").setup(opts) - vim.g.scrollview_excluded_filetypes = { "NvimTree", "vista_kind", "Outline", "neo-tree" } - end, + "dstein64/nvim-scrollview", + lazy = true, + event = { "BufRead", "InsertEnter", "BufNewFile" }, + opts = { + bg = "LightCyan", + ctermbg = 160, + }, + config = function(_, opts) + require("scrollview").setup(opts) + vim.g.scrollview_excluded_filetypes = { "NvimTree", "vista_kind", "Outline", "neo-tree" } + end, } diff --git a/lua/pcode/plugins/extras/smartsplit.lua b/lua/pcode/plugins/extras/smartsplit.lua index ebc4b83..42da51e 100644 --- a/lua/pcode/plugins/extras/smartsplit.lua +++ b/lua/pcode/plugins/extras/smartsplit.lua @@ -1,21 +1,21 @@ return { - "mrjones2014/smart-splits.nvim", - lazy = true, - event = { "BufRead", "InsertEnter", "BufNewFile" }, - opts = { - ignored_filetypes = { - "nofile", - "quickfix", - "qf", - "prompt", - }, - ignored_buftypes = { "nofile" }, - }, - config = function(_, opts) - require("smart-splits").setup(opts) - vim.keymap.set("n", "", require("smart-splits").resize_left) - vim.keymap.set("n", "", require("smart-splits").resize_down) - vim.keymap.set("n", "", require("smart-splits").resize_right) - end, + "mrjones2014/smart-splits.nvim", + lazy = true, + event = { "BufRead", "InsertEnter", "BufNewFile" }, + opts = { + ignored_filetypes = { + "nofile", + "quickfix", + "qf", + "prompt", + }, + ignored_buftypes = { "nofile" }, + }, + config = function(_, opts) + require("smart-splits").setup(opts) + vim.keymap.set("n", "", require("smart-splits").resize_left) + vim.keymap.set("n", "", require("smart-splits").resize_down) + vim.keymap.set("n", "", require("smart-splits").resize_right) + end, } diff --git a/lua/pcode/plugins/extras/transparent.lua b/lua/pcode/plugins/extras/transparent.lua index 0661863..b0970e0 100644 --- a/lua/pcode/plugins/extras/transparent.lua +++ b/lua/pcode/plugins/extras/transparent.lua @@ -1,64 +1,64 @@ return { - -- transparant config - { - "xiyaowong/transparent.nvim", - lazy = true, - event = "BufWinEnter", - cmd = { "TransparentToggle", "TransparentEnable", "TransparentDisable" }, - config = function() - require("transparent").setup({ - extra_groups = { - "Normal", - "NormalNC", - "NormalFloat", - "FloatBorder", - "Comment", - "Folded", - "GitSignsAdd", - "GitSignsDelete", - "GitSignsChange", - "FoldColumn", - "WinBar", - "WinBarNC", - "NotifyBackground", - }, - exclude_groups = { - -- disable active selection backgroun - "CursorLine", - "CursorLineNR", - "CursorLineSign", - "CursorLineFold", - -- disable nvimtree CursorLine - "NvimTreeCursorLine", - -- disable Neotree CursorLine - "NeoTreeCursorLine", - -- disable Telescope active selection background - "TelescopeSelection", - -- disable lualine background color - "LualineNormal", - }, - }) - require("transparent").clear_prefix("BufferLine") - -- clear prefix for which-key - require("transparent").clear_prefix("WhichKey") - -- clear prefix for lazy.nvim - require("transparent").clear_prefix("Lazy") - -- clear prefix for NvimTree - require("transparent").clear_prefix("NvimTree") - -- clear prefix for NeoTree - require("transparent").clear_prefix("NeoTree") - -- clear prefix for Telescope - require("transparent").clear_prefix("Telescope") - require("transparent").clear_prefix("mason") - -- create auto command to set transparent - vim.cmd("TransparentDisable") - vim.cmd("TransparentEnable") - end, - }, - { - "rcarriga/nvim-notify", - opts = function(_, opts) - opts.background_colour = "#00000000" - end, - }, + -- transparant config + { + "xiyaowong/transparent.nvim", + lazy = true, + event = "BufWinEnter", + cmd = { "TransparentToggle", "TransparentEnable", "TransparentDisable" }, + config = function() + require("transparent").setup({ + extra_groups = { + "Normal", + "NormalNC", + "NormalFloat", + "FloatBorder", + "Comment", + "Folded", + "GitSignsAdd", + "GitSignsDelete", + "GitSignsChange", + "FoldColumn", + "WinBar", + "WinBarNC", + "NotifyBackground", + }, + exclude_groups = { + -- disable active selection backgroun + "CursorLine", + "CursorLineNR", + "CursorLineSign", + "CursorLineFold", + -- disable nvimtree CursorLine + "NvimTreeCursorLine", + -- disable Neotree CursorLine + "NeoTreeCursorLine", + -- disable Telescope active selection background + "TelescopeSelection", + -- disable lualine background color + "LualineNormal", + }, + }) + require("transparent").clear_prefix("BufferLine") + -- clear prefix for which-key + require("transparent").clear_prefix("WhichKey") + -- clear prefix for lazy.nvim + require("transparent").clear_prefix("Lazy") + -- clear prefix for NvimTree + require("transparent").clear_prefix("NvimTree") + -- clear prefix for NeoTree + require("transparent").clear_prefix("NeoTree") + -- clear prefix for Telescope + require("transparent").clear_prefix("Telescope") + require("transparent").clear_prefix("mason") + -- create auto command to set transparent + vim.cmd("TransparentDisable") + vim.cmd("TransparentEnable") + end, + }, + { + "rcarriga/nvim-notify", + opts = function(_, opts) + opts.background_colour = "#00000000" + end, + }, } diff --git a/lua/pcode/plugins/extras/treesittercontex.lua b/lua/pcode/plugins/extras/treesittercontex.lua index 46ac2fd..7871d22 100644 --- a/lua/pcode/plugins/extras/treesittercontex.lua +++ b/lua/pcode/plugins/extras/treesittercontex.lua @@ -1,10 +1,10 @@ return { - "nvim-treesitter/nvim-treesitter-context", - lazy = true, - event = { "BufRead", "VeryLazy" }, - opts = {}, - keys = { - { "T", "", desc = "  TS Context" }, - { "Tt", "TSContextToggle", desc = "Toggle Context" }, - }, + "nvim-treesitter/nvim-treesitter-context", + lazy = true, + event = { "BufRead", "VeryLazy" }, + opts = {}, + keys = { + { "T", "", desc = "  TS Context" }, + { "Tt", "TSContextToggle", desc = "Toggle Context" }, + }, } diff --git a/lua/pcode/plugins/extras/verticalcolumn.lua b/lua/pcode/plugins/extras/verticalcolumn.lua index 0bedae9..8214e58 100644 --- a/lua/pcode/plugins/extras/verticalcolumn.lua +++ b/lua/pcode/plugins/extras/verticalcolumn.lua @@ -1,27 +1,27 @@ return { - { - "lukas-reineke/virt-column.nvim", - event = "BufRead", - opts = {}, - config = function() - local icons = require("pcode.user.icons") - require("virt-column").overwrite({ - exclude = { - filetypes = { "help", "text", "markdown" }, - }, - char = icons.ui.LineMiddle, - }) - -- Mengatur colum color max 80 caracter - vim.api.nvim_create_autocmd("BufWinEnter", { - pattern = "*", - callback = function() - vim.opt.formatoptions = "croql" - vim.opt.textwidth = 80 - vim.opt.colorcolumn = "+1" - vim.opt.lazyredraw = false - -- vim.cmd "hi ColorColumn guibg=#1B2430 ctermbg=246" - end, - }) - end, - }, + { + "lukas-reineke/virt-column.nvim", + event = "BufRead", + opts = {}, + config = function() + local icons = require("pcode.user.icons") + require("virt-column").overwrite({ + exclude = { + filetypes = { "help", "text", "markdown" }, + }, + char = icons.ui.LineMiddle, + }) + -- Mengatur colum color max 80 caracter + vim.api.nvim_create_autocmd("BufWinEnter", { + pattern = "*", + callback = function() + vim.opt.formatoptions = "croql" + vim.opt.textwidth = 80 + vim.opt.colorcolumn = "+1" + vim.opt.lazyredraw = false + -- vim.cmd "hi ColorColumn guibg=#1B2430 ctermbg=246" + end, + }) + end, + }, } diff --git a/lua/pcode/plugins/extras/visualmulti.lua b/lua/pcode/plugins/extras/visualmulti.lua index f52e20d..0717bfd 100644 --- a/lua/pcode/plugins/extras/visualmulti.lua +++ b/lua/pcode/plugins/extras/visualmulti.lua @@ -1,17 +1,17 @@ return { - "mg979/vim-visual-multi", - event = { "BufRead", "InsertEnter", "BufNewFile" }, - branch = "master", - lazy = true, - init = function() - vim.g.VM_mouse_mappings = 1 -- equal CTRL + Left Click on VSCODE - vim.g.VM_maps = { - ["Find Under"] = "", -- equal CTRL+D on VSCODE - ["Find Subword Under"] = "", -- equal CTRL+D on VSCODE - ["Select Cursor Down"] = "", -- equal CTRL+ALT+DOWN on VSCODE - ["Select Cursor Up"] = "", -- equal CTRL+ALT+UP on VSCODE - ["Undo"] = "u", -- undo - ["Redo"] = "", -- redo - } - end, + "mg979/vim-visual-multi", + event = { "BufRead", "InsertEnter", "BufNewFile" }, + branch = "master", + lazy = true, + init = function() + vim.g.VM_mouse_mappings = 1 -- equal CTRL + Left Click on VSCODE + vim.g.VM_maps = { + ["Find Under"] = "", -- equal CTRL+D on VSCODE + ["Find Subword Under"] = "", -- equal CTRL+D on VSCODE + ["Select Cursor Down"] = "", -- equal CTRL+ALT+DOWN on VSCODE + ["Select Cursor Up"] = "", -- equal CTRL+ALT+UP on VSCODE + ["Undo"] = "u", -- undo + ["Redo"] = "", -- redo + } + end, } diff --git a/lua/pcode/plugins/extras/yanky.lua b/lua/pcode/plugins/extras/yanky.lua index 3e05197..fbdd6b9 100644 --- a/lua/pcode/plugins/extras/yanky.lua +++ b/lua/pcode/plugins/extras/yanky.lua @@ -1,19 +1,19 @@ return { - "gbprod/yanky.nvim", - event = "BufReadPre", - opts = { - ring = { - history_length = 50, - storage = "memory", - }, - preserve_cursor_position = { - enabled = false, - }, - }, - config = function(_, opts) - require("yanky").setup(opts) - -- cycle through the yank history, only work after paste - vim.keymap.set("n", "[y", "(YankyCycleForward)") - vim.keymap.set("n", "]y", "(YankyCycleBackward)") - end, + "gbprod/yanky.nvim", + event = "BufReadPre", + opts = { + ring = { + history_length = 50, + storage = "memory", + }, + preserve_cursor_position = { + enabled = false, + }, + }, + config = function(_, opts) + require("yanky").setup(opts) + -- cycle through the yank history, only work after paste + vim.keymap.set("n", "[y", "(YankyCycleForward)") + vim.keymap.set("n", "]y", "(YankyCycleBackward)") + end, } diff --git a/lua/pcode/plugins/extras/zenmode.lua b/lua/pcode/plugins/extras/zenmode.lua index bb12e6c..79f4eee 100644 --- a/lua/pcode/plugins/extras/zenmode.lua +++ b/lua/pcode/plugins/extras/zenmode.lua @@ -1,22 +1,21 @@ return { - "folke/zen-mode.nvim", - event = "VeryLazy", - opts = { - plugins = { - options = { - -- hide statusline - laststatus = 0, - }, - }, - on_open = function(win) - require("notify")("Zen Mode ON") - end, - on_close = function() - require("notify")("Zen Mode OFF") - end, - }, - keys = { - { "z", "ZenMode", desc = "󰤼 Toggle Zen Mode" }, - }, + "folke/zen-mode.nvim", + event = "VeryLazy", + opts = { + plugins = { + options = { + -- hide statusline + laststatus = 0, + }, + }, + on_open = function(win) + require("notify")("Zen Mode ON") + end, + on_close = function() + require("notify")("Zen Mode OFF") + end, + }, + keys = { + { "z", "ZenMode", desc = "󰤼 Toggle Zen Mode" }, + }, } - diff --git a/lua/pcode/plugins/lang/php.lua b/lua/pcode/plugins/lang/php.lua index e2ed934..f9e671f 100644 --- a/lua/pcode/plugins/lang/php.lua +++ b/lua/pcode/plugins/lang/php.lua @@ -64,8 +64,8 @@ return { "pojokcodeid/auto-conform.nvim", event = "VeryLazy", opts = function(_, opts) - vim.list_extend(opts.ensure_installed, { "php-cs-fixer", "blade-formatter" }) - opts.formatters_by_ft.php = { "easy-coding-standard" } + vim.list_extend(opts.ensure_installed, { "pretty-php", "blade-formatter" }) + opts.formatters_by_ft.php = { "pretty-php" } opts.formatters_by_ft.blade = { "blade-formatter" } end, }, @@ -199,9 +199,11 @@ return { -- npm install -g tree-sitter-cli { "adalessa/laravel.nvim", - enabled = is_laravel_project() and vim.fn.has("win32") == 0, -- pastikan membuka laravel project - version = "v2.2.1", + enabled = is_laravel_project(), -- pastikan membuka laravel project + -- version = "v2.2.1", dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", "tpope/vim-dotenv", "nvim-telescope/telescope.nvim", "MunifTanjim/nui.nvim", diff --git a/lua/pcode/plugins/notify.lua b/lua/pcode/plugins/notify.lua index 183a8e9..639d0de 100644 --- a/lua/pcode/plugins/notify.lua +++ b/lua/pcode/plugins/notify.lua @@ -1,30 +1,30 @@ return { - "rcarriga/nvim-notify", - lazy = true, - event = "VeryLazy", - keys = { - { - "un", - function() - require("notify").dismiss({ silent = true, pending = true }) - end, - desc = "Delete all Notifications", - }, - }, - opts = { - timeout = 3000, - max_height = function() - return math.floor(vim.o.lines * 0.75) - end, - max_width = function() - return math.floor(vim.o.columns * 0.75) - end, - render = "wrapped-compact", - -- background_colour = "#00000000", - }, - config = function(_, opts) - local notify = require("notify") - notify.setup(opts) - vim.notify = notify.notify - end, + "rcarriga/nvim-notify", + lazy = true, + event = "VeryLazy", + keys = { + { + "uN", + function() + require("notify").dismiss({ silent = true, pending = true }) + end, + desc = "Delete all Notifications", + }, + }, + opts = { + timeout = 3000, + max_height = function() + return math.floor(vim.o.lines * 0.75) + end, + max_width = function() + return math.floor(vim.o.columns * 0.75) + end, + render = "wrapped-compact", + -- background_colour = "#00000000", + }, + config = function(_, opts) + local notify = require("notify") + notify.setup(opts) + vim.notify = notify.notify + end, } diff --git a/lua/pcode/user/custom.lua b/lua/pcode/user/custom.lua index f3b1257..095ee2e 100644 --- a/lua/pcode/user/custom.lua +++ b/lua/pcode/user/custom.lua @@ -1,129 +1,129 @@ return { - -- overidse dashboard - { - "goolord/alpha-nvim", - opts = { - dash_model = { - [[ _ __ __ ]], - [[ ___ ___ (____ / /__ _______ ___/ ___ ]], - [[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]], - [[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]], - [[ /_/ |___/ ]], - }, - }, - }, - -- overide lualine - { - "pojokcodeid/auto-lualine.nvim", - opts = { - -- for more options check out https://github.com/pojokcodeid/auto-lualine.nvim - setColor = "auto", - setOption = "roundedall", - setMode = 5, - }, - }, - -- overide formatting - { - "pojokcodeid/auto-conform.nvim", - opts = { - format_on_save = true, - format_timeout_ms = 5000, - }, - }, - -- install treesitter - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - vim.list_extend(opts.ensure_installed, { "lua", "c" }) - end, - }, - -- install mason (lsp, dap, linters, formatters) - { - "williamboman/mason.nvim", - opts = { ensure_installed = { "stylua" } }, - }, - -- overide lsp config - { - "williamboman/mason-lspconfig.nvim", - opts = function(_, opts) - vim.list_extend(opts.skip_config, { "jdtls" }) - opts.virtual_text = true - end, - }, - -- add whichkey mappings - { - "folke/which-key.nvim", - opts = function(_, opts) - opts.mappings = opts.mappings or {} - vim.list_extend(opts.mappings, { - { "h", "nohlsearch", desc = "󱪿 No Highlight", mode = "n" }, - }) - end, - }, - -- overide telescope - { - "nvim-telescope/telescope.nvim", - opts = function(_, opts) - opts.pickers = { - find_files = { - hidden = true, - }, - live_grep = { - theme = "dropdown", - only_sort_text = true, - additional_args = function() - return { "--multiline" } - end, - }, - } - end, - }, - -- add code runner - { - "CRAG666/code_runner.nvim", - opts = function(_, opts) - vim.list_extend(opts.filetype, { go = "go run $fileName" }) - end, - }, - -- custem nvimtree - { - "nvim-tree/nvim-tree.lua", - opts = function(_, opts) - -- set nvimtree float view (default left side) - -- opts.view = { - -- adaptive_size = false, - -- centralize_selection = true, - -- side = "left", - -- preserve_window_proportions = false, - -- number = false, - -- relativenumber = false, - -- signcolumn = "yes", - -- float = { - -- enable = true, - -- open_win_config = function() - -- local screen_w = vim.opt.columns:get() - -- local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get() - -- local window_w = screen_w * 0.5 - -- local window_h = screen_h * 0.9 - -- local window_w_int = math.floor(window_w) - -- local window_h_int = math.floor(window_h) - -- local center_x = (screen_w - window_w) / 2 - -- local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get() - -- return { - -- border = "rounded", - -- relative = "editor", - -- row = center_y, - -- col = center_x, - -- width = window_w_int, - -- height = window_h_int, - -- } - -- end, - -- }, - -- width = function() - -- return math.floor(vim.opt.columns:get() * 0.5) - -- end, - -- } - return opts - end, - }, + -- overidse dashboard + { + "goolord/alpha-nvim", + opts = { + dash_model = { + [[ _ __ __ ]], + [[ ___ ___ (____ / /__ _______ ___/ ___ ]], + [[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]], + [[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]], + [[ /_/ |___/ ]], + }, + }, + }, + -- overide lualine + { + "pojokcodeid/auto-lualine.nvim", + opts = { + -- for more options check out https://github.com/pojokcodeid/auto-lualine.nvim + setColor = "auto", + setOption = "roundedall", + setMode = 5, + }, + }, + -- overide formatting + { + "pojokcodeid/auto-conform.nvim", + opts = { + format_on_save = true, + format_timeout_ms = 5000, + }, + }, + -- install treesitter + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + vim.list_extend(opts.ensure_installed, { "lua", "c" }) + end, + }, + -- install mason (lsp, dap, linters, formatters) + { + "williamboman/mason.nvim", + opts = { ensure_installed = { "stylua" } }, + }, + -- overide lsp config + { + "williamboman/mason-lspconfig.nvim", + opts = function(_, opts) + vim.list_extend(opts.skip_config, { "jdtls" }) + opts.virtual_text = true + end, + }, + -- add whichkey mappings + { + "folke/which-key.nvim", + opts = function(_, opts) + opts.mappings = opts.mappings or {} + vim.list_extend(opts.mappings, { + { "h", "nohlsearch", desc = "󱪿 No Highlight", mode = "n" }, + }) + end, + }, + -- overide telescope + { + "nvim-telescope/telescope.nvim", + opts = function(_, opts) + opts.pickers = { + find_files = { + hidden = true, + }, + live_grep = { + theme = "dropdown", + only_sort_text = true, + additional_args = function() + return { "--multiline" } + end, + }, + } + end, + }, + -- add code runner + { + "CRAG666/code_runner.nvim", + opts = function(_, opts) + vim.list_extend(opts.filetype, { go = "go run $fileName" }) + end, + }, + -- custem nvimtree + { + "nvim-tree/nvim-tree.lua", + opts = function(_, opts) + -- set nvimtree float view (default left side) + -- opts.view = { + -- adaptive_size = false, + -- centralize_selection = true, + -- side = "left", + -- preserve_window_proportions = false, + -- number = false, + -- relativenumber = false, + -- signcolumn = "yes", + -- float = { + -- enable = true, + -- open_win_config = function() + -- local screen_w = vim.opt.columns:get() + -- local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get() + -- local window_w = screen_w * 0.5 + -- local window_h = screen_h * 0.9 + -- local window_w_int = math.floor(window_w) + -- local window_h_int = math.floor(window_h) + -- local center_x = (screen_w - window_w) / 2 + -- local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get() + -- return { + -- border = "rounded", + -- relative = "editor", + -- row = center_y, + -- col = center_x, + -- width = window_w_int, + -- height = window_h_int, + -- } + -- end, + -- }, + -- width = function() + -- return math.floor(vim.opt.columns:get() * 0.5) + -- end, + -- } + return opts + end, + }, } diff --git a/lua/pcode/user/default.lua b/lua/pcode/user/default.lua index 5e698d6..d0beb40 100644 --- a/lua/pcode/user/default.lua +++ b/lua/pcode/user/default.lua @@ -24,7 +24,7 @@ pcode.extras = { minianimate = false, neoscroll = false, nvimufo = false, - refactoring = false, + refactoring = true, rest = false, treesittercontex = false, codeium = true, diff --git a/lua/pcode/user/options.lua b/lua/pcode/user/options.lua index c900c7a..7f8888c 100644 --- a/lua/pcode/user/options.lua +++ b/lua/pcode/user/options.lua @@ -69,3 +69,5 @@ vim.api.nvim_create_autocmd("FileType", { opt.relativenumber = false end, }) + +vim.opt.guicursor = "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20"