enc: upgrade v2 to v2.5

This commit is contained in:
Pojok Code 2024-11-04 21:29:25 +07:00
parent 68ea712b98
commit 609234c086
443 changed files with 5224 additions and 90746 deletions

View file

@ -1 +0,0 @@
vim.bo.commentstring = '{{-- %s --}}'

View file

@ -1 +0,0 @@
vim.bo.commentstring = '// %s'

View file

@ -1 +0,0 @@
vim.bo.commentstring = '<!-- %s -->'

View file

@ -1,4 +0,0 @@
(directive) @tag
(directive_start) @tag
(directive_end) @tag
(comment) @comment @spell

View file

@ -1,16 +0,0 @@
((text) @injection.content
(#not-has-ancestor? @injection.content "envoy")
(#set! injection.combined)
(#set! injection.language php))
((text) @injection.content
(#has-ancestor? @injection.content "envoy")
(#set! injection.combined)
(#set! injection.language bash))
((php_only) @injection.content
(#set! injection.combined)
(#set! injection.language php_only))
((parameter) @injection.content
(#set! injection.language php_only))

View file

@ -1,36 +0,0 @@
;; extends
; AlpineJS attributes
(attribute
(attribute_name) @_attr
(#lua-match? @_attr "^x%-%l")
(#not-any-of? @_attr "x-teleport" "x-ref" "x-transition")
(quoted_attribute_value
(attribute_value) @injection.content)
(#set! injection.language "javascript"))
; Blade escaped JS attributes
; <x-foo ::bar="baz" />
(element
(_
(tag_name) @_tag
(#lua-match? @_tag "^x%-%l")
(attribute
(attribute_name) @_attr
(#lua-match? @_attr "^::%l")
(quoted_attribute_value
(attribute_value) @injection.content)
(#set! injection.language "javascript"))))
; Blade PHP attributes
; <x-foo :bar="$baz" />
(element
(_
(tag_name) @_tag
(#lua-match? @_tag "^x%-%l")
(attribute
(attribute_name) @_attr
(#lua-match? @_attr "^:%l")
(quoted_attribute_value
(attribute_value) @injection.content)
(#set! injection.language "php_only"))))

View file

@ -1,10 +0,0 @@
;; extends
[
; prevent double indent for `return new class ...`
(return_statement
(object_creation_expression))
; prevent double indent for `return function() { ... }`
(return_statement
(anonymous_function_creation_expression))
] @indent.dedent

View file

@ -1,9 +0,0 @@
;; extends
; ((text) @injection.content
; (#set! injection.language "html")
; (#set! injection.combined))
; ((php) @injection.content
; (#set! injection.language "php_only")
; (#set! injection.combined))

View file

@ -1,180 +0,0 @@
-- more space in the neovim command line for displaying messages
-- use this function notation to build some variables
-- vim.opt_local.shiftwidth = 4
-- vim.opt_local.tabstop = 4
-- vim.opt_local.softtabstop = 4
-- vim.opt_local.ts = 4
-- vim.opt_local.expandtab = true
--
-- local status, jdtls = pcall(require, "jdtls")
-- if not status then
-- return
-- end
--
-- local function capabilities()
-- local status_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
-- if status_ok then
-- return cmp_nvim_lsp.default_capabilities()
-- end
--
-- local CAPABILITIES = vim.lsp.protocol.make_client_capabilities()
-- CAPABILITIES.textDocument.completion.completionItem.snippetSupport = true
-- CAPABILITIES.textDocument.completion.completionItem.resolveSupport = {
-- properties = {
-- "documentation",
-- "detail",
-- "additionalTextEdits",
-- },
-- }
--
-- return CAPABILITIES
-- end
--
-- local function directory_exists(path)
-- local f = io.popen("cd " .. path)
-- local ff = f:read("*all")
--
-- if ff:find("ItemNotFoundException") then
-- return false
-- else
-- return true
-- end
-- end
--
-- local root_markers = { ".git", "mvnw", "gradlew", "pom.xml", "build.gradle" }
-- local root_dir = require("jdtls.setup").find_root(root_markers)
--
-- -- calculate workspace dir
-- local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t")
-- local workspace_dir = vim.fn.stdpath("data") .. "/site/java/workspace-root/" .. project_name
-- if directory_exists(workspace_dir) then
-- else
-- os.execute("mkdir " .. workspace_dir)
-- end
-- -- get the mason install path
-- local install_path = require("mason-registry").get_package("jdtls"):get_install_path()
--
-- -- get the current OS
-- local os
-- if vim.fn.has("macunix") then
-- os = "mac"
-- elseif vim.fn.has("win32") then
-- os = "win"
-- else
-- os = "linux"
-- end
--
-- local bundles = {}
-- local mason_path = vim.fn.glob(vim.fn.stdpath("data") .. "/mason/")
-- vim.list_extend(bundles, vim.split(vim.fn.glob(mason_path .. "packages/java-test/extension/server/*.jar"), "\n"))
-- vim.list_extend(
-- bundles,
-- vim.split(
-- vim.fn.glob(
-- vim.fn.stdpath("data")
-- .. "/lazy/java-debug/com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin-*.jar"
-- ),
-- "\n"
-- )
-- )
--
-- local config = {
-- cmd = {
-- "java",
-- "-Declipse.application=org.eclipse.jdt.ls.core.id1",
-- "-Dosgi.bundles.defaultStartLevel=4",
-- "-Declipse.product=org.eclipse.jdt.ls.core.product",
-- "-Dlog.protocol=true",
-- "-Dlog.level=ALL",
-- "-javaagent:" .. install_path .. "/lombok.jar",
-- "-Xms1g",
-- "--add-modules=ALL-SYSTEM",
-- "--add-opens",
-- "java.base/java.util=ALL-UNNAMED",
-- "--add-opens",
-- "java.base/java.lang=ALL-UNNAMED",
-- "-jar",
-- vim.fn.glob(install_path .. "/plugins/org.eclipse.equinox.launcher_*.jar"),
-- "-configuration",
-- install_path .. "/config_" .. os,
-- "-data",
-- workspace_dir,
-- },
-- capabilities = capabilities(),
-- root_dir = root_dir,
-- settings = {
-- java = {},
-- },
--
-- init_options = {
-- bundles = bundles,
-- -- bundles = {
-- -- vim.fn.glob(
-- -- mason_path .. "packages/java-debug-adapter/extension/server/com.microsoft.java.debug.plugin-*.jar",
-- -- "\n"
-- -- ),
-- -- },
-- },
-- }
--
-- config["on_attach"] = function(client, bufnr)
-- local _, _ = pcall(vim.lsp.codelens.refresh)
--
-- -- valdation if DAP not installed
-- local dap_status, _ = pcall(require, "nvim-dap")
-- if not dap_status then
-- return
-- end
--
-- require("jdtls.dap").setup_dap_main_class_configs()
-- jdtls.setup_dap({ hotcodereplace = "auto" })
-- require("user.lsp.handlers").on_attach(client, bufnr)
-- end
--
-- vim.api.nvim_create_autocmd({ "BufWritePost" }, {
-- pattern = { "*.java" },
-- callback = function()
-- local _, _ = pcall(vim.lsp.codelens.refresh)
-- end,
-- })
--
-- jdtls.start_or_attach(config)
--
-- vim.cmd(
-- [[command! -buffer -nargs=? -complete=custom,v:lua.require'jdtls'._complete_set_runtime JdtSetRuntime lua require('jdtls').set_runtime(<f-args>)]]
-- )
-- local mason_reg = require("mason-registry")
-- for _, pkg in pairs(mason_reg.get_installed_packages()) do
-- for _, type in pairs(pkg.spec.categories) do
-- if type == "LSP" and pkg.spec.name == "jdtls" then
-- local ok, lspconfig = pcall(require, "lspconfig")
-- if not ok then
-- return
-- end
--
-- lspconfig.jdtls.setup({
-- cmd = {
-- "jdtls",
-- "-configuration",
-- vim.fn.expand("$HOME") .. "/.cache/jdtls/config",
-- "-data",
-- vim.fn.expand("$HOME") .. "/.cache/jdtls/workspace",
-- },
-- filetypes = { "java" },
-- root_dir = require("lspconfig.util").root_pattern(
-- -- Single-module projects
-- {
-- "build.xml", -- Ant
-- "pom.xml", -- Maven
-- "settings.gradle", -- Gradle
-- "settings.gradle.kts", -- Gradle
-- },
-- -- Multi-module projects
-- { "build.gradle", "build.gradle.kts" }
-- ) or vim.fn.getcwd(),
-- singe_file_support = true,
-- })
-- end
-- end
-- end

View file

@ -1,59 +0,0 @@
-- vim.opt_local.expandtab = true
-- vim.opt_local.shiftwidth = 4
-- vim.opt_local.tabstop = 4
-- vim.opt_local.softtabstop = 4
-- local status_ok, configs = pcall(require, "nvim-treesitter.configs")
-- if not status_ok then
-- return
-- end
-- local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
-- if not lspconfig_status_ok then
-- return
-- end
-- local mason_ok, mason_lsp = pcall(require, "mason-lspconfig")
-- if not mason_ok then
-- return
-- end
-- mason_lsp.setup({
-- ensure_installed = { "kotlin_language_server" },
-- automatic_installation = true,
-- })
-- lspconfig.kotlin_language_server.setup({
-- on_attach = require("user.lsp.handlers").on_attach,
-- capabilities = require("user.lsp.handlers").capabilities,
-- cmd = { "kotlin-language-server" },
-- filetypes = { "kotlin" },
-- root_dir = require("lspconfig.util").root_pattern(
-- "build.gradle.kts",
-- "build.gradle",
-- "settings.gradle",
-- "gradlew",
-- "pom.xml",
-- "build.gradle.kts",
-- "build.kts",
-- ".git"
-- ),
-- })
-- configs.setup({
-- ensure_installed = { "kotlin" }, -- pastikan parser TypeScript terinstal
-- highlight = {
-- enable = true, -- aktifkan highlight berbasis treesitter
-- additional_vim_regex_highlighting = false,
-- },
-- rainbow = {
-- enable = false,
-- },
-- incremental_selection = { enable = true },
-- indent = { enable = true, disable = { "python", "css" } },
-- autopairs = {
-- enable = true,
-- },
-- })
--
-- require("nvim-ts-autotag").setup()

View file

@ -1,5 +0,0 @@
vim.opt_local.shiftwidth = 4
vim.opt_local.tabstop = 4
vim.opt_local.softtabstop = 4
vim.opt_local.ts = 4
vim.opt_local.expandtab = true

View file

@ -1,4 +0,0 @@
vim.opt_local.expandtab = true
vim.opt_local.shiftwidth = 4
vim.opt_local.tabstop = 4
vim.opt_local.softtabstop = 4

View file

@ -1,109 +0,0 @@
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
if not status_ok then
return
end
configs.setup({
ensure_installed = { "typescript", "tsx" }, -- pastikan parser TypeScript terinstal
highlight = {
enable = true, -- aktifkan highlight berbasis treesitter
additional_vim_regex_highlighting = false,
},
rainbow = {
enable = false,
},
incremental_selection = { enable = true },
indent = { enable = true, disable = { "python", "css" } },
autopairs = {
enable = true,
},
})
require("nvim-ts-autotag").setup()
-- local lspconfig_status_ok, lspconfig = pcall(require, "lspconfig")
-- if not lspconfig_status_ok then
-- return
-- end
-- local function idxOf(array, value)
-- for i, v in ipairs(array) do
-- if v == value then
-- return i
-- end
-- end
-- return nil
-- end
-- local unregis_lsp = {}
-- local data_ok, unregis = pcall(require, "core.config")
-- if data_ok then
-- if unregis.unregister_lsp ~= nil then
-- unregis_lsp = unregis.unregister_lsp
-- end
-- end
-- local idxts = idxOf(unregis_lsp, "tsserver")
-- if idxts ~= nil then
-- lspconfig.tsserver.setup({
-- on_attach = require("user.lsp.handlers").on_attach,
-- capabilities = require("user.lsp.handlers").capabilities,
-- -- add cmd
-- cmd = { "typescript-language-server", "--stdio" },
-- -- add file type support
-- filetypes = {
-- "javascript",
-- "javascriptreact",
-- "javascript.jsx",
-- "typescript",
-- "typescriptreact",
-- "typescript.tsx",
-- },
-- -- add dynamic root dir support
-- root_dir = require("lspconfig.util").root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"),
-- init_options = {
-- hostInfo = "neovim",
-- },
-- })
-- end
-- local idxemmet = idxOf(unregis_lsp, "emmet_ls")
-- if idxemmet ~= nil then
-- lspconfig.emmet_ls.setup({
-- on_attach = require("user.lsp.handlers").on_attach,
-- capabilities = require("user.lsp.handlers").capabilities,
-- -- add cmd
-- cmd = { "emmet-ls", "-c", "--stdio" },
-- -- add file type support
-- filetypes = {
-- "javascript",
-- "javascriptreact",
-- "javascript.jsx",
-- "typescript",
-- "typescriptreact",
-- "typescript.tsx",
-- },
-- -- add dynamic root dir support
-- root_dir = require("lspconfig.util").root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"),
-- })
-- end
-- local idxeslint = idxOf(unregis_lsp, "eslint")
-- if idxeslint ~= nil then
-- lspconfig.eslint.setup({
-- on_attach = require("user.lsp.handlers").on_attach,
-- capabilities = require("user.lsp.handlers").capabilities,
-- -- add cmd
-- cmd = { "vscode-eslint-language-server", "--stdio" }, -- add file type support
-- filetypes = {
-- "javascript",
-- "javascriptreact",
-- "javascript.jsx",
-- "typescript",
-- "typescriptreact",
-- "typescript.tsx",
-- },
-- -- add dynamic root dir support
-- root_dir = require("lspconfig.util").root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"),
-- })
-- end

View file

@ -1,4 +1,3 @@
-- PERF fully optimized
if vim.g.vscode then
-- config vscode
Map = vim.keymap.set
@ -11,5 +10,5 @@ if vim.g.vscode then
require("_vscode.mappings")
else
-- config neovim
require("core")
require("pcode.core")
end

View file

@ -1,14 +1,15 @@
{
"Comment.nvim": { "branch": "master", "commit": "e51f2b142d88bb666dcaa77d93a07f4b419aca70" },
"Eva-Theme.nvim": { "branch": "master", "commit": "902dd17975a7710e544d409ea856dbecc9d64997" },
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
"Eva-Theme.nvim": { "branch": "master", "commit": "568fdba3a2a3088bec2198e7bb8f28d482629e58" },
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"LuaSnip": { "branch": "master", "commit": "4bf40748f6fe939bdcb69325918535b1c5edea51" },
"alpha-nvim": { "branch": "main", "commit": "bf3c8bb8c02ed3d9644cc5bbc48e2bdc39349cd7" },
"auto-bufferline.nvim": { "branch": "main", "commit": "f5835a4b62bfb6f6c829f8f050e5102ccf230b3e" },
"auto-conform.nvim": { "branch": "main", "commit": "5f0897235e84bf2f8ff9d634e81678d5bfa63ab8" },
"auto-lint.nvim": { "branch": "main", "commit": "aff13cb8eaa055e66e940d43b7d83166397e5413" },
"auto-lsp.nvim": { "branch": "main", "commit": "352e1a55a10026525f6b7489055b5fbe56d15703" },
"auto-lualine.nvim": { "branch": "main", "commit": "fc8557f61dc1da12a8b90167a49420958b991d8c" },
"bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" },
"breadcrumbs.nvim": { "branch": "master", "commit": "9f764278784ce2f10dbe2f555ba14be2451d36a0" },
"bufferline.nvim": { "branch": "main", "commit": "5cc447cb2b463cb499c82eaeabbed4f5fa6a0a44" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
@ -17,52 +18,54 @@
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
"code_runner.nvim": { "branch": "main", "commit": "dcedccbf969a0f3bc00db446172b4966e83101dd" },
"codeium.nvim": { "branch": "main", "commit": "dddaee0d1e9a1d0bcaea66f08a8103b3cdf26604" },
"conform.nvim": { "branch": "master", "commit": "50649648851cd0e126dfedd0f3c33b900a6f1ef8" },
"dressing.nvim": { "branch": "master", "commit": "1b7921eecc65af1baf8ac1dc06f0794934cbcfb2" },
"codeium.vim": { "branch": "main", "commit": "8c01979323b2b480c8bf160d3ff85bd1668baa49" },
"conform.nvim": { "branch": "master", "commit": "d28ccf945374edd9f1c34a82f6c22261dbd8ab98" },
"dressing.nvim": { "branch": "master", "commit": "c334ac73e031f0dc93d6d91f3658ee75b8be1d3b" },
"friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" },
"gitsigns.nvim": { "branch": "main", "commit": "0b04035bb7b3c83e999b9676e2fb46fd0aa9f910" },
"gitsigns.nvim": { "branch": "main", "commit": "4daf7022f1481edf1e8fb9947df13bb07c18e89a" },
"indent-blankline.nvim": { "branch": "master", "commit": "04e44b09ee3ff189c69ab082edac1ef7ae2e256c" },
"lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" },
"live-server.nvim": { "branch": "main", "commit": "5fc8abb727827a09d0ce1b7757d0a4c7b5802b09" },
"lsp-progress.nvim": { "branch": "main", "commit": "d5f4d28efe75ce636bfbe271eb45f39689765aab" },
"lazy.nvim": { "branch": "main", "commit": "b1134ab82ee4279e31f7ddf7e34b2a99eb9b7bc9" },
"lualine.nvim": { "branch": "master", "commit": "640260d7c2d98779cab89b1e7088ab14ea354a02" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
"mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
"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" },
"mini.indentscope": { "branch": "main", "commit": "da9af64649e114aa79480c238fd23f6524bc0903" },
"minty": { "branch": "main", "commit": "6e5c4cfc66e5dbb248ab78293d1c147de0c33a54" },
"neoscroll.nvim": { "branch": "master", "commit": "a731f66f1d39ec6175fd201c5bf849e54abda99c" },
"neotest": { "branch": "master", "commit": "6d3d22cdad49999ef774ebe1bc250a4994038964" },
"neotest-phpunit": { "branch": "main", "commit": "baae8dfa0a3aaacd9f0bb6845d6348f5bcdc48bb" },
"noice.nvim": { "branch": "main", "commit": "5a78b42bec5e775f2db03bf93f6d1e0f3636306c" },
"nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" },
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
"nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" },
"nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" },
"nvim-colorizer.lua": { "branch": "master", "commit": "19477946096b7800ca215bc813c0f021ae98c46c" },
"nvim-colorizer.lua": { "branch": "master", "commit": "58bbb51898709b4222feaa84a30464a107ddf8eb" },
"nvim-dap": { "branch": "master", "commit": "7ff6936010b7222fea2caea0f67ed77f1b7c60dd" },
"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": "056f569f71e4b726323b799b9cfacc53653bceb3" },
"nvim-lspconfig": { "branch": "master", "commit": "bc6ada4b0892b7f10852c0b8ca7209fd39a6d754" },
"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": "bc37a942debe191fffd072f0f1f2ec7c56c54b17" },
"nvim-tree.lua": { "branch": "master", "commit": "4a9e82d10a3715d0c3845e1d2f66ddfb8b711253" },
"nvim-scrollview": { "branch": "main", "commit": "f7f611330a8f7cd00dc81538fec369611be678ed" },
"nvim-tree.lua": { "branch": "master", "commit": "610a1c189bdb2b9b936169b2ea9d1838f971fa2b" },
"nvim-treesitter": { "branch": "master", "commit": "dfd3207ed43a0c572c13acc02bf9d7dc270f4030" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "3e450cd85243da99dc23ebbf14f9c70e9a0c26a4" },
"nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "9c74db656c3d0b1c4392fc89a016b1910539e7c0" },
"nvim-web-devicons": { "branch": "master", "commit": "5b9067899ee6a2538891573500e8fd6ff008440f" },
"playground": { "branch": "master", "commit": "bcfab84f98a33f2ad34dda6c842046dca70aabf6" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
"nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "e0f9b3efe150724af2d2ed59997d5ece373840e3" },
"smart-splits.nvim": { "branch": "master", "commit": "1a2b268a7ec7aeef879cdd15973339010ec134f7" },
"smart-splits.nvim": { "branch": "master", "commit": "477a004122ea180b14d3e29544857d572c861668" },
"telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" },
"tiny-devicons-auto-colors.nvim": { "branch": "main", "commit": "a39fa4c92268832f6034306793b8acbfec2a7549" },
"toggleterm.nvim": { "branch": "main", "commit": "5969229c0352ff1ed7f6e24aba9c6554e1842939" },
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
"vim-startuptime": { "branch": "master", "commit": "97a88e688482a09c3c4b777d07b509b328a5ec29" },
"vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" },
"virt-column.nvim": { "branch": "master", "commit": "b62b4ef0774d19452d4ed18e473e824c7a756f2f" },
"volt": { "branch": "main", "commit": "c99a2f4ece14ff501f14e4c10fe9cd60b22757a8" },
"which-key.nvim": { "branch": "main", "commit": "fb070344402cfc662299d9914f5546d840a22126" },
"yanky.nvim": { "branch": "main", "commit": "9268018e92d02650a94e39dd5f5903c542f7ea11" },
"zen-mode.nvim": { "branch": "main", "commit": "04b52674b8c800f8b7d4609e8bd8d0212e3ffa79" }
"vscode-php-debug": { "branch": "main", "commit": "6193fbc1c819437325df3dad43e254d8e5c416e5" },
"which-key.nvim": { "branch": "main", "commit": "8badb359f7ab8711e2575ef75dfe6fbbd87e4821" },
"yanky.nvim": { "branch": "main", "commit": "73215b77d22ebb179cef98e7e1235825431d10e4" },
"zen-mode.nvim": { "branch": "main", "commit": "29b292bdc58b76a6c8f294c961a8bf92c5a6ebd6" }
}

View file

@ -1,60 +0,0 @@
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
vim.fn.system({
"git", "clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath
})
end
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({
spec = {
{ import = "plugins.themes" },
{ import = "plugins" },
{ import = "custom.plugins" },
},
defaults = {
lazy = true, -- every plugin is lazy-loaded by default
version = "*", -- try installing the latest stable version for plugins that support semver
},
ui = {
backdrop = 100,
border = "rounded",
browser = "chrome",
throttle = 40,
custom_keys = { ["<localleader>l"] = false },
icons = {
ft = icons.ft,
lazy = icons.Bell .. " ",
loaded = icons.CheckCircle,
not_loaded = icons.not_loaded,
},
},
change_detection = { enabled = false, notify = false },
checker = { enabled = true }, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
"matchit",
"matchparen",
"netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
"lazyredraw",
},
},
},
})

View file

@ -1,22 +0,0 @@
_G.pcode = _G.pcode or {}
require("custom.default")
require("custom.dashboard")
require("config.lazy_lib")
require("user.colorscheme")
require("user.keymaps")
require("core.neovide")
require("custom.autocmd")
require("custom.keymaps")
-- require("user.snip")
-- require("user.nvim-tree")
-- require("user.options")
-- require("user.keymaps")
-- require("user.autocommands")
-- require("user.format_onsave")
-- require("user.snip")
-- require("user.bufferline")
-- require("user.chat_gpt")
-- vim.cmd("colorscheme one_monokai")
-- vim.cmd("colorscheme onedark")
-- vim.cmd("colorscheme github_dark_dimmed")
-- vim.cmd("colorscheme github_dark_high_contrast")

View file

@ -1,55 +0,0 @@
local transparent_mode = pcode.transparent_mode or 0
if transparent_mode ~= nil then
if transparent_mode == 1 then
vim.cmd("TransparentDisable")
vim.cmd("TransparentEnable")
end
end
-- get folder name from current directory
local _get_folder_name = function()
local str = vim.fn.fnamemodify(vim.fn.getcwd(), ":t")
return " " .. str:lower():gsub("^%l", string.upper) .. " "
end
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
vim.api.nvim_create_autocmd("BufRead", {
group = vim.api.nvim_create_augroup("BufRead", { clear = true }),
command = 'silent !wezterm cli set-tab-title "' .. _get_folder_name() .. '"',
desc = "Set Folder Name",
})
end
vim.api.nvim_create_autocmd("ExitPre", {
group = vim.api.nvim_create_augroup("Exit", { clear = true }),
command = "set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50,a:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor,sm:block-blinkwait175-blinkoff150-blinkon175,a:ver90",
desc = "Set cursor back to beam when leaving Neovim.",
})
-- config for vim-visual-multi color selection
vim.g.VM_Mono_hl = "DiffText"
vim.g.VM_Extend_hl = "DiffAdd"
-- vim.g.VM_Cursor_hl = "Visual"
vim.g.VM_Cursor_hl = "DiffText"
vim.g.VM_Insert_hl = "DiffChange"
-- NvimTree automatically resize the floating window when neovim's window size changes
-- local tree_api = require("nvim-tree")
-- local tree_view = require("nvim-tree.view")
--
-- vim.api.nvim_create_augroup("NvimTreeResize", {
-- clear = true,
-- })
--
-- vim.api.nvim_create_autocmd({ "VimResized" }, {
-- group = "NvimTreeResize",
-- callback = function()
-- if tree_view.is_visible() then
-- tree_view.close()
-- tree_api.open()
-- end
-- end,
-- })

View file

@ -1,37 +0,0 @@
-- Untuk Ubah Dashboard
-- 1. Buka remark dash board dibawah
-- 2. Ubah dashboard sesuai keinginan dan kebutuhan
pcode.header1 = {
[[ _ __ __ ]],
[[ ___ ___ (____ / /__ _______ ___/ ___ ]],
[[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]],
[[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]],
[[ /_/ |___/ ]],
}
-- pcode.header2 = {
-- [[ __ ]],
-- [[ ___ ___ ___ __ __ /\_\ ___ ___ ]],
-- [[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]],
-- [[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]],
-- [[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]],
-- [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]],
-- }
-- pcode.header1 = {
-- " ▄ ▄ ",
-- " ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ ",
-- " █ ▄ █▄█ ▄▄▄ █ █▄█ █ █ ",
-- " ▄▄ █▄█▄▄▄█ █▄█▄█▄▄█▄▄█ █ ",
-- " ▄ █▄▄█ ▄ ▄▄ ▄█ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ",
-- " █▄▄▄▄ ▄▄▄ █ ▄ ▄▄▄ ▄ ▄▄▄ ▄ ▄ █ ▄",
-- "▄ █ █▄█ █▄█ █ █ █▄█ █ █▄█ ▄▄▄ █ █",
-- "█▄█ ▄ █▄▄█▄▄█ █ ▄▄█ █ ▄ █ █▄█▄█ █",
-- " █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█ █▄█▄▄▄█ ",
-- }
pcode.footer = "PCode"
-- 1 startify model
-- 2 dashboard model
pcode.model = 1 -- isi dengan 1 atau 2 untuk model dashboard

View file

@ -1,181 +0,0 @@
-- custom colorscheme
-- colorscheme ready :
-- tokyonight, tokyonight-night, tokyonight-storm, tokyonight-day, tokyonight-moon
-- gruvbox-baby (default)
-- sonokai, sonokai_atlantis,
-- sonokai_andromeda,sonokai_shusia,sonokai_maia,sonokai_espresso
-- material, material_deepocean, material_palenight, material_lighter, material_darker
-- onedark, onedark_vivid, onedark_dark
-- nord
-- catppuccin, catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha
-- dracula
-- nightfox, dayfox, dawnfox, duskfox, nordfox, terafox, carbonfox
-- github_dark, github_dark_default, github_dark_colorblind, github_dark_dimmed
-- solarized-osaka
-- darcula-dark
-- juliana
-- Eva-Dark, Eva-Dark-Italic, Eva-Dark-Bold
pcode.colorscheme = "Eva-Dark"
-- 0 =off 1= on
pcode.transparent_mode = 0
-- https://github.com/nvim-lualine/lualine.nvim
-- rounded
-- roundedall
-- square
-- triangle
-- parallelogram
-- transparent
-- default
pcode.lualinetheme = "roundedall"
-- 0 disable progress
-- 1 lualine lsp progress
-- 2 fidget progress
pcode.progress = 1
-- 0 = on full text mode info,
-- 1 = on initial mode + logo
-- 2 = logo only
-- 3 = initial only
-- 4 = off
-- 5 = icon
pcode.show_mode = 5
-- true or false
pcode.format_on_save = true
pcode.format_timeout_ms = 5000
-- https://github.com/mfussenegger/nvim-lint
-- https://github.com/stevearc/conform.nvim
-- use conform and nvim-lint if set true
pcode.disable_null_ls = true
pcode.treesitter_ensure_installed = {}
pcode.tscontext = false
-- ini hanya untuk lsp yg tidak support masson
-- untuk referesi support language kunjungi link dibawah
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
pcode.lsp_installer = {
-- "yamlls",
-- tambahkan di bawah sini setelah melakukan :masoninstall
}
-- use for lsp diagnostics virtual text
pcode.lsp_virtualtext = true
-- use for lsp ghost text config
pcode.lspghost_text = false
-- untuk referesi support language kunjungi link dibawah
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
pcode.mason_ensure_installed = { -- sebelumnya register_lsp
-- "yamlls",
-- tambahkan di bawah sini setelah melakukan :masoninstall
}
pcode.unregister_lsp = {
-- "jdtls", -- tambahkan di bawah ini
}
-- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md
pcode.null_ls_ensure_installed = {
"stylua",
}
-- dap instal hanya support linux dan mac
-- https://github.com/jay-babu/mason-nvim-dap.nvim/blob/main/lua/mason-nvim-dap/mappings/source.lua
-- atau gunakan :MasonInstall
pcode.dap_ensure_installed = {
-- "python",
}
-- https://github.com/folke/which-key.nvim
pcode.whichkey = {
-- contoh penambahan
{ "<leader>r", "", desc = "  Run", mode = "n" },
{ "<leader>rx", "<cmd>Jaq float<CR>", desc = "Run With Jaq", mode = "n" },
}
-- https://github.com/CRAG666/code_runner.nvim
-- ready default java, python, typescript, javascript, rust, cpp, scss
pcode.coderunner = {
go = "go run $fileName",
html = "live-server $dir/$fileName",
}
-- https://github.com/nvim-tree/nvim-tree.lua
-- 0 = normal
-- 1 = float
pcode.nvimtree_isfloat = 0
-- https://github.com/roobert/tailwindcss-colorizer-cmp.nvim
pcode.tailwindcolorizer = false
-- https://github.com/Exafunction/codeium.vim
pcode.codeium = false
-- https://github.com/Exafunction/codeium.nvim
pcode.codeium_nvim = true
-- https://github.com/kevinhwang91/nvim-ufo
pcode.nvimufo = false
-- https://github.com/echasnovski/mini.indentscope
pcode.indentscope = true
-- https://github.com/echasnovski/mini.animate
pcode.minianimate = false
-- https://github.com/hrsh7th/nvim-cmp
pcode.disable_cmpdoc = false
-- https://github.com/rachartier/tiny-devicons-auto-colors.nvim
pcode.adaptive_color_icon = true
-- https://github.com/lukas-reineke/virt-column.nvim
pcode.columnline = true
-- https://github.com/okuuva/auto-save.nvim
pcode.auto_save = false
-- https://github.com/folke/todo-comments.nvim
pcode.todo_comment = false
-- https://github.com/nvim-telescope/telescope.nvim
---@alias telescope_themes
---| "cursor" # see `telescope.themes.get_cursor()`
---| "dropdown" # see `telescope.themes.get_dropdown()`
---| "ivy" # see `telescope.themes.get_ivy()`
---| "center" # retain the default telescope theme
pcode.telescope_theme_find_file = "center"
pcode.telescope_theme_live_grep = "dropdown"
-- https://github.com/ThePrimeagen/refactoring.nvim
pcode.refactoring = false
-- https://github.com/kristijanhusak/vim-dadbod-ui
pcode.database = false
-- https://github.com/rest-nvim/rest.nvim
pcode.rest_client = false
-- https://github.com/mfussenegger/nvim-dap
pcode.nvim_dap = false -- not support for windows os (auto config mason-nvim-dap)
-- conefig special support test & dap
pcode.active_rust_config = false
pcode.active_javascript_config = {
active = false,
jest_command = "npm test -- ",
jest_config = "jest.config.mjs",
}
pcode.active_prisma_config = false
pcode.active_php_config = false
pcode.active_golang_config = false
pcode.active_python_config = false
pcode.active_cpp_config = false
pcode.active_java_config = {
active = false,
project = "gradle", -- gradle or maven
use_nvim_jdtls = true, -- mfussenegger/nvim-jdtls
}
pcode.active_deno_config = false
pcode.active_kotlin_config = false

View file

@ -1,11 +0,0 @@
local opts = { noremap = true, silent = true }
local keymap = vim.api.nvim_set_keymap
keymap("n", "]h", '<cmd>lua print("Testing")<cr>', opts)
keymap("n", "f", "<cmd>NvimTreeFindFileToggle<cr><cr><Up>", opts)
-- Allow clipboard copy paste in neovim
vim.api.nvim_set_keymap("", "<C-v>", "+p<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("!", "<C-v>", "<C-R>+", { noremap = true, silent = true })
vim.api.nvim_set_keymap("t", "<C-v>", "<C-R>+", { noremap = true, silent = true })
vim.api.nvim_set_keymap("v", "<C-v>", "<C-R>+", { noremap = true, silent = true })

View file

@ -1,10 +0,0 @@
local null_ls = require("null-ls")
local m = {
sources = {
-- null_ls.builtins.formatting.stylua, -- tambahkan di bawah sini
-- null_ls.builtins.formatting.clang_format.with({ filetypes = { "c", "cpp" } }),
--null_ls.builtins.diagnostics.flake8, -- tambahkan di bawah sini
--null_ls.builtins.formatting.blade_formatter.with({ filetypes = { "blade", "php" } }),
},
}
return m

View file

@ -1,161 +0,0 @@
-- initial gui app
local is_neovide = false
local use_noice = true
-- if vim.g.neovide then
-- is_neovide = true
-- use_noice = false
-- end
-- vim.opt.lazyredraw = is_neovide
return {
-- { "gelguy/wilder.nvim", enabled = not use_noice },
-- {
-- "folke/noice.nvim",
-- lazy = true,
-- enabled = use_noice,
-- dependencies = {
-- { "MunifTanjim/nui.nvim", enabled = use_noice },
-- },
-- -- event = "BufWinEnter",
-- event = "VeryLazy",
-- opts = {
-- messages = {
-- enabled = false,
-- },
-- notify = {
-- enabled = false,
-- },
-- lsp = {
-- progress = {
-- enabled = false,
-- },
-- hover = {
-- enabled = false,
-- },
-- signature = {
-- enabled = false,
-- },
-- },
-- },
-- init = function()
-- -- load if mode command mode
-- -- vim.api.nvim_create_autocmd("CmdlineEnter", {
-- -- callback = function()
-- -- require("lazy").load({ plugins = { "noice.nvim" } })
-- -- end,
-- -- })
-- -- require("lazy").load({ plugins = { "noice.nvim" } })
-- end,
-- keys = {
-- {
-- "<S-Enter>",
-- function()
-- require("noice").redirect(vim.fn.getcmdline())
-- end,
-- mode = "c",
-- desc = "Redirect Cmdline",
-- },
-- {
-- "<leader>snl",
-- function()
-- require("noice").cmd("last")
-- end,
-- desc = "Noice Last Message",
-- },
-- {
-- "<leader>snh",
-- function()
-- require("noice").cmd("history")
-- end,
-- desc = "Noice History",
-- },
-- {
-- "<leader>sna",
-- function()
-- require("noice").cmd("all")
-- end,
-- desc = "Noice All",
-- },
-- {
-- "<c-f>",
-- function()
-- if not require("noice.lsp").scroll(4) then
-- return "<c-f>"
-- end
-- end,
-- silent = true,
-- expr = true,
-- desc = "Scroll forward",
-- mode = { "i", "n", "s" },
-- },
-- {
-- "<c-b>",
-- function()
-- if not require("noice.lsp").scroll(-4) then
-- return "<c-b>"
-- end
-- end,
-- silent = true,
-- expr = true,
-- desc = "Scroll backward",
-- mode = { "i", "n", "s" },
-- },
-- },
-- },
-- {
-- "hrsh7th/cmp-cmdline",
-- event = "VeryLazy",
-- enabled = use_noice,
-- init = function()
-- -- load if mode command mode
-- -- vim.api.nvim_create_autocmd("CmdlineEnter", {
-- -- callback = function()
-- -- require("lazy").load({ plugins = { "cmp-cmdline" } })
-- -- end,
-- -- })
-- end,
-- config = function()
-- local cmp = require("cmp")
-- local mapping = {
-- ["<CR>"] = cmp.mapping.confirm({ select = true }),
-- ["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
-- ["<S-Tab>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
-- ["<Down>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
-- ["<Tab>"] = 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 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,
-- },
}

View file

@ -1,16 +0,0 @@
return {
-- "soulis-1256/eagle.nvim",
-- event = "BufRead",
-- config = function()
-- require("eagle").setup()
-- vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter", "WinEnter" }, {
-- pattern = "*",
-- callback = function()
-- -- Aktifkan mousemoveevent untuk semua buffer kecuali NvimTree
-- if vim.fn.win_gettype() ~= "NvimTree" then
-- vim.o.mousemoveevent = true
-- end
-- end,
-- })
-- end,
}

View file

@ -1,60 +0,0 @@
return {
-- "nvim-telescope/telescope-file-browser.nvim",
-- dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
-- keys = {
-- {
-- "sf",
-- function()
-- local telescope = require "telescope"
--
-- local function telescope_buffer_dir()
-- return vim.fn.expand "%:p:h"
-- end
--
-- telescope.extensions.file_browser.file_browser {
-- path = "%:p:h",
-- cwd = telescope_buffer_dir(),
-- respect_gitignore = false,
-- hidden = true,
-- grouped = true,
-- previewer = false,
-- initial_mode = "insert",
-- layout_config = { height = 40 },
-- }
-- end,
-- desc = "Open File Browser with the path of the current buffer",
-- },
-- },
-- config = function(_, opts)
-- local telescope = require "telescope"
-- local actions = require "telescope.actions"
-- local fb_actions = require("telescope").extensions.file_browser.actions
-- opts.extensions = {
-- file_browser = {
-- theme = "dropdown",
-- -- disables netrw and use telescope-file-browser in its place
-- hijack_netrw = true,
-- mappings = {
-- -- your custom insert mode mappings
-- ["n"] = {
-- -- your custom normal mode mappings
-- ["N"] = fb_actions.create,
-- ["h"] = fb_actions.goto_parent_dir,
-- ["<C-u>"] = function(prompt_bufnr)
-- for i = 1, 10 do
-- actions.move_selection_previous(prompt_bufnr)
-- end
-- end,
-- ["<C-d>"] = function(prompt_bufnr)
-- for i = 1, 10 do
-- actions.move_selection_next(prompt_bufnr)
-- end
-- end,
-- },
-- },
-- },
-- }
-- telescope.setup(opts)
-- require("telescope").load_extension "file_browser"
-- end,
}

View file

@ -1,110 +0,0 @@
return {
-- {
-- "navarasu/onedark.nvim",
-- enabled = false,
-- },
-- {
-- "projekt0n/github-nvim-theme",
-- lazy = false, -- make sure we load this during startup if it is your main colorscheme
-- priority = 1000, -- make sure to load this before all the other start plugins
-- config = function()
-- local is_transparent = false
-- local palette = require("github-theme.palette").load("github_dark_dimmed")
-- require("github-theme").setup({
-- options = {
-- -- Compiled file's destination location
-- compile_path = vim.fn.stdpath("cache") .. "/github-theme",
-- compile_file_suffix = "_compiled", -- Compiled file suffix
-- hide_end_of_buffer = true, -- Hide the '~' character at the end of the buffer for a cleaner look
-- hide_nc_statusline = true, -- Override the underline style for non-active statuslines
-- transparent = is_transparent, -- Disable setting background
-- terminal_colors = true, -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal`
-- dim_inactive = false, -- Non focused panes set to alternative background
-- module_default = true, -- Default enable value for modules
-- styles = { -- Style to be applied to different syntax groups
-- comments = "italic", -- Value is any valid attr-list value `:help attr-list`
-- functions = "italic",
-- keywords = "NONE",
-- variables = "NONE",
-- conditionals = "NONE",
-- constants = "NONE",
-- numbers = "NONE",
-- operators = "NONE",
-- strings = "NONE",
-- types = "NONE",
-- },
-- inverse = { -- Inverse highlight for different types
-- match_paren = false,
-- visual = false,
-- search = false,
-- },
-- darken = { -- Darken floating windows and sidebar-like windows
-- floats = false,
-- sidebars = {
-- enabled = true,
-- list = {}, -- Apply dark background to specific windows
-- },
-- },
-- modules = { -- List of various plugins and additional options
-- -- ...
-- },
-- },
-- palettes = {
-- github_dark_dimmed = {
-- bg0 = is_transparent and "NONE" or "bg1",
-- bg1 = is_transparent and "NONE" or "bg",
-- },
-- },
-- specs = {},
-- groups = {
-- all = {
-- illuminatedWord = { bg = "#3b4261" },
-- illuminatedCurWord = { bg = "#3b4261" },
-- IlluminatedWordText = { bg = "#3b4261" },
-- IlluminatedWordRead = { bg = "#3b4261" },
-- IlluminatedWordWrite = { bg = "#3b4261" },
-- ["@tag.attribute"] = { fg = "#77bdfb", style = "italic" },
-- ["@text.uri"] = { fg = palette.const, style = "italic" },
-- ["@keyword.return"] = { fg = "#fa7970", style = "italic" },
-- -- ["@tag.attribute.html"] = { fg = "#faa356", style = "italic" },
-- -- ["@operator.html"] = { fg = "#faa356" },
-- -- ["@tag.html"] = { fg = "#fa7970" },
-- -- ["@tag.delimiter.html"] = { fg = "#faa356" },
-- -- ["@tag.javascript"] = { fg = "#faa356" },
-- -- ["@tag.javascript"] = { fg = "#8ddb8c" },
-- -- ["@tag.tsx"] = { fg = "#8ddb8c" },
-- ["@string.special.url"] = { fg = palette.const, style = "italic" },
-- ["@tag.delimiter.javascript"] = { fg = "fg1" },
-- ["@tag.tsx"] = { fg = "#faa356" },
-- ["@lsp.type.parameter"] = { fg = "#faa356" },
-- ["@property.lua"] = { fg = "#91cbff", bg = is_transparent and "NONE" or "bg1" },
-- ["@lsp.type.property.lua"] = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" },
-- ["@lsp.type.variable.lua"] = { fg = "#91cbff", bg = is_transparent and "NONE" or "bg1" },
-- },
-- github_dark_high_contrast = {
-- NvimTreeSpecialFile = { fg = "#faa356", style = "italic" },
-- },
-- github_dark_dimmed = {
-- -- As with specs and palettes, a specific style's value will be used over the `all`'s value.
-- NvimTreeNormal = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" },
-- NvimTreeSpecialFile = { fg = "#faa356", style = "italic" },
-- NvimTreeIndentMarker = { fg = "#3E4450" },
-- BufferLineFill = { bg = is_transparent and "NONE" or "bg1" },
-- BufferLineUnfocusedFill = { bg = is_transparent and "NONE" or "bg1" },
-- LualineNormal = { bg = is_transparent and "NONE" or "bg1" },
-- StatusLine = { bg = is_transparent and "NONE" or "bg1" },
-- StatusLineTerm = { bg = is_transparent and "NONE" or "bg1" },
-- Pmenu = { bg = is_transparent and "NONE" or "bg1" },
-- PmenuSel = { link = "CursorLine" },
-- WhichKeyFloat = { bg = is_transparent and "NONE" or "bg1" },
-- LazyNormal = { bg = is_transparent and "NONE" or "bg1" },
-- LazyBackground = { bg = is_transparent and "NONE" or "bg1" },
-- NormalSB = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" }, -- normal text
-- NormalFloat = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" },
-- IblIndent = { fg = "#3E4450" },
-- },
-- },
-- })
-- end,
-- },
}

View file

@ -1,9 +0,0 @@
return {
-- {
-- "https://github.com/adelarsq/image_preview.nvim",
-- event = "VeryLazy",
-- config = function()
-- require("image_preview").setup()
-- end,
-- },
}

View file

@ -1,153 +0,0 @@
local icons = pcode.icons
return {
--- masukan plugin tambahan disini
-- {
-- "folke/trouble.nvim",
-- event = "BufRead",
-- cmd = { "TroubleToggle", "Trouble" },
-- opts = { use_diagnostic_signs = true },
-- keys = {
-- {
-- "<leader>xx",
-- "<cmd>TroubleToggle document_diagnostics<cr>",
-- desc = "Document Diagnostics (Trouble)",
-- },
-- {
-- "<leader>xX",
-- "<cmd>TroubleToggle workspace_diagnostics<cr>",
-- desc = "Workspace Diagnostics (Trouble)",
-- },
-- },
-- },
-- {
-- "echasnovski/mini.indentscope",
-- version = false, -- wait till new 0.7.0 release to put it back on semver
-- event = "BufReadPre",
-- opts = {
-- -- symbol = "▏",
-- -- symbol = "│",
-- symbol = icons.ui.LineMiddle,
-- options = { try_as_border = true },
-- },
-- config = function(_, opts)
-- vim.api.nvim_create_autocmd("FileType", {
-- pattern = { "help", "alpha", "dashboard", "NvimTree", "Trouble", "lazy", "mason" },
-- callback = function()
-- vim.b.miniindentscope_disable = true
-- end,
-- })
-- require("mini.indentscope").setup(opts)
-- end,
-- },
-- {
-- "hrsh7th/cmp-nvim-lua",
-- enabled = false,
-- },
-- {
-- "gbprod/yanky.nvim",
-- event = "BufReadPre",
-- config = function()
-- require("user.yanky")
-- end,
-- },
-- {
-- "is0n/jaq-nvim",
-- event = "BufRead",
-- config = function()
-- require("user.jaq")
-- end,
-- },
-- better todo coloring and icon
-- {
-- "folke/todo-comments.nvim",
-- event = { "BufReadPost", "BufNewFile" },
-- config = function()
-- require("todo-comments").setup()
-- end,
-- },
-- mini scrollview
-- {
-- "karb94/neoscroll.nvim",
-- event = "BufRead",
-- config = function()
-- require("user.neoscroll")
-- end,
-- },
-- { "ahmedkhalf/project.nvim", commit = "628de7e433dd503e782831fe150bb750e56e55d6", event = "VeryLazy" }, --
-- additional plugins
-- makes some plugins dot-repeatable like leap
-- { "tpope/vim-repeat", event = "VeryLazy" },
-- better diagnostics list and others
-- for markdown preview
-- make sure already install npm and yarn
-- {
-- "iamcco/markdown-preview.nvim",
-- event = "VeryLazy",
-- build = "cd app && npm install",
-- init = function()
-- vim.g.mkdp_filetypes = { "markdown" }
-- end,
-- ft = { "markdown" },
-- cmd = { "MarkdownPreview", "MarkdownPreviewStop", "MarkdownPreviewToggle" },
-- },
-- for codeGPT
-- {
-- "jackMort/ChatGPT.nvim",
-- dependencies = { "MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim" },
-- lazy = true,
-- event = "VeryLazy",
-- -- opts = function()
-- -- require("user.chat_gpt")
-- -- end,
-- },
-- indent detection
-- {
-- "Darazaki/indent-o-matic",
-- event = "VeryLazy",
-- opt = true,
-- cmd = { "IndentOMatic" },
-- config = function()
-- require("user.indent-o-matic")
-- end,
-- },
-- Khusus Projek laravel baru di buka
-- {
-- "adalessa/laravel.nvim",
-- dependencies = {
-- "nvim-telescope/telescope.nvim",
-- },
-- cmd = { "Sail", "Artisan", "Composer" },
-- keys = {
-- { "<leader>pa", ":Artisan<cr>" },
-- },
-- config = function()
-- require("laravel").setup()
-- require("telescope").load_extension("laravel")
-- end,
-- },
-- --
-- {
-- "barrett-ruth/live-server.nvim",
-- build = "yarn global add live-server",
-- config = true,
-- init = function()
-- require("live-server").setup({
-- -- Arguments passed to live-server via `vim.fn.jobstart()`
-- -- Run `live-server --help` to see list of available options
-- -- For example, to use port 7000 and browser firefox:
-- args = { "--port=7000", "--browser=firefox" },
-- --args = {},
-- })
-- end,
-- },
-- for install lsp tidak support mason
-- {
-- "williamboman/nvim-lsp-installer",
-- event = "BufRead",
-- lazy = true,
-- config = function()
-- require("user.lsp.config")
-- end,
-- },
}

View file

@ -1,3 +0,0 @@
return {
-- { "mfussenegger/nvim-jdtls", event = "BufRead" },
}

View file

@ -1,20 +0,0 @@
return {
-- "abzcoding/lsp_lines.nvim",
-- event = "BufRead",
-- config = function()
-- require("lsp_lines").setup()
-- vim.api.nvim_create_autocmd("FileType", {
-- pattern = { "*" }, --ini untuk file yang tidak ingin dibaca
-- callback = function()
-- local exclude_ft = {
-- "lazy",
-- }
-- if vim.tbl_contains(exclude_ft, vim.o.filetype) then
-- vim.diagnostic.config({ virtual_lines = false })
-- else
-- vim.diagnostic.config({ virtual_lines = true })
-- end
-- end,
-- })
-- end,
}

View file

@ -1,243 +0,0 @@
return {
-- {
-- "nvim-lualine/lualine.nvim",
-- event = "InsertEnter",
-- config = function()
-- local hide_in_width = function()
-- return vim.fn.winwidth(0) > 80
-- end
-- local icons = require("user.icons")
--
-- local getLeftSubstring = function(word, length)
-- if #word > length then
-- return string.sub(word, 1, length) .. "..."
-- else
-- return word
-- end
-- end
--
-- -- start for lsp
-- local list_registered_providers_names = function(filetype)
-- local s = require("null-ls.sources")
-- local available_sources = s.get_available(filetype)
-- local registered = {}
-- for _, source in ipairs(available_sources) do
-- for method in pairs(source.methods) do
-- registered[method] = registered[method] or {}
-- table.insert(registered[method], source.name)
-- end
-- end
-- return registered
-- end
--
-- local null_ls = require("null-ls")
-- -- for formatter
-- local list_registered = function(filetype)
-- local method = null_ls.methods.FORMATTING
-- local registered_providers = list_registered_providers_names(filetype)
-- return registered_providers[method] or {}
-- end
--
-- --- for linter
-- local alternative_methods = {
-- null_ls.methods.DIAGNOSTICS,
-- null_ls.methods.DIAGNOSTICS_ON_OPEN,
-- null_ls.methods.DIAGNOSTICS_ON_SAVE,
-- }
--
-- local linter_list_registered = function(filetype)
-- local registered_providers = list_registered_providers_names(filetype)
-- -- local providers_for_methods = vim.tbl_flatten(vim.tbl_map(function(m)
-- -- return registered_providers[m] or {}
-- -- end, alternative_methods))
-- local providers_for_methods = vim.iter(vim.tbl_map(function(m)
-- return registered_providers[m] or {}
-- end, alternative_methods))
--
-- return providers_for_methods
-- end
-- -- end for lsp
--
-- local lsp_info = {
-- function()
-- local msg = "LS Inactive"
-- local buf_ft = vim.bo.filetype
-- -- start register
-- local buf_clients = vim.lsp.get_clients()
-- local buf_client_names = {}
-- if next(buf_clients) == nil then
-- -- TODO: clean up this if statement
-- if type(msg) == "boolean" or #msg == 0 then
-- return "LS Inactive"
-- end
-- return msg
-- end
-- -- add client
-- for _, client in pairs(buf_clients) do
-- if client.name ~= "null-ls" and client.name ~= "copilot" then
-- table.insert(buf_client_names, client.name)
-- end
-- end
-- -- add formatter
-- local supported_formatters = list_registered(buf_ft)
-- vim.list_extend(buf_client_names, supported_formatters)
-- -- add linter
-- local supported_linters = linter_list_registered(buf_ft)
-- vim.list_extend(buf_client_names, supported_linters)
-- -- decomple
-- local unique_client_names = vim.fn.uniq(buf_client_names)
-- local msg = table.concat(unique_client_names, ", ")
-- return msg
-- end,
-- --icon = " ",
-- icon = icons.ui.Gear .. "",
-- padding = 1,
-- }
--
-- local diagnostics = {
-- "diagnostics",
-- sources = { "nvim_diagnostic" },
-- sections = { "error", "warn" },
-- -- symbols = { error = " ", warn = " " },
-- symbols = {
-- error = icons.diagnostics.BoldError .. " ",
-- warn = icons.diagnostics.BoldWarning .. " ",
-- },
-- colored = true,
-- update_in_insert = false,
-- always_visible = false,
-- }
--
-- local diff = {
-- "diff",
-- colored = true,
-- -- symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
-- symbols = {
-- added = icons.git.LineAdded .. " ",
-- modified = icons.git.LineModified .. " ",
-- removed = icons.git.LineRemoved .. " ",
-- }, -- changes diff symbols
-- cond = hide_in_width,
-- }
--
-- local spaces = function()
-- -- return " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
-- return icons.ui.Tab .. " " .. vim.api.nvim_get_option_value(0, "shiftwidth")
-- end
--
-- local mode = {
-- "mode",
-- padding = 1,
-- separator = { left = " " },
-- -- right_padding = 3,
-- fmt = function(str)
-- return icons.ui.Neovim .. " " .. str
-- end,
-- }
-- local branch = {
-- "branch",
-- padding = 1,
-- }
--
-- local get_branch = function()
-- if vim.b.gitsigns_head ~= nil then
-- return icons.git.Branch2 .. " " .. getLeftSubstring(vim.b.gitsigns_head, 6)
-- else
-- return icons.git.Branch2 .. vim.fn.fnamemodify("", ":t")
-- end
-- end
--
-- local lsp_progress = {}
-- local data_ok, lspprogress = pcall(require, "lsp-progress")
-- if data_ok then
-- lsp_progress = lspprogress.progress
-- end
-- -- stylua: ignore
-- -- local github=vim.fn.fnamemodify("auto", ":t")
-- local github={}
-- local status_ok, _ = pcall(require, "github-theme")
-- if status_ok then
-- local C = require("github-theme.lib.color")
-- local config = require("github-theme.config").options
-- local s = require("github-theme.spec").load("github_dark_dimmed")
-- local p = s.palette
-- local tbg = config.transparent and "NONE" or s.bg0
--
-- local function blend(color, a)
-- return C(s.bg1):blend(C(color), a):to_css()
-- end
--
-- --- Create lualine group colors for github-theme
-- ---@param color string
-- local tint = function(color)
-- return {
-- a = { bg = color, fg = s.bg1 },
-- b = { bg = blend(color, 0.2), fg = blend(color, 0.8) },
-- c = { bg = "NONE", fg = blend(color, 0.60) },
-- }
-- end
--
-- local inactive_hi = { bg = tbg, fg = blend(s.fg1, 0.3) }
-- github = {
-- normal = tint(p.blue.base),
-- insert = tint(p.green.base),
-- command = tint(p.magenta.bright),
-- visual = tint(p.yellow.base),
-- replace = tint(p.red.base),
-- terminal = tint(p.orange),
-- inactive = {
-- a = inactive_hi,
-- b = inactive_hi,
-- c = inactive_hi,
-- },
-- }
-- end
--
-- require("lualine").setup({
-- options = {
-- theme = github or "auto",
-- -- theme = "auto",
-- component_separators = { left = "", right = "" },
-- section_separators = { left = "", right = "" },
-- disabled_filetypes = {
-- "TelescopePrompt",
-- "packer",
-- "alpha",
-- "dashboard",
-- "NvimTree",
-- "Outline",
-- "DressingInput",
-- "toggleterm",
-- "lazy",
-- "mason",
-- "neo-tree",
-- "startuptime",
-- },
-- always_divide_middle = true,
-- },
-- sections = {
-- lualine_a = {
-- mode,
-- },
-- lualine_b = { get_branch },
-- lualine_c = { lsp_info, diagnostics, lsp_progress },
-- lualine_x = { diff, spaces, "filetype" },
-- lualine_y = { "progress" },
-- lualine_z = {
-- { "location", separator = { right = " " }, padding = 1 },
-- },
-- },
-- inactive_sections = {
-- lualine_a = { "filename" },
-- lualine_b = {},
-- lualine_c = {},
-- lualine_x = {},
-- lualine_y = {},
-- lualine_z = { "location" },
-- },
-- tabline = {},
-- extensions = {},
-- })
-- end,
-- },
}

View file

@ -1,249 +0,0 @@
return {
-- {
-- "nvim-lualine/lualine.nvim",
-- event = "InsertEnter",
-- config = function()
-- local hide_in_width = function()
-- return vim.fn.winwidth(0) > 80
-- end
-- local icons = require("user.icons")
--
-- local getLeftSubstring = function(word, length)
-- if #word > length then
-- return string.sub(word, 1, length) .. "..."
-- else
-- return word
-- end
-- end
--
-- -- start for lsp
-- local list_registered_providers_names = function(filetype)
-- local s = require("null-ls.sources")
-- local available_sources = s.get_available(filetype)
-- local registered = {}
-- for _, source in ipairs(available_sources) do
-- for method in pairs(source.methods) do
-- registered[method] = registered[method] or {}
-- table.insert(registered[method], source.name)
-- end
-- end
-- return registered
-- end
--
-- local null_ls = require("null-ls")
-- -- for formatter
-- local list_registered = function(filetype)
-- local method = null_ls.methods.FORMATTING
-- local registered_providers = list_registered_providers_names(filetype)
-- return registered_providers[method] or {}
-- end
--
-- --- for linter
-- local alternative_methods = {
-- null_ls.methods.DIAGNOSTICS,
-- null_ls.methods.DIAGNOSTICS_ON_OPEN,
-- null_ls.methods.DIAGNOSTICS_ON_SAVE,
-- }
--
-- local linter_list_registered = function(filetype)
-- local registered_providers = list_registered_providers_names(filetype)
-- local providers_for_methods = vim.iter(vim.tbl_map(function(m)
-- return registered_providers[m] or {}
-- end, alternative_methods))
--
-- return providers_for_methods
-- end
-- -- end for lsp
--
-- local lsp_info = {
-- function()
-- local msg = "LS Inactive"
-- local buf_ft = vim.bo.filetype
-- -- start register
-- local buf_clients = {}
-- buf_clients = vim.lsp.get_clients({ bufnr = 0 })
-- local buf_client_names = {}
-- if next(buf_clients) == nil then
-- -- TODO: clean up this if statement
-- if type(msg) == "boolean" or #msg == 0 then
-- return "LS Inactive"
-- end
-- return msg
-- end
-- -- add client
-- for _, client in pairs(buf_clients) do
-- if client.name ~= "null-ls" and client.name ~= "copilot" then
-- table.insert(buf_client_names, client.name)
-- end
-- end
-- -- add formatter
-- local supported_formatters = list_registered(buf_ft)
-- vim.list_extend(buf_client_names, supported_formatters)
-- -- add linter
-- local supported_linters = linter_list_registered(buf_ft)
-- vim.list_extend(buf_client_names, supported_linters)
-- -- decomple
-- local unique_client_names = vim.fn.uniq(buf_client_names)
-- local msg = table.concat(unique_client_names, ", ")
-- return msg
-- end,
-- --icon = " ",
-- icon = icons.ui.Gear .. "",
-- padding = 1,
-- }
--
-- local diagnostics = {
-- "diagnostics",
-- sources = { "nvim_diagnostic" },
-- sections = { "error", "warn" },
-- -- symbols = { error = " ", warn = " " },
-- symbols = {
-- error = icons.diagnostics.BoldError .. " ",
-- warn = icons.diagnostics.BoldWarning .. " ",
-- },
-- colored = true,
-- update_in_insert = false,
-- always_visible = false,
-- }
--
-- local diff = {
-- "diff",
-- colored = true,
-- -- symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
-- symbols = {
-- added = icons.git.LineAdded .. " ",
-- modified = icons.git.LineModified .. " ",
-- removed = icons.git.LineRemoved .. " ",
-- }, -- changes diff symbols
-- cond = hide_in_width,
-- }
--
-- local spaces = function()
-- -- return " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
-- return icons.ui.Tab .. " " .. vim.api.nvim_get_option_value(0, "shiftwidth")
-- end
--
-- local mode = {
-- "mode",
-- padding = 1,
-- separator = { left = " " },
-- -- right_padding = 3,
-- fmt = function(str)
-- return icons.ui.Neovim .. " " .. str
-- end,
-- }
-- local branch = {
-- "branch",
-- padding = 1,
-- }
--
-- local get_branch = function()
-- if vim.b.gitsigns_head ~= nil then
-- return icons.git.Branch2 .. " " .. getLeftSubstring(vim.b.gitsigns_head, 6)
-- else
-- return icons.git.Branch2 .. vim.fn.fnamemodify("", ":t")
-- end
-- end
--
-- local lsp_progress = {}
-- local data_ok, lspprogress = pcall(require, "lsp-progress")
-- if data_ok then
-- lsp_progress = lspprogress.progress
-- end
-- -- stylua: ignore
-- -- local onedark=vim.fn.fnamemodify("auto", ":t")
-- local onedark={}
-- local is_transparat = true
-- local status_ok, onedarkpro = pcall(require, "onedarkpro.helpers")
-- if status_ok then
-- local colors = onedarkpro.get_colors("onedark")
--
-- onedark = {
-- normal = {
-- a = { bg = colors.green, fg = colors.bg },
-- b = { bg = colors.fg_gutter, fg = colors.green },
-- c = {
-- bg = is_transparat and colors.none or colors.bg_statusline,
-- fg = colors.fg,
-- },
-- },
--
-- insert = {
-- a = { bg = colors.blue, fg = colors.bg },
-- b = { bg = colors.fg_gutter, fg = colors.blue },
-- },
-- visual = {
-- a = { bg = colors.yellow, fg = colors.bg },
-- b = { bg = colors.fg_gutter, fg = colors.yellow },
-- },
-- replace = {
-- a = { bg = colors.red, fg = colors.bg },
-- b = { bg = colors.fg_gutter, fg = colors.red },
-- },
-- command = {
-- a = { bg = colors.purple, fg = colors.bg },
-- b = { bg = colors.fg_gutter, fg = colors.purple },
-- },
-- terminal = {
-- a = { bg = colors.cyan, fg = colors.bg },
-- b = { bg = colors.fg_gutter, fg = colors.cyan },
-- },
-- inactive = {
-- a = { bg = colors.bg, fg = colors.blue },
-- b = { bg = colors.bg, fg = colors.fg_gutter_inactive, gui = "bold" },
-- c = {
-- bg = is_transparat and colors.none or colors.bg,
-- fg = colors.fg_gutter_inactive,
-- },
-- },
-- }
-- end
--
-- require("lualine").setup({
-- options = {
-- theme = onedark,
-- -- theme = "auto",
-- component_separators = { left = "", right = "" },
-- section_separators = { left = "", right = "" },
-- disabled_filetypes = {
-- "TelescopePrompt",
-- "packer",
-- "alpha",
-- "dashboard",
-- "NvimTree",
-- "Outline",
-- "DressingInput",
-- "toggleterm",
-- "lazy",
-- "mason",
-- "neo-tree",
-- "startuptime",
-- },
-- always_divide_middle = true,
-- },
-- sections = {
-- lualine_a = {
-- mode,
-- },
-- lualine_b = { get_branch },
-- lualine_c = { lsp_info, diagnostics, lsp_progress },
-- lualine_x = { diff, spaces, "filetype" },
-- lualine_y = { "progress" },
-- lualine_z = {
-- { "location", separator = { right = " " }, padding = 1 },
-- },
-- },
-- inactive_sections = {
-- lualine_a = { "filename" },
-- lualine_b = {},
-- lualine_c = {},
-- lualine_x = {},
-- lualine_y = {},
-- lualine_z = { "location" },
-- },
-- tabline = {},
-- extensions = {},
-- })
-- end,
-- },
}

View file

@ -1,46 +0,0 @@
local is_neovide = false
if vim.g.neovide then
is_neovide = true
end
return {
-- animations
-- {
-- "echasnovski/mini.animate",
-- event = "BufRead",
-- enabled = not is_neovide,
-- opts = function()
-- -- don't use animate when scrolling with the mouse
-- local mouse_scrolled = false
-- for _, scroll in ipairs({ "Up", "Down" }) do
-- local key = "<ScrollWheel" .. scroll .. ">"
-- 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,
-- },
}

View file

@ -1,51 +0,0 @@
return {
-- "echasnovski/mini.map",
-- branch = "stable",
-- event = "BufRead",
-- config = function()
-- require("mini.map").setup()
-- local map = require("mini.map")
-- map.setup({
-- integrations = {
-- map.gen_integration.builtin_search(),
-- map.gen_integration.diagnostic({
-- error = "DiagnosticFloatingError",
-- warn = "DiagnosticFloatingWarn",
-- info = "DiagnosticFloatingInfo",
-- hint = "DiagnosticFloatingHint",
-- }),
-- },
-- symbols = {
-- encode = map.gen_encode_symbols.dot("4x2"),
-- },
-- window = {
-- side = "right",
-- width = 10, -- set to 1 for a pure scrollbar :)
-- winblend = 15,
-- show_integration_count = false,
-- },
-- })
--
-- vim.api.nvim_create_autocmd("FileType", {
-- pattern = "*",
-- callback = function()
-- local exclude_ft = {
-- "qf",
-- "NvimTree",
-- "toggleterm",
-- "TelescopePrompt",
-- "alpha",
-- "netrw",
-- }
--
-- local map = require("mini.map")
-- if vim.tbl_contains(exclude_ft, vim.o.filetype) then
-- vim.b.minimap_disable = true
-- map.close()
-- elseif vim.o.buftype == "" then
-- map.open()
-- end
-- end,
-- })
-- end,
}

View file

@ -1,76 +0,0 @@
return {
-- { "kyazdani42/nvim-tree.lua", enabled = false },
-- {
-- "nvim-neo-tree/neo-tree.nvim",
-- dependencies = { "MunifTanjim/nui.nvim" },
-- event = "BufWinEnter",
-- cmd = "Neotree",
-- keys = {
-- {
-- "<leader>fE",
-- function()
-- require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() })
-- end,
-- desc = "Explorer NeoTree (cwd)",
-- },
-- { "<leader>n", "<cmd>Neotree toggle<cr>", desc = "Explorer NeoTree (root dir)", remap = true },
-- { "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
-- },
-- deactivate = function()
-- vim.cmd([[Neotree close]])
-- end,
-- init = function()
-- vim.g.neo_tree_remove_legacy_commands = 1
-- if vim.fn.argc() == 1 then
-- local stat = vim.loop.fs_stat(vim.fn.argv(0))
-- if stat and stat.type == "directory" then
-- require("neo-tree")
-- end
-- end
-- end,
-- opts = {
-- filesystem = {
-- bind_to_cwd = false,
-- follow_current_file = true,
-- },
-- window = {
-- position = "left",
-- width = 30,
-- mappings = {
-- ["<space>"] = "none",
-- },
-- },
-- default_component_configs = {
-- icon = {
-- folder_closed = "",
-- folder_open = "",
-- folder_empty = "ﰊ",
-- -- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
-- -- then these will never be used.
-- default = "*",
-- highlight = "NeoTreeFileIcon",
-- },
-- modified = {
-- symbol = "[+]",
-- highlight = "NeoTreeModified",
-- },
-- git_status = {
-- symbols = {
-- -- Change type
-- added = "✚", -- or "✚", but this is redundant info if you use git_status_colors on the name
-- modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
-- deleted = "✖", -- this can only be used in the git_status source
-- renamed = "", -- this can only be used in the git_status source
-- -- Status type
-- untracked = "",
-- ignored = "",
-- -- unstaged = "",
-- unstaged = "",
-- staged = "",
-- conflict = "",
-- },
-- },
-- },
-- },
-- },
}

View file

@ -1,255 +0,0 @@
-- local icons = pcode.icons
-- local HEIGHT_RATIO = 0.9 -- You can change this
-- local WIDTH_RATIO = 0.5 -- You can change this too
return {
-- "kyazdani42/nvim-tree.lua",
-- lazy = true,
-- cmd = { "NvimTreeFindFileToggle", "NvimTree", "NvimTreeOpen", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" },
-- opts = {
-- auto_reload_on_write = false,
-- disable_netrw = false,
-- hijack_cursor = false,
-- hijack_netrw = true,
-- hijack_unnamed_buffer_when_opening = false,
-- sort_by = "name",
-- root_dirs = {},
-- prefer_startup_root = false,
-- sync_root_with_cwd = true,
-- reload_on_bufenter = false,
-- respect_buf_cwd = false,
-- on_attach = "default",
-- select_prompts = false,
-- view = {
-- adaptive_size = false,
-- centralize_selection = true,
-- -- width = 30,
-- side = "left",
-- preserve_window_proportions = false,
-- number = false,
-- relativenumber = false,
-- signcolumn = "yes",
-- -- float = {
-- -- enable = false,
-- -- quit_on_focus_loss = true,
-- -- open_win_config = {
-- -- relative = "editor",
-- -- border = "rounded",
-- -- width = 30,
-- -- height = 30,
-- -- row = 1,
-- -- col = 1,
-- -- },
-- -- },
-- 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 * WIDTH_RATIO
-- local window_h = screen_h * HEIGHT_RATIO
-- 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() * WIDTH_RATIO)
-- end,
-- },
-- renderer = {
-- add_trailing = false,
-- group_empty = false,
-- highlight_git = true,
-- full_name = false,
-- highlight_opened_files = "none",
-- -- root_folder_label = ":t",
-- root_folder_label = false,
-- indent_width = 2,
-- indent_markers = {
-- enable = true,
-- inline_arrows = true,
-- icons = {
-- corner = "└",
-- edge = "│",
-- item = "│",
-- none = " ",
-- },
-- },
-- icons = {
-- webdev_colors = true,
-- git_placement = "before",
-- padding = " ",
-- symlink_arrow = " ➛ ",
-- show = {
-- file = true,
-- folder = true,
-- folder_arrow = true,
-- git = true,
-- },
-- glyphs = {
-- default = icons.ui.Text,
-- symlink = icons.ui.FileSymlink,
-- bookmark = icons.ui.BookMark,
-- folder = {
-- -- arrow_closed = icons.ui.TriangleShortArrowRight,
-- arrow_closed = icons.ui.ChevronShortRight,
-- -- arrow_open = icons.ui.TriangleShortArrowDown,
-- arrow_open = icons.ui.ChevronShortDown,
-- default = icons.ui.Folder,
-- open = icons.ui.FolderOpen,
-- empty = icons.ui.EmptyFolder,
-- empty_open = icons.ui.EmptyFolderOpen,
-- symlink = icons.ui.FolderSymlink,
-- symlink_open = icons.ui.FolderOpen,
-- },
-- git = {
-- unstaged = icons.git.FileUnstaged,
-- staged = icons.git.FileStaged,
-- unmerged = icons.git.FileUnmerged,
-- renamed = icons.git.FileRenamed,
-- untracked = icons.git.FileUntracked,
-- deleted = icons.git.FileDeleted,
-- ignored = icons.git.FileIgnored,
-- },
-- },
-- },
-- special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
-- symlink_destination = true,
-- },
-- hijack_directories = {
-- enable = false,
-- auto_open = true,
-- },
-- update_focused_file = {
-- enable = true,
-- debounce_delay = 15,
-- update_root = true,
-- ignore_list = {},
-- },
-- diagnostics = {
-- enable = true,
-- show_on_dirs = false,
-- show_on_open_dirs = true,
-- debounce_delay = 50,
-- severity = {
-- min = vim.diagnostic.severity.HINT,
-- max = vim.diagnostic.severity.ERROR,
-- },
-- icons = {
-- hint = icons.diagnostics.BoldHint,
-- info = icons.diagnostics.BoldInformation,
-- warning = icons.diagnostics.BoldWarning,
-- error = icons.diagnostics.BoldError,
-- },
-- },
-- filters = {
-- dotfiles = false,
-- git_clean = false,
-- no_buffer = false,
-- custom = { "node_modules", "\\.cache", "\\.git" },
-- exclude = {
-- ".gitignore",
-- ".prettierignore",
-- },
-- },
-- filesystem_watchers = {
-- enable = true,
-- debounce_delay = 50,
-- ignore_dirs = {},
-- },
-- git = {
-- enable = true,
-- ignore = false,
-- show_on_dirs = true,
-- show_on_open_dirs = true,
-- disable_for_dirs = {},
-- timeout = 400,
-- },
-- actions = {
-- use_system_clipboard = true,
-- change_dir = {
-- enable = true,
-- global = false,
-- restrict_above_cwd = false,
-- },
-- expand_all = {
-- max_folder_discovery = 300,
-- exclude = {},
-- },
-- file_popup = {
-- open_win_config = {
-- col = 1,
-- row = 1,
-- relative = "cursor",
-- border = "shadow",
-- style = "minimal",
-- },
-- },
-- open_file = {
-- quit_on_open = false,
-- resize_window = false,
-- window_picker = {
-- enable = true,
-- picker = "default",
-- chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
-- exclude = {
-- filetype = { "notify", "lazy", "qf", "diff", "fugitive", "fugitiveblame" },
-- buftype = { "nofile", "terminal", "help" },
-- },
-- },
-- },
-- remove_file = {
-- close_window = true,
-- },
-- },
-- trash = {
-- cmd = "trash",
-- require_confirm = true,
-- },
-- live_filter = {
-- prefix = "[FILTER]: ",
-- always_show_folders = true,
-- },
-- tab = {
-- sync = {
-- open = false,
-- close = false,
-- ignore = {},
-- },
-- },
-- notify = {
-- threshold = vim.log.levels.INFO,
-- -- threshold = vim.log.levels.ERROR,
-- },
-- log = {
-- enable = false,
-- truncate = false,
-- types = {
-- all = false,
-- config = false,
-- copy_paste = false,
-- dev = false,
-- diagnostics = false,
-- git = false,
-- profile = false,
-- watcher = false,
-- },
-- },
-- system_open = {
-- cmd = nil,
-- args = {},
-- },
-- },
-- config = function(_, opts)
-- require("nvim-tree").setup(opts)
-- end,
}

View file

@ -1,335 +0,0 @@
function TABLE_CONTAINS(tbl, x)
local found = false
for _, v in pairs(tbl) do
if v == x then
found = true
end
end
return found
end
local icons = pcode.icons.folding
return {
-- "kevinhwang91/nvim-ufo",
-- dependencies = {
-- "kevinhwang91/promise-async",
-- {
-- "luukvbaal/statuscol.nvim",
-- config = function()
-- local builtin = require "statuscol.builtin"
-- require("statuscol").setup {
-- -- relculright = true,
-- -- segments = {
-- -- { text = { builtin.foldfunc }, click = "v:lua.ScFa" },
-- -- { text = { "%s" }, click = "v:lua.ScSa" },
-- -- { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
-- -- },
-- setopt = true,
-- relculright = true,
-- segments = {
-- { text = { "%s" }, click = "v:lua.ScSa" },
-- {
-- -- text = { builtin.foldfunc, " " },
-- text = { builtin.foldfunc },
-- condition = { builtin.not_empty, true, builtin.not_empty },
-- click = "v:lua.ScFa",
-- },
-- { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
-- -- { text = { builtin.lnumfunc }, click = "v:lua.ScLa" },
-- },
-- }
-- end,
-- },
-- },
-- enabled = true,
-- lazy = true,
-- -- event = "BufReadPost",
-- -- event = { "BufReadPost", "BufRead", "InsertEnter", "BufNewFile" },
-- event = "VeryLazy",
-- config = function()
-- vim.o.foldcolumn = "1" -- '0' is not bad
-- vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
-- vim.o.foldlevelstart = 99
-- vim.o.foldenable = true
-- -- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
-- -- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
-- -- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep:│,foldclose:]]
-- -- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep:│,foldclose:]]
-- -- vim.o.fillchars = [[eob: ,fold: ,foldopen:󰛲,foldsep:│,foldclose:󰜄]]
-- -- vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep:│,foldclose:]]
-- -- vim.o.fillchars = [[eob: ,fold: ,foldopen:▾,foldsep:│,foldclose:▸]]
-- vim.opt.fillchars = {
-- vert = icons.vert,
-- fold = icons.fold,
-- eob = icons.eob,
-- diff = icons.diff,
-- msgsep = icons.msgsep,
-- foldopen = icons.foldopen,
-- foldsep = icons.foldsep,
-- foldclose = icons.foldclose,
-- }
-- -- these are "extra", change them as you like
-- vim.keymap.set("n", "zR", require("ufo").openAllFolds)
-- vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
-- vim.cmd("highlight FoldColumn guifg=" .. vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID "Comment"), "fg"))
-- -- vim.cmd("highlight FoldColumn guifg=" .. vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID("IblIndent")), "fg"))
-- -- Option 3: treesitter as a main provider instead
-- -- Only depend on `nvim-treesitter/queries/filetype/folds.scm`,
-- -- performance and stability are better than `foldmethod=nvim_treesitter#foldexpr()`
--
-- --[[require("ufo").setup({
-- -- provider_selector = function(bufnr, filetype, buftype)
-- -- return { "treesitter", "indent" }
-- -- end,
-- open_fold_hl_timeout = 150,
-- close_fold_kinds_for_ft = {
-- default = { "imports", "comment" },
-- json = { "array" },
-- c = { "comment", "region" },
-- },
-- preview = {
-- win_config = {
-- border = { "", "─", "", "", "", "─", "", "" },
-- -- winhighlight = 'Normal:Normal',
-- -- winhighlight = 'IncSearch:Folded',
-- winhighlight = "Normal:UfoPreviewNormal,FloatBorder:UfoPreviewBorder,CursorLine:UfoPreviewCursorLine",
-- winblend = 0,
-- },
-- mappings = {
-- scrollU = "<C-u>",
-- scrollD = "<C-d>",
-- jumpTop = "[",
-- jumpBot = "]",
-- },
-- },
-- provider_selector = function(_, filetype)
-- return { "treesitter", "indent" }
-- end,
-- fold_virt_text_handler = function(virt_text, lnum, end_lnum, width, truncate)
-- local result = {}
-- local _end = end_lnum - 1
-- local final_text = vim.trim(vim.api.nvim_buf_get_text(0, _end, 0, _end, -1, {})[1])
-- local suffix = final_text:format(end_lnum - lnum)
-- local suffix_width = vim.fn.strdisplaywidth(suffix)
-- local target_width = width - suffix_width
-- local cur_width = 0
-- for _, chunk in ipairs(virt_text) do
-- local chunk_text = chunk[1]
-- local chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- if target_width > cur_width + chunk_width then
-- table.insert(result, chunk)
-- else
-- chunk_text = truncate(chunk_text, target_width - cur_width)
-- local hl_group = chunk[2]
-- table.insert(result, { chunk_text, hl_group })
-- chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- -- str width returned from truncate() may less than 2nd argument, need padding
-- if cur_width + chunk_width < target_width then
-- suffix = suffix .. (" "):rep(target_width - cur_width - chunk_width)
-- end
-- break
-- end
-- cur_width = cur_width + chunk_width
-- end
-- table.insert(result, { " ⋯ ", "NonText" })
-- if vim.bo.filetype ~= "json" then
-- table.insert(result, { suffix, "TSPunctBracket" })
-- end
-- return result
-- end,
-- })]]
-- --
--
-- -- start ini bagian code support comment dan import
-- local ftMap = {
-- vim = "indent",
-- python = { "indent" },
-- git = "",
-- -- javascriptreact = { "treesitter", "indent" },
-- -- typescriptreact = { "treesitter", "indent" },
-- }
--
-- local function customizeSelector(bufnr)
-- local function handleFallbackException(err, providerName)
-- if type(err) == "string" and err:match "UfoFallbackException" then
-- return require("ufo").getFolds(bufnr, providerName)
-- else
-- return require("promise").reject(err)
-- end
-- end
--
-- return require("ufo")
-- .getFolds(bufnr, "lsp")
-- :catch(function(err)
-- return handleFallbackException(err, "treesitter")
-- end)
-- :catch(function(err)
-- return handleFallbackException(err, "indent")
-- end)
-- end
--
-- require("ufo").setup {
-- open_fold_hl_timeout = 150,
-- close_fold_kinds_for_ft = {
-- -- default = { "imports", "comment" },
-- -- json = { "array" },
-- -- c = { "comment", "region" },
-- },
-- preview = {
-- win_config = {
-- border = { "", "─", "", "", "", "─", "", "" },
-- winhighlight = "Normal:Folded",
-- winblend = 0,
-- },
-- mappings = {
-- scrollU = "<C-u>",
-- scrollD = "<C-d>",
-- jumpTop = "[",
-- jumpBot = "]",
-- },
-- },
-- provider_selector = function(bufnr, filetype, buftype)
-- -- if you prefer treesitter provider rather than lsp,
-- -- return ftMap[filetype]
-- -- return ftMap[filetype] or {'treesitter', 'indent'}
-- return ftMap[filetype] or customizeSelector
--
-- -- refer to ./doc/example.lua for detail
-- end,
--
-- fold_virt_text_handler = function(virt_text, lnum, end_lnum, width, truncate)
-- local result = {}
-- local closed_fold_text = "comments ..." -- Teks yang ingin ditampilkan
-- local import_fold_text = "import ..." -- Teks yang ingin ditampilkan
-- local is_comment = false -- Variabel untuk mengecek apakah ini komentar
-- local is_import = false
-- local is_bracket = false
--
-- -- Memeriksa apakah baris awal dari fold adalah komentar
-- local start_line = vim.api.nvim_buf_get_lines(0, lnum - 1, lnum, false)[1]
-- -- cari comentar dengan awalan /* untuk generaal comment
-- if start_line:find "^%s*%/%*" then
-- is_comment = true
-- -- cara commentar dengan awalan <!-- untuk html
-- elseif start_line:find "^%s*<!--" then
-- is_comment = true
-- -- cari comentar dengan awalan -- untuk lua
-- elseif start_line:find "^%s*%-%-" then
-- is_comment = true
-- end
-- -- cek fold yang berawalan import
-- if start_line:find "^%s*import" then
-- is_import = true
-- end
-- -- cek fold dengan akhiran {
-- if start_line:find "%s*{%s*$" then
-- is_bracket = true
-- end
-- if is_comment then
-- local suffix = string.format(" %s ", closed_fold_text)
-- local target_width = width - vim.fn.strdisplaywidth(suffix)
-- local cur_width = 0
-- for _, chunk in ipairs(virt_text) do
-- local chunk_text = chunk[1]
-- local chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- if target_width > cur_width + chunk_width then
-- table.insert(result, chunk)
-- else
-- chunk_text = truncate(chunk_text, target_width - cur_width)
-- local hl_group = chunk[2]
-- table.insert(result, { chunk_text, hl_group })
-- break
-- end
-- cur_width = cur_width + chunk_width
-- end
-- -- Menambahkan teks 'Comments ...' ke akhir baris yang dilipat
-- table.insert(result, { suffix, "NonText" })
-- elseif is_import then
-- --[[
-- local suffix = string.format(" %s ", import_fold_text)
-- local target_width = width - vim.fn.strdisplaywidth(suffix)
-- local cur_width = 0
-- for _, chunk in ipairs(virt_text) do
-- local chunk_text = chunk[1]
-- local chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- if target_width > cur_width + chunk_width then
-- table.insert(result, chunk)
-- else
-- chunk_text = truncate(chunk_text, target_width - cur_width)
-- local hl_group = chunk[2]
-- table.insert(result, { chunk_text, hl_group })
-- break
-- end
-- cur_width = cur_width + chunk_width
-- end
-- -- Menambahkan teks 'Comments ...' ke akhir baris yang dilipat
-- table.insert(result, { suffix, "NonText" })
-- ]]
-- --
--
-- local suffix = (" 󰁂 %d "):format(end_lnum - lnum)
-- local sufWidth = vim.fn.strdisplaywidth(suffix)
-- local targetWidth = width - sufWidth
-- local curWidth = 0
-- for _, chunk in ipairs(virt_text) do
-- local chunkText = chunk[1]
-- local chunkWidth = vim.fn.strdisplaywidth(chunkText)
-- if targetWidth > curWidth + chunkWidth then
-- table.insert(result, chunk)
-- else
-- chunkText = truncate(chunkText, targetWidth - curWidth)
-- local hlGroup = chunk[2]
-- table.insert(result, { 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(result, { " import⋯ ", "NonText" })
-- table.insert(result, { suffix, "MoreMsg" })
-- else
-- -- Jika bukan komentar, tampilkan teks asli
-- -- for _, chunk in ipairs(virt_text) do
-- -- table.insert(result, chunk)
-- -- end
-- local _end = end_lnum - 1
-- local final_text = vim.trim(vim.api.nvim_buf_get_text(0, _end, 0, _end, -1, {})[1])
-- local suffix = final_text:format(end_lnum - lnum)
-- local suffix_width = vim.fn.strdisplaywidth(suffix)
-- local target_width = width - suffix_width
-- local cur_width = 0
-- for _, chunk in ipairs(virt_text) do
-- local chunk_text = chunk[1]
-- local chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- if target_width > cur_width + chunk_width then
-- table.insert(result, chunk)
-- else
-- chunk_text = truncate(chunk_text, target_width - cur_width)
-- local hl_group = chunk[2]
-- table.insert(result, { chunk_text, hl_group })
-- chunk_width = vim.fn.strdisplaywidth(chunk_text)
-- -- str width returned from truncate() may less than 2nd argument, need padding
-- if cur_width + chunk_width < target_width then
-- suffix = suffix .. (" "):rep(target_width - cur_width - chunk_width)
-- end
-- break
-- end
-- cur_width = cur_width + chunk_width
-- end
-- table.insert(result, { " ⋯ ", "NonText" })
-- local l = { "javascriptreact", "typescriptreact" }
-- if TABLE_CONTAINS(l, vim.bo.filetype) and not is_bracket then
-- table.insert(result, { suffix, "TSPunctBracket" })
-- end
-- end
-- return result
-- end,
-- }
-- -- end bagian code support comment dan import
-- end,
}

View file

@ -1,114 +0,0 @@
return {
-- { "navarasu/onedark.nvim", enabled = false },
-- {
-- "olimorris/onedarkpro.nvim",
-- priority = 1000, -- Ensure it loads first
-- config = function()
-- local is_transparent = false
-- require("onedarkpro").setup({
-- styles = {
-- types = "NONE",
-- methods = "NONE",
-- numbers = "NONE",
-- strings = "NONE",
-- comments = "italic",
-- keywords = "bold,italic",
-- constants = "NONE",
-- functions = "italic",
-- operators = "NONE",
-- variables = "NONE",
-- parameters = "NONE",
-- conditionals = "italic",
-- virtual_text = "NONE",
-- tags = "italic",
-- },
-- colors = {
-- onedark = {
-- green = "#99c379",
-- gray = "#8094b4",
-- red = "#e06c75",
-- purple = "#c678dd",
-- yellow = "#e5c07a",
-- blue = "#61afef",
-- cyan = "#56b6c2",
-- bg_statusline = "#282c34",
-- indentline = "#3b4261",
-- float_bg = "#282c34",
-- },
-- },
-- options = {
-- cursorline = true,
-- transparency = is_transparent,
-- terminal_colors = true,
-- },
-- highlights = {
-- -- overide cursor line fill colors
-- LineNr = { fg = "#49505E" }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set.
-- CursorLineNr = { fg = "${blue}" }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line.
-- CursorLine = { bg = "#333842" },
-- Cursor = { fg = "${bg}", bg = "${fg}" }, -- character under the cursor
-- lCursor = { fg = "${bg}", bg = "${fg}" }, -- the character under the cursor when |language-mapping| is used (see 'guicursor')
-- CursorIM = { fg = "${bg}", bg = "${fg}" }, -- like Cursor, but used when in IME mode |CursorIM|
-- CursorColumn = { bg = "#333842" }, -- Screen-column at the cursor, when 'cursorcolumn' is set.
-- -- overide nvimtree folder icon fill color
-- NvimTreeFolderIcon = { fg = "${gray}" },
-- -- overide nvimtree text fill color folder opened
-- NvimTreeOpenedFolderName = { fg = "${blue}" },
-- -- overide nvimtree text fill color root folder
-- NvimTreeRootFolder = { fg = "${yellow}" },
-- NvimTreeSpecialFile = { fg = "${orange}" },
-- NvimTreeWinSeparator = { fg = "#202329" },
-- NvimTreeIndentMarker = { fg = "#3E4450" },
-- -- overide indenline fill color
-- IblIndent = { fg = "#3E4450" },
-- -- overide cmp cursorline fill color with #333842
-- PmenuSel = { bg = "#333842" },
-- illuminatedWord = { bg = "#3b4261" },
-- illuminatedCurWord = { bg = "#3b4261" },
-- IlluminatedWordText = { bg = "#3b4261" },
-- IlluminatedWordRead = { bg = "#3b4261" },
-- IlluminatedWordWrite = { bg = "#3b4261" },
-- StatusLine = { fg = "#f8f8f2", bg = is_transparent and "NONE" or "${bg}" },
-- StatusLineTerm = { fg = "#f8f8f2", bg = "${bg}" },
-- BufferLineFill = { bg = is_transparent and "NONE" or "${bg}" },
-- ["@string.special.url.html"] = { fg = "${green}" },
-- ["@lsp.type.parameter"] = { fg = "${gray}" },
-- -- ["@text.uri.html"] = { fg = "${green}" },
-- -- ["@tag.javascript"] = { fg = "${red}" },
-- -- ["@tag.attribute"] = { fg = "${orange}", style = "italic" },
-- -- ["@constructor.javascript"] = { fg = "${red}" },
-- -- ["@variable"] = { fg = "${fg}", style = "NONE" }, -- various variable names
-- -- ["@variable.builtin"] = { fg = "${red}", style = "NONE" },
-- -- ["@variable.member"] = "${cyan}",
-- -- ["@variable.parameter"] = "${red}",
-- -- ["@property"] = { fg = "${cyan}" }, -- similar to `@field`
-- ["@property.lua"] = { fg = "${red}", bg = "NONE" },
-- ["@lsp.type.property.lua"] = { fg = "${cyan}", bg = "NONE" },
-- ["@lsp.type.variable.lua"] = { fg = "${red}", bg = "NONE" },
-- NvimTreeGitDirty = { fg = "${yellow}" },
-- Pmenu = { fg = "${fg}", bg = "${bg}" },
-- PmenuThumb = { bg = "${gray}" }, -- Popup menu: Thumb of the scrollbar.
-- -- overide lualine fill color with bg color
-- LualineNormal = { bg = "${bg}" },
-- -- overide lualine_c fill color with bg color
-- LualineC = { bg = "${bg}" },
-- -- overide lualine_x fill color with bg color
-- LualineX = { bg = "${bg}" },
-- -- overide which-key fill color with bg color
-- -- WhichKey = { bg = "${bg}" },
-- -- -- overide which-key fill color with bg color
-- -- WhichKeySeperator = { bg = "${bg}" },
-- -- -- overide which-key fill color with bg color
-- -- WhichKeyDesc = { fg = "${red}" },
-- -- -- overide which-key fill color with bg color
-- -- WhichKeyFloat = { bg = "${bg}" },
-- WhichKeyFloat = { bg = is_transparent and "NONE" or "${bg}" },
-- -- -- overide which-key fill color with bg color
-- -- WhichKeyValue = { bg = "${bg}" },
-- -- -- overide which-key fill color with bg color
-- -- WhichKeyBorder = { bg = "${bg}" },
-- },
-- })
-- end,
-- },
}

View file

@ -1,27 +0,0 @@
return {
"folke/playground",
lazy = true,
event = "BufRead",
config = function()
require("nvim-treesitter.configs").setup {
playground = {
enable = true,
disable = {},
updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
persist_queries = false, -- Whether the query persists across vim sessions
keybindings = {
toggle_query_editor = "o",
toggle_hl_groups = "i",
toggle_injected_languages = "t",
toggle_anonymous_nodes = "a",
toggle_language_display = "I",
focus_language = "f",
unfocus_language = "F",
update = "R",
goto_node = "<cr>",
show_help = "?",
},
},
}
end,
}

View file

@ -1,40 +0,0 @@
return {
-- Incremental rename
-- {
-- "smjonas/inc-rename.nvim",
-- cmd = "IncRename",
-- keys = {
-- {
-- "<leader>un",
-- function()
-- return ":IncRename " .. vim.fn.expand "<cword>"
-- end,
-- desc = "Incremental rename",
-- mode = "n",
-- noremap = true,
-- expr = true,
-- },
-- },
-- config = true,
-- },
--
-- -- Refactoring tool
-- {
-- "ThePrimeagen/refactoring.nvim",
-- keys = {
-- {
-- "<leader>r",
-- function()
-- require("refactoring").select_refactor {
-- show_success_message = true,
-- }
-- end,
-- mode = "v",
-- noremap = true,
-- silent = true,
-- expr = false,
-- },
-- },
-- opts = {},
-- },
}

View file

@ -1,80 +0,0 @@
return {
-- {
-- "folke/tokyonight.nvim",
-- lazy = false,
-- priority = 1000,
-- opts = {},
-- config = function()
-- local status_ok, tokyonight = pcall(require, "tokyonight")
-- if not status_ok then
-- return
-- end
-- local transp = false
-- local sidebar = "normal" --"dark , transparent, normal"
-- local hilight = "#292e42"
-- local data_exists, config = pcall(require, "core.config")
-- if data_exists then
-- local tras = config.transparent_mode
-- if tras == 1 then
-- transp = true
-- sidebar = "transparent"
-- -- hilight = "#3E4254"
-- -- hilight = "#353a56"
-- hilight = "#292e42"
-- end
-- end
-- tokyonight.setup({
-- -- your configuration comes here
-- -- or leave it empty to use the default settings
-- style = "night", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
-- light_style = "day", -- The theme is used when the background is set to light
-- transparent = transp, -- Enable this to disable setting the background color
-- terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
-- styles = {
-- -- Style to be applied to different syntax groups
-- -- Value is any valid attr-list value for `:help nvim_set_hl`
-- -- comments = { italic = true },
-- comments = { italic = true },
-- keywords = { italic = true },
-- functions = {},
-- variables = {},
-- -- Background styles. Can be "dark", "transparent" or "normal"
-- sidebars = sidebar, -- style for sidebars, see below
-- floats = sidebar, -- style for floating windows
-- },
-- sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
-- day_brightness = 0.2, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
-- hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**.
-- dim_inactive = false, -- dims inactive windows
-- lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
--
-- --- You can override specific color groups to use other groups or a hex color
-- --- function will be called with a ColorScheme table
-- -- @param colors ColorScheme
-- on_colors = function(colors)
-- colors.bg_highlight = hilight
-- colors.bg_statusline = colors.none
-- end,
--
-- --- You can override specific highlights to use other groups or a hex color
-- --- function will be called with a Highlights and ColorScheme table
-- --@param highlights Highlights
-- -- @param colors ColorScheme
-- on_highlights = function(highlights, colors)
-- highlights.NvimTreeFolderIcon = {
-- bg = colors.none,
-- fg = "#e0af68",
-- }
-- highlights.Underlined = {
-- underline = false,
-- }
-- highlights.NvimTreeWinSeparator = {
-- fg = colors.border,
-- }
-- highlights.BufferLineFill = { bg = colors.bg }
-- highlights.NvimTreeSpecialFile = { fg = colors.purple, underline = false }
-- end,
-- })
-- end,
-- },
}

View file

@ -1,72 +0,0 @@
return {
-- {
-- "folke/tokyonight.nvim",
-- lazy = false,
-- priority = 1000,
-- opts = {},
-- config = function()
-- local status_ok, tokyonight = pcall(require, "tokyonight")
-- if not status_ok then
-- return
-- end
-- local transp = false
-- local sidebar = "normal" --"dark , transparent, normal"
-- tokyonight.setup({
-- -- your configuration comes here
-- -- or leave it empty to use the default settings
-- style = "night", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day`
-- light_style = "day", -- The theme is used when the background is set to light
-- transparent = transp, -- Enable this to disable setting the background color
-- terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
-- styles = {
-- -- Style to be applied to different syntax groups
-- -- Value is any valid attr-list value for `:help nvim_set_hl`
-- -- comments = { italic = true },
-- comments = { italic = true },
-- keywords = { italic = true },
-- functions = {},
-- variables = {},
-- -- Background styles. Can be "dark", "transparent" or "normal"
-- sidebars = sidebar, -- style for sidebars, see below
-- floats = sidebar, -- style for floating windows
-- },
-- sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]`
-- day_brightness = 0.2, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors
-- hide_inactive_statusline = false, -- Enabling this option, will hide inactive statuslines and replace them with a thin border instead. Should work with the standard **StatusLine** and **LuaLine**.
-- dim_inactive = false, -- dims inactive windows
-- lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
--
-- --- You can override specific color groups to use other groups or a hex color
-- --- function will be called with a ColorScheme table
-- -- @param colors ColorScheme
-- on_colors = function(colors)
-- colors.bg_statusline = colors.bg
-- colors.bg_sidebar = colors.bg
-- colors.bg = colors.bg
-- colors.bg_dark = colors.bg
-- colors.terminal_black = colors.bg
-- end,
--
-- --- You can override specific highlights to use other groups or a hex color
-- --- function will be called with a Highlights and ColorScheme table
-- --@param highlights Highlights
-- -- @param colors ColorScheme
-- on_highlights = function(highlights, colors)
-- highlights.NvimTreeFolderIcon = {
-- bg = colors.none,
-- fg = "#e0af68",
-- }
-- highlights.Underlined = {
-- underline = false,
-- }
-- highlights.BufferLineFill = { bg = colors.none }
-- highlights.NvimTreeWinSeparator = {
-- fg = colors.border,
-- bg = colors.bg_sidebar,
-- }
-- highlights.Pmenu = { fg = colors.fg, bg = colors.bg }
-- end,
-- })
-- end,
-- },
}

View file

@ -1,10 +0,0 @@
return {
-- "pmizio/typescript-tools.nvim",
-- event = "BufRead",
-- dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
-- config = function()
-- require("typescript-tools").setup({
-- on_attach = require("user.lsp.handlers").on_attach,
-- })
-- end,
}

View file

@ -1,26 +0,0 @@
return {
-- { "RRethy/nvim-base16" },
-- -- simbol outline
-- {
-- "simrat39/symbols-outline.nvim",
-- lazy = true,
-- event = "BufRead",
-- config = function()
-- require("symbols-outline").setup()
-- end,
-- },
-- {
-- "nvim-lualine/lualine.nvim",
-- lazy = true,
-- event = "BufWinEnter",
-- config = function()
-- require("user.lualine")
-- end,
-- },
-- { "RRethy/vim-illuminate", event = "InsertEnter", enabled = true },
-- { "cpea2506/one_monokai.nvim" },
-- { "luisiacc/gruvbox-baby", lazy = true, enabled = false },
-- { "projekt0n/github-nvim-theme", version = "v0.0.7" },
-- { "stevearc/dressing.nvim", enabled = false },
-- { "karb94/neoscroll.nvim", enabled = false },
}

View file

@ -1,20 +0,0 @@
return {
"folke/zen-mode.nvim",
event = "VeryLazy",
opts = {
plugins = {
options = {
laststatus = 0,
},
},
on_open = function(win)
require("notify")("Zen Mode ON")
end,
on_close = function()
require("notify")("Zen Mode OFF")
end,
},
keys = {
{ "<leader>zz", "<cmd>ZenMode<cr>", desc = "Toggle Zen Mode" },
},
}

View file

@ -0,0 +1,86 @@
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
local icons = require("pcode.user.icons").ui
-- Make sure to setup `mapleader` and `maplocalleader` before
-- loading lazy.nvim so that mappings are correct.
-- This is also a good place to setup other settings (vim.opt)
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- initialisasi plugins
local importdata = {
{ import = "pcode.plugins" },
}
-- load theme
local theme = pcode.themes or {}
for key, _ in pairs(theme) do
table.insert(importdata, { import = "pcode.plugins.theme." .. key })
end
-- load extras plugins
local extras = pcode.extras or {}
for _, value in pairs(extras) do
table.insert(importdata, { import = "pcode.plugins.extras." .. value })
end
-- load language config
local lang = pcode.lang or {}
for _, value in pairs(lang) do
table.insert(importdata, { import = "pcode.plugins.lang." .. value })
end
-- load transparant config
local transparant = pcode.transparent or false
if transparant then
table.insert(importdata, { import = "pcode.plugins.extras.transparent" })
end
-- add overide path
table.insert(importdata, { import = "pcode.user.custom" })
-- Setup lazy.nvim
require("lazy").setup({
spec = importdata,
ui = {
backdrop = 100, -- Menyeting backdrop UI
border = "rounded", -- Mengatur border UI ke rounded
browser = "chrome", -- Menggunakan Chrome sebagai browser default
throttle = 40, -- Menyeting throttle
custom_keys = {
["<localleader>l"] = false, -- Menonaktifkan kunci lokal leader l
},
icons = {
ft = icons.ft,
lazy = icons.Bell .. " ",
loaded = icons.CheckCircle,
not_loaded = icons.not_loaded,
},
},
change_detection = { enabled = false, notify = false }, -- Nonaktifkan deteksi perubahan
-- automatically check for plugin updates
checker = { enabled = true },
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
"matchit",
"matchparen",
"netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})

5
lua/pcode/core/init.lua Normal file
View file

@ -0,0 +1,5 @@
_G.pcode = _G.pcode or {}
require("pcode.user.default")
require("pcode.config.lazy_lib")
require("pcode.user.colorscheme")
require("pcode.core.neovide")

View file

@ -0,0 +1,55 @@
_G.idxOf = function(array, value)
for i, v in ipairs(array) do
if v == value then
return i
end
end
return nil
end
_G.LAZYGIT_TOGGLE = function()
local ok = pcall(require, "toggleterm")
if not ok then
require("notify")("toggleterm not found!", "error")
return
end
local Terminal = require("toggleterm.terminal").Terminal
local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
lazygit:toggle()
end
_G.substring = function(text, key)
local index, _ = string.find(text, key)
if index then
return true
else
return false
end
end
_G.all_trim = function(s)
return s:match("^%s*(.-)%s*$")
end
_G.current_theme = function()
if pcode.themes then
local theme = ""
for _, value in pairs(pcode.themes or {}) do
theme = value
end
return all_trim(theme)
end
return ""
end
local function safeRequire(module)
local ok, result = pcall(require, module)
if ok then
return result
end
end
safeRequire("pcode.user.options")
safeRequire("pcode.user.autocmd")
safeRequire("pcode.user.keymaps")
return {}

111
lua/pcode/plugins/_lsp.lua Normal file
View file

@ -0,0 +1,111 @@
return {
{
"williamboman/mason-lspconfig.nvim",
event = { "VeryLazy", "BufReadPre", "BufNewFile", "BufRead" },
dependencies = {
{ "pojokcodeid/auto-lsp.nvim", lazy = true },
{
"neovim/nvim-lspconfig",
lazy = true,
cmd = {
"LspInfo",
"LspInstall",
"LspUninstall",
},
config = function()
require("lspconfig.ui.windows").default_options.border = "rounded"
end,
},
{
"williamboman/mason.nvim",
lazy = true,
build = ":MasonUpdate",
opts_extend = { "ensure_installed" },
cmd = {
"Mason",
"MasonInstall",
"MasonUninstall",
"MasonUninstallAll",
"MasonLog",
},
opts = function(_, opts)
local icons = require("pcode.user.icons").ui
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "stylua" })
opts.ui = {
-- border = "none",
border = icons.Border,
icons = {
package_pending = icons.Pending,
package_installed = icons.CheckCircle,
package_uninstalled = icons.BlankCircle,
},
keymaps = {
toggle_server_expand = "<CR>",
install_server = "i",
update_server = "u",
check_server_version = "c",
update_all_servers = "U",
check_outdated_servers = "C",
uninstall_server = "X",
},
}
opts.log_level = vim.log.levels.INFO
opts.max_concurrent_installers = 4
return opts
end,
config = function(_, opts)
require("mason").setup(opts)
local mr = require("mason-registry")
mr:on("package:install:success", function()
vim.defer_fn(function()
-- trigger FileType event to possibly load this newly installed LSP server
require("lazy.core.handler.event").trigger({
event = "FileType",
buf = vim.api.nvim_get_current_buf(),
})
end, 100)
end)
mr.refresh(function()
for _, tool in ipairs(opts.ensure_installed) do
local p = mr.get_package(tool)
if not p:is_installed() then
p:install()
end
end
end)
end,
},
},
opts = function(_, opts)
opts.skip_config = opts.skip_config or {}
opts.ensure_installed = opts.ensure_installed or {}
opts.automatic_installation = true
vim.list_extend(opts.ensure_installed, { "lua_ls" })
opts.format_on_save = true -- if use none-ls set true
opts.virtual_text = true
opts.timeout_ms = 5000
return opts
end,
config = function(_, opts)
require("auto-lsp").setup(opts)
end,
-- stylua: ignore
keys = {
{ "<leader>l", "", desc = "  LSP", mode = "n" },
{ "<leader>la", "<cmd>lua vim.lsp.buf.code_action()<cr>", desc = "Code Action", mode = "n" },
{ "<leader>ld", "<cmd>Telescope diagnostics bufnr=0<cr>", desc = "Document Diagnostics", mode = "n" },
{ "<leader>lw", "<cmd>Telescope diagnostics<cr>", desc = "Workspace Diagnostics", mode = "n" },
{ "<leader>li", "<cmd>LspInfo<cr>", desc = "Info", mode = "n" },
{ "<leader>lI", "<cmd>Mason<cr>", desc = "Mason", mode = "n" },
{ "<leader>lj", "<cmd>lua vim.lsp.diagnostic.goto_next()<CR>", desc = "Next Diagnostic", mode = "n" },
{ "<leader>lk", "<cmd>lua vim.lsp.diagnostic.goto_prev()<cr>", desc = "Prev Diagnostic", mode = "n" },
{ "<leader>ll", "<cmd>lua vim.lsp.codelens.run()<cr>", desc = "Code Lens Action", mode = "n" },
{ "<leader>lq", "<cmd>lua vim.diagnostic.setloclist()<cr>", desc = "Quickfix", mode = "n" },
{ "<leader>lr", "<cmd>lua vim.lsp.buf.rename()<cr>", desc = "Rename", mode = "n" },
{ "<leader>ls", "<cmd>Telescope lsp_document_symbols<cr>", desc = "Document Symbols", mode = "n" },
{ "<leader>lS", "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>", desc = "Workspace Symbols", mode = "n"},
},
},
}

View file

@ -0,0 +1,47 @@
return {
{ "nvim-lua/plenary.nvim", event = "VeryLazy" },
{
"nvim-treesitter/nvim-treesitter",
event = { "BufRead", "VeryLazy" },
version = false,
build = ":TSUpdate",
lazy = true,
cmd = {
"TSInstall",
"TSInstallInfo",
"TSInstallSync",
"TSUpdate",
"TSUpdateSync",
"TSUninstall",
"TSUninstallInfo",
"TSInstallFromGrammar",
},
opts = function()
return {
highlight = { enable = true },
indent = { enable = true },
ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc" },
incremental_selection = {
enable = true,
},
autopairs = {
enable = true,
},
}
end,
config = function(_, opts)
if type(opts.ensure_installed) == "table" then
---@type table<string, boolean>
local added = {}
opts.ensure_installed = vim.tbl_filter(function(lang)
if added[lang] then
return false
end
added[lang] = true
return true
end, opts.ensure_installed)
end
require("nvim-treesitter.configs").setup(opts)
end,
},
}

View file

@ -0,0 +1,35 @@
return {
"windwp/nvim-autopairs",
lazy = true,
dependencies = "hrsh7th/nvim-cmp",
event = "InsertEnter",
opts = {
check_ts = true,
ts_config = {
lua = { "string", "source" },
javascript = { "string", "template_string" },
java = false,
},
disable_filetype = { "TelescopePrompt", "spectre_panel" },
fast_wrap = {
map = "<M-e>",
chars = { "{", "[", "(", '"', "'", "`" },
pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""),
offset = 0, -- Offset from pattern match
end_key = "$",
keys = "qwertyuiopzxcvbnmasdfghjkl",
check_comma = true,
highlight = "PmenuSel",
highlight_grey = "LineNr",
},
},
config = function(_, opts)
require("nvim-autopairs").setup(opts)
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local cmp_status_ok, cmp = pcall(require, "cmp")
if not cmp_status_ok then
return
end
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
end,
}

View file

@ -0,0 +1,6 @@
return {
"windwp/nvim-ts-autotag",
lazy = true,
event = { "BufRead", "VeryLazy" },
opts = {},
}

View file

@ -0,0 +1,82 @@
local M = {
"goolord/alpha-nvim",
event = "VimEnter",
}
M.opts = {
dash_model = {
[[ _ __ __ ]],
[[ ___ ___ (____ / /__ _______ ___/ ___ ]],
[[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]],
[[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]],
[[ /_/ |___/ ]],
},
}
function M.config(_, opts)
local alpha = require("alpha")
local startify = require("alpha.themes.startify")
startify.section.header.val = pcode.dashboard or opts.dash_model
startify.section.top_buttons.val = {
startify.button("F", "󰈞 Find file", ":Telescope find_files <CR>"),
startify.button("e", " New file", ":ene <BAR> startinsert <CR>"),
startify.button("p", "󰉋 Find project", ":Telescope projects <CR>"),
startify.button("r", "󰦛 Recently used files", ":Telescope oldfiles <CR>"),
startify.button("t", "󰊄 Find text", ":Telescope live_grep <CR>"),
startify.button("c", " Configuration", ":e $MYVIMRC <CR>"),
startify.button("L", "󰒲 Lazy", ":Lazy<CR>"),
startify.button("q", "󰅚 Quit", ":qa<CR>"),
}
-- disable MRU
startify.section.mru.val = { { type = "padding", val = 4 } }
-- disable MRU cwd
startify.section.mru_cwd.val = { { type = "padding", val = 0 } }
-- disable nvim_web_devicons
startify.nvim_web_devicons.enabled = false
startify.section.bottom_buttons.val = {}
vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimStarted",
desc = "Add Alpha dashboard footer",
once = true,
callback = function()
local stats = require("lazy").stats()
local ms = math.floor(stats.startuptime * 100 + 0.5) / 100
-- stylua: ignore
startify.section.footer.val = {
-- {
-- type = "text",
-- val = {"───────────────────────────────────────────"},
-- },
{
type = "text",
val = {
"⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins  in " .. ms .. "ms",
},
},
-- {
-- type = "text",
-- val = {"───────────────────────────────────────────"},
-- },
}
pcall(vim.cmd.AlphaRedraw)
end,
})
vim.api.nvim_create_autocmd({ "User" }, {
pattern = { "AlphaReady" },
callback = function()
vim.cmd([[
set laststatus=0 | autocmd BufUnload <buffer> set laststatus=3
]])
end,
})
-- ignore filetypes in MRU
local default_mru_ignore = {}
startify.mru_opts.ignore = function(path, ext)
return (string.find(path, "COMMIT_EDITMSG")) or (vim.tbl_contains(default_mru_ignore, ext))
end
alpha.setup(startify.config)
end
return M

View file

@ -0,0 +1,34 @@
return {
"akinsho/bufferline.nvim",
branch = "main",
event = { "BufRead", "InsertEnter", "BufNewFile" },
dependencies = "pojokcodeid/auto-bufferline.nvim",
config = function()
vim.opt.termguicolors = true
local config = require("auto-bufferline").config()
require("bufferline").setup(config)
end,
keys = {
{ "<leader>b", "", desc = "  Buffers", mode = "n" },
{
"<leader>bb",
function()
require("telescope.builtin").buffers(require("telescope.themes").get_dropdown({ previewer = false }))
end,
desc = "All Buffer",
mode = "n",
},
{
"<leader>bc",
function()
require("auto-bufferline.configs.utils").bufremove()
end,
desc = "Close current buffer",
mode = "n",
},
{ "<leader>bd", "<cmd>BufferLineCloseLeft<cr>", desc = "Close Buffer Left", mode = "n" },
{ "<leader>bD", "<cmd>BufferLineCloseRight<cr>", desc = "Close Buffer Right", mode = "n" },
{ "<leader>ba", "<cmd>BufferLineCloseOthers<cr>", desc = "Close Buffer Other", mode = "n" },
{ "<leader>bA", "<cmd>BufferLineCloseOthers<cr><cmd>bd!<cr>", desc = "Close Buffer All", mode = "n" },
},
}

121
lua/pcode/plugins/cmp.lua Normal file
View file

@ -0,0 +1,121 @@
return {
{
"L3MON4D3/LuaSnip",
event = "InsertEnter",
opts = {
history = true,
delete_check_events = "TextChanged",
},
-- stylua: ignore
keys = {
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
},
},
{
"hrsh7th/nvim-cmp",
version = false, -- last release is way too old
event = "InsertEnter",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"saadparwaiz1/cmp_luasnip",
"hrsh7th/cmp-nvim-lua",
},
opts = function()
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")
end
return {
completion = {
completeopt = "menu,menuone,noinsert",
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expandable() then
luasnip.expand()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif check_backspace() then
fallback()
else
fallback()
end
end, {
"i",
"s",
}),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, {
"i",
"s",
}),
}),
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)
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 = ({
-- nvim_lsp = "(LSP)",
-- luasnip = "(Snippet)",
-- buffer = "(Buffer)",
-- path = "(Path)",
-- codeium = "(Codeium)",
-- })[entry.source.name]
return vim_item
end,
},
window = {
completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(),
},
experimental = {
ghost_text = false,
native_menu = false,
},
}
end,
},
{
"rafamadriz/friendly-snippets",
event = "InsertEnter",
lazy = true,
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
require("pcode.user.snippets")
end,
},
}

View file

@ -0,0 +1,133 @@
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 = {
{
"<S-Enter>",
function()
require("noice").redirect(vim.fn.getcmdline())
end,
mode = "c",
desc = "Redirect Cmdline",
},
{
"<leader>snl",
function()
require("noice").cmd("last")
end,
desc = "Noice Last Message",
},
{
"<leader>snh",
function()
require("noice").cmd("history")
end,
desc = "Noice History",
},
{
"<leader>sna",
function()
require("noice").cmd("all")
end,
desc = "Noice All",
},
{
"<c-f>",
function()
if not require("noice.lsp").scroll(4) then
return "<c-f>"
end
end,
silent = true,
expr = true,
desc = "Scroll forward",
mode = { "i", "n", "s" },
},
{
"<c-b>",
function()
if not require("noice.lsp").scroll(-4) then
return "<c-b>"
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 = {
["<CR>"] = cmp.mapping.confirm({ select = true }),
["<Up>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
["<S-Tab>"] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }),
["<Down>"] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }),
["<Tab>"] = 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 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,
},
}

View file

@ -0,0 +1,52 @@
--typescript = "deno run",
-- cpp="gcc $fileName -lstdc++ -o $fileNameWithoutExt && $fileNameWithoutExt"
local pyrun = "python -u"
if vim.fn.has("win32") == 0 then
pyrun = "python3 -u"
end
local rfile = {
java = "cd $dir && javac $fileName && java $fileNameWithoutExt",
python = pyrun,
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"',
go = "go run .",
}
return {
"CRAG666/code_runner.nvim",
lazy = true,
cmd = { "RunCode", "RunFile", "RunProject", "RunClose" },
opts = {
filetype = rfile,
mode = "float",
focus = true,
startinsert = true,
term = {
position = "bot",
size = 50,
},
float = {
close_key = "<ESC>",
border = "rounded",
height = 0.8,
width = 0.8,
x = 0.5,
y = 0.5,
border_hl = "FloatBorder",
float_hl = "Normal",
blend = 0,
},
},
config = function(_, opts)
require("code_runner").setup(opts)
end,
keys = {
{ "<leader>r", "", desc = "  Run", mode = "n" },
{ "<leader>rr", "<cmd>RunCode<CR>", desc = "Run Code", mode = "n" },
{ "<leader>rf", "<cmd>RunFile<CR>", desc = "Run File", mode = "n" },
{ "<leader>rp", "<cmd>RunProject<CR>", desc = "Run Project", mode = "n" },
},
}

View file

@ -0,0 +1,29 @@
return {
"numToStr/Comment.nvim",
event = "VeryLazy",
dependencies = {
"JoosepAlviste/nvim-ts-context-commentstring",
},
opts = function()
return {
pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(),
}
end,
keys = {
{
"<leader>/",
"<Plug>(comment_toggle_linewise_current)",
desc = "󰆈 Coment line",
mode = "n",
},
{
"<leader>/",
"<Plug>(comment_toggle_linewise_visual)",
desc = "󰆈 Coment line",
mode = "v",
},
},
config = function(_, opts)
require("Comment").setup(opts)
end,
}

View file

@ -0,0 +1,40 @@
return {
"pojokcodeid/auto-conform.nvim",
dependencies = {
"williamboman/mason.nvim",
"stevearc/conform.nvim",
},
event = "VeryLazy",
opts = function(_, opts)
opts.formatters = opts.formatters or {}
opts.formatters_by_ft = opts.formatters_by_ft or {}
opts.ensure_installed = opts.ensure_installed or {}
-- vim.list_extend(opts.ensure_installed, { "stylua" })
opts.lang_maps = opts.lang_maps or {}
opts.name_maps = opts.name_maps or {}
opts.add_new = opts.add_new or {}
opts.ignore = opts.ignore or {}
opts.format_on_save = opts.format_on_save or true
opts.format_timeout_ms = opts.format_timeout_ms or 5000
end,
config = function(_, opts)
require("auto-conform").setup(opts)
-- other conform config
local conform = require("conform")
if opts.format_on_save then
conform.setup({
format_on_save = {
lsp_fallback = true,
timeout_ms = opts.format_timeout_ms or 5000,
},
})
end
vim.keymap.set({ "n", "v" }, "<leader>lF", function()
conform.format({
lsp_fallback = true,
async = false,
timeout_ms = opts.format_timeout_ms or 5000,
})
end, { desc = "Format file or range (in visual mode)" })
end,
}

View file

@ -0,0 +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,
}

View file

@ -0,0 +1,53 @@
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", {})
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 = {
{ "<leader>n", ":ASToggle<CR>", desc = "󰨚 Toggle auto-save" },
},
}

View file

@ -0,0 +1,8 @@
return {
"LunarVim/bigfile.nvim",
lazy = true,
event = "BufReadPre",
opts = {
file_size = 2,
},
}

View file

@ -0,0 +1,33 @@
return {
"exafunction/codeium.vim",
enabled = true,
-- for fix notwork new version
-- https://github.com/exafunction/codeium.vim/issues/376#issuecomment-2159643405
-- version = "1.8.37",
-- event = "bufwinenter",
-- event = "bufenter",
-- event = "insertenter",
event = { "VeryLazy", "bufreadpre", "bufnewfile", "bufread" },
build = ":Codeium Auth",
cmd = { "CodeiumChat" },
config = function()
vim.g.codeium_disable_bindings = 1
-- Change '<C-g>' here to any keycode you like.
vim.keymap.set("i", "<C-g>", function()
return vim.fn["codeium#Accept"]()
end, { expr = true, silent = true })
vim.keymap.set("i", "<c-;>", function()
return vim.fn["codeium#CycleCompletions"](1)
end, { expr = true, silent = true })
vim.keymap.set("i", "<c-,>", function()
return vim.fn["codeium#CycleCompletions"](-1)
end, { expr = true, silent = true })
vim.keymap.set("i", "<c-x>", function()
return vim.fn["codeium#Clear"]()
end, { expr = true, silent = true })
end,
keys = {
{ "<leader>c", ":CodeiumChat<cr>", desc = "󰭹 codeium chat", mode = "n" },
},
}

View file

@ -0,0 +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,
},
}

View file

@ -0,0 +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
},
},
}

View file

@ -0,0 +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 = {
{ "<leader>d", "", desc = "  Debug" },
{ "<leader>dt", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", desc = "Toggle Breakpoint" },
{ "<leader>db", "<cmd>lua require'dap'.step_back()<cr>", desc = "Step Back" },
{ "<leader>dc", "<cmd>lua require'dap'.continue()<cr>", desc = "Continue" },
{ "<leader>dC", "<cmd>lua require'dap'.run_to_cursor()<cr>", desc = "Run To Cursor" },
{ "<leader>dd", "<cmd>lua require'dap'.disconnect()<cr>", desc = "Disconnect" },
{ "<leader>dg", "<cmd>lua require'dap'.session()<cr>", desc = "Get Session" },
{ "<leader>di", "<cmd>lua require'dap'.step_into()<cr>", desc = "Step Into" },
{ "<leader>do", "<cmd>lua require'dap'.step_over()<cr>", desc = "Step Over" },
{ "<leader>du", "<cmd>lua require'dap'.step_out()<cr>", desc = "Step Out" },
{ "<leader>dp", "<cmd>lua require'dap'.pause()<cr>", desc = "Pause" },
{ "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", desc = "Toggle Repl" },
{ "<leader>ds", "<cmd>lua require'dap'.continue()<cr>", desc = "Start" },
{ "<leader>dq", "<cmd>lua require'dap'.close()<cr>", desc = "Quit" },
{ "<leader>dU", "<cmd>lua require'dapui'.toggle({reset = true})<cr>", 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,
},
}

View file

@ -0,0 +1,7 @@
return {
"rachartier/tiny-devicons-auto-colors.nvim",
event = "VeryLazy",
config = function()
require("tiny-devicons-auto-colors").setup()
end,
}

View file

@ -0,0 +1,36 @@
local M = {
"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",
},
})
end
return M

View file

@ -0,0 +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,
}

View file

@ -0,0 +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
{ "<leader>rl", "<cmd>LiveServerToggle<cr>", desc = "LiveServer" },
},
}

View file

@ -0,0 +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 = "<ScrollWheel" .. scroll .. ">"
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,
},
}

View file

@ -0,0 +1,35 @@
local M = {
"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,
})
end
return M

View file

@ -0,0 +1,8 @@
return {
"karb94/neoscroll.nvim",
event = "VeryLazy",
lazy = true,
config = function()
require("neoscroll").setup({})
end,
}

View file

@ -0,0 +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", "<C-t>", function()
require("menu").open("default")
end, {})
-- mouse users + nvimtree users!
vim.keymap.set("n", "<RightMouse>", function()
vim.cmd.exec('"normal! \\<RightMouse>"')
local options = vim.bo.ft == "NvimTree" and "nvimtree" or "default"
require("menu").open(options, opts)
end, {})
end,
},
}

View file

@ -0,0 +1,107 @@
local M = { "kevinhwang91/nvim-ufo" }
M.event = "VeryLazy"
M.dependencies = {
"kevinhwang91/promise-async",
"luukvbaal/statuscol.nvim",
}
M.config = function()
local builtin = require("statuscol.builtin")
local cfg = {
setopt = true,
relculright = true,
segments = {
{ text = { builtin.foldfunc, " " }, click = "v:lua.ScFa", hl = "Comment" },
{ text = { "%s" }, click = "v:lua.ScSa" },
{ text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" },
},
}
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:▸]]
-- 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 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" }
-- refer to ./doc/example.lua for detail
end,
preview = {
win_config = {
border = { "", "", "", "", "", "", "", "" },
winhighlight = "Normal:Folded",
winblend = 0,
},
mappings = {
scrollU = "<C-k>",
scrollD = "<C-j>",
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)
end
return M

View file

@ -0,0 +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,
}

View file

@ -0,0 +1,43 @@
return {
-- Incremental rename
{
"smjonas/inc-rename.nvim",
cmd = "IncRename",
-- stylua: ignore
keys = {
{"<leader>u","",desc="  Edit"},
{
"<leader>un",
function()
return ":IncRename " .. vim.fn.expand("<cword>")
end,
desc = "Incremental rename",
mode = "n",
noremap = true,
expr = true,
},
},
config = true,
},
-- Refactoring tool
{
"ThePrimeagen/refactoring.nvim",
keys = {
{
"<leader>r",
function()
require("refactoring").select_refactor({
show_success_message = true,
})
end,
mode = "v",
noremap = true,
silent = true,
expr = false,
desc = "  Refactoring",
},
},
opts = {},
},
}

View file

@ -0,0 +1,27 @@
vim.filetype.add({
extension = {
["http"] = "http",
},
})
return {
{
"mistweaverco/kulala.nvim",
ft = "http",
keys = {
{ "<leader>R", "", desc = " 󰖟 Rest" },
{ "<leader>Rs", "<cmd>lua require('kulala').run()<cr>", desc = "Send the request" },
{ "<leader>Rt", "<cmd>lua require('kulala').toggle_view()<cr>", desc = "Toggle headers/body" },
{ "<leader>Rp", "<cmd>lua require('kulala').jump_prev()<cr>", desc = "Jump to previous request" },
{ "<leader>Rn", "<cmd>lua require('kulala').jump_next()<cr>", 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,
},
}

View file

@ -0,0 +1,46 @@
-- install luarock
-- sudo apt-get install luarocks lua5.4 (untuk linux)
-- https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Windows
-- 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 = {
{
"<Leader>rh",
"<cmd>Rest run<cr>",
desc = "Run http request under cursor",
},
{
"<Leader>rH",
"<cmd>Rest last<cr>",
desc = "Run last http request",
},
},
}

View file

@ -0,0 +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,
}

View file

@ -0,0 +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", "<C-Left>", require("smart-splits").resize_left)
vim.keymap.set("n", "<C-Down>", require("smart-splits").resize_down)
vim.keymap.set("n", "<C-Up", require("smart-splits").resize_up)
vim.keymap.set("n", "<C-Right>", require("smart-splits").resize_right)
end,
}

View file

@ -0,0 +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,
},
}

View file

@ -0,0 +1,10 @@
return {
"nvim-treesitter/nvim-treesitter-context",
lazy = true,
event = { "BufRead", "VeryLazy" },
opts = {},
keys = {
{ "<leader>T", "", desc = "  TS Context" },
{ "<leader>Tt", "<cmd>TSContextToggle<cr>", desc = "Toggle Context" },
},
}

View file

@ -0,0 +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,
},
}

View file

@ -0,0 +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"] = "<C-d>", -- equal CTRL+D on VSCODE
["Find Subword Under"] = "<C-d>", -- equal CTRL+D on VSCODE
["Select Cursor Down"] = "<M-C-Down>", -- equal CTRL+ALT+DOWN on VSCODE
["Select Cursor Up"] = "<M-C-Up>", -- equal CTRL+ALT+UP on VSCODE
["Undo"] = "u", -- undo
["Redo"] = "<C-r>", -- redo
}
end,
}

View file

@ -0,0 +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", "<Plug>(YankyCycleForward)")
vim.keymap.set("n", "]y", "<Plug>(YankyCycleBackward)")
end,
}

View file

@ -0,0 +1,22 @@
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 = {
{ "<leader>z", "<cmd>ZenMode<cr>", desc = "󰤼 Toggle Zen Mode" },
},
}

View file

@ -0,0 +1,66 @@
return {
"lewis6991/gitsigns.nvim",
lazy = true,
enabled = vim.fn.executable("git") == 1,
ft = "gitcommit",
event = "BufRead",
opts = {
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "" },
topdelete = { text = "" },
changedelete = { text = "" },
untracked = { text = "" },
},
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 = "<author>, <author_time:%Y-%m-%d> - <summary>",
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,
},
},
config = function(_, opts)
require("gitsigns").setup(opts)
end,
-- stylua: ignore
keys = {
{ "<leader>g", "", desc = "  Git" },
{ "<leader>gg",function()LAZYGIT_TOGGLE()end,desc = "Lazygit"},
{ "<leader>gj",function()require("gitsigns").next_hunk()end,desc = "Next Hunk"},
{ "<leader>gk",function()require("gitsigns").prev_hunk()end,desc = "Prev Hunk"},
{ "<leader>gl",function()require("gitsigns").blame_line()end,desc = "Blame"},
{ "<leader>gp",function()require("gitsigns").preview_hunk()end,desc = "Preview Hunk"},
{ "<leader>gr",function()require("gitsigns").reset_hunk()end,desc = "Reset Hunk"},
{ "<leader>gR",function()require("gitsigns").reset_buffer()end,desc = "Reset Buffer"},
{ "<leader>gs",function()require("gitsigns").stage_hunk()end,desc = "Stage Hunge"},
{ "<leader>gu",function()require("gitsigns").undo_stage_hunk()end,desc = "Undo Stage Hunge"},
{ "<leader>go","<cmd>Telescope git_status<cr>",desc = "Opened Changed File"},
{ "<leader>gb","<cmd>Telescope git_branches<cr>",desc = "Checkout Branch"},
{ "<leader>gc","<cmd>Telescope git_commits<cr>",desc = "Checkout Commit"},
{ "<leader>gd","<cmd>Gitsigns diffthis HEAD<cr>",desc = "Diff"},
},
}

View file

@ -0,0 +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",
}

View file

@ -0,0 +1,29 @@
return {
{
"nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "angular", "scss", "typescript" })
end
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
pattern = { "*.component.html", "*.container.html" },
callback = function()
vim.treesitter.start(nil, "angular")
end,
})
end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "angularls", "ts_ls" })
end,
},
{
"williamboman/mason.nvim",
opts = {
ensure_installed = { "prettier" },
},
},
}

View file

@ -0,0 +1,66 @@
return {
{
"nvim-treesitter/nvim-treesitter",
event = "VeryLazy",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "cpp", "c" })
end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "clangd" })
end,
},
{
"jay-babu/mason-nvim-dap.nvim",
event = "VeryLazy",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "codelldb" })
end,
},
{
"pojokcodeid/auto-conform.nvim",
event = "VeryLazy",
opts = function(_, opts)
local package = "clang-format"
vim.list_extend(opts.ensure_installed, { package })
opts.formatters_by_ft.cpp = { package }
opts.formatters_by_ft.c = { package }
end,
},
{
"nvim-neotest/neotest",
ft = { "cpp" },
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-neotest/nvim-nio",
"antoinemadec/FixCursorHold.nvim",
"nvim-lua/plenary.nvim",
"alfaix/neotest-gtest",
},
config = function()
require("neotest").setup({
adapters = {
require("neotest-gtest").setup({}),
},
})
end,
-- stylua: ignore
keys = {
{ "<leader>T","",desc="  Test"},
{ "<leader>Tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
{ "<leader>Tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
{ "<leader>TT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" },
{ "<leader>Tl", function() require("neotest").run.run_last() end, desc = "Run Last" },
{ "<Leader>Ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" },
{ "<leader>To", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" },
{ "<Leader>TO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" },
{ "<Leader>TS", function() require("neotest").run.stop() end, desc = "Stop" },
{ "<leader>rc", "<cmd>terminal<cr>g++ --debug main.cpp -o main<cr>", desc = "Compile Debug main.cpp" },
},
},
}

View file

@ -0,0 +1,149 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(
opts.ensure_installed,
{ "html", "javascript", "typescript", "tsx", "css", "json", "jsonc" }
)
end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "html", "eslint", "cssls", "emmet_ls", "jsonls", "denols" })
end,
},
{
"pojokcodeid/auto-conform.nvim",
event = "VeryLazy",
opts = function(_, opts)
opts.formatters_by_ft = opts.formatters_by_ft or {}
local package = "prettier"
vim.list_extend(opts.ensure_installed, { package })
opts.formatters_by_ft.javascript = { package }
end,
},
{
"pojokcodeid/auto-lint.nvim",
opts = function(_, opts)
opts.linters_by_ft = opts.linters_by_ft or {}
vim.list_extend(opts.ensure_installed, { "eslint_d" })
opts.linters_by_ft.javascript = { "eslint_d" }
end,
},
{
"rcarriga/nvim-dap-ui",
lazy = true,
event = "BufRead",
dependencies = {
{ "mfussenegger/nvim-dap", lazy = true },
{ "nvim-neotest/nvim-nio", lazy = true },
{
"mxsdev/nvim-dap-vscode-js",
dependencies = {
"microsoft/vscode-js-debug",
version = "1.x",
build = "npm i && npm run compile vsDebugServerBundle && mv dist out",
},
config = function()
require("dap-vscode-js").setup({
-- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node"
debugger_path = vim.fn.stdpath("data") .. "/lazy/vscode-js-debug",
-- debugger_cmd = { "extension" }, -- Command to use to launch the debug server. Takes precedence over `node_path` and `debugger_path`.
adapters = {
"chrome",
"pwa-node",
"pwa-chrome",
"pwa-msedge",
"node-terminal",
"pwa-extensionHost",
"node",
"chrome",
}, -- which adapters to register in nvim-dap
-- log_file_path = "(stdpath cache)/dap_vscode_js.log" -- Path for file logging
-- log_file_level = false -- Logging level for output to file. Set to false to disable file logging.
-- log_console_level = vim.log.levels.ERROR -- Logging level for output to console. Set to false to disable console output.
})
end,
},
},
config = function()
require("pcode.user.dapui")
local js_based_languages = { "typescript" }
for _, language in ipairs(js_based_languages) do
require("dap").configurations[language] = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
runtimeExecutable = "deno",
runtimeArgs = {
"run",
"--inspect-wait",
"--allow-all",
},
program = "${file}",
cwd = "${workspaceFolder}",
attachSimplePort = 9229,
},
}
end
end,
-- stylua: ignor
keys = {
{ "<leader>d", "", desc = "  Debug" },
{ "<leader>dt", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", desc = "Toggle Breakpoint" },
{ "<leader>db", "<cmd>lua require'dap'.step_back()<cr>", desc = "Step Back" },
{ "<leader>dc", "<cmd>lua require'dap'.continue()<cr>", desc = "Continue" },
{ "<leader>dC", "<cmd>lua require'dap'.run_to_cursor()<cr>", desc = "Run To Cursor" },
{ "<leader>dd", "<cmd>lua require'dap'.disconnect()<cr>", desc = "Disconnect" },
{ "<leader>dg", "<cmd>lua require'dap'.session()<cr>", desc = "Get Session" },
{ "<leader>di", "<cmd>lua require'dap'.step_into()<cr>", desc = "Step Into" },
{ "<leader>do", "<cmd>lua require'dap'.step_over()<cr>", desc = "Step Over" },
{ "<leader>du", "<cmd>lua require'dap'.step_out()<cr>", desc = "Step Out" },
{ "<leader>dp", "<cmd>lua require'dap'.pause()<cr>", desc = "Pause" },
{ "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", desc = "Toggle Repl" },
{ "<leader>ds", "<cmd>lua require'dap'.continue()<cr>", desc = "Start" },
{ "<leader>dq", "<cmd>lua require'dap'.close()<cr>", desc = "Quit" },
{ "<leader>dU", "<cmd>lua require'dapui'.toggle({reset = true})<cr>", desc = "Toggle UI" },
{ "<leader>T", "", desc = "  Test" },
{ "<leader>Tr", "<cmd>terminal deno test<cr>", desc = "Run Test" },
{ "<leader>Tp", "<cmd>terminal deno test --parallel<cr>", desc = "Run Parallel" },
{
"<leader>Ts",
function()
vim.cmd("terminal deno test " .. vim.fn.expand("%"))
end,
desc = "Run Current File",
},
{
"<leader>Tu",
function()
-- local current_word = vim.fn.expand("<cword>")
local extracted_text = ""
local input = vim.fn.getline(".")
local contains_double_quotes = input:match('"')
local contains_single_quotes = input:match("'")
if contains_double_quotes then
-- process jika ada double quote
input = input:gsub('"', "'")
local start_index, end_index = input:find("'([^']*)'") -- Mencari teks di dalam tanda petik satu
extracted_text = input:sub(start_index, end_index)
elseif contains_single_quotes then
input = input:gsub('"', "'")
local start_index, end_index = input:find("'([^']*)'") -- Mencari teks di dalam tanda petik satu
extracted_text = input:sub(start_index, end_index)
else
extracted_text = (input:gsub("Deno.test%(function", "")):gsub("%(%) %{", "")
end
vim.cmd("terminal deno test --filter " .. extracted_text)
end,
desc = "Run Under Cursor",
},
},
},
}

View file

@ -0,0 +1,164 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "go", "gomod", "gosum", "gotmpl", "gowork" })
end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "gopls" })
end,
},
{
"pojokcodeid/auto-conform.nvim",
event = "VeryLazy",
opts = function(_, opts)
local package = "gofumpt"
vim.list_extend(opts.ensure_installed, { package })
opts.formatters_by_ft.gofumpt = { package }
end,
},
{
"pojokcodeid/auto-lint.nvim",
opts = function(_, opts)
opts.linters_by_ft = opts.linters_by_ft or {}
vim.list_extend(opts.ensure_installed, { "ast-grep" })
opts.linters_by_ft.php = { "ast-grep" }
end,
},
{
"nvim-neotest/neotest",
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
"antoinemadec/FixCursorHold.nvim",
"nvim-treesitter/nvim-treesitter",
"nvim-neotest/neotest-plenary",
"nvim-neotest/neotest-vim-test",
"nvim-neotest/nvim-nio",
{
"fredrikaverpil/neotest-golang",
dependencies = {
{
"leoluz/nvim-dap-go",
opts = {},
},
},
branch = "main",
},
},
opts = function(_, opts)
opts.adapters = opts.adapters or {}
opts.adapters["neotest-golang"] = {
go_test_args = {
"-v",
"-race",
"-count=1",
"-timeout=60s",
"-coverprofile=" .. vim.fn.getcwd() .. "/coverage.out",
},
dap_go_enabled = true,
}
end,
config = function(_, opts)
if opts.adapters then
local adapters = {}
for name, config in pairs(opts.adapters or {}) do
if type(name) == "number" then
if type(config) == "string" then
config = require(config)
end
adapters[#adapters + 1] = config
elseif config ~= false then
local adapter = require(name)
if type(config) == "table" and not vim.tbl_isempty(config) then
local meta = getmetatable(adapter)
if adapter.setup then
adapter.setup(config)
elseif meta and meta.__call then
adapter(config)
else
error("Adapter " .. name .. " does not support setup")
end
end
adapters[#adapters + 1] = adapter
end
end
opts.adapters = adapters
end
require("neotest").setup(opts)
end,
-- stylua: ignore
keys = {
{ "<leader>T","",desc="  Test"},
{ "<leader>Ta", function() require("neotest").run.attach() end, desc = "[t]est [a]ttach" },
{ "<leader>Tf", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "[t]est run [f]ile" },
{ "<leader>TA", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "[t]est [A]ll files" },
{ "<leader>TS", function() require("neotest").run.run({ suite = true }) end, desc = "[t]est [S]uite" },
{ "<leader>Tn", function() require("neotest").run.run() end, desc = "[t]est [n]earest" },
{ "<leader>Tl", function() require("neotest").run.run_last() end, desc = "[t]est [l]ast" },
{ "<leader>Ts", function() require("neotest").summary.toggle() end, desc = "[t]est [s]ummary" },
{ "<leader>To", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "[t]est [o]utput" },
{ "<leader>TO", function() require("neotest").output_panel.toggle() end, desc = "[t]est [O]utput panel" },
{ "<leader>Tt", function() require("neotest").run.stop() end, desc = "[t]est [t]erminate" },
{ "<leader>Td", function() require("neotest").run.run({ suite = false, strategy = "dap" }) end, desc = "Debug nearest test" },
},
},
{
"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 = {
{ "<leader>d", "", desc = "  Debug" },
{ "<leader>dt", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", desc = "Toggle Breakpoint" },
{ "<leader>db", "<cmd>lua require'dap'.step_back()<cr>", desc = "Step Back" },
{ "<leader>dc", "<cmd>lua require'dap'.continue()<cr>", desc = "Continue" },
{ "<leader>dC", "<cmd>lua require'dap'.run_to_cursor()<cr>", desc = "Run To Cursor" },
{ "<leader>dd", "<cmd>lua require'dap'.disconnect()<cr>", desc = "Disconnect" },
{ "<leader>dg", "<cmd>lua require'dap'.session()<cr>", desc = "Get Session" },
{ "<leader>di", "<cmd>lua require'dap'.step_into()<cr>", desc = "Step Into" },
{ "<leader>do", "<cmd>lua require'dap'.step_over()<cr>", desc = "Step Over" },
{ "<leader>du", "<cmd>lua require'dap'.step_out()<cr>", desc = "Step Out" },
{ "<leader>dp", "<cmd>lua require'dap'.pause()<cr>", desc = "Pause" },
{ "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", desc = "Toggle Repl" },
{ "<leader>ds", "<cmd>lua require'dap'.continue()<cr>", desc = "Start" },
{ "<leader>dq", "<cmd>lua require'dap'.close()<cr>", desc = "Quit" },
{ "<leader>dU", "<cmd>lua require'dapui'.toggle({reset = true})<cr>", desc = "Toggle UI" },
},
},
{
"jay-babu/mason-nvim-dap.nvim",
lazy = true,
event = "BufRead",
dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" },
config = function()
require("mason-nvim-dap").setup({
automatic_installation = true,
automatic_setup = true,
handlers = {},
ensure_installed = { "delve" },
})
end,
},
}

View file

@ -0,0 +1,309 @@
local M = {}
local java_filetypes = { "java" }
local root_markers = { ".git", "mvnw", "gradlew", "pom.xml", "build.gradle" }
-- Utility function to extend or override a config table, similar to the way
-- that Plugin.opts works.
---@param config table
---@param custom function | table | nil
local function extend_or_override(config, custom, ...)
if type(custom) == "function" then
config = custom(config, ...) or config
elseif custom then
config = vim.tbl_deep_extend("force", config, custom) --[[@as table]]
end
return config
end
M = {
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
opts.skip_config = opts.skip_config or {}
vim.list_extend(opts.skip_config, { "jdtls" })
end,
},
{
"mfussenegger/nvim-jdtls",
ft = java_filetypes,
enabled = true,
opts = function()
return {
root_dir = require("jdtls.setup").find_root(root_markers),
project_name = function()
return vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t")
end,
-- Where are the config and workspace dirs for a project?
jdtls_config_dir = function(project_name)
return vim.fn.stdpath("cache") .. "/jdtls/" .. project_name .. "/config"
end,
jdtls_workspace_dir = function(project_name)
return vim.fn.stdpath("cache") .. "/jdtls/" .. project_name .. "/workspace"
end,
cmd = { vim.fn.exepath("jdtls") },
full_cmd = function(opts)
local project_name = vim.fn.fnamemodify(vim.fn.getcwd(), ":p:h:t")
local cmd = vim.deepcopy(opts.cmd)
if project_name then
vim.list_extend(cmd, {
"-configuration",
opts.jdtls_config_dir(project_name),
"-data",
opts.jdtls_workspace_dir(project_name),
})
end
return cmd
end,
-- These depend on nvim-dap, but can additionally be disabled by setting false here.
dap = { hotcodereplace = "auto", config_overrides = {} },
dap_main = {},
test = true,
settings = {
java = {
inlayHints = {
parameterNames = {
enabled = "all",
},
},
},
},
}
end,
config = function(_, opts)
local opt = vim.opt
opt.shiftwidth = 4
opt.tabstop = 4
opt.softtabstop = 4
opt.ts = 4
opt.expandtab = true
local mason_registry = require("mason-registry")
local bundles = {} ---@type string[]
if opts.dap and mason_registry.is_installed("java-debug-adapter") then
local java_dbg_pkg = mason_registry.get_package("java-debug-adapter")
local java_dbg_path = java_dbg_pkg:get_install_path()
local jar_patterns = {
java_dbg_path .. "/extension/server/com.microsoft.java.debug.plugin-*.jar",
}
-- java-test also depends on java-debug-adapter.
if opts.test and mason_registry.is_installed("java-test") then
local java_test_pkg = mason_registry.get_package("java-test")
local java_test_path = java_test_pkg:get_install_path()
vim.list_extend(jar_patterns, {
java_test_path .. "/extension/server/*.jar",
})
end
for _, jar_pattern in ipairs(jar_patterns) do
for _, bundle in ipairs(vim.split(vim.fn.glob(jar_pattern), "\n")) do
table.insert(bundles, bundle)
end
end
end
local function attach_jdtls()
local fname = vim.api.nvim_buf_get_name(0)
-- Configuration can be augmented and overridden by opts.jdtls
local config = extend_or_override({
cmd = opts.full_cmd(opts),
root_dir = require("jdtls.setup").find_root(root_markers),
init_options = {
bundles = bundles,
},
settings = opts.settings,
-- enable CMP capabilities
-- capabilities = require("user.lsp.handlers").capabilities or nil,
capabilities = require("auto-lsp.lsp.handlers").capabilities or nil,
}, opts.jdtls)
-- Existing server will be reused if the root_dir matches.
require("jdtls").start_or_attach(config)
-- not need to require("jdtls.setup").add_commands(), start automatically adds commands
end
vim.api.nvim_create_autocmd("FileType", {
pattern = java_filetypes,
callback = attach_jdtls,
})
-- Setup keymap and dap after the lsp is fully attached.
-- https://github.com/mfussenegger/nvim-jdtls#nvim-dap-configuration
-- https://neovim.io/doc/user/lsp.html#LspAttach
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client and client.name == "jdtls" then
local wk = require("which-key")
wk.add({
{
mode = "n",
buffer = args.buf,
{ "<leader>cx", group = "extract" },
{ "<leader>cxv", require("jdtls").extract_variable_all, desc = "Extract Variable" },
{ "<leader>cxc", require("jdtls").extract_constant, desc = "Extract Constant" },
{ "gs", require("jdtls").super_implementation, desc = "Goto Super" },
{ "<leader>co", require("jdtls").organize_imports, desc = "Organize Imports" },
},
})
wk.add({
{
mode = "v",
buffer = args.buf,
{ "<leader>cx", group = "extract" },
{
"<leader>cxm",
[[<ESC><CMD>lua require('jdtls').extract_method(true)<CR>]],
desc = "Extract Method",
},
{
"<leader>cxv",
[[<ESC><CMD>lua require('jdtls').extract_variable_all(true)<CR>]],
desc = "Extract Variable",
},
{
"<leader>cxc",
[[<ESC><CMD>lua require('jdtls').extract_constant(true)<CR>]],
desc = "Extract Constant",
},
},
})
if opts.dap and mason_registry.is_installed("java-debug-adapter") then
-- custom init for Java debugger
require("jdtls").setup_dap(opts.dap)
require("jdtls.dap").setup_dap_main_class_configs(opts.dap_main)
-- Java Test require Java debugger to work
-- if opts.test and mason_registry.is_installed("java-test") then
-- -- custom keymaps for Java test runner (not yet compatible with neotest)
-- wk.register({
-- ["<leader>t"] = { name = "+test" },
-- ["<leader>tt"] = { require("jdtls.dap").test_class, "Run All Test" },
-- ["<leader>tr"] = { require("jdtls.dap").test_nearest_method, "Run Nearest Test" },
-- ["<leader>tT"] = { require("jdtls.dap").pick_test, "Run Test" },
-- }, { mode = "n", buffer = args.buf })
-- end
end
-- User can set additional keymaps in opts.on_attach
if opts.on_attach then
opts.on_attach(args)
end
end
end,
})
-- Avoid race condition by calling attach the first time, since the autocmd won't fire.
attach_jdtls()
end,
},
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "java" })
end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "jdtls" })
end,
},
{
"pojokcodeid/auto-conform.nvim",
event = "VeryLazy",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, { "java-debug-adapter", "java-test" })
opts.formatters_by_ft.java = { "lsp_fmt" }
end,
},
{
"nvim-neotest/neotest",
dependencies = {
"nvim-neotest/nvim-nio",
"nvim-lua/plenary.nvim",
"antoinemadec/FixCursorHold.nvim",
"nvim-treesitter/nvim-treesitter",
"andy-bell101/neotest-java",
},
config = function()
require("neotest").setup({
adapters = {
require("neotest-java")({
-- function to determine which runner to use based on project path
determine_runner = function(project_root_path)
-- return should be "maven" or "gradle"
return "gradle"
end,
-- override the builtin runner discovery behaviour to always use given
-- tool. Default is "nil", so no override
force_runner = nil,
-- if the automatic runner discovery can't uniquely determine whether
-- to use Gradle or Maven, fallback to using this runner. Default is
-- "gradle or maven"
fallback_runner = "gradle",
}),
},
})
end,
-- stylua: ignore
keys = {
{ "<leader>T","",desc="  Test"},
{ "<leader>Tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
{ "<leader>Tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
{ "<leader>TT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" },
{ "<leader>Tl", function() require("neotest").run.run_last() end, desc = "Run Last" },
{ "<Leader>Ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" },
{ "<leader>To", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" },
{ "<Leader>TO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" },
{ "<Leader>TS", function() require("neotest").run.stop() end, desc = "Stop" },
{ "<leader>rg", "<cmd>terminal<cr>gradle run<cr>", desc = "Run Gradle", mode = "n" },
},
},
{
"rockerBOO/symbols-outline.nvim",
cmd = "SymbolsOutline",
config = function()
require("symbols-outline").setup({
symbols = {
File = { icon = "󰈔", hl = "@text.uri" },
Module = { icon = "", hl = "@namespace" },
Namespace = { icon = "󰅪", hl = "@namespace" },
Package = { icon = "", hl = "@namespace" },
Class = { icon = "𝓒", hl = "@type" },
Method = { icon = "ƒ", hl = "@method" },
Property = { icon = "", hl = "@method" },
Field = { icon = "", hl = "@field" },
Constructor = { icon = "", hl = "@constructor" },
Enum = { icon = "", hl = "@type" },
Interface = { icon = "", hl = "@type" },
Function = { icon = "", hl = "@function" },
Variable = { icon = "", hl = "@constant" },
Constant = { icon = "", hl = "@constant" },
String = { icon = "𝓐", hl = "@string" },
Number = { icon = "#", hl = "@number" },
Boolean = { icon = "󰨙 ", hl = "@boolean" },
Array = { icon = "", hl = "@constant" },
Object = { icon = "⦿", hl = "@type" },
Key = { icon = "🔐", hl = "@type" },
Null = { icon = "NULL", hl = "@type" },
EnumMember = { icon = "", hl = "@field" },
Struct = { icon = "𝓢", hl = "@type" },
Event = { icon = "🗲", hl = "@type" },
Operator = { icon = "+", hl = "@operator" },
TypeParameter = { icon = "𝙏", hl = "@parameter" },
Component = { icon = "󰅴", hl = "@function" },
Fragment = { icon = "󰅴", hl = "@constant" },
},
})
end,
keys = {
{ "<leader>S", "<cmd>SymbolsOutline<cr>", desc = "Toggle Outline" },
},
},
}
return M

View file

@ -0,0 +1,202 @@
local config_file = "jest.config.ts"
local M = {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(
opts.ensure_installed,
{ "html", "javascript", "typescript", "tsx", "css", "json", "jsonc" }
)
end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "html", "eslint", "cssls", "emmet_ls", "jsonls", "ts_ls" })
end,
},
{
"pojokcodeid/auto-conform.nvim",
event = "VeryLazy",
opts = function(_, opts)
opts.formatters_by_ft = opts.formatters_by_ft or {}
local package = "prettier"
vim.list_extend(opts.ensure_installed, { package })
opts.formatters_by_ft.javascript = { package }
end,
},
{
"nvim-neotest/neotest",
dependencies = {
"antoinemadec/FixCursorHold.nvim",
"nvim-neotest/neotest-jest",
"nvim-neotest/nvim-nio",
},
opts = {
adapters = {
["neotest-jest"] = {
jestCommand = "npm test -- ",
jestConfigFile = function()
local file = vim.fn.expand("%:p")
if string.find(file, "/packages/") then
return string.match(file, "(.-/[^/]+/)src") .. config_file
end
return vim.fn.getcwd() .. "/" .. config_file
end,
cwd = function()
local file = vim.fn.expand("%:p")
if string.find(file, "/packages/") then
return string.match(file, "(.-/[^/]+/)src")
end
return vim.fn.getcwd()
end,
},
},
status = { virtual_text = true },
output = { open_on_run = true },
},
config = function(_, opts)
local neotest_ns = vim.api.nvim_create_namespace("neotest")
vim.diagnostic.config({
virtual_text = {
format = function(diagnostic)
-- Replace newline and tab characters with space for more compact diagnostics
local message =
diagnostic.message:gsub("\n", " "):gsub("\t", " "):gsub("%s+", " "):gsub("^%s+", "")
return message
end,
},
}, neotest_ns)
opts.consumers = opts.consumers or {}
if opts.adapters then
local adapters = {}
for name, config in pairs(opts.adapters or {}) do
if type(name) == "number" then
if type(config) == "string" then
config = require(config)
end
adapters[#adapters + 1] = config
elseif config ~= false then
local adapter = require(name)
if type(config) == "table" and not vim.tbl_isempty(config) then
local meta = getmetatable(adapter)
if adapter.setup then
adapter.setup(config)
elseif meta and meta.__call then
adapter(config)
else
error("Adapter " .. name .. " does not support setup")
end
end
adapters[#adapters + 1] = adapter
end
end
opts.adapters = adapters
end
require("neotest").setup(opts)
end,
-- stylua: ignore
keys = {
{ "<leader>T","",desc="  Test"},
{ "<leader>Tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
{ "<leader>Tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
{ "<leader>TT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" },
{ "<leader>Tl", function() require("neotest").run.run_last() end, desc = "Run Last" },
{ "<Leader>Ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" },
{ "<leader>To", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" },
{ "<Leader>TO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" },
{ "<Leader>TS", function() require("neotest").run.stop() end, desc = "Stop" },
},
},
{
"rcarriga/nvim-dap-ui",
lazy = true,
event = "BufRead",
dependencies = {
{ "mfussenegger/nvim-dap", lazy = true },
{ "nvim-neotest/nvim-nio", lazy = true },
{
"mxsdev/nvim-dap-vscode-js",
dependencies = {
"microsoft/vscode-js-debug",
version = "1.x",
build = "npm i && npm run compile vsDebugServerBundle && mv dist out",
},
config = function()
require("dap-vscode-js").setup({
-- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node"
debugger_path = vim.fn.stdpath("data") .. "/lazy/vscode-js-debug",
-- debugger_cmd = { "extension" }, -- Command to use to launch the debug server. Takes precedence over `node_path` and `debugger_path`.
adapters = {
"chrome",
"pwa-node",
"pwa-chrome",
"pwa-msedge",
"node-terminal",
"pwa-extensionHost",
"node",
"chrome",
}, -- which adapters to register in nvim-dap
-- log_file_path = "(stdpath cache)/dap_vscode_js.log" -- Path for file logging
-- log_file_level = false -- Logging level for output to file. Set to false to disable file logging.
-- log_console_level = vim.log.levels.ERROR -- Logging level for output to console. Set to false to disable console output.
})
end,
},
},
config = function()
require("pcode.user.dapui")
local js_based_languages = { "typescript", "javascript", "typescriptreact" }
for _, language in ipairs(js_based_languages) do
require("dap").configurations[language] = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require("dap.utils").pick_process,
cwd = "${workspaceFolder}",
},
{
type = "pwa-chrome",
request = "launch",
name = 'Start Chrome with "localhost"',
url = "http://localhost:3000",
webRoot = "${workspaceFolder}",
userDataDir = "${workspaceFolder}/.vscode/vscode-chrome-debug-userdatadir",
},
}
end
end,
keys = {
{ "<leader>d", "", desc = "  Debug" },
{ "<leader>dt", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", desc = "Toggle Breakpoint" },
{ "<leader>db", "<cmd>lua require'dap'.step_back()<cr>", desc = "Step Back" },
{ "<leader>dc", "<cmd>lua require'dap'.continue()<cr>", desc = "Continue" },
{ "<leader>dC", "<cmd>lua require'dap'.run_to_cursor()<cr>", desc = "Run To Cursor" },
{ "<leader>dd", "<cmd>lua require'dap'.disconnect()<cr>", desc = "Disconnect" },
{ "<leader>dg", "<cmd>lua require'dap'.session()<cr>", desc = "Get Session" },
{ "<leader>di", "<cmd>lua require'dap'.step_into()<cr>", desc = "Step Into" },
{ "<leader>do", "<cmd>lua require'dap'.step_over()<cr>", desc = "Step Over" },
{ "<leader>du", "<cmd>lua require'dap'.step_out()<cr>", desc = "Step Out" },
{ "<leader>dp", "<cmd>lua require'dap'.pause()<cr>", desc = "Pause" },
{ "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", desc = "Toggle Repl" },
{ "<leader>ds", "<cmd>lua require'dap'.continue()<cr>", desc = "Start" },
{ "<leader>dq", "<cmd>lua require'dap'.close()<cr>", desc = "Quit" },
{ "<leader>dU", "<cmd>lua require'dapui'.toggle({reset = true})<cr>", desc = "Toggle UI" },
},
},
}
return M

View file

@ -0,0 +1,136 @@
return {
-- install treesitter
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "kotlin" })
end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "kotlin_language_server" })
end,
},
{
"pojokcodeid/auto-conform.nvim",
event = "VeryLazy",
opts = function(_, opts)
opts.formatters_by_ft = opts.formatters_by_ft or {}
local package = "ktfmt"
vim.list_extend(opts.ensure_installed, { package })
opts.formatters_by_ft.kotlin = { package }
end,
},
{
"pojokcodeid/auto-lint.nvim",
optional = true,
opts = function(_, opts)
opts.linters_by_ft = opts.linters_by_ft or {}
vim.list_extend(opts.ensure_installed, { "ktlint" })
opts.linters_by_ft.kotlin = { "ktlint" }
end,
},
{
"mason.nvim",
opts = {
ensure_installed = { "kotlin-debug-adapter" },
},
},
{
"rcarriga/nvim-dap-ui",
lazy = true,
event = "BufRead",
dependencies = {
{ "mfussenegger/nvim-dap", lazy = true },
{ "nvim-neotest/nvim-nio", lazy = true },
},
opts = function()
require("pcode.user.dapui")
local dap = require("dap")
if not dap.adapters.kotlin then
dap.adapters.kotlin = {
type = "executable",
command = "kotlin-debug-adapter",
options = { auto_continue_if_many_stopped = false },
}
end
dap.configurations.kotlin = {
{
type = "kotlin",
request = "launch",
name = "This file",
-- may differ, when in doubt, whatever your project structure may be,
-- it has to correspond to the class file located at `build/classes/`
-- and of course you have to build before you debug
mainClass = function()
local root = vim.uv.cwd()
local fname = vim.api.nvim_buf_get_name(0)
fname = fname:gsub(root, "")
fname = fname:gsub("/app/src/main/kotlin/", "")
fname = fname:gsub(".kt", "Kt"):gsub("/", ".")
-- src/main/kotlin/websearch/Main.kt -> websearch.MainKt
return fname
end,
projectRoot = "${workspaceFolder}",
jsonLogFile = "",
enableJsonLogging = false,
},
{
-- Use this for unit tests
-- First, run
-- ./gradlew --info cleanTest test --debug-jvm
-- then attach the debugger to it
type = "kotlin",
request = "attach",
name = "Attach to debugging session",
port = 5005,
args = {},
projectRoot = vim.fn.getcwd,
hostName = "localhost",
timeout = 2000,
},
}
end,
keys = {
{ "<leader>d", "", desc = "  Debug" },
{ "<leader>dt", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", desc = "Toggle Breakpoint" },
{ "<leader>db", "<cmd>lua require'dap'.step_back()<cr>", desc = "Step Back" },
{ "<leader>dc", "<cmd>lua require'dap'.continue()<cr>", desc = "Continue" },
{ "<leader>dC", "<cmd>lua require'dap'.run_to_cursor()<cr>", desc = "Run To Cursor" },
{ "<leader>dd", "<cmd>lua require'dap'.disconnect()<cr>", desc = "Disconnect" },
{ "<leader>dg", "<cmd>lua require'dap'.session()<cr>", desc = "Get Session" },
{ "<leader>di", "<cmd>lua require'dap'.step_into()<cr>", desc = "Step Into" },
{ "<leader>do", "<cmd>lua require'dap'.step_over()<cr>", desc = "Step Over" },
{ "<leader>du", "<cmd>lua require'dap'.step_out()<cr>", desc = "Step Out" },
{ "<leader>dp", "<cmd>lua require'dap'.pause()<cr>", desc = "Pause" },
{ "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", desc = "Toggle Repl" },
{ "<leader>ds", "<cmd>lua require'dap'.continue()<cr>", desc = "Start" },
{ "<leader>dq", "<cmd>lua require'dap'.close()<cr>", desc = "Quit" },
{ "<leader>dU", "<cmd>lua require'dapui'.toggle({reset = true})<cr>", desc = "Toggle UI" },
-- setting cek
-- https://stackoverflow.com/questions/9356543/logging-while-testing-through-gradle
{ "<leader>T", "", desc = " Test" },
{ "<leader>Ta", "<cmd>terminal gradle test<cr>", desc = "Run All" },
{
"<leader>Tu",
function()
-- local current_word = vim.fn.expand("<cword>")
local current_word = ""
local input = vim.fn.getline(".")
current_word = all_trim((input:gsub("class", "")):gsub("{", "")) -- hilangkan bagian class
current_word = current_word:gsub("fun", "")
current_word = current_word:gsub("%(%)", "")
current_word = current_word:gsub("{", "")
current_word = current_word:gsub("@Test", "")
vim.cmd("terminal gradle test --tests *." .. all_trim(current_word))
end,
desc = "Run Under Cursor",
},
{ "<leader>rg", "<cmd>terminal<cr>gradle run<cr>", desc = "Run Gradle", mode = "n" },
},
},
}

View file

@ -0,0 +1,102 @@
return {
{
"pojokcodeid/auto-conform.nvim",
event = "VeryLazy",
optional = true,
opts = function(_, opts)
vim.list_extend(opts.formatters, {
["markdown-toc"] = {
condition = function(_, ctx)
for _, line in ipairs(vim.api.nvim_buf_get_lines(ctx.buf, 0, -1, false)) do
if line:find("<!%-%- toc %-%->") then
return true
end
end
end,
},
["markdownlint-cli2"] = {
condition = function(_, ctx)
local diag = vim.tbl_filter(function(d)
return d.source == "markdownlint"
end, vim.diagnostic.get(ctx.buf))
return #diag > 0
end,
},
})
vim.list_extend(opts.formatters_by_ft, {
["markdown"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
["markdown.mdx"] = { "prettier", "markdownlint-cli2", "markdown-toc" },
})
end,
},
{
"williamboman/mason.nvim",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, { "markdownlint-cli2", "markdown-toc" })
end,
},
{
"pojokcodeid/auto-lint.nvim",
event = "VeryLazy",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, { "markdownlint-cli2" })
end,
config = function(_, opts)
require("auto-lint").setup(opts)
end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "marksman" })
end,
},
-- Markdown preview
{
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
build = function()
require("lazy").load({ plugins = { "markdown-preview.nvim" } })
vim.fn["mkdp#util#install"]()
end,
keys = {
{
"<leader>Cp",
ft = "markdown",
"<cmd>MarkdownPreviewToggle<cr>",
desc = "Markdown Preview",
},
},
config = function()
vim.cmd([[do FileType]])
end,
},
{
"MeanderingProgrammer/render-markdown.nvim",
opts = {
code = {
sign = false,
width = "block",
right_pad = 1,
},
heading = {
sign = false,
icons = {},
},
},
ft = { "markdown", "norg", "rmd", "org" },
config = function(_, opts)
require("render-markdown").setup(opts)
end,
keys = {
{ "<leader>C", "", desc = "  Markdown" },
{
"<leader>Cr",
"<cmd>RenderMarkdown<cr>",
desc = "Render Markdown",
},
},
},
}

View file

@ -0,0 +1,220 @@
local function is_laravel_project()
return vim.fn.isdirectory("app") == 1
and vim.fn.isdirectory("bootstrap") == 1
and vim.fn.isdirectory("config") == 1
and vim.fn.isdirectory("database") == 1
and vim.fn.isdirectory("routes") == 1
end
-- check parser php
-- local is_config = true
-- local parsers = require("nvim-treesitter.parsers").get_parser_configs()
-- if parsers.php ~= nil then
-- is_config = false
-- end
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, {
"c",
"lua",
"vim",
"vimdoc",
"query",
"markdown",
"markdown_inline",
"html",
"php_only",
"php",
"bash",
"blade",
"json",
})
end,
config = function(_, opts)
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.blade = {
install_info = {
url = "https://github.com/EmranMR/tree-sitter-blade",
files = { "src/parser.c" },
branch = "main",
},
filetype = "blade",
}
vim.filetype.add({
pattern = {
[".*%.blade%.php"] = "blade",
},
})
require("nvim-treesitter.configs").setup(opts)
end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "intelephense", "stimulus_ls" })
end,
},
{
"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" }
opts.formatters_by_ft.blade = { "blade-formatter" }
end,
},
{
"pojokcodeid/auto-lint.nvim",
event = "VeryLazy",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, { "phpcs" })
end,
config = function(_, opts)
require("auto-lint").setup(opts)
end,
},
{
"rcarriga/nvim-dap-ui",
lazy = true,
event = "BufRead",
dependencies = {
{ "mfussenegger/nvim-dap", lazy = true },
{ "nvim-neotest/nvim-nio", lazy = true },
{
"xdebug/vscode-php-debug",
version = "1.x",
build = "npm install && npm run build",
config = function()
require("dap.ext.vscode").load_launchjs()
end,
},
},
config = function()
require("pcode.user.dapui")
local dap = require("dap")
dap.adapters.php = {
type = "executable",
command = "node",
-- change this to where you build vscode-php-debug
args = { vim.fn.stdpath("data") .. "/lazy/vscode-php-debug/out/phpDebug.js" },
}
dap.configurations.php = {
-- to run php right from the editor
{
name = "run current script",
type = "php",
request = "launch",
port = 9003,
cwd = "${fileDirname}",
program = "${file}",
runtimeExecutable = "php",
},
-- to listen to any php call
{
name = "listen for Xdebug local",
type = "php",
request = "launch",
port = 9003,
},
-- to listen to php call in docker container
{
name = "listen for Xdebug docker",
type = "php",
request = "launch",
port = 9003,
-- this is where your file is in the container
pathMappings = {
["/opt/project"] = "${workspaceFolder}",
},
},
}
end,
keys = {
{ "<leader>d", "", desc = "  Debug" },
{ "<leader>dt", "<cmd>lua require'dap'.toggle_breakpoint()<cr>", desc = "Toggle Breakpoint" },
{ "<leader>db", "<cmd>lua require'dap'.step_back()<cr>", desc = "Step Back" },
{ "<leader>dc", "<cmd>lua require'dap'.continue()<cr>", desc = "Continue" },
{ "<leader>dC", "<cmd>lua require'dap'.run_to_cursor()<cr>", desc = "Run To Cursor" },
{ "<leader>dd", "<cmd>lua require'dap'.disconnect()<cr>", desc = "Disconnect" },
{ "<leader>dg", "<cmd>lua require'dap'.session()<cr>", desc = "Get Session" },
{ "<leader>di", "<cmd>lua require'dap'.step_into()<cr>", desc = "Step Into" },
{ "<leader>do", "<cmd>lua require'dap'.step_over()<cr>", desc = "Step Over" },
{ "<leader>du", "<cmd>lua require'dap'.step_out()<cr>", desc = "Step Out" },
{ "<leader>dp", "<cmd>lua require'dap'.pause()<cr>", desc = "Pause" },
{ "<leader>dr", "<cmd>lua require'dap'.repl.toggle()<cr>", desc = "Toggle Repl" },
{ "<leader>ds", "<cmd>lua require'dap'.continue()<cr>", desc = "Start" },
{ "<leader>dq", "<cmd>lua require'dap'.close()<cr>", desc = "Quit" },
{ "<leader>dU", "<cmd>lua require'dapui'.toggle({reset = true})<cr>", desc = "Toggle UI" },
},
},
{
"nvim-neotest/neotest",
dependencies = {
"antoinemadec/FixCursorHold.nvim",
"olimorris/neotest-phpunit",
"nvim-neotest/nvim-nio",
},
config = function()
require("neotest-phpunit")({
filter_dirs = { "vendor" },
})
require("neotest").setup({
adapters = {
require("neotest-phpunit"),
},
})
end,
-- stylua: ignore
keys = {
{ "<leader>T","",desc="  Test"},
{ "<leader>Tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" },
{ "<leader>Tr", function() require("neotest").run.run() end, desc = "Run Nearest" },
{ "<leader>TT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" },
{ "<leader>Tl", function() require("neotest").run.run_last() end, desc = "Run Last" },
{ "<Leader>Ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" },
{ "<leader>To", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" },
{ "<Leader>TO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" },
{ "<Leader>TS", function() require("neotest").run.stop() end, desc = "Stop" },
},
},
{
"mfussenegger/nvim-lint",
opts = function(_, opts)
opts.linters_by_ft = opts.linters_by_ft or {}
opts.linters_by_ft.php = { "phpcs" }
opts.linters_by_ft.blade = { "tlint" }
end,
config = function(_, opts)
require("lint").linters_by_ft = opts.linters_by_ft
end,
},
-- untuk case tertentu install ini
-- npm install -g tree-sitter-cli
{
"adalessa/laravel.nvim",
enabled = is_laravel_project(), -- pastikan membuka laravel project
dependencies = {
"tpope/vim-dotenv",
"nvim-telescope/telescope.nvim",
"MunifTanjim/nui.nvim",
"kevinhwang91/promise-async",
},
cmd = { "Laravel" },
keys = {
{ "<leader>L", "", desc = " 󰫐 Laravel" },
{ "<leader>La", ":Laravel artisan<cr>" },
{ "<leader>Lr", ":Laravel routes<cr>" },
{ "<leader>Lm", ":Laravel related<cr>" },
},
event = { "VeryLazy" },
opts = {},
config = true,
},
}

View file

@ -0,0 +1,57 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "prisma" })
end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
vim.list_extend(opts.ensure_installed, { "prismals" })
vim.cmd([[
autocmd BufWritePost *.prisma silent! execute "!npx prisma format"
]])
end,
keys = {
{ "<leader>p", "", desc = "  Prisma" },
{
"<leader>pf",
function()
vim.cmd("execute '!npx prisma format'")
end,
desc = "Prisma Format",
},
{
"<leader>pm",
function()
vim.cmd("execute '!npx prisma init --datasource-provider mysql'")
end,
desc = "init MySQL",
},
{
"<leader>pp",
function()
vim.cmd("execute '!npx prisma init --datasource-provider postgresql'")
end,
desc = "init postgresql",
},
{
"<leader>pe",
function()
vim.cmd("execute '!npx prisma migrate dev --name init'")
end,
desc = "Migrate",
},
{
"<leader>ps",
function()
vim.cmd("terminal npx prisma studio")
end,
desc = "npx prisma Studio",
},
},
},
}

Some files were not shown because too many files have changed in this diff Show more