├── .gitignore ├── .stylua.toml ├── LICENSE ├── README.md ├── img ├── Spring_boot_code.jpeg ├── coding.png ├── demo.gif ├── home.png ├── laravel.jpeg ├── node.png ├── plugins_manager.png ├── terminal_spring_boot.jpeg ├── transparant.png └── ts_lsp.gif ├── init.lua ├── lazy-lock.json ├── lua ├── _vscode │ ├── functions.lua │ └── mappings.lua ├── auto-jdtls2 │ ├── create_gradle_project.lua │ ├── create_maven_project.lua │ ├── create_springboot_project.lua │ ├── generate_java_class.lua │ ├── generate_java_interface.lua │ ├── generate_java_main_class.lua │ ├── init.lua │ └── utils.lua └── pcode │ ├── config │ └── lazy_lib.lua │ ├── core │ ├── init.lua │ └── neovide.lua │ ├── plugins │ ├── _default.lua │ ├── _lsp.lua │ ├── _treesitter.lua │ ├── _treesitterautopairs.lua │ ├── _treesitterautotag.lua │ ├── alpha.lua │ ├── bufferline.lua │ ├── cmp.lua │ ├── cmpcmdline.lua │ ├── coderunner.lua │ ├── comment.lua │ ├── conform.lua │ ├── dressing.lua │ ├── extras │ │ ├── autosave.lua │ │ ├── bigfiles.lua │ │ ├── codeium.lua │ │ ├── codeiumnvim.lua │ │ ├── colorizer.lua │ │ ├── dap.lua │ │ ├── deviconcolor.lua │ │ ├── illuminate.lua │ │ ├── indentscupe.lua │ │ ├── liveserver.lua │ │ ├── lspsignatur.lua │ │ ├── minianimate.lua │ │ ├── navic.lua │ │ ├── neoscroll.lua │ │ ├── nvimmenu.lua │ │ ├── nvimufo.lua │ │ ├── rainbowdelimiters.lua │ │ ├── refactoring.lua │ │ ├── rest.lua │ │ ├── restnvim.lua │ │ ├── scrollview.lua │ │ ├── smartsplit.lua │ │ ├── telescopetreesiterinfo.lua │ │ ├── transparent.lua │ │ ├── treesittercontex.lua │ │ ├── verticalcolumn.lua │ │ ├── visualmulti.lua │ │ ├── yanky.lua │ │ └── zenmode.lua │ ├── gitsign.lua │ ├── indentblakline.lua │ ├── lang │ │ ├── angular.lua │ │ ├── cpp.lua │ │ ├── deno.lua │ │ ├── golang.lua │ │ ├── java.lua │ │ ├── java2.lua │ │ ├── java3.lua │ │ ├── java4.lua │ │ ├── javascript.lua │ │ ├── kotlin.lua │ │ ├── markdown.lua │ │ ├── php.lua │ │ ├── prisma.lua │ │ ├── python.lua │ │ ├── rust.lua │ │ ├── sql.lua │ │ └── tailwind.lua │ ├── lualine.lua │ ├── notify.lua │ ├── nvimlint.lua │ ├── nvimtree.lua │ ├── telecope.lua │ ├── theme │ │ ├── catppuccin.lua │ │ ├── dracula.lua │ │ ├── evatheme.lua │ │ ├── github.lua │ │ ├── gruvbox.lua │ │ ├── jetbrains.lua │ │ ├── onedarkpro.lua │ │ ├── sublimetext.lua │ │ └── tokyonight.lua │ ├── toggleterm.lua │ ├── webdevicon.lua │ └── whichkey.lua │ └── user │ ├── autocmd.lua │ ├── colorscheme.lua │ ├── custom.lua │ ├── dapui.lua │ ├── default.lua │ ├── icons.lua │ ├── java.lua │ ├── keymaps.lua │ ├── options.lua │ └── snippets.lua ├── mysnippets ├── html │ └── snippets.json └── package.json └── queries ├── blade ├── folds.scm ├── highlights.scm └── injections.scm └── php ├── folds.scm ├── highlights.scm ├── indents.scm ├── injections.scm └── locals.scm /.gitignore: -------------------------------------------------------------------------------- 1 | db_ui 2 | -------------------------------------------------------------------------------- /.stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 120 2 | line_endings = "Unix" 3 | indent_type = "Spaces" 4 | indent_width = 2 5 | quote_style = "AutoPreferDouble" 6 | # no_call_parentheses = true 7 | -------------------------------------------------------------------------------- /img/Spring_boot_code.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pojokcodeid/nvim-lazy/af0923e403762eee9fde13eb38a161b419017302/img/Spring_boot_code.jpeg -------------------------------------------------------------------------------- /img/coding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pojokcodeid/nvim-lazy/af0923e403762eee9fde13eb38a161b419017302/img/coding.png -------------------------------------------------------------------------------- /img/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pojokcodeid/nvim-lazy/af0923e403762eee9fde13eb38a161b419017302/img/demo.gif -------------------------------------------------------------------------------- /img/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pojokcodeid/nvim-lazy/af0923e403762eee9fde13eb38a161b419017302/img/home.png -------------------------------------------------------------------------------- /img/laravel.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pojokcodeid/nvim-lazy/af0923e403762eee9fde13eb38a161b419017302/img/laravel.jpeg -------------------------------------------------------------------------------- /img/node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pojokcodeid/nvim-lazy/af0923e403762eee9fde13eb38a161b419017302/img/node.png -------------------------------------------------------------------------------- /img/plugins_manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pojokcodeid/nvim-lazy/af0923e403762eee9fde13eb38a161b419017302/img/plugins_manager.png -------------------------------------------------------------------------------- /img/terminal_spring_boot.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pojokcodeid/nvim-lazy/af0923e403762eee9fde13eb38a161b419017302/img/terminal_spring_boot.jpeg -------------------------------------------------------------------------------- /img/transparant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pojokcodeid/nvim-lazy/af0923e403762eee9fde13eb38a161b419017302/img/transparant.png -------------------------------------------------------------------------------- /img/ts_lsp.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pojokcodeid/nvim-lazy/af0923e403762eee9fde13eb38a161b419017302/img/ts_lsp.gif -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | if vim.g.vscode then 2 | -- config vscode 3 | Map = vim.keymap.set 4 | Cmd = vim.cmd 5 | 6 | VSCodeNotify = vim.fn.VSCodeNotify 7 | VSCodeCall = vim.fn.VSCodeCall 8 | 9 | require("_vscode.functions") 10 | require("_vscode.mappings") 11 | else 12 | -- config neovim 13 | require("pcode.core") 14 | end 15 | -------------------------------------------------------------------------------- /lua/_vscode/functions.lua: -------------------------------------------------------------------------------- 1 | function Active_whichkey() 2 | VSCodeNotify("whichkey.show") 3 | end 4 | 5 | function Top_screen() 6 | Cmd("call 3_reveal('top', 0)") 7 | end 8 | 9 | function Bottom_screen() 10 | Cmd("call 3_reveal('bottom', 0)") 11 | end 12 | 13 | function Move_to_top_screen() 14 | Cmd("call 3_moveCursor('top')") 15 | end 16 | 17 | function Move_to_bottom_screen() 18 | Cmd("call 3_moveCursor('bottom')") 19 | end 20 | 21 | function Scroll_line_down() 22 | VSCodeCall("scrollLineDown") 23 | end 24 | 25 | function Scroll_line_up() 26 | VSCodeCall("scrollLineUp") 27 | end 28 | 29 | function Vscode_ctrl_d() 30 | VSCodeNotify("vscode-neovim.ctrl-d") 31 | end 32 | 33 | function Vscode_ctrl_u() 34 | VSCodeNotify("vscode-neovim.ctrl-u") 35 | end 36 | 37 | function Move_to_bottom_screen__center_screen() 38 | Move_to_bottom_screen() 39 | Center_screen() 40 | end 41 | 42 | function Move_to_top_screen__center_screen() 43 | Move_to_top_screen() 44 | Center_screen() 45 | end 46 | 47 | function Trim_trailing_whitespace() 48 | VSCodeCall("editor.action.trimTrailingWhitespace") 49 | end 50 | 51 | function Save() 52 | VSCodeCall("workbench.action.files.save") 53 | end 54 | 55 | function Save_no_format() 56 | VSCodeCall("workbench.action.files.saveWithoutFormatting") 57 | end 58 | 59 | function Trim__save__no_format() 60 | Trim_trailing_whitespace() 61 | Save_no_format() 62 | end 63 | 64 | function Trim__save__no_highlight() 65 | Trim_trailing_whitespace() 66 | Save() 67 | Remove_highlighting() 68 | end 69 | 70 | function Format() 71 | VSCodeCall("editor.action.formatDocument") 72 | print("formatted!") 73 | end 74 | 75 | function Trim__save__format() 76 | Trim_trailing_whitespace() 77 | Format() 78 | Save() 79 | end 80 | 81 | function Reveal_definition_aside() 82 | VSCodeNotify("editor.action.revealDefinitionAside") 83 | end 84 | 85 | function Go_to_implementation() 86 | VSCodeNotify("editor.action.goToImplementation") 87 | end 88 | 89 | function Go_to_reference() 90 | VSCodeNotify("editor.action.goToReferences") 91 | end 92 | 93 | function Rename_symbol() 94 | VSCodeNotify("editor.action.rename") 95 | end 96 | 97 | function Outdent() 98 | ---@diagnostic disable-next-line: unused-local 99 | for i = 1, vim.v.count1 do 100 | VSCodeNotify("editor.action.outdentLines") 101 | end 102 | end 103 | 104 | function Indent() 105 | ---@diagnostic disable-next-line: unused-local 106 | for i = 1, vim.v.count1 do 107 | VSCodeNotify("editor.action.indentLines") 108 | end 109 | end 110 | 111 | function Outdent_vis() 112 | VSCodeNotify("editor.action.outdentLines", false) 113 | end 114 | 115 | function Indent_vis() 116 | VSCodeNotify("editor.action.indentLines", false) 117 | end 118 | 119 | function Comment() 120 | VSCodeNotify("editor.action.commentLine") 121 | end 122 | 123 | function Convert_to_spaces() 124 | VSCodeNotify("editor.action.indentationToSpaces") 125 | end 126 | 127 | function Convert_to_tabs() 128 | VSCodeNotify("editor.action.indentationToTabs") 129 | end 130 | 131 | function Indent_with_spaces() 132 | VSCodeNotify("editor.action.indentUsingSpaces") 133 | end 134 | 135 | function Indent_with_tabs() 136 | VSCodeNotify("editor.action.indentUsingTabs") 137 | end 138 | 139 | function CloseEditor() 140 | VSCodeNotify("workbench.action.closeActiveEditor") 141 | end 142 | 143 | function UndoCloseEditor() 144 | VSCodeNotify("workbench.action.reopenClosedEditor") 145 | end 146 | 147 | function Git_stage_file() 148 | Trim_trailing_whitespace() 149 | Save() 150 | VSCodeNotify("git.stage") 151 | end 152 | 153 | function Git_unstage_file() 154 | Save() 155 | VSCodeNotify("git.unstage") 156 | end 157 | 158 | function Git_revert_change() 159 | VSCodeNotify("git.revertSelectedRanges") 160 | end 161 | 162 | function Git_stage_change() 163 | VSCodeNotify("git.stageSelectedRanges") 164 | end 165 | 166 | function Git_unstage_change() 167 | VSCodeNotify("git.unstageSelectedRanges") 168 | end 169 | 170 | function Git_open_changes() 171 | VSCodeNotify("git.openChange") 172 | end 173 | 174 | function Git_open_all_changes() 175 | VSCodeNotify("git.openAllChanges") 176 | end 177 | 178 | function Accept_merge_both() 179 | VSCodeNotify("merge-conflict.accept.both") 180 | end 181 | 182 | function Accept_merge_all_both() 183 | VSCodeNotify("merge-conflict.accept.all-both") 184 | end 185 | 186 | function Accept_merge_current() 187 | VSCodeNotify("merge-conflict.accept.current") 188 | end 189 | 190 | function Accept_merge_all_current() 191 | VSCodeNotify("merge-conflict.accept.all-current") 192 | end 193 | 194 | function Accept_merge_incoming() 195 | VSCodeNotify("merge-conflict.accept.incoming") 196 | end 197 | 198 | function Accept_merge_all_incoming() 199 | VSCodeNotify("merge-conflict.accept.all-incoming") 200 | end 201 | 202 | function Accept_merge_selection() 203 | VSCodeNotify("merge-conflict.accept.selection") 204 | end 205 | 206 | function Codesnap() 207 | VSCodeNotify("codesnap.start", true) 208 | end 209 | 210 | function Comment_vis() 211 | VSCodeNotify("editor.action.commentLine", false) 212 | end 213 | 214 | function Toggle_breakpoint() 215 | VSCodeNotify("editor.debug.action.toggleBreakpoint") 216 | end 217 | 218 | function Copy_path() 219 | VSCodeNotify("copyFilePath") 220 | end 221 | 222 | function Copy_relative_path() 223 | VSCodeNotify("copyRelativeFilePath") 224 | end 225 | 226 | function Active_whichkey() 227 | VSCodeNotify("whichkey.show") 228 | end 229 | 230 | function Navigation_down() 231 | VSCodeNotify("workbench.action.navigateDown") 232 | end 233 | 234 | function Navigation_up() 235 | VSCodeNotify("workbench.action.navigateUp") 236 | end 237 | 238 | function Navigation_left() 239 | VSCodeNotify("workbench.action.navigateLeft") 240 | end 241 | 242 | function Navigation_right() 243 | VSCodeNotify("workbench.action.navigateRight") 244 | end 245 | 246 | function Select_all() 247 | VSCodeNotify("editor.action.selectAll") 248 | end 249 | 250 | function Copy_clipboard() 251 | VSCodeNotify("editor.action.clipboardCopyAction") 252 | end 253 | 254 | function Paste_clipboard() 255 | VSCodeNotify("editor.action.clipboardPasteAction") 256 | end 257 | 258 | function Save() 259 | VSCodeNotify("workbench.action.files.save") 260 | VSCodeNotify("workbench.action.files.saveAll") 261 | end 262 | 263 | function Close() 264 | VSCodeNotify("workbench.action.closeActiveEditor") 265 | end 266 | -------------------------------------------------------------------------------- /lua/_vscode/mappings.lua: -------------------------------------------------------------------------------- 1 | -- n = normal mode 2 | -- i = insert mode 3 | -- v = visual mode 4 | -- x = visual block mode 5 | -- t = terminal mode 6 | -- c = command mode 7 | -- o = operator pending mode 8 | 9 | Map({ "n", "x" }, "", Active_whichkey) 10 | 11 | Map("", "U", Trim__save__format) 12 | 13 | Map("n", "gD", Reveal_definition_aside) 14 | Map("n", "gt", Go_to_implementation) 15 | Map("n", "gq", Go_to_reference) 16 | Map("n", ",r", Rename_symbol) 17 | Map("n", "<<", Outdent) 18 | Map("n", ">>", Indent) 19 | Map("n", "gcc", Comment) 20 | Map("n", "=s", Convert_to_spaces) 21 | Map("n", "=t", Convert_to_tabs) 22 | Map("n", "=d", Indent_with_spaces) 23 | Map("n", "=g", Indent_with_tabs) 24 | Map("n", "K", CloseEditor) 25 | Map("n", ",K", UndoCloseEditor) 26 | Map("n", "zk", Git_stage_file) 27 | Map("n", "zK", Git_unstage_file) 28 | Map("n", "zi", Git_open_changes) 29 | Map("n", "zI", Git_open_all_changes) 30 | Map("n", "zy", Toggle_breakpoint) 31 | Map("n", "yr", Copy_relative_path) 32 | Map("n", "yR", Copy_path) 33 | Map({ "n", "i", "v", "x" }, "", Select_all) 34 | Map({ "n", "v", "x" }, "y", Copy_clipboard) 35 | Map({ "n", "v", "x" }, "p", Paste_clipboard) 36 | Map({ "n", "v", "x" }, "", Save) 37 | Map({ "n" }, "q", Close) 38 | 39 | Map("v", "gs", Codesnap) 40 | Map("v", "<", Outdent_vis) 41 | Map("v", ">", Indent_vis) 42 | Map("v", "gc", Comment_vis) 43 | 44 | Map({ "n", "v" }, "zJ", Git_revert_change) 45 | Map({ "n", "v" }, "zj", Git_stage_change) 46 | -- Map({ "n", "v" }, "zt", Vscode_ctrl_d) 47 | -- Map({ "n", "v" }, "zb", Vscode_ctrl_u) 48 | 49 | vim.api.nvim_exec( 50 | [[ 51 | " THEME CHANGER 52 | function! SetCursorLineNrColorInsert(mode) 53 | " Insert mode: blue 54 | if a:mode == "i" 55 | call VSCodeNotify('nvim-theme.insert') 56 | 57 | " Replace mode: red 58 | elseif a:mode == "r" 59 | call VSCodeNotify('nvim-theme.replace') 60 | endif 61 | endfunction 62 | 63 | augroup CursorLineNrColorSwap 64 | autocmd! 65 | autocmd ModeChanged *:[vV\x16]* call VSCodeNotify('nvim-theme.visual') 66 | autocmd ModeChanged *:[R]* call VSCodeNotify('nvim-theme.replace') 67 | autocmd InsertEnter * call SetCursorLineNrColorInsert(v:insertmode) 68 | autocmd InsertLeave * call VSCodeNotify('nvim-theme.normal') 69 | autocmd CursorHold * call VSCodeNotify('nvim-theme.normal') 70 | autocmd ModeChanged [vV\x16]*:* call VSCodeNotify('nvim-theme.normal') 71 | augroup END 72 | ]], 73 | false 74 | ) 75 | -------------------------------------------------------------------------------- /lua/auto-jdtls2/create_gradle_project.lua: -------------------------------------------------------------------------------- 1 | local function gradle_new_project() 2 | local function create_notif(message, level) 3 | local notif_ok, notify = pcall(require, "notify") 4 | if notif_ok then 5 | notify(message, level) 6 | else 7 | print(message) 8 | end 9 | end 10 | 11 | -- Fungsi untuk meminta input dari pengguna dengan opsi untuk membatalkan 12 | local function get_user_input(prompt, default_value) 13 | vim.fn.inputsave() 14 | local result = vim.fn.input(prompt, default_value) 15 | vim.fn.inputrestore() 16 | 17 | -- Cek apakah pengguna menekan Esc untuk membatalkan input 18 | if result == "" then 19 | create_notif("Input canceled.", "info") 20 | return nil, true 21 | end 22 | 23 | return result, false 24 | end 25 | -- Ambil input Testing 26 | local test, canceled_test = get_user_input("Testing (junit,junit-jupiter,testng,spock): ", "junit-jupiter") 27 | if canceled_test then 28 | return 29 | end 30 | -- Ambil input DSL 31 | local script_dsl, canceled_dsl = get_user_input("Script DSL (kotlin, groovy): ", "groovy") 32 | if canceled_dsl then 33 | return 34 | end 35 | -- Ambil input package name 36 | local package_name, canceled_package = get_user_input("Enter package name: ", "com.example") 37 | if canceled_package then 38 | return 39 | end 40 | 41 | -- Format perintah Gradle berdasarkan input pengguna 42 | local command = string.format( 43 | "echo no | gradle init --type java-application --test-framework %s --dsl %s --package %s --no-daemon", 44 | test, 45 | script_dsl, 46 | package_name 47 | ) 48 | 49 | -- Fungsi untuk menjalankan perintah Gradle dan menampilkan outputnya 50 | local function run_gradle_command(cmd, path, pkg) 51 | local output = vim.fn.system(cmd) 52 | if vim.v.shell_error ~= 0 then 53 | create_notif("Error executing: " .. output, "error") 54 | else 55 | create_notif("Project created successfully!", "info") 56 | create_notif("Please Reopen Dir : " .. path, "info") 57 | vim.cmd(":NvimTreeFindFileToggle") 58 | local main_class_path = string.format("%s/app/src/main/java/%s/App.java", path, pkg:gsub("%.", "/")) 59 | if vim.fn.filereadable(main_class_path) == 1 then 60 | vim.cmd(":edit " .. main_class_path) 61 | end 62 | local function delayed_quit() 63 | vim.defer_fn(function() 64 | vim.cmd("qa!") 65 | end, 4000) -- Delay is set in milliseconds (3,000ms = 3 seconds) 66 | end 67 | -- Run the delayed quit function 68 | delayed_quit() 69 | end 70 | end 71 | 72 | -- Jalankan perintah Gradle dan buka proyek 73 | run_gradle_command(command, vim.fn.getcwd(), package_name) 74 | end 75 | 76 | vim.api.nvim_create_user_command("GradleNewProject", gradle_new_project, {}) 77 | -------------------------------------------------------------------------------- /lua/auto-jdtls2/create_maven_project.lua: -------------------------------------------------------------------------------- 1 | local function mvn_new_project() 2 | local function create_notif(message, level) 3 | local notif_ok, notify = pcall(require, "notify") 4 | if notif_ok then 5 | notify(message, level) 6 | else 7 | print(message) 8 | end 9 | end 10 | -- Fungsi untuk meminta input dari pengguna dengan opsi untuk membatalkan 11 | local function get_user_input(prompt, default_value) 12 | vim.fn.inputsave() 13 | local result = vim.fn.input(prompt, default_value) 14 | vim.fn.inputrestore() 15 | 16 | -- Cek apakah pengguna menekan Esc untuk membatalkan input 17 | if result == "" then 18 | create_notif("Input canceled.", "info") 19 | return nil, true 20 | end 21 | 22 | return result, false 23 | end 24 | -- Ambil input dari pengguna untuk menentukan direktori proyek 25 | local project_dir, canceled = get_user_input("Enter project directory: ", vim.fn.getcwd()) 26 | if canceled then 27 | return 28 | end 29 | -- Buat direktori jika belum ada 30 | if vim.fn.isdirectory(project_dir) == 0 then 31 | if vim.fn.mkdir(project_dir, "p") == 0 then 32 | create_notif("Failed to create project directory: " .. project_dir, "error") 33 | return 34 | end 35 | end 36 | -- Pindah ke direktori proyek 37 | -- Hapus satu level dari path 38 | local parent_dir = vim.fn.fnamemodify(project_dir, ":h") 39 | local success, err = pcall(vim.fn.chdir, parent_dir) 40 | if not success then 41 | create_notif("Error changing directory: " .. err, "error") 42 | return 43 | end 44 | 45 | create_notif("Changed directory to: " .. project_dir, "info") 46 | -- Fungsi untuk mendapatkan nama direktori terakhir dari path 47 | local function getLastDirName(path) 48 | local uname = vim.loop.os_uname().sysname 49 | local name 50 | if uname == "Windows_NT" then 51 | name = path:match("([^\\]+)$") 52 | else 53 | name = path:match("([^/]+)$") 54 | end 55 | return name 56 | end 57 | -- Ambil input dari pengguna untuk Maven 58 | local group_id, canceled_group = get_user_input("Enter groupId: ", "com.example") 59 | if canceled_group then 60 | return 61 | end 62 | local artifact_id = getLastDirName(project_dir) 63 | local archetype_artifact_id, canceled_archetype = 64 | get_user_input("Enter archetypeArtifactId: ", "maven-archetype-quickstart") 65 | if canceled_archetype then 66 | return 67 | end 68 | local archetype_version, canceled_version = get_user_input("Enter archetypeVersion: ", "1.5") 69 | if canceled_version then 70 | return 71 | end 72 | local interactive_mode, canceled_interactive = get_user_input("Enter interactiveMode (true/false): ", "false") 73 | if canceled_interactive then 74 | return 75 | end 76 | -- Format perintah Maven berdasarkan input pengguna 77 | local command = string.format( 78 | [[mvn archetype:generate "-DgroupId=%s" "-DartifactId=%s" "-DarchetypeArtifactId=%s" "-DarchetypeVersion=%s" "-DinteractiveMode=%s"]], 79 | group_id, 80 | artifact_id, 81 | archetype_artifact_id, 82 | archetype_version, 83 | interactive_mode 84 | ) 85 | 86 | -- Fungsi untuk menjalankan perintah Maven dan menampilkan outputnya 87 | local function run_maven_command(cmd, project_name) 88 | local output = vim.fn.system(cmd) 89 | if vim.v.shell_error ~= 0 then 90 | print("Erro ao executar: " .. output) 91 | else 92 | local ch_dir = string.format("cd %s", project_name) 93 | vim.fn.system(ch_dir) 94 | vim.fn.chdir(project_name) 95 | -- Cari dan buka file main class 96 | local uname = vim.loop.os_uname().sysname 97 | if uname == "Windows_NT" then 98 | if group_id then 99 | group_id = group_id:gsub("%.", "\\") 100 | local main_class_path = string.format("src\\main\\java\\%s\\App.java", group_id) 101 | if vim.fn.filereadable(main_class_path) == 1 then 102 | vim.cmd(":edit " .. main_class_path) 103 | end 104 | end 105 | else 106 | if group_id then 107 | group_id = group_id:gsub("%.", "/") 108 | local main_class_path = string.format("src/main/java/%s/App.java", group_id) 109 | if vim.fn.filereadable(main_class_path) == 1 then 110 | vim.cmd(":edit " .. main_class_path) 111 | end 112 | end 113 | end 114 | vim.cmd(":NvimTreeFindFileToggl") 115 | end 116 | end 117 | 118 | -- Jalankan perintah Maven dan buka proyek 119 | run_maven_command(command, artifact_id) 120 | create_notif("Project created successfully !", "info") 121 | end 122 | 123 | vim.api.nvim_create_user_command("MavenNewProject", mvn_new_project, {}) 124 | -------------------------------------------------------------------------------- /lua/auto-jdtls2/generate_java_class.lua: -------------------------------------------------------------------------------- 1 | local function create_java_class() 2 | local is_maven_project = function() 3 | if vim.fn.findfile("pom.xml", vim.fn.getcwd()) == "pom.xml" then 4 | return true 5 | else 6 | return false 7 | end 8 | end 9 | 10 | local function create_notif(message, level) 11 | local notif_ok, notify = pcall(require, "notify") 12 | if notif_ok then 13 | notify(message, level) 14 | else 15 | print(message) 16 | end 17 | end 18 | 19 | -- Fungsi untuk meminta input dari pengguna dengan opsi untuk membatalkan 20 | local function get_user_input(prompt, default_value) 21 | vim.fn.inputsave() 22 | local result = vim.fn.input(prompt, default_value) 23 | vim.fn.inputrestore() 24 | 25 | -- Cek apakah pengguna menekan Esc untuk membatalkan input 26 | if result == "" then 27 | create_notif("Input canceled.", "info") 28 | return nil, true 29 | end 30 | 31 | return result, false 32 | end 33 | 34 | -- Fungsi untuk mendapatkan nama package default berdasarkan buffer aktif 35 | local function get_default_package() 36 | local path = vim.fn.expand("%:p:h") 37 | local project_root = vim.fn.getcwd() 38 | local relative_path = path:sub(#project_root + 1) 39 | relative_path = relative_path:gsub("app\\src\\main\\java\\", "") 40 | relative_path = relative_path:gsub("src\\main\\java\\", "") 41 | relative_path = relative_path:gsub("app/src/main/java/", "") 42 | relative_path = relative_path:gsub("src/main/java/", "") 43 | relative_path = relative_path:gsub("\\", ".") 44 | relative_path = relative_path:gsub("/", ".") 45 | return relative_path:sub(2) 46 | end 47 | 48 | -- Ambil input dari pengguna untuk nama package dan nama kelas 49 | local package_name, canceled_package = get_user_input("Enter package name: ", get_default_package()) 50 | if canceled_package then 51 | return 52 | end 53 | 54 | local class_name, canceled_class = get_user_input("Enter class name: ", "MyClass") 55 | if canceled_class then 56 | return 57 | end 58 | 59 | -- Format direktori dan path file berdasarkan input pengguna 60 | local package_dir = nil 61 | if package_name then 62 | if is_maven_project() then 63 | package_dir = string.format("src/main/java/%s", package_name:gsub("%.", "/")) 64 | else 65 | package_dir = string.format("app/src/main/java/%s", package_name:gsub("%.", "/")) 66 | end 67 | if vim.fn.isdirectory(package_dir) == 0 then 68 | vim.fn.mkdir(package_dir, "p") 69 | end 70 | else 71 | create_notif("Invalid package name: " .. package_name, "error") 72 | return 73 | end 74 | 75 | local file_path = string.format("%s/%s.java", package_dir, class_name) 76 | if vim.fn.filereadable(file_path) == 1 then 77 | create_notif("Class already exists: " .. file_path, "error") 78 | return 79 | end 80 | 81 | -- Tulis konten kelas Java ke dalam file 82 | local class_content = string.format( 83 | [[ 84 | package %s; 85 | 86 | public class %s { 87 | 88 | } 89 | ]], 90 | package_name, 91 | class_name, 92 | class_name 93 | ) 94 | 95 | local file = io.open(file_path, "w") 96 | if file then 97 | file:write(class_content) 98 | file:close() 99 | end 100 | 101 | -- Buka file Java yang baru dibuat di Neovim 102 | vim.cmd(":edit " .. file_path) 103 | create_notif("Java class created: " .. file_path, "info") 104 | end 105 | 106 | vim.api.nvim_create_user_command("CreateJavaClass", create_java_class, {}) 107 | -------------------------------------------------------------------------------- /lua/auto-jdtls2/generate_java_interface.lua: -------------------------------------------------------------------------------- 1 | local function create_java_class() 2 | local function create_notif(message, level) 3 | local notif_ok, notify = pcall(require, "notify") 4 | if notif_ok then 5 | notify(message, level) 6 | else 7 | print(message) 8 | end 9 | end 10 | 11 | local is_maven_project = function() 12 | if vim.fn.findfile("pom.xml", vim.fn.getcwd()) == "pom.xml" then 13 | return true 14 | else 15 | return false 16 | end 17 | end 18 | 19 | -- Fungsi untuk meminta input dari pengguna dengan opsi untuk membatalkan 20 | local function get_user_input(prompt, default_value) 21 | vim.fn.inputsave() 22 | local result = vim.fn.input(prompt, default_value) 23 | vim.fn.inputrestore() 24 | 25 | -- Cek apakah pengguna menekan Esc untuk membatalkan input 26 | if result == "" then 27 | create_notif("Input canceled.", "info") 28 | return nil, true 29 | end 30 | 31 | return result, false 32 | end 33 | 34 | -- Fungsi untuk mendapatkan nama package default berdasarkan buffer aktif 35 | local function get_default_package() 36 | local path = vim.fn.expand("%:p:h") 37 | local project_root = vim.fn.getcwd() 38 | local relative_path = path:sub(#project_root + 1) 39 | relative_path = relative_path:gsub("app\\src\\main\\java\\", "") 40 | relative_path = relative_path:gsub("src\\main\\java\\", "") 41 | relative_path = relative_path:gsub("app/src/main/java/", "") 42 | relative_path = relative_path:gsub("src/main/java/", "") 43 | relative_path = relative_path:gsub("\\", ".") 44 | relative_path = relative_path:gsub("/", ".") 45 | return relative_path:sub(2) 46 | end 47 | 48 | -- Ambil input dari pengguna untuk nama package dan nama kelas 49 | local package_name, canceled_package = get_user_input("Enter package name: ", get_default_package()) 50 | if canceled_package then 51 | return 52 | end 53 | 54 | local class_name, canceled_class = get_user_input("Enter interface name: ", "MyInterface") 55 | if canceled_class then 56 | return 57 | end 58 | 59 | -- Format direktori dan path file berdasarkan input pengguna 60 | local package_dir = nil 61 | if package_name then 62 | if is_maven_project() then 63 | package_dir = string.format("src/main/java/%s", package_name:gsub("%.", "/")) 64 | else 65 | package_dir = string.format("app/src/main/java/%s", package_name:gsub("%.", "/")) 66 | end 67 | if vim.fn.isdirectory(package_dir) == 0 then 68 | vim.fn.mkdir(package_dir, "p") 69 | end 70 | else 71 | create_notif("Invalid package name: " .. package_name, "error") 72 | return 73 | end 74 | 75 | local file_path = string.format("%s/%s.java", package_dir, class_name) 76 | if vim.fn.filereadable(file_path) == 1 then 77 | create_notif("Class already exists: " .. file_path, "error") 78 | return 79 | end 80 | 81 | -- Tulis konten kelas Java ke dalam file 82 | local class_content = string.format( 83 | [[ 84 | /* 85 | * This Java source file. 86 | */ 87 | package %s; 88 | 89 | public interface %s { 90 | // Other methods and fields 91 | } 92 | ]], 93 | package_name, 94 | class_name, 95 | class_name 96 | ) 97 | 98 | local file = io.open(file_path, "w") 99 | if file then 100 | file:write(class_content) 101 | file:close() 102 | end 103 | 104 | -- Buka file Java yang baru dibuat di Neovim 105 | vim.cmd(":edit " .. file_path) 106 | create_notif("Java interface created: " .. file_path, "info") 107 | end 108 | 109 | vim.api.nvim_create_user_command("CreateJavaInterface", create_java_class, {}) 110 | -------------------------------------------------------------------------------- /lua/auto-jdtls2/generate_java_main_class.lua: -------------------------------------------------------------------------------- 1 | local function create_java_main_class() 2 | local function create_notif(message, level) 3 | local notif_ok, notify = pcall(require, "notify") 4 | if notif_ok then 5 | notify(message, level) 6 | else 7 | print(message) 8 | end 9 | end 10 | 11 | local is_maven_project = function() 12 | if vim.fn.findfile("pom.xml", vim.fn.getcwd()) == "pom.xml" then 13 | return true 14 | else 15 | return false 16 | end 17 | end 18 | 19 | -- Fungsi untuk meminta input dari pengguna dengan opsi untuk membatalkan 20 | local function get_user_input(prompt, default_value) 21 | vim.fn.inputsave() 22 | local result = vim.fn.input(prompt, default_value) 23 | vim.fn.inputrestore() 24 | 25 | -- Cek apakah pengguna menekan Esc untuk membatalkan input 26 | if result == "" then 27 | create_notif("Input canceled.", "info") 28 | return nil, true 29 | end 30 | 31 | return result, false 32 | end 33 | 34 | -- Fungsi untuk mendapatkan nama package default berdasarkan buffer aktif 35 | local function get_default_package() 36 | local path = vim.fn.expand("%:p:h") 37 | local project_root = vim.fn.getcwd() 38 | local relative_path = path:sub(#project_root + 1) 39 | relative_path = relative_path:gsub("app\\src\\main\\java\\", "") 40 | relative_path = relative_path:gsub("src\\main\\java\\", "") 41 | relative_path = relative_path:gsub("app/src/main/java/", "") 42 | relative_path = relative_path:gsub("src/main/java/", "") 43 | relative_path = relative_path:gsub("\\", ".") 44 | relative_path = relative_path:gsub("/", ".") 45 | return relative_path:sub(2) 46 | end 47 | 48 | -- Ambil input dari pengguna untuk nama package dan nama kelas 49 | local package_name, canceled_package = get_user_input("Enter package name: ", get_default_package()) 50 | if canceled_package then 51 | return 52 | end 53 | 54 | local class_name, canceled_class = get_user_input("Enter class name: ", "MyMainClass") 55 | if canceled_class then 56 | return 57 | end 58 | 59 | -- Format direktori dan path file berdasarkan input pengguna 60 | local package_dir = nil 61 | if package_name then 62 | if is_maven_project() then 63 | package_dir = string.format("src/main/java/%s", package_name:gsub("%.", "/")) 64 | else 65 | package_dir = string.format("app/src/main/java/%s", package_name:gsub("%.", "/")) 66 | end 67 | if vim.fn.isdirectory(package_dir) == 0 then 68 | vim.fn.mkdir(package_dir, "p") 69 | end 70 | else 71 | create_notif("Invalid package name: " .. package_name, "error") 72 | return 73 | end 74 | 75 | local file_path = string.format("%s/%s.java", package_dir, class_name) 76 | if vim.fn.filereadable(file_path) == 1 then 77 | create_notif("Class already exists: " .. file_path, "error") 78 | return 79 | end 80 | 81 | -- Tulis konten kelas Java ke dalam file 82 | local class_content = string.format( 83 | [[ 84 | /* 85 | * This Java source file. 86 | */ 87 | package %s; 88 | 89 | public class %s { 90 | /** 91 | * 92 | */ 93 | public static void main(String[] args) { 94 | System.out.println("Hello World"); 95 | } 96 | 97 | } 98 | ]], 99 | package_name, 100 | class_name, 101 | class_name 102 | ) 103 | 104 | local file = io.open(file_path, "w") 105 | if file then 106 | file:write(class_content) 107 | file:close() 108 | end 109 | 110 | -- Buka file Java yang baru dibuat di Neovim 111 | vim.cmd(":edit " .. file_path) 112 | create_notif("Java class created: " .. file_path, "info") 113 | end 114 | 115 | vim.api.nvim_create_user_command("CreateJavaMainClass", create_java_main_class, {}) 116 | -------------------------------------------------------------------------------- /lua/auto-jdtls2/init.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | M.setup = function(opt) 4 | opt = opt or {} 5 | require("auto-jdtls2.create_gradle_project") 6 | require("auto-jdtls2.create_maven_project") 7 | require("auto-jdtls2.create_springboot_project") 8 | require("auto-jdtls2.generate_java_class") 9 | require("auto-jdtls2.generate_java_interface") 10 | require("auto-jdtls2.generate_java_main_class") 11 | -- require("auto-jdtls2.utils").install() 12 | -- require("auto-jdtls2.utils").attach_jdtls(opt) 13 | end 14 | 15 | return M 16 | -------------------------------------------------------------------------------- /lua/pcode/config/lazy_lib.lua: -------------------------------------------------------------------------------- 1 | -- Bootstrap lazy.nvim 2 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 3 | if not (vim.uv or vim.loop).fs_stat(lazypath) then 4 | local lazyrepo = "https://github.com/folke/lazy.nvim.git" 5 | local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) 6 | if vim.v.shell_error ~= 0 then 7 | vim.api.nvim_echo({ 8 | { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, 9 | { out, "WarningMsg" }, 10 | { "\nPress any key to exit..." }, 11 | }, true, {}) 12 | vim.fn.getchar() 13 | os.exit(1) 14 | end 15 | end 16 | vim.opt.rtp:prepend(vim.env.LAZY or lazypath) 17 | vim.opt.number = false 18 | 19 | local icons = require("pcode.user.icons").ui 20 | -- Make sure to setup `mapleader` and `maplocalleader` before 21 | -- loading lazy.nvim so that mappings are correct. 22 | -- This is also a good place to setup other settings (vim.opt) 23 | vim.g.mapleader = " " 24 | vim.g.maplocalleader = "\\" 25 | -- initialisasi plugins 26 | local importdata = { 27 | { import = "pcode.plugins" }, 28 | } 29 | -- load theme 30 | local theme = pcode.themes or {} 31 | for key, _ in pairs(theme) do 32 | table.insert(importdata, { import = "pcode.plugins.theme." .. key }) 33 | end 34 | -- load extras plugins 35 | local extras = pcode.extras or {} 36 | for key, value in pairs(extras) do 37 | if value then 38 | table.insert(importdata, { import = "pcode.plugins.extras." .. key }) 39 | end 40 | end 41 | -- load language config 42 | local lang = pcode.lang or {} 43 | for key, value in pairs(lang) do 44 | if value then 45 | table.insert(importdata, { import = "pcode.plugins.lang." .. key }) 46 | end 47 | end 48 | -- load transparant config 49 | local transparant = pcode.transparent or false 50 | if transparant then 51 | table.insert(importdata, { import = "pcode.plugins.extras.transparent" }) 52 | end 53 | -- add overide path 54 | table.insert(importdata, { import = "pcode.user.custom" }) 55 | -- Setup lazy.nvim 56 | require("lazy").setup({ 57 | spec = importdata, 58 | ui = { 59 | backdrop = 100, -- Menyeting backdrop UI 60 | border = "rounded", -- Mengatur border UI ke rounded 61 | browser = "chrome", -- Menggunakan Chrome sebagai browser default 62 | throttle = 40, -- Menyeting throttle 63 | custom_keys = { 64 | ["l"] = false, -- Menonaktifkan kunci lokal leader l 65 | }, 66 | icons = { 67 | ft = icons.ft, 68 | lazy = icons.Bell .. " ", 69 | loaded = icons.CheckCircle, 70 | not_loaded = icons.not_loaded, 71 | }, 72 | }, 73 | change_detection = { enabled = false, notify = false }, -- Nonaktifkan deteksi perubahan 74 | -- automatically check for plugin updates 75 | checker = { enabled = true }, 76 | performance = { 77 | rtp = { 78 | -- disable some rtp plugins 79 | disabled_plugins = { 80 | "gzip", 81 | "matchit", 82 | "matchparen", 83 | "netrwPlugin", 84 | "tarPlugin", 85 | "tohtml", 86 | "tutor", 87 | "zipPlugin", 88 | }, 89 | }, 90 | }, 91 | }) 92 | -------------------------------------------------------------------------------- /lua/pcode/core/init.lua: -------------------------------------------------------------------------------- 1 | _G.pcode = _G.pcode or {} 2 | require("pcode.user.default") 3 | require("pcode.config.lazy_lib") 4 | require("pcode.user.colorscheme") 5 | require("pcode.core.neovide") 6 | -------------------------------------------------------------------------------- /lua/pcode/core/neovide.lua: -------------------------------------------------------------------------------- 1 | if vim.g.neovide then 2 | local opts = { noremap = true, silent = true } 3 | vim.g.neovide_input_use_logo = 1 -- enable use of the logo (cmd) key 4 | vim.keymap.set("n", "", ":w", opts) -- Save 5 | vim.keymap.set("v", "", '"+y', opts) -- Copy 6 | vim.keymap.set("n", "", '"+P', opts) -- Paste normal mode 7 | vim.keymap.set("v", "", '"+P', opts) -- Paste visual mode 8 | vim.keymap.set("x", "", '"+P', opts) -- Paste visual mode 9 | vim.keymap.set("c", "", "+", { noremap = true }) -- Paste command mode 10 | vim.keymap.set("i", "", 'l"+Pli', opts) -- Paste insert mode 11 | vim.keymap.set( 12 | "n", 13 | "", 14 | "lua require('Comment.api').toggle.linewise.current()$i", 15 | opts 16 | ) 17 | vim.keymap.set( 18 | "i", 19 | "", 20 | "lua require('Comment.api').toggle.linewise.current()$i", 21 | opts 22 | ) 23 | vim.keymap.set("v", "", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", opts) 24 | 25 | vim.o.guifont = "Hasklug_Nerd_Font:h15" 26 | vim.g.neovide_padding_top = 0 27 | vim.g.neovide_padding_bottom = 1 28 | vim.g.neovide_padding_right = 1 29 | vim.g.neovide_padding_left = 1 30 | 31 | -- config for transparent 32 | vim.g.neovide_transparency = 1 33 | vim.g.neovide_hide_mouse_when_typing = false 34 | vim.g.neovide_underline_automatic_scaling = false 35 | vim.g.neovide_refresh_rate_idle = 5 36 | vim.g.neovide_no_idle = true 37 | vim.g.neovide_remember_window_size = true 38 | vim.g.neovide_touch_drag_timeout = 0.17 39 | vim.g.neovide_show_border = false 40 | vim.g.neovide_theme = "auto" 41 | vim.g.neovide_confirm_quit = true 42 | vim.g.neovide_remember_window_size = true 43 | vim.g.neovide_cursor_smooth_blink = true 44 | -- animation config 45 | --vim.g.neovide_scroll_animation_length = 0.3 46 | --vim.g.neovide_cursor_animation_length = 0.13 47 | vim.g.neovide_cursor_trail_size = 0.8 48 | vim.g.neovide_cursor_antialiasing = true 49 | vim.g.neovide_cursor_animate_in_insert_mode = true 50 | vim.g.neovide_cursor_vfx_mode = "torpedo" 51 | 52 | vim.opt.linespace = 0 53 | vim.g.neovide_scale_factor = 1 54 | vim.opt.cmdheight = 0 55 | vim.opt.spell = false 56 | 57 | vim.g.neovide_window_blurred = true 58 | vim.g.neovide_floating_blur_amount_x = 2.0 59 | vim.g.neovide_floating_blur_amount_y = 2.0 60 | vim.g.neovide_floating_shadow = false 61 | vim.g.neovide_floating_z_height = 10 62 | vim.g.neovide_light_angle_degrees = 45 63 | vim.g.neovide_light_radius = 5 64 | end 65 | 66 | -- -- Allow clipboard copy paste in neovim 67 | -- vim.g.neovide_input_use_logo = 1 68 | -- vim.api.nvim_set_keymap("", "", "+p", { noremap = true, silent = true }) 69 | -- vim.api.nvim_set_keymap("!", "", "+", { noremap = true, silent = true }) 70 | -- vim.api.nvim_set_keymap("t", "", "+", { noremap = true, silent = true }) 71 | -- vim.api.nvim_set_keymap("v", "", "+", { noremap = true, silent = true }) 72 | -------------------------------------------------------------------------------- /lua/pcode/plugins/_default.lua: -------------------------------------------------------------------------------- 1 | _G.idxOf = function(array, value) 2 | for i, v in ipairs(array) do 3 | if v == value then 4 | return i 5 | end 6 | end 7 | return nil 8 | end 9 | 10 | _G.LAZYGIT_TOGGLE = function() 11 | local ok = pcall(require, "toggleterm") 12 | if not ok then 13 | require("notify")("toggleterm not found!", "error") 14 | return 15 | end 16 | local Terminal = require("toggleterm.terminal").Terminal 17 | local lazygit = Terminal:new({ cmd = "lazygit", hidden = true }) 18 | lazygit:toggle() 19 | end 20 | 21 | _G.substring = function(text, key) 22 | local index, _ = string.find(text, key) 23 | if index then 24 | return true 25 | else 26 | return false 27 | end 28 | end 29 | 30 | _G.all_trim = function(s) 31 | return s:match("^%s*(.-)%s*$") 32 | end 33 | 34 | _G.current_theme = function() 35 | if pcode.themes then 36 | local theme = "" 37 | for _, value in pairs(pcode.themes or {}) do 38 | theme = value 39 | end 40 | return all_trim(theme) 41 | end 42 | return "" 43 | end 44 | 45 | local function safeRequire(module) 46 | local ok, result = pcall(require, module) 47 | if ok then 48 | return result 49 | end 50 | end 51 | 52 | safeRequire("pcode.user.options") 53 | safeRequire("pcode.user.autocmd") 54 | safeRequire("pcode.user.keymaps") 55 | return {} 56 | -------------------------------------------------------------------------------- /lua/pcode/plugins/_lsp.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "williamboman/mason-lspconfig.nvim", 4 | event = { "VeryLazy", "BufReadPre", "BufNewFile", "BufRead" }, 5 | dependencies = { 6 | { "pojokcodeid/auto-lsp.nvim", lazy = true }, 7 | { 8 | "neovim/nvim-lspconfig", 9 | lazy = true, 10 | cmd = { 11 | "LspInfo", 12 | "LspInstall", 13 | "LspUninstall", 14 | }, 15 | config = function() 16 | require("lspconfig.ui.windows").default_options.border = "rounded" 17 | end, 18 | }, 19 | { 20 | "williamboman/mason.nvim", 21 | lazy = true, 22 | build = ":MasonUpdate", 23 | opts_extend = { "ensure_installed" }, 24 | cmd = { 25 | "Mason", 26 | "MasonInstall", 27 | "MasonUninstall", 28 | "MasonUninstallAll", 29 | "MasonLog", 30 | }, 31 | opts = function(_, opts) 32 | local icons = require("pcode.user.icons").ui 33 | opts.ensure_installed = opts.ensure_installed or {} 34 | vim.list_extend(opts.ensure_installed, { "stylua" }) 35 | opts.ui = { 36 | -- border = "none", 37 | border = icons.Border, 38 | icons = { 39 | package_pending = icons.Pending, 40 | package_installed = icons.CheckCircle, 41 | package_uninstalled = icons.BlankCircle, 42 | }, 43 | keymaps = { 44 | toggle_server_expand = "", 45 | install_server = "i", 46 | update_server = "u", 47 | check_server_version = "c", 48 | update_all_servers = "U", 49 | check_outdated_servers = "C", 50 | uninstall_server = "X", 51 | }, 52 | } 53 | opts.log_level = vim.log.levels.INFO 54 | opts.max_concurrent_installers = 4 55 | return opts 56 | end, 57 | config = function(_, opts) 58 | require("mason").setup(opts) 59 | local mr = require("mason-registry") 60 | mr:on("package:install:success", function() 61 | vim.defer_fn(function() 62 | -- trigger FileType event to possibly load this newly installed LSP server 63 | require("lazy.core.handler.event").trigger({ 64 | event = "FileType", 65 | buf = vim.api.nvim_get_current_buf(), 66 | }) 67 | end, 100) 68 | end) 69 | 70 | mr.refresh(function() 71 | for _, tool in ipairs(opts.ensure_installed) do 72 | local p = mr.get_package(tool) 73 | if not p:is_installed() then 74 | p:install() 75 | end 76 | end 77 | end) 78 | end, 79 | }, 80 | }, 81 | opts = function(_, opts) 82 | opts.skip_config = opts.skip_config or {} 83 | opts.ensure_installed = opts.ensure_installed or {} 84 | opts.automatic_installation = true 85 | vim.list_extend(opts.ensure_installed, { "lua_ls" }) 86 | opts.format_on_save = true -- if use none-ls set true 87 | opts.virtual_text = true 88 | opts.timeout_ms = 5000 89 | return opts 90 | end, 91 | config = function(_, opts) 92 | require("auto-lsp").setup(opts) 93 | end, 94 | }, 95 | } 96 | -------------------------------------------------------------------------------- /lua/pcode/plugins/_treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { "nvim-lua/plenary.nvim", event = "VeryLazy" }, 3 | { 4 | "nvim-treesitter/nvim-treesitter", 5 | event = { "BufRead", "VeryLazy" }, 6 | version = false, 7 | build = ":TSUpdate", 8 | lazy = true, 9 | cmd = { 10 | "TSInstall", 11 | "TSInstallInfo", 12 | "TSInstallSync", 13 | "TSUpdate", 14 | "TSUpdateSync", 15 | "TSUninstall", 16 | "TSUninstallInfo", 17 | "TSInstallFromGrammar", 18 | }, 19 | opts = function() 20 | return { 21 | highlight = { enable = true }, 22 | indent = { enable = true }, 23 | ensure_installed = { "lua", "luadoc", "printf", "vim", "vimdoc" }, 24 | incremental_selection = { 25 | enable = true, 26 | }, 27 | autopairs = { 28 | enable = true, 29 | }, 30 | } 31 | end, 32 | config = function(_, opts) 33 | if type(opts.ensure_installed) == "table" then 34 | ---@type table 35 | local added = {} 36 | opts.ensure_installed = vim.tbl_filter(function(lang) 37 | if added[lang] then 38 | return false 39 | end 40 | added[lang] = true 41 | return true 42 | end, opts.ensure_installed) 43 | end 44 | require("nvim-treesitter.configs").setup(opts) 45 | end, 46 | }, 47 | } 48 | -------------------------------------------------------------------------------- /lua/pcode/plugins/_treesitterautopairs.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "windwp/nvim-autopairs", 3 | lazy = true, 4 | dependencies = "hrsh7th/nvim-cmp", 5 | event = "InsertEnter", 6 | opts = { 7 | check_ts = true, 8 | ts_config = { 9 | lua = { "string", "source" }, 10 | javascript = { "string", "template_string" }, 11 | java = false, 12 | }, 13 | disable_filetype = { "TelescopePrompt", "spectre_panel" }, 14 | fast_wrap = { 15 | map = "", 16 | chars = { "{", "[", "(", '"', "'", "`" }, 17 | pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), 18 | offset = 0, -- Offset from pattern match 19 | end_key = "$", 20 | keys = "qwertyuiopzxcvbnmasdfghjkl", 21 | check_comma = true, 22 | highlight = "PmenuSel", 23 | highlight_grey = "LineNr", 24 | }, 25 | }, 26 | config = function(_, opts) 27 | require("nvim-autopairs").setup(opts) 28 | local cmp_autopairs = require("nvim-autopairs.completion.cmp") 29 | local cmp_status_ok, cmp = pcall(require, "cmp") 30 | if not cmp_status_ok then 31 | return 32 | end 33 | cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } })) 34 | end, 35 | } 36 | -------------------------------------------------------------------------------- /lua/pcode/plugins/_treesitterautotag.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "windwp/nvim-ts-autotag", 3 | lazy = true, 4 | event = { "BufRead", "VeryLazy" }, 5 | opts = {}, 6 | } 7 | -------------------------------------------------------------------------------- /lua/pcode/plugins/alpha.lua: -------------------------------------------------------------------------------- 1 | local M = { 2 | "goolord/alpha-nvim", 3 | event = "VimEnter", 4 | } 5 | 6 | M.opts = { 7 | dash_model = { 8 | [[ _ __ __ ]], 9 | [[ ___ ___ (____ / /__ _______ ___/ ___ ]], 10 | [[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]], 11 | [[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]], 12 | [[ /_/ |___/ ]], 13 | }, 14 | } 15 | 16 | function M.config(_, opts) 17 | local alpha = require("alpha") 18 | local startify = require("alpha.themes.startify") 19 | startify.section.header.val = pcode.dashboard or opts.dash_model 20 | startify.section.top_buttons.val = { 21 | startify.button("F", "󰈞 Find file", ":Telescope find_files "), 22 | startify.button("e", " New file", ":ene startinsert "), 23 | startify.button("p", "󰉋 Find project", ":Telescope projects "), 24 | startify.button("r", "󰦛 Recently used files", ":Telescope oldfiles "), 25 | startify.button("t", "󰊄 Find text", ":Telescope live_grep "), 26 | startify.button("c", " Configuration", ":e $MYVIMRC "), 27 | startify.button("l", "󰒲 Lazy", ":Lazy"), 28 | startify.button("q", "󰅚 Quit", ":qa"), 29 | } 30 | -- disable MRU 31 | startify.section.mru.val = { { type = "padding", val = 4 } } 32 | -- disable MRU cwd 33 | startify.section.mru_cwd.val = { { type = "padding", val = 0 } } 34 | -- disable nvim_web_devicons 35 | startify.nvim_web_devicons.enabled = false 36 | startify.section.bottom_buttons.val = {} 37 | 38 | vim.api.nvim_create_autocmd("User", { 39 | pattern = "LazyVimStarted", 40 | desc = "Add Alpha dashboard footer", 41 | once = true, 42 | callback = function() 43 | local stats = require("lazy").stats() 44 | local ms = math.floor(stats.startuptime * 100 + 0.5) / 100 45 | -- stylua: ignore 46 | startify.section.footer.val = { 47 | -- { 48 | -- type = "text", 49 | -- val = {"───────────────────────────────────────────"}, 50 | -- }, 51 | { 52 | type = "text", 53 | val = { 54 | "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins  in " .. ms .. "ms", 55 | }, 56 | }, 57 | -- { 58 | -- type = "text", 59 | -- val = {"───────────────────────────────────────────"}, 60 | -- }, 61 | } 62 | pcall(vim.cmd.AlphaRedraw) 63 | end, 64 | }) 65 | 66 | vim.api.nvim_create_autocmd({ "User" }, { 67 | pattern = { "AlphaReady" }, 68 | callback = function() 69 | vim.cmd([[ 70 | set laststatus=0 | autocmd BufUnload set laststatus=3 71 | ]]) 72 | end, 73 | }) 74 | -- ignore filetypes in MRU 75 | local default_mru_ignore = {} 76 | startify.mru_opts.ignore = function(path, ext) 77 | return (string.find(path, "COMMIT_EDITMSG")) or (vim.tbl_contains(default_mru_ignore, ext)) 78 | end 79 | alpha.setup(startify.config) 80 | end 81 | 82 | return M 83 | -------------------------------------------------------------------------------- /lua/pcode/plugins/bufferline.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "akinsho/bufferline.nvim", 3 | branch = "main", 4 | event = { "BufRead", "InsertEnter", "BufNewFile" }, 5 | dependencies = "pojokcodeid/auto-bufferline.nvim", 6 | config = function() 7 | vim.opt.termguicolors = true 8 | local config = require("auto-bufferline").config() 9 | require("bufferline").setup(config) 10 | end, 11 | keys = { 12 | { "b", "", desc = "  Buffers", mode = "n" }, 13 | { 14 | "bb", 15 | function() 16 | require("telescope.builtin").buffers(require("telescope.themes").get_dropdown({ previewer = false })) 17 | end, 18 | desc = "All Buffer", 19 | mode = "n", 20 | }, 21 | { 22 | "bc", 23 | function() 24 | require("auto-bufferline.configs.utils").bufremove() 25 | end, 26 | desc = "Close current buffer", 27 | mode = "n", 28 | }, 29 | { "bd", "BufferLineCloseLeft", desc = "Close Buffer Left", mode = "n" }, 30 | { "bD", "BufferLineCloseRight", desc = "Close Buffer Right", mode = "n" }, 31 | { "ba", "BufferLineCloseOthers", desc = "Close Buffer Other", mode = "n" }, 32 | { "bA", "BufferLineCloseOthersbd!", desc = "Close Buffer All", mode = "n" }, 33 | }, 34 | } 35 | -------------------------------------------------------------------------------- /lua/pcode/plugins/cmp.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "L3MON4D3/LuaSnip", 4 | event = "InsertEnter", 5 | opts = { 6 | history = true, 7 | delete_check_events = "TextChanged", 8 | }, 9 | -- stylua: ignore 10 | keys = { 11 | { "", function() require("luasnip").jump(1) end, mode = "s" }, 12 | { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, 13 | }, 14 | }, 15 | { 16 | "hrsh7th/nvim-cmp", 17 | version = false, -- last release is way too old 18 | event = "InsertEnter", 19 | dependencies = { 20 | "hrsh7th/cmp-nvim-lsp", 21 | "hrsh7th/cmp-buffer", 22 | "hrsh7th/cmp-path", 23 | "saadparwaiz1/cmp_luasnip", 24 | "hrsh7th/cmp-nvim-lua", 25 | }, 26 | opts = function() 27 | local cmp = require("cmp") 28 | local luasnip = require("luasnip") 29 | 30 | local check_backspace = function() 31 | local col = vim.fn.col(".") - 1 32 | return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") 33 | end 34 | 35 | return { 36 | completion = { 37 | completeopt = "menu,menuone,noinsert", 38 | }, 39 | snippet = { 40 | expand = function(args) 41 | require("luasnip").lsp_expand(args.body) 42 | end, 43 | }, 44 | mapping = cmp.mapping.preset.insert({ 45 | [""] = cmp.mapping.scroll_docs(-4), 46 | [""] = cmp.mapping.scroll_docs(4), 47 | [""] = cmp.mapping.complete(), 48 | [""] = cmp.mapping.abort(), 49 | [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. 50 | [""] = cmp.mapping(function(fallback) 51 | if cmp.visible() then 52 | cmp.select_next_item() 53 | elseif luasnip.expandable() then 54 | luasnip.expand() 55 | elseif luasnip.expand_or_jumpable() then 56 | luasnip.expand_or_jump() 57 | elseif check_backspace() then 58 | fallback() 59 | else 60 | fallback() 61 | end 62 | end, { 63 | "i", 64 | "s", 65 | }), 66 | [""] = cmp.mapping(function(fallback) 67 | if cmp.visible() then 68 | cmp.select_prev_item() 69 | elseif luasnip.jumpable(-1) then 70 | luasnip.jump(-1) 71 | else 72 | fallback() 73 | end 74 | end, { 75 | "i", 76 | "s", 77 | }), 78 | }), 79 | sources = cmp.config.sources({ 80 | { name = "nvim_lsp" }, 81 | { name = "luasnip" }, 82 | { name = "buffer" }, 83 | { name = "path" }, 84 | { name = "nvim_lua" }, 85 | }), 86 | formatting = { 87 | fields = { "kind", "abbr", "menu" }, 88 | format = function(entry, vim_item) 89 | vim_item.menu = vim.api.nvim_get_mode().mode == "c" and "" or all_trim(vim_item.kind) 90 | vim_item.kind = string.format("%s", all_trim(require("pcode.user.icons")["kind"][vim_item.kind])) 91 | -- vim_item.menu = ({ 92 | -- nvim_lsp = "(LSP)", 93 | -- luasnip = "(Snippet)", 94 | -- buffer = "(Buffer)", 95 | -- path = "(Path)", 96 | -- codeium = "(Codeium)", 97 | -- })[entry.source.name] 98 | return vim_item 99 | end, 100 | }, 101 | window = { 102 | completion = cmp.config.window.bordered(), 103 | documentation = cmp.config.window.bordered(), 104 | }, 105 | experimental = { 106 | ghost_text = false, 107 | native_menu = false, 108 | }, 109 | } 110 | end, 111 | }, 112 | { 113 | "rafamadriz/friendly-snippets", 114 | event = "InsertEnter", 115 | lazy = true, 116 | config = function() 117 | require("luasnip.loaders.from_vscode").lazy_load() 118 | require("pcode.user.snippets") 119 | end, 120 | }, 121 | } 122 | -------------------------------------------------------------------------------- /lua/pcode/plugins/cmpcmdline.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "folke/noice.nvim", 4 | lazy = true, 5 | enabled = true, 6 | dependencies = { 7 | { "MunifTanjim/nui.nvim" }, 8 | }, 9 | event = "CmdlineEnter", 10 | opts = { 11 | messages = { 12 | enabled = false, 13 | }, 14 | notify = { 15 | enabled = false, 16 | }, 17 | lsp = { 18 | progress = { 19 | enabled = false, 20 | }, 21 | hover = { 22 | enabled = false, 23 | }, 24 | signature = { 25 | enabled = false, 26 | }, 27 | }, 28 | presets = { 29 | -- Preset ini menyesuaikan bentuk cursor pada mode commond 30 | command_bar_cursor = { 31 | enabled = true, 32 | cursor_shape = "ver30", -- "ver" menandakan bar vertikal, 30 adalah tinggi dalam persen 33 | }, 34 | }, 35 | }, 36 | keys = { 37 | { 38 | "", 39 | function() 40 | require("noice").redirect(vim.fn.getcmdline()) 41 | end, 42 | mode = "c", 43 | desc = "Redirect Cmdline", 44 | }, 45 | { 46 | "snl", 47 | function() 48 | require("noice").cmd("last") 49 | end, 50 | desc = "Noice Last Message", 51 | }, 52 | { 53 | "snh", 54 | function() 55 | require("noice").cmd("history") 56 | end, 57 | desc = "Noice History", 58 | }, 59 | { 60 | "sna", 61 | function() 62 | require("noice").cmd("all") 63 | end, 64 | desc = "Noice All", 65 | }, 66 | { 67 | "", 68 | function() 69 | if not require("noice.lsp").scroll(4) then 70 | return "" 71 | end 72 | end, 73 | silent = true, 74 | expr = true, 75 | desc = "Scroll forward", 76 | mode = { "i", "n", "s" }, 77 | }, 78 | { 79 | "", 80 | function() 81 | if not require("noice.lsp").scroll(-4) then 82 | return "" 83 | end 84 | end, 85 | silent = true, 86 | expr = true, 87 | desc = "Scroll backward", 88 | mode = { "i", "n", "s" }, 89 | }, 90 | }, 91 | }, 92 | { 93 | "hrsh7th/cmp-cmdline", 94 | event = "VeryLazy", 95 | config = function() 96 | local cmp = require("cmp") 97 | local mapping = { 98 | [""] = cmp.mapping.confirm({ select = true }), 99 | [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), 100 | [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "c" }), 101 | [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), 102 | [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "c" }), 103 | } 104 | 105 | -- Use buffer source for `/`. 106 | cmp.setup.cmdline("/", { 107 | preselect = "none", 108 | completion = { 109 | completeopt = "menu,preview,menuone,noselect", 110 | }, 111 | mapping = mapping, 112 | sources = { 113 | { name = "buffer" }, 114 | }, 115 | experimental = { 116 | ghost_text = true, 117 | native_menu = false, 118 | }, 119 | }) 120 | 121 | -- Use cmdline & path source for ':'. 122 | cmp.setup.cmdline(":", { 123 | preselect = "none", 124 | completion = { 125 | completeopt = "menu,preview,menuone,noselect", 126 | }, 127 | mapping = mapping, 128 | sources = cmp.config.sources({ 129 | { name = "path" }, 130 | }, { 131 | { name = "cmdline" }, 132 | }), 133 | experimental = { 134 | ghost_text = true, 135 | native_menu = false, 136 | }, 137 | }) 138 | end, 139 | }, 140 | } 141 | -------------------------------------------------------------------------------- /lua/pcode/plugins/coderunner.lua: -------------------------------------------------------------------------------- 1 | --typescript = "deno run", 2 | -- cpp="gcc $fileName -lstdc++ -o $fileNameWithoutExt && $fileNameWithoutExt" 3 | local pyrun = "python -u" 4 | if vim.fn.has("win32") == 0 then 5 | pyrun = "python3 -u" 6 | end 7 | local rfile = { 8 | java = "cd $dir && javac $fileName && java $fileNameWithoutExt", 9 | python = pyrun, 10 | typescript = "ts-node $dir/$fileName", 11 | rust = "cd $dir && rustc $fileName && $dir/$fileNameWithoutExt", 12 | cpp = "cd $dir && g++ $fileName -o $fileNameWithoutExt && $dir/$fileNameWithoutExt", 13 | scss = "sass $dir/$fileName $dir/$fileNameWithoutExt.css", 14 | javascript = 'node "$dir/$fileName"', 15 | go = "go run .", 16 | } 17 | 18 | return { 19 | "CRAG666/code_runner.nvim", 20 | lazy = true, 21 | cmd = { "RunCode", "RunFile", "RunProject", "RunClose" }, 22 | opts = { 23 | filetype = rfile, 24 | mode = "float", 25 | focus = true, 26 | startinsert = true, 27 | term = { 28 | position = "bot", 29 | size = 50, 30 | }, 31 | float = { 32 | close_key = "", 33 | border = "rounded", 34 | height = 0.8, 35 | width = 0.8, 36 | x = 0.5, 37 | y = 0.5, 38 | border_hl = "FloatBorder", 39 | float_hl = "Normal", 40 | blend = 0, 41 | }, 42 | }, 43 | config = function(_, opts) 44 | require("code_runner").setup(opts) 45 | end, 46 | keys = { 47 | { "r", "", desc = "  Run", mode = "n" }, 48 | { "rr", "RunCode", desc = "Run Code", mode = "n" }, 49 | { "rf", "RunFile", desc = "Run File", mode = "n" }, 50 | { "rp", "RunProject", desc = "Run Project", mode = "n" }, 51 | }, 52 | } 53 | -------------------------------------------------------------------------------- /lua/pcode/plugins/comment.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "numToStr/Comment.nvim", 3 | event = "VeryLazy", 4 | dependencies = { 5 | "JoosepAlviste/nvim-ts-context-commentstring", 6 | }, 7 | opts = function() 8 | return { 9 | pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), 10 | } 11 | end, 12 | keys = { 13 | { 14 | "/", 15 | "(comment_toggle_linewise_current)", 16 | desc = "󰆈 Coment line", 17 | mode = "n", 18 | }, 19 | { 20 | "/", 21 | "(comment_toggle_linewise_visual)", 22 | desc = "󰆈 Coment line", 23 | mode = "v", 24 | }, 25 | }, 26 | config = function(_, opts) 27 | require("Comment").setup(opts) 28 | end, 29 | } 30 | -------------------------------------------------------------------------------- /lua/pcode/plugins/conform.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "pojokcodeid/auto-conform.nvim", 3 | dependencies = { 4 | "williamboman/mason.nvim", 5 | "stevearc/conform.nvim", 6 | }, 7 | event = "VeryLazy", 8 | opts = function(_, opts) 9 | opts.formatters = opts.formatters or {} 10 | opts.formatters_by_ft = opts.formatters_by_ft or {} 11 | opts.ensure_installed = opts.ensure_installed or {} 12 | -- vim.list_extend(opts.ensure_installed, { "stylua" }) 13 | opts.lang_maps = opts.lang_maps or {} 14 | opts.name_maps = opts.name_maps or {} 15 | opts.add_new = opts.add_new or {} 16 | opts.ignore = opts.ignore or {} 17 | opts.format_on_save = opts.format_on_save or true 18 | opts.format_timeout_ms = opts.format_timeout_ms or 5000 19 | end, 20 | config = function(_, opts) 21 | require("auto-conform").setup(opts) 22 | -- other conform config 23 | local conform = require("conform") 24 | if opts.format_on_save then 25 | conform.setup({ 26 | format_on_save = { 27 | lsp_fallback = true, 28 | timeout_ms = opts.format_timeout_ms or 5000, 29 | }, 30 | }) 31 | end 32 | vim.keymap.set({ "n", "v" }, "lF", function() 33 | conform.format({ 34 | lsp_fallback = true, 35 | async = false, 36 | timeout_ms = opts.format_timeout_ms or 5000, 37 | }) 38 | end, { desc = "Format file or range (in visual mode)" }) 39 | end, 40 | } 41 | -------------------------------------------------------------------------------- /lua/pcode/plugins/dressing.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "stevearc/dressing.nvim", 3 | lazy = true, 4 | init = function() 5 | ---@diagnostic disable-next-line: duplicate-set-field 6 | vim.ui.select = function(...) 7 | require("lazy").load({ plugins = { "dressing.nvim" } }) 8 | return vim.ui.select(...) 9 | end 10 | ---@diagnostic disable-next-line: duplicate-set-field 11 | vim.ui.input = function(...) 12 | require("lazy").load({ plugins = { "dressing.nvim" } }) 13 | return vim.ui.input(...) 14 | end 15 | end, 16 | opts = { 17 | input = { 18 | title_pos = "center", 19 | relative = "editor", 20 | default_prompt = "➤ ", 21 | win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" }, 22 | prefer_width = 30, 23 | max_width = { 140, 0.9 }, 24 | min_width = { 50, 0.2 }, 25 | }, 26 | select = { 27 | backend = { "telescope", "builtin" }, 28 | builtin = { win_options = { winhighlight = "Normal:Normal,NormalNC:Normal" } }, 29 | }, 30 | }, 31 | config = function(_, opts) 32 | require("dressing").setup(opts) 33 | end, 34 | } 35 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/autosave.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "okuuva/auto-save.nvim", 3 | version = "^1.0.0", -- see https://devhints.io/semver, alternatively use '*' to use the latest tagged release 4 | cmd = "ASToggle", -- optional for lazy loading on command 5 | event = { "InsertLeave", "TextChanged" }, -- optional for lazy loading on trigger events 6 | opts = { 7 | enabled = true, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it) 8 | trigger_events = { -- See :h events 9 | immediate_save = { "BufLeave", "FocusLost" }, -- vim events that trigger an immediate save 10 | defer_save = { "InsertLeave", "TextChanged" }, -- vim events that trigger a deferred save (saves after `debounce_delay`) 11 | cancel_deferred_save = { "InsertEnter" }, -- vim events that cancel a pending deferred save 12 | }, 13 | -- function that takes the buffer handle and determines whether to save the current buffer or not 14 | -- return true: if buffer is ok to be saved 15 | -- return false: if it's not ok to be saved 16 | -- if set to `nil` then no specific condition is applied 17 | condition = nil, 18 | write_all_buffers = false, -- write all buffers when the current one meets `condition` 19 | noautocmd = false, -- do not execute autocmds when saving 20 | lockmarks = false, -- lock marks when saving, see `:h lockmarks` for more details 21 | debounce_delay = 1500, -- delay after which a pending save is executed 22 | -- log debug messages to 'auto-save.log' file in neovim cache directory, set to `true` to enable 23 | debug = false, 24 | }, 25 | config = function(_, opts) 26 | require("auto-save").setup(opts) 27 | local group = vim.api.nvim_create_augroup("autosave", {}) 28 | 29 | vim.api.nvim_create_autocmd("User", { 30 | pattern = "AutoSaveWritePost", 31 | group = group, 32 | callback = function(opts) 33 | local ftype = vim.bo.filetype 34 | if opts.data.saved_buffer ~= nil and ftype ~= "TelescopePrompt" and not substring(tostring(ftype), "dap") then 35 | local filename = vim.api.nvim_buf_get_name(opts.data.saved_buffer) 36 | local is_ok = pcall(require, "notify") 37 | if is_ok then 38 | require("notify")("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S")) 39 | else 40 | print("AutoSave: saved " .. filename .. " at " .. vim.fn.strftime("%H:%M:%S")) 41 | end 42 | end 43 | end, 44 | }) 45 | end, 46 | keys = { 47 | { "n", ":ASToggle", desc = "󰨚 Toggle auto-save" }, 48 | }, 49 | } 50 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/bigfiles.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "LunarVim/bigfile.nvim", 3 | lazy = true, 4 | event = "BufReadPre", 5 | opts = { 6 | file_size = 2, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/codeium.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "exafunction/codeium.vim", 3 | enabled = true, 4 | -- for fix notwork new version 5 | -- https://github.com/exafunction/codeium.vim/issues/376#issuecomment-2159643405 6 | -- version = "1.8.37", 7 | -- event = "bufwinenter", 8 | -- event = "bufenter", 9 | -- event = "insertenter", 10 | event = { "VeryLazy", "bufreadpre", "bufnewfile", "bufread" }, 11 | build = ":Codeium Auth", 12 | cmd = { "CodeiumChat" }, 13 | config = function() 14 | vim.g.codeium_disable_bindings = 1 15 | 16 | -- Change '' here to any keycode you like. 17 | vim.keymap.set("i", "", function() 18 | return vim.fn["codeium#Accept"]() 19 | end, { expr = true, silent = true }) 20 | vim.keymap.set("i", "", function() 21 | return vim.fn["codeium#CycleCompletions"](1) 22 | end, { expr = true, silent = true }) 23 | vim.keymap.set("i", "", function() 24 | return vim.fn["codeium#CycleCompletions"](-1) 25 | end, { expr = true, silent = true }) 26 | vim.keymap.set("i", "", function() 27 | return vim.fn["codeium#Clear"]() 28 | end, { expr = true, silent = true }) 29 | end, 30 | keys = { 31 | { "c", ":CodeiumChat", desc = "󰭹 codeium chat", mode = "n" }, 32 | }, 33 | } 34 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/codeiumnvim.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- codeium cmp source 3 | { 4 | "nvim-cmp", 5 | dependencies = { 6 | -- codeium 7 | { 8 | "Exafunction/codeium.nvim", 9 | cmd = "Codeium", 10 | enabled = false, 11 | build = ":Codeium Auth", 12 | opts = { 13 | enable_chat = true, 14 | }, 15 | }, 16 | }, 17 | --@param opts cmp.ConfigSchema 18 | opts = function(_, opts) 19 | table.insert(opts.sources, 1, { 20 | name = "codeium", 21 | group_index = 1, 22 | priority = 100, 23 | }) 24 | end, 25 | }, 26 | } 27 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/colorizer.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "NvChad/nvim-colorizer.lua", 3 | lazy = true, 4 | event = { "BufRead", "InsertEnter", "BufNewFile" }, 5 | opts = { 6 | user_default_options = { 7 | RGB = true, -- #RGB hex codes 8 | RRGGBB = true, -- #RRGGBB hex codes 9 | names = true, -- "Name" codes like Blue 10 | RRGGBBAA = true, -- #RRGGBBAA hex codes 11 | rgb_fn = true, -- CSS rgb() and rgba() functions 12 | hsl_fn = true, -- CSS hsl() and hsla() functions 13 | css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB 14 | css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn 15 | -- Available modes: foreground, background 16 | mode = "background", -- Set the display mode. 17 | tailwind = true, 18 | }, 19 | filetypes = { 20 | "*", -- Highlight all files, but customize some others. 21 | css = { rgb_fn = true }, -- Enable parsing rgb(...) functions in css. 22 | html = { names = false }, -- Disable parsing "names" like Blue or Gray 23 | }, 24 | }, 25 | } 26 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/dap.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "rcarriga/nvim-dap-ui", 4 | lazy = true, 5 | event = "BufRead", 6 | dependencies = { 7 | { "mfussenegger/nvim-dap", lazy = true }, 8 | { "nvim-neotest/nvim-nio", lazy = true }, 9 | { 10 | "theHamsta/nvim-dap-virtual-text", 11 | opts = { 12 | virt_text_win_col = 80, 13 | }, 14 | }, 15 | }, 16 | config = function() 17 | require("pcode.user.dapui") 18 | end, 19 | keys = { 20 | { "d", "", desc = "  Debug" }, 21 | { "dt", "lua require'dap'.toggle_breakpoint()", desc = "Toggle Breakpoint" }, 22 | { "db", "lua require'dap'.step_back()", desc = "Step Back" }, 23 | { "dc", "lua require'dap'.continue()", desc = "Continue" }, 24 | { "dC", "lua require'dap'.run_to_cursor()", desc = "Run To Cursor" }, 25 | { "dd", "lua require'dap'.disconnect()", desc = "Disconnect" }, 26 | { "dg", "lua require'dap'.session()", desc = "Get Session" }, 27 | { "di", "lua require'dap'.step_into()", desc = "Step Into" }, 28 | { "do", "lua require'dap'.step_over()", desc = "Step Over" }, 29 | { "du", "lua require'dap'.step_out()", desc = "Step Out" }, 30 | { "dp", "lua require'dap'.pause()", desc = "Pause" }, 31 | { "dr", "lua require'dap'.repl.toggle()", desc = "Toggle Repl" }, 32 | { "ds", "lua require'dap'.continue()", desc = "Start" }, 33 | { "dq", "lua require'dap'.close()", desc = "Quit" }, 34 | { "dU", "lua require'dapui'.toggle({reset = true})", desc = "Toggle UI" }, 35 | }, 36 | }, 37 | { 38 | "jay-babu/mason-nvim-dap.nvim", 39 | lazy = true, 40 | event = "BufRead", 41 | dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" }, 42 | opts = function(_, opts) 43 | opts.ensure_installed = opts.ensure_installed or {} 44 | vim.list_extend(opts.ensure_installed, {}) 45 | opts.automatic_setup = true 46 | opts.handlers = { 47 | function(config) 48 | -- all sources with no handler get passed here 49 | 50 | -- Keep original functionality 51 | require("mason-nvim-dap").default_setup(config) 52 | end, 53 | } 54 | return opts 55 | end, 56 | -- enabled = vim.fn.has("win32") == 0, 57 | config = function(_, opts) 58 | require("mason").setup() 59 | require("mason-nvim-dap").setup(opts) 60 | end, 61 | }, 62 | } 63 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/deviconcolor.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "rachartier/tiny-devicons-auto-colors.nvim", 3 | event = "VeryLazy", 4 | config = function() 5 | require("tiny-devicons-auto-colors").setup() 6 | end, 7 | } 8 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/illuminate.lua: -------------------------------------------------------------------------------- 1 | local M = { 2 | "RRethy/vim-illuminate", 3 | event = "VeryLazy", 4 | } 5 | 6 | M.opts = { 7 | delay = 200, 8 | large_file_cutoff = 2000, 9 | large_file_overrides = { 10 | providers = { "lsp" }, 11 | }, 12 | filetypes_denylist = { 13 | "mason", 14 | "harpoon", 15 | "DressingInput", 16 | "NeogitCommitMessage", 17 | "qf", 18 | "dirvish", 19 | "oil", 20 | "minifiles", 21 | "fugitive", 22 | "alpha", 23 | "NvimTree", 24 | "lazy", 25 | "NeogitStatus", 26 | "Trouble", 27 | "netrw", 28 | "lir", 29 | "DiffviewFiles", 30 | "Outline", 31 | "Jaq", 32 | "spectre_panel", 33 | "toggleterm", 34 | "DressingSelect", 35 | "TelescopePrompt", 36 | }, 37 | } 38 | 39 | function M.config(_, opts) 40 | require("illuminate").configure(opts) 41 | local function map(key, dir, buffer) 42 | vim.keymap.set("n", key, function() 43 | require("illuminate")["goto_" .. dir .. "_reference"](false) 44 | end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer }) 45 | end 46 | 47 | map("]]", "next") 48 | map("[[", "prev") 49 | 50 | -- also set it after loading ftplugins, since a lot overwrite [[ and ]] 51 | vim.api.nvim_create_autocmd("FileType", { 52 | callback = function() 53 | local buffer = vim.api.nvim_get_current_buf() 54 | map("]]", "next", buffer) 55 | map("[[", "prev", buffer) 56 | end, 57 | }) 58 | end 59 | 60 | M.keys = { 61 | { "]]", desc = "Next Reference" }, 62 | { "[[", desc = "Prev Reference" }, 63 | } 64 | 65 | return M 66 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/indentscupe.lua: -------------------------------------------------------------------------------- 1 | local icons = require("pcode.user.icons") 2 | return { 3 | "echasnovski/mini.indentscope", 4 | version = false, -- wait till new 0.7.0 release to put it back on semver 5 | event = "BufReadPre", 6 | opts = { 7 | symbol = icons.ui.LineMiddle, 8 | options = { try_as_border = true }, 9 | }, 10 | init = function() 11 | vim.api.nvim_create_autocmd("FileType", { 12 | pattern = { 13 | "alpha", 14 | "dashboard", 15 | "fzf", 16 | "help", 17 | "lazy", 18 | "lazyterm", 19 | "mason", 20 | "neo-tree", 21 | "NvimTree", 22 | "notify", 23 | "toggleterm", 24 | "Trouble", 25 | "trouble", 26 | }, 27 | callback = function() 28 | vim.b.miniindentscope_disable = true 29 | end, 30 | }) 31 | end, 32 | } 33 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/liveserver.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "barrett-ruth/live-server.nvim", 3 | build = "npm i -g live-server", 4 | cmd = { "LiveServerStart", "LiveServerStop", "LiveServerToggle" }, 5 | config = true, 6 | keys = { 7 | -- open http://localhost:5555/ jika menggunakan wsl 8 | { "rl", "LiveServerToggle", desc = "LiveServer" }, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/lspsignatur.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "ray-x/lsp_signature.nvim", 3 | event = "VeryLazy", 4 | opts = function() 5 | local is_enabled = true 6 | return { 7 | -- Window mode 8 | floating_window = is_enabled, -- Display it as floating window. 9 | hi_parameter = "IncSearch", -- Color to highlight floating window. 10 | handler_opts = { border = "rounded" }, -- Window style 11 | 12 | -- Hint mode 13 | hint_enable = false, -- Display it as hint. 14 | hint_prefix = "👈 ", 15 | 16 | -- Additionally, you can use uH to toggle inlay hints. 17 | toggle_key_flip_floatwin_setting = is_enabled, 18 | } 19 | end, 20 | config = function(_, opts) 21 | require("lsp_signature").setup(opts) 22 | end, 23 | } 24 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/minianimate.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- animations 3 | { 4 | "echasnovski/mini.animate", 5 | event = "BufRead", 6 | opts = function() 7 | -- don't use animate when scrolling with the mouse 8 | local mouse_scrolled = false 9 | for _, scroll in ipairs({ "Up", "Down" }) do 10 | local key = "" 11 | vim.keymap.set({ "", "i" }, key, function() 12 | mouse_scrolled = true 13 | return key 14 | end, { expr = true }) 15 | end 16 | 17 | local animate = require("mini.animate") 18 | return { 19 | resize = { 20 | timing = animate.gen_timing.linear({ duration = 100, unit = "total" }), 21 | }, 22 | scroll = { 23 | timing = animate.gen_timing.linear({ duration = 150, unit = "total" }), 24 | subscroll = animate.gen_subscroll.equal({ 25 | predicate = function(total_scroll) 26 | if mouse_scrolled then 27 | mouse_scrolled = false 28 | return false 29 | end 30 | return total_scroll > 1 31 | end, 32 | }), 33 | }, 34 | } 35 | end, 36 | config = function(_, opts) 37 | require("mini.animate").setup(opts) 38 | end, 39 | }, 40 | } 41 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/navic.lua: -------------------------------------------------------------------------------- 1 | local M = { 2 | "SmiteshP/nvim-navic", 3 | event = "VeryLazy", 4 | dependencies = { 5 | "LunarVim/breadcrumbs.nvim", 6 | opts = {}, 7 | config = true, 8 | }, 9 | } 10 | 11 | function M.config() 12 | local icons = require("pcode.user.icons").kind 13 | for key, value in pairs(icons) do 14 | icons[key] = value .. " " 15 | end 16 | require("nvim-navic").setup({ 17 | icons = icons, 18 | lsp = { 19 | auto_attach = true, 20 | preference = nil, 21 | }, 22 | highlight = false, 23 | separator = " > ", 24 | depth_limit = 0, 25 | depth_limit_indicator = "..", 26 | safe_output = true, 27 | lazy_update_context = false, 28 | click = false, 29 | format_text = function(text) 30 | return text 31 | end, 32 | }) 33 | end 34 | 35 | return M 36 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/neoscroll.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "karb94/neoscroll.nvim", 3 | event = "VeryLazy", 4 | lazy = true, 5 | config = function() 6 | require("neoscroll").setup({}) 7 | end, 8 | } 9 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/nvimmenu.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvchad/menu", 4 | lazy = true, 5 | event = { "VeryLazy" }, 6 | dependencies = { 7 | { "nvchad/volt", lazy = true }, 8 | { 9 | "nvchad/minty", 10 | cmd = { "Shades", "Huefy" }, 11 | lazy = true, 12 | }, 13 | }, 14 | opts = { 15 | mouse = true, 16 | border = true, 17 | }, 18 | config = function(_, opts) 19 | -- Keyboard users 20 | vim.keymap.set("n", "", function() 21 | require("menu").open("default") 22 | end, {}) 23 | 24 | -- mouse users + nvimtree users! 25 | vim.keymap.set("n", "", function() 26 | vim.cmd.exec('"normal! \\"') 27 | 28 | local options = vim.bo.ft == "NvimTree" and "nvimtree" or "default" 29 | require("menu").open(options, opts) 30 | end, {}) 31 | end, 32 | }, 33 | } 34 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/nvimufo.lua: -------------------------------------------------------------------------------- 1 | local M = { "kevinhwang91/nvim-ufo" } 2 | M.event = "VeryLazy" 3 | M.dependencies = { 4 | "kevinhwang91/promise-async", 5 | "luukvbaal/statuscol.nvim", 6 | } 7 | M.config = function() 8 | local builtin = require("statuscol.builtin") 9 | local cfg = { 10 | setopt = true, 11 | relculright = true, 12 | segments = { 13 | 14 | { text = { builtin.foldfunc, " " }, click = "v:lua.ScFa", hl = "Comment" }, 15 | 16 | { text = { "%s" }, click = "v:lua.ScSa" }, 17 | { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" }, 18 | }, 19 | } 20 | 21 | require("statuscol").setup(cfg) 22 | 23 | vim.o.foldcolumn = "1" -- '0' is not bad 24 | vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value 25 | vim.o.foldlevelstart = 99 26 | vim.o.foldenable = true 27 | vim.o.fillchars = [[eob: ,fold: ,foldopen:▾,foldsep: ,foldclose:▸]] 28 | 29 | -- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself 30 | vim.keymap.set("n", "zR", require("ufo").openAllFolds) 31 | vim.keymap.set("n", "zM", require("ufo").closeAllFolds) 32 | 33 | local handler = function(virtText, lnum, endLnum, width, truncate) 34 | local newVirtText = {} 35 | local suffix = (" 󰡏 %d "):format(endLnum - lnum) 36 | local sufWidth = vim.fn.strdisplaywidth(suffix) 37 | local targetWidth = width - sufWidth 38 | local curWidth = 0 39 | for _, chunk in ipairs(virtText) do 40 | local chunkText = chunk[1] 41 | local chunkWidth = vim.fn.strdisplaywidth(chunkText) 42 | if targetWidth > curWidth + chunkWidth then 43 | table.insert(newVirtText, chunk) 44 | else 45 | chunkText = truncate(chunkText, targetWidth - curWidth) 46 | local hlGroup = chunk[2] 47 | table.insert(newVirtText, { chunkText, hlGroup }) 48 | chunkWidth = vim.fn.strdisplaywidth(chunkText) 49 | -- str width returned from truncate() may less than 2nd argument, need padding 50 | if curWidth + chunkWidth < targetWidth then 51 | suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth) 52 | end 53 | break 54 | end 55 | curWidth = curWidth + chunkWidth 56 | end 57 | table.insert(newVirtText, { suffix, "MoreMsg" }) 58 | return newVirtText 59 | end 60 | 61 | local ftMap = { 62 | -- typescriptreact = { "lsp", "treesitter" }, 63 | -- python = { "indent" }, 64 | -- git = "", 65 | } 66 | 67 | require("ufo").setup({ 68 | fold_virt_text_handler = handler, 69 | close_fold_kinds = {}, 70 | -- close_fold_kinds = { "imports", "comment" }, 71 | provider_selector = function(bufnr, filetype, buftype) 72 | -- if you prefer treesitter provider rather than lsp, 73 | -- return ftMap[filetype] or {'treesitter', 'indent'} 74 | return ftMap[filetype] 75 | -- return { "treesitter", "indent" } 76 | 77 | -- refer to ./doc/example.lua for detail 78 | end, 79 | 80 | preview = { 81 | win_config = { 82 | border = { "", "─", "", "", "", "─", "", "" }, 83 | winhighlight = "Normal:Folded", 84 | winblend = 0, 85 | }, 86 | mappings = { 87 | scrollU = "", 88 | scrollD = "", 89 | jumpTop = "[", 90 | jumpBot = "]", 91 | }, 92 | }, 93 | }) 94 | 95 | vim.keymap.set("n", "zR", require("ufo").openAllFolds) 96 | vim.keymap.set("n", "zM", require("ufo").closeAllFolds) 97 | vim.keymap.set("n", "zr", require("ufo").openFoldsExceptKinds) 98 | vim.keymap.set("n", "zm", require("ufo").closeFoldsWith) -- closeAllFolds == closeFoldsWith(0) 99 | vim.keymap.set("n", "K", function() 100 | local winid = require("ufo").peekFoldedLinesUnderCursor() 101 | if not winid then 102 | vim.lsp.buf.hover() 103 | end 104 | end) 105 | end 106 | 107 | return M 108 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/rainbowdelimiters.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "hiphish/rainbow-delimiters.nvim", 3 | lazy = true, 4 | event = "BufRead", 5 | branch = "master", 6 | config = function() 7 | -- Modul ini berisi beberapa definisi default 8 | local rainbow_delimiters = require("rainbow-delimiters") 9 | vim.g.rainbow_delimiters = { 10 | strategy = { 11 | [""] = rainbow_delimiters.strategy["global"], 12 | vim = rainbow_delimiters.strategy["local"], 13 | }, 14 | query = { 15 | [""] = "rainbow-delimiters", 16 | -- lua = "rainbow-blocks", 17 | }, 18 | priority = { 19 | [""] = 110, 20 | lua = 210, 21 | }, 22 | highlight = { 23 | "RainbowDelimiterRed", 24 | "RainbowDelimiterYellow", 25 | "RainbowDelimiterBlue", 26 | "RainbowDelimiterOrange", 27 | "RainbowDelimiterGreen", 28 | "RainbowDelimiterViolet", 29 | "RainbowDelimiterCyan", 30 | }, 31 | blacklist = { 32 | "html", 33 | "tsx", 34 | }, 35 | } 36 | end, 37 | } 38 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/refactoring.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- Incremental rename 3 | { 4 | "smjonas/inc-rename.nvim", 5 | cmd = "IncRename", 6 | -- stylua: ignore 7 | keys = { 8 | {"u","",desc="  Edit"}, 9 | { 10 | "un", 11 | function() 12 | return ":IncRename " .. vim.fn.expand("") 13 | end, 14 | desc = "Incremental rename", 15 | mode = "n", 16 | noremap = true, 17 | expr = true, 18 | }, 19 | }, 20 | config = true, 21 | }, 22 | { 23 | "folke/noice.nvim", 24 | optional = true, 25 | opts = { 26 | presets = { inc_rename = true }, 27 | }, 28 | }, 29 | -- Refactoring tool 30 | { 31 | "ThePrimeagen/refactoring.nvim", 32 | keys = { 33 | { 34 | "r", 35 | function() 36 | require("refactoring").select_refactor({ 37 | show_success_message = true, 38 | }) 39 | end, 40 | mode = "v", 41 | noremap = true, 42 | silent = true, 43 | expr = false, 44 | desc = "  Refactoring", 45 | }, 46 | }, 47 | opts = {}, 48 | }, 49 | } 50 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/rest.lua: -------------------------------------------------------------------------------- 1 | vim.filetype.add({ 2 | extension = { 3 | ["http"] = "http", 4 | }, 5 | }) 6 | return { 7 | { 8 | "mistweaverco/kulala.nvim", 9 | ft = "http", 10 | keys = { 11 | { "R", "", desc = " 󰖟 Rest" }, 12 | { "Rs", "lua require('kulala').run()", desc = "Send the request" }, 13 | { "Rt", "lua require('kulala').toggle_view()", desc = "Toggle headers/body" }, 14 | { "Rp", "lua require('kulala').jump_prev()", desc = "Jump to previous request" }, 15 | { "Rn", "lua require('kulala').jump_next()", desc = "Jump to next request" }, 16 | }, 17 | opts = {}, 18 | }, 19 | { 20 | "nvim-treesitter/nvim-treesitter", 21 | opts = function(_, opts) 22 | opts.ensure_installed = opts.ensure_installed or {} 23 | vim.list_extend(opts.ensure_installed, { "http", "graphql" }) 24 | return opts 25 | end, 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/restnvim.lua: -------------------------------------------------------------------------------- 1 | -- install luarock 2 | -- sudo apt-get install luarocks lua5.4 (untuk linux) 3 | -- https://github.com/luarocks/luarocks/wiki/Installation-instructions-for-Windows 4 | 5 | -- manual penggunaan 6 | -- https://www.jetbrains.com/help/idea/exploring-http-syntax.html 7 | return { 8 | "rest-nvim/rest.nvim", 9 | -- NOTE: Follow https://github.com/rest-nvim/rest.nvim/issues/306 10 | -- commit = "91badd46c60df6bd9800c809056af2d80d33da4c", 11 | event = "VeryLazy", 12 | enabled = vim.fn.executable("luarocks") == 1, 13 | dependencies = { 14 | { 15 | "nvim-treesitter/nvim-treesitter", 16 | opts = function(_, opts) 17 | vim.list_extend(opts.ensure_installed, { "http" }) 18 | end, 19 | }, 20 | }, 21 | config = function() 22 | require("rest-nvim").setup() 23 | vim.api.nvim_create_autocmd("FileType", { 24 | pattern = { "http", "httpResult" }, 25 | callback = function() 26 | local opt = vim.opt 27 | opt.number = false -- Print line number 28 | opt.preserveindent = false -- Preserve indent structure as much as possible 29 | opt.relativenumber = false 30 | end, 31 | }) 32 | end, 33 | ft = "http", 34 | keys = { 35 | { 36 | "rh", 37 | "Rest run", 38 | desc = "Run http request under cursor", 39 | }, 40 | { 41 | "rH", 42 | "Rest last", 43 | desc = "Run last http request", 44 | }, 45 | }, 46 | } 47 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/scrollview.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "dstein64/nvim-scrollview", 3 | lazy = true, 4 | event = { "BufRead", "InsertEnter", "BufNewFile" }, 5 | opts = { 6 | bg = "LightCyan", 7 | ctermbg = 160, 8 | }, 9 | config = function(_, opts) 10 | require("scrollview").setup(opts) 11 | vim.g.scrollview_excluded_filetypes = { "NvimTree", "vista_kind", "Outline", "neo-tree" } 12 | end, 13 | } 14 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/smartsplit.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "mrjones2014/smart-splits.nvim", 3 | lazy = true, 4 | event = { "BufRead", "InsertEnter", "BufNewFile" }, 5 | opts = { 6 | ignored_filetypes = { 7 | "nofile", 8 | "quickfix", 9 | "qf", 10 | "prompt", 11 | }, 12 | ignored_buftypes = { "nofile" }, 13 | }, 14 | config = function(_, opts) 15 | require("smart-splits").setup(opts) 16 | vim.keymap.set("n", "", require("smart-splits").resize_left) 17 | vim.keymap.set("n", "", require("smart-splits").resize_down) 18 | vim.keymap.set("n", "", require("smart-splits").resize_right) 20 | end, 21 | } 22 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/telescopetreesiterinfo.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-telescope/telescope.nvim", 3 | dependencies = { 4 | "nvim-lua/plenary.nvim", 5 | "roycrippen4/telescope-treesitter-info.nvim", 6 | }, 7 | config = function() 8 | require("telescope").load_extension("treesitter_info") 9 | end, 10 | keys = { 11 | { "p", "Telescope treesitter_info", desc = "Treesitter Info" }, 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/transparent.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- transparant config 3 | { 4 | "xiyaowong/transparent.nvim", 5 | lazy = true, 6 | event = "BufWinEnter", 7 | cmd = { "TransparentToggle", "TransparentEnable", "TransparentDisable" }, 8 | config = function() 9 | require("transparent").setup({ 10 | extra_groups = { 11 | "Normal", 12 | "NormalNC", 13 | "NormalFloat", 14 | "FloatBorder", 15 | "Comment", 16 | "Folded", 17 | "GitSignsAdd", 18 | "GitSignsDelete", 19 | "GitSignsChange", 20 | "FoldColumn", 21 | "WinBar", 22 | "WinBarNC", 23 | "NotifyBackground", 24 | }, 25 | exclude_groups = { 26 | -- disable active selection backgroun 27 | "CursorLine", 28 | "CursorLineNR", 29 | "CursorLineSign", 30 | "CursorLineFold", 31 | -- disable nvimtree CursorLine 32 | "NvimTreeCursorLine", 33 | -- disable Neotree CursorLine 34 | "NeoTreeCursorLine", 35 | -- disable Telescope active selection background 36 | "TelescopeSelection", 37 | -- disable lualine background color 38 | "LualineNormal", 39 | }, 40 | }) 41 | require("transparent").clear_prefix("BufferLine") 42 | -- clear prefix for which-key 43 | require("transparent").clear_prefix("WhichKey") 44 | -- clear prefix for lazy.nvim 45 | require("transparent").clear_prefix("Lazy") 46 | -- clear prefix for NvimTree 47 | require("transparent").clear_prefix("NvimTree") 48 | -- clear prefix for NeoTree 49 | require("transparent").clear_prefix("NeoTree") 50 | -- clear prefix for Telescope 51 | require("transparent").clear_prefix("Telescope") 52 | require("transparent").clear_prefix("mason") 53 | -- create auto command to set transparent 54 | vim.cmd("TransparentDisable") 55 | vim.cmd("TransparentEnable") 56 | end, 57 | }, 58 | { 59 | "rcarriga/nvim-notify", 60 | opts = function(_, opts) 61 | opts.background_colour = "#00000000" 62 | end, 63 | }, 64 | } 65 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/treesittercontex.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-treesitter/nvim-treesitter-context", 3 | lazy = true, 4 | event = { "BufRead", "VeryLazy" }, 5 | opts = {}, 6 | keys = { 7 | { "T", "", desc = "  TS Context" }, 8 | { "Tt", "TSContextToggle", desc = "Toggle Context" }, 9 | }, 10 | } 11 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/verticalcolumn.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "lukas-reineke/virt-column.nvim", 4 | event = "BufRead", 5 | opts = {}, 6 | config = function() 7 | local icons = require("pcode.user.icons") 8 | require("virt-column").overwrite({ 9 | exclude = { 10 | filetypes = { "help", "text", "markdown" }, 11 | }, 12 | char = icons.ui.LineMiddle, 13 | }) 14 | -- Mengatur colum color max 80 caracter 15 | vim.api.nvim_create_autocmd("BufWinEnter", { 16 | pattern = "*", 17 | callback = function() 18 | vim.opt.formatoptions = "croql" 19 | vim.opt.textwidth = 80 20 | vim.opt.colorcolumn = "+1" 21 | vim.opt.lazyredraw = false 22 | -- vim.cmd "hi ColorColumn guibg=#1B2430 ctermbg=246" 23 | end, 24 | }) 25 | end, 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/visualmulti.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "mg979/vim-visual-multi", 3 | event = { "BufRead", "InsertEnter", "BufNewFile" }, 4 | branch = "master", 5 | lazy = true, 6 | init = function() 7 | vim.g.VM_mouse_mappings = 1 -- equal CTRL + Left Click on VSCODE 8 | vim.g.VM_maps = { 9 | ["Find Under"] = "", -- equal CTRL+D on VSCODE 10 | ["Find Subword Under"] = "", -- equal CTRL+D on VSCODE 11 | ["Select Cursor Down"] = "", -- equal CTRL+ALT+DOWN on VSCODE 12 | ["Select Cursor Up"] = "", -- equal CTRL+ALT+UP on VSCODE 13 | ["Undo"] = "u", -- undo 14 | ["Redo"] = "", -- redo 15 | } 16 | end, 17 | } 18 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/yanky.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "gbprod/yanky.nvim", 3 | event = "BufReadPre", 4 | opts = { 5 | ring = { 6 | history_length = 50, 7 | storage = "memory", 8 | }, 9 | preserve_cursor_position = { 10 | enabled = false, 11 | }, 12 | }, 13 | config = function(_, opts) 14 | require("yanky").setup(opts) 15 | -- cycle through the yank history, only work after paste 16 | vim.keymap.set("n", "[y", "(YankyCycleForward)") 17 | vim.keymap.set("n", "]y", "(YankyCycleBackward)") 18 | end, 19 | } 20 | -------------------------------------------------------------------------------- /lua/pcode/plugins/extras/zenmode.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/zen-mode.nvim", 3 | event = "VeryLazy", 4 | opts = { 5 | plugins = { 6 | options = { 7 | -- hide statusline 8 | laststatus = 0, 9 | }, 10 | }, 11 | on_open = function(win) 12 | require("notify")("Zen Mode ON") 13 | end, 14 | on_close = function() 15 | require("notify")("Zen Mode OFF") 16 | end, 17 | }, 18 | keys = { 19 | { "z", "ZenMode", desc = "󰤼 Toggle Zen Mode" }, 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /lua/pcode/plugins/gitsign.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "lewis6991/gitsigns.nvim", 3 | lazy = true, 4 | enabled = vim.fn.executable("git") == 1, 5 | ft = "gitcommit", 6 | event = "BufRead", 7 | opts = { 8 | signs = { 9 | add = { text = "▎" }, 10 | change = { text = "▎" }, 11 | delete = { text = "" }, 12 | topdelete = { text = "" }, 13 | changedelete = { text = "▎" }, 14 | untracked = { text = "▎" }, 15 | }, 16 | signcolumn = true, 17 | numhl = false, 18 | linehl = false, 19 | word_diff = false, 20 | watch_gitdir = { 21 | interval = 1000, 22 | follow_files = true, 23 | }, 24 | attach_to_untracked = true, 25 | current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` 26 | current_line_blame_opts = { 27 | virt_text = true, 28 | virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' 29 | delay = 1000, 30 | ignore_whitespace = false, 31 | }, 32 | current_line_blame_formatter = ", - ", 33 | sign_priority = 6, 34 | status_formatter = nil, -- Use default 35 | update_debounce = 200, 36 | max_file_length = 40000, 37 | preview_config = { 38 | -- Options passed to nvim_open_win 39 | border = "rounded", 40 | style = "minimal", 41 | relative = "cursor", 42 | row = 0, 43 | col = 1, 44 | }, 45 | }, 46 | config = function(_, opts) 47 | require("gitsigns").setup(opts) 48 | end, 49 | -- stylua: ignore 50 | keys = { 51 | { "g", "", desc = "  Git" }, 52 | { "gg",function()LAZYGIT_TOGGLE()end,desc = "Lazygit"}, 53 | { "gj",function()require("gitsigns").next_hunk()end,desc = "Next Hunk"}, 54 | { "gk",function()require("gitsigns").prev_hunk()end,desc = "Prev Hunk"}, 55 | { "gl",function()require("gitsigns").blame_line()end,desc = "Blame"}, 56 | { "gp",function()require("gitsigns").preview_hunk()end,desc = "Preview Hunk"}, 57 | { "gr",function()require("gitsigns").reset_hunk()end,desc = "Reset Hunk"}, 58 | { "gR",function()require("gitsigns").reset_buffer()end,desc = "Reset Buffer"}, 59 | { "gs",function()require("gitsigns").stage_hunk()end,desc = "Stage Hunge"}, 60 | { "gu",function()require("gitsigns").undo_stage_hunk()end,desc = "Undo Stage Hunge"}, 61 | { "go","Telescope git_status",desc = "Opened Changed File"}, 62 | { "gb","Telescope git_branches",desc = "Checkout Branch"}, 63 | { "gc","Telescope git_commits",desc = "Checkout Commit"}, 64 | { "gd","Gitsigns diffthis HEAD",desc = "Diff"}, 65 | }, 66 | } 67 | -------------------------------------------------------------------------------- /lua/pcode/plugins/indentblakline.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "lukas-reineke/indent-blankline.nvim", 3 | -- version = "3.5.4", 4 | event = { "BufRead", "InsertEnter", "BufNewFile" }, 5 | lazy = true, 6 | opts = { 7 | indent = { 8 | char = "│", 9 | tab_char = "│", 10 | }, 11 | scope = { enabled = false }, 12 | exclude = { 13 | buftypes = { 14 | "nofile", 15 | "prompt", 16 | "quickfix", 17 | "terminal", 18 | }, 19 | filetypes = { 20 | "help", 21 | "alpha", 22 | "dashboard", 23 | "neo-tree", 24 | "Trouble", 25 | "trouble", 26 | "lazy", 27 | "mason", 28 | "notify", 29 | "toggleterm", 30 | "lazyterm", 31 | "NvimTree", 32 | "aerial", 33 | "neogitstatus", 34 | "startify", 35 | }, 36 | }, 37 | }, 38 | main = "ibl", 39 | } 40 | -------------------------------------------------------------------------------- /lua/pcode/plugins/lang/angular.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter", 4 | opts = function(_, opts) 5 | if type(opts.ensure_installed) == "table" then 6 | vim.list_extend(opts.ensure_installed, { "angular", "scss", "typescript" }) 7 | end 8 | vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, { 9 | pattern = { "*.component.html", "*.container.html" }, 10 | callback = function() 11 | vim.treesitter.start(nil, "angular") 12 | end, 13 | }) 14 | end, 15 | }, 16 | { 17 | "williamboman/mason-lspconfig.nvim", 18 | opts = function(_, opts) 19 | opts.ensure_installed = opts.ensure_installed or {} 20 | vim.list_extend(opts.ensure_installed, { "angularls", "ts_ls" }) 21 | end, 22 | }, 23 | { 24 | "williamboman/mason.nvim", 25 | opts = { 26 | ensure_installed = { "prettier" }, 27 | }, 28 | }, 29 | } 30 | -------------------------------------------------------------------------------- /lua/pcode/plugins/lang/cpp.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/nvim-treesitter", 4 | event = "VeryLazy", 5 | opts = function(_, opts) 6 | opts.ensure_installed = opts.ensure_installed or {} 7 | vim.list_extend(opts.ensure_installed, { "cpp", "c" }) 8 | end, 9 | }, 10 | { 11 | "williamboman/mason-lspconfig.nvim", 12 | opts = function(_, opts) 13 | opts.ensure_installed = opts.ensure_installed or {} 14 | vim.list_extend(opts.ensure_installed, { "clangd" }) 15 | end, 16 | }, 17 | { 18 | "jay-babu/mason-nvim-dap.nvim", 19 | event = "VeryLazy", 20 | opts = function(_, opts) 21 | opts.ensure_installed = opts.ensure_installed or {} 22 | vim.list_extend(opts.ensure_installed, { "codelldb" }) 23 | end, 24 | }, 25 | { 26 | "pojokcodeid/auto-conform.nvim", 27 | event = "VeryLazy", 28 | opts = function(_, opts) 29 | local package = "clang-format" 30 | vim.list_extend(opts.ensure_installed, { package }) 31 | opts.formatters_by_ft.cpp = { package } 32 | opts.formatters_by_ft.c = { package } 33 | end, 34 | }, 35 | { 36 | "nvim-neotest/neotest", 37 | ft = { "cpp" }, 38 | dependencies = { 39 | "nvim-treesitter/nvim-treesitter", 40 | "nvim-neotest/nvim-nio", 41 | "antoinemadec/FixCursorHold.nvim", 42 | "nvim-lua/plenary.nvim", 43 | "alfaix/neotest-gtest", 44 | }, 45 | config = function() 46 | require("neotest").setup({ 47 | adapters = { 48 | require("neotest-gtest").setup({}), 49 | }, 50 | }) 51 | end, 52 | -- stylua: ignore 53 | keys = { 54 | { "T","",desc="  Test"}, 55 | { "Tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, 56 | { "Tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, 57 | { "TT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" }, 58 | { "Tl", function() require("neotest").run.run_last() end, desc = "Run Last" }, 59 | { "Ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" }, 60 | { "To", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" }, 61 | { "TO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" }, 62 | { "TS", function() require("neotest").run.stop() end, desc = "Stop" }, 63 | { "rc", "terminalg++ --debug main.cpp -o main", desc = "Compile Debug main.cpp" }, 64 | }, 65 | }, 66 | } 67 | -------------------------------------------------------------------------------- /lua/pcode/plugins/lang/deno.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/nvim-treesitter", 4 | opts = function(_, opts) 5 | opts.ensure_installed = opts.ensure_installed or {} 6 | vim.list_extend( 7 | opts.ensure_installed, 8 | { "html", "javascript", "typescript", "tsx", "css", "json", "jsonc" } 9 | ) 10 | end, 11 | }, 12 | { 13 | "williamboman/mason-lspconfig.nvim", 14 | opts = function(_, opts) 15 | opts.ensure_installed = opts.ensure_installed or {} 16 | vim.list_extend(opts.ensure_installed, { "html", "eslint", "cssls", "emmet_ls", "jsonls", "denols" }) 17 | end, 18 | }, 19 | { 20 | "pojokcodeid/auto-conform.nvim", 21 | event = "VeryLazy", 22 | opts = function(_, opts) 23 | opts.formatters_by_ft = opts.formatters_by_ft or {} 24 | local package = "prettier" 25 | vim.list_extend(opts.ensure_installed, { package }) 26 | opts.formatters_by_ft.javascript = { package } 27 | end, 28 | }, 29 | { 30 | "pojokcodeid/auto-lint.nvim", 31 | opts = function(_, opts) 32 | opts.linters_by_ft = opts.linters_by_ft or {} 33 | vim.list_extend(opts.ensure_installed, { "eslint_d" }) 34 | opts.linters_by_ft.javascript = { "eslint_d" } 35 | end, 36 | }, 37 | { 38 | "rcarriga/nvim-dap-ui", 39 | lazy = true, 40 | event = "BufRead", 41 | dependencies = { 42 | { "mfussenegger/nvim-dap", lazy = true }, 43 | { "nvim-neotest/nvim-nio", lazy = true }, 44 | { 45 | "mxsdev/nvim-dap-vscode-js", 46 | dependencies = { 47 | "microsoft/vscode-js-debug", 48 | version = "1.x", 49 | build = "npm i && npm run compile vsDebugServerBundle && mv dist out", 50 | }, 51 | config = function() 52 | require("dap-vscode-js").setup({ 53 | -- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node" 54 | debugger_path = vim.fn.stdpath("data") .. "/lazy/vscode-js-debug", 55 | -- debugger_cmd = { "extension" }, -- Command to use to launch the debug server. Takes precedence over `node_path` and `debugger_path`. 56 | adapters = { 57 | "chrome", 58 | "pwa-node", 59 | "pwa-chrome", 60 | "pwa-msedge", 61 | "node-terminal", 62 | "pwa-extensionHost", 63 | "node", 64 | "chrome", 65 | }, -- which adapters to register in nvim-dap 66 | -- log_file_path = "(stdpath cache)/dap_vscode_js.log" -- Path for file logging 67 | -- log_file_level = false -- Logging level for output to file. Set to false to disable file logging. 68 | -- log_console_level = vim.log.levels.ERROR -- Logging level for output to console. Set to false to disable console output. 69 | }) 70 | end, 71 | }, 72 | }, 73 | config = function() 74 | require("pcode.user.dapui") 75 | local js_based_languages = { "typescript" } 76 | 77 | for _, language in ipairs(js_based_languages) do 78 | require("dap").configurations[language] = { 79 | { 80 | type = "pwa-node", 81 | request = "launch", 82 | name = "Launch file", 83 | runtimeExecutable = "deno", 84 | runtimeArgs = { 85 | "run", 86 | "--inspect-wait", 87 | "--allow-all", 88 | }, 89 | program = "${file}", 90 | cwd = "${workspaceFolder}", 91 | attachSimplePort = 9229, 92 | }, 93 | } 94 | end 95 | end, 96 | -- stylua: ignor 97 | keys = { 98 | { "d", "", desc = "  Debug" }, 99 | { "dt", "lua require'dap'.toggle_breakpoint()", desc = "Toggle Breakpoint" }, 100 | { "db", "lua require'dap'.step_back()", desc = "Step Back" }, 101 | { "dc", "lua require'dap'.continue()", desc = "Continue" }, 102 | { "dC", "lua require'dap'.run_to_cursor()", desc = "Run To Cursor" }, 103 | { "dd", "lua require'dap'.disconnect()", desc = "Disconnect" }, 104 | { "dg", "lua require'dap'.session()", desc = "Get Session" }, 105 | { "di", "lua require'dap'.step_into()", desc = "Step Into" }, 106 | { "do", "lua require'dap'.step_over()", desc = "Step Over" }, 107 | { "du", "lua require'dap'.step_out()", desc = "Step Out" }, 108 | { "dp", "lua require'dap'.pause()", desc = "Pause" }, 109 | { "dr", "lua require'dap'.repl.toggle()", desc = "Toggle Repl" }, 110 | { "ds", "lua require'dap'.continue()", desc = "Start" }, 111 | { "dq", "lua require'dap'.close()", desc = "Quit" }, 112 | { "dU", "lua require'dapui'.toggle({reset = true})", desc = "Toggle UI" }, 113 | { "T", "", desc = "  Test" }, 114 | { "Tr", "terminal deno test", desc = "Run Test" }, 115 | { "Tp", "terminal deno test --parallel", desc = "Run Parallel" }, 116 | { 117 | "Ts", 118 | function() 119 | vim.cmd("terminal deno test " .. vim.fn.expand("%")) 120 | end, 121 | desc = "Run Current File", 122 | }, 123 | { 124 | "Tu", 125 | function() 126 | -- local current_word = vim.fn.expand("") 127 | local extracted_text = "" 128 | local input = vim.fn.getline(".") 129 | local contains_double_quotes = input:match('"') 130 | local contains_single_quotes = input:match("'") 131 | if contains_double_quotes then 132 | -- process jika ada double quote 133 | input = input:gsub('"', "'") 134 | local start_index, end_index = input:find("'([^']*)'") -- Mencari teks di dalam tanda petik satu 135 | extracted_text = input:sub(start_index, end_index) 136 | elseif contains_single_quotes then 137 | input = input:gsub('"', "'") 138 | local start_index, end_index = input:find("'([^']*)'") -- Mencari teks di dalam tanda petik satu 139 | extracted_text = input:sub(start_index, end_index) 140 | else 141 | extracted_text = (input:gsub("Deno.test%(function", "")):gsub("%(%) %{", "") 142 | end 143 | vim.cmd("terminal deno test --filter " .. extracted_text) 144 | end, 145 | desc = "Run Under Cursor", 146 | }, 147 | }, 148 | }, 149 | } 150 | -------------------------------------------------------------------------------- /lua/pcode/plugins/lang/golang.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/nvim-treesitter", 4 | opts = function(_, opts) 5 | opts.ensure_installed = opts.ensure_installed or {} 6 | vim.list_extend(opts.ensure_installed, { "go", "gomod", "gosum", "gotmpl", "gowork" }) 7 | end, 8 | }, 9 | { 10 | "williamboman/mason-lspconfig.nvim", 11 | opts = function(_, opts) 12 | opts.ensure_installed = opts.ensure_installed or {} 13 | vim.list_extend(opts.ensure_installed, { "gopls" }) 14 | end, 15 | }, 16 | { 17 | "pojokcodeid/auto-conform.nvim", 18 | event = "VeryLazy", 19 | opts = function(_, opts) 20 | local package = "gofumpt" 21 | vim.list_extend(opts.ensure_installed, { package }) 22 | opts.formatters_by_ft.gofumpt = { package } 23 | end, 24 | }, 25 | { 26 | "pojokcodeid/auto-lint.nvim", 27 | opts = function(_, opts) 28 | opts.linters_by_ft = opts.linters_by_ft or {} 29 | vim.list_extend(opts.ensure_installed, { "golangci-lint" }) 30 | opts.linters_by_ft.php = { "golangci-lint" } 31 | end, 32 | }, 33 | { 34 | "nvim-neotest/neotest", 35 | event = "VeryLazy", 36 | dependencies = { 37 | "nvim-lua/plenary.nvim", 38 | "antoinemadec/FixCursorHold.nvim", 39 | "nvim-treesitter/nvim-treesitter", 40 | 41 | "nvim-neotest/neotest-plenary", 42 | "nvim-neotest/neotest-vim-test", 43 | 44 | "nvim-neotest/nvim-nio", 45 | 46 | { 47 | "fredrikaverpil/neotest-golang", 48 | dependencies = { 49 | { 50 | "leoluz/nvim-dap-go", 51 | opts = {}, 52 | }, 53 | }, 54 | branch = "main", 55 | }, 56 | }, 57 | opts = function(_, opts) 58 | opts.adapters = opts.adapters or {} 59 | opts.adapters["neotest-golang"] = { 60 | go_test_args = { 61 | "-v", 62 | "-race", 63 | "-count=1", 64 | "-timeout=60s", 65 | "-coverprofile=" .. vim.fn.getcwd() .. "/coverage.out", 66 | }, 67 | dap_go_enabled = true, 68 | } 69 | end, 70 | config = function(_, opts) 71 | if opts.adapters then 72 | local adapters = {} 73 | for name, config in pairs(opts.adapters or {}) do 74 | if type(name) == "number" then 75 | if type(config) == "string" then 76 | config = require(config) 77 | end 78 | adapters[#adapters + 1] = config 79 | elseif config ~= false then 80 | local adapter = require(name) 81 | if type(config) == "table" and not vim.tbl_isempty(config) then 82 | local meta = getmetatable(adapter) 83 | if adapter.setup then 84 | adapter.setup(config) 85 | elseif meta and meta.__call then 86 | adapter(config) 87 | else 88 | error("Adapter " .. name .. " does not support setup") 89 | end 90 | end 91 | adapters[#adapters + 1] = adapter 92 | end 93 | end 94 | opts.adapters = adapters 95 | end 96 | 97 | require("neotest").setup(opts) 98 | end, 99 | -- stylua: ignore 100 | keys = { 101 | { "T","",desc="  Test"}, 102 | { "Ta", function() require("neotest").run.attach() end, desc = "[t]est [a]ttach" }, 103 | { "Tf", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "[t]est run [f]ile" }, 104 | { "TA", function() require("neotest").run.run(vim.uv.cwd()) end, desc = "[t]est [A]ll files" }, 105 | { "TS", function() require("neotest").run.run({ suite = true }) end, desc = "[t]est [S]uite" }, 106 | { "Tn", function() require("neotest").run.run() end, desc = "[t]est [n]earest" }, 107 | { "Tl", function() require("neotest").run.run_last() end, desc = "[t]est [l]ast" }, 108 | { "Ts", function() require("neotest").summary.toggle() end, desc = "[t]est [s]ummary" }, 109 | { "To", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "[t]est [o]utput" }, 110 | { "TO", function() require("neotest").output_panel.toggle() end, desc = "[t]est [O]utput panel" }, 111 | { "Tt", function() require("neotest").run.stop() end, desc = "[t]est [t]erminate" }, 112 | { "Td", function() require("neotest").run.run({ suite = false, strategy = "dap" }) end, desc = "Debug nearest test" }, 113 | }, 114 | }, 115 | { 116 | "rcarriga/nvim-dap-ui", 117 | lazy = true, 118 | event = "BufRead", 119 | dependencies = { 120 | { "mfussenegger/nvim-dap", lazy = true }, 121 | { "nvim-neotest/nvim-nio", lazy = true }, 122 | { 123 | "theHamsta/nvim-dap-virtual-text", 124 | opts = { 125 | virt_text_win_col = 80, 126 | }, 127 | }, 128 | }, 129 | config = function() 130 | require("pcode.user.dapui") 131 | end, 132 | keys = { 133 | { "d", "", desc = "  Debug" }, 134 | { "dt", "lua require'dap'.toggle_breakpoint()", desc = "Toggle Breakpoint" }, 135 | { "db", "lua require'dap'.step_back()", desc = "Step Back" }, 136 | { "dc", "lua require'dap'.continue()", desc = "Continue" }, 137 | { "dC", "lua require'dap'.run_to_cursor()", desc = "Run To Cursor" }, 138 | { "dd", "lua require'dap'.disconnect()", desc = "Disconnect" }, 139 | { "dg", "lua require'dap'.session()", desc = "Get Session" }, 140 | { "di", "lua require'dap'.step_into()", desc = "Step Into" }, 141 | { "do", "lua require'dap'.step_over()", desc = "Step Over" }, 142 | { "du", "lua require'dap'.step_out()", desc = "Step Out" }, 143 | { "dp", "lua require'dap'.pause()", desc = "Pause" }, 144 | { "dr", "lua require'dap'.repl.toggle()", desc = "Toggle Repl" }, 145 | { "ds", "lua require'dap'.continue()", desc = "Start" }, 146 | { "dq", "lua require'dap'.close()", desc = "Quit" }, 147 | { "dU", "lua require'dapui'.toggle({reset = true})", desc = "Toggle UI" }, 148 | }, 149 | }, 150 | { 151 | "jay-babu/mason-nvim-dap.nvim", 152 | lazy = true, 153 | event = "BufRead", 154 | dependencies = { "williamboman/mason.nvim", "mfussenegger/nvim-dap" }, 155 | config = function() 156 | require("mason-nvim-dap").setup({ 157 | automatic_installation = true, 158 | automatic_setup = true, 159 | handlers = {}, 160 | ensure_installed = { "delve" }, 161 | }) 162 | end, 163 | }, 164 | } 165 | -------------------------------------------------------------------------------- /lua/pcode/plugins/lang/java.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | M = { 3 | { 4 | "williamboman/mason-lspconfig.nvim", 5 | opts = function(_, opts) 6 | opts.skip_config = opts.skip_config or {} 7 | vim.list_extend(opts.skip_config, { "jdtls" }) 8 | end, 9 | }, 10 | { 11 | "pojokcodeid/auto-java-project.nvim", 12 | event = "VeryLazy", 13 | config = function() 14 | require("auto-java-project").setup() 15 | vim.keymap.set("n", "Jc", ":CreateJavaClass", { desc = "Create Java Class" }) 16 | vim.keymap.set("n", "Jm", ":CreateJavaMainClass", { desc = "Create Java Main Class" }) 17 | vim.keymap.set("n", "Ji", ":CreateJavaInterface", { desc = "Create Java Interface" }) 18 | end, 19 | }, 20 | { 21 | "mfussenegger/nvim-jdtls", 22 | dependencies = { "pojokcodeid/auto-jdtls.nvim" }, 23 | ft = { "java" }, 24 | -- your opts go here 25 | opts = {}, 26 | config = function(_, opts) 27 | require("auto-jdtls").setup(opts) 28 | require("auto-jdtls.utils").lsp_keymaps() 29 | require("auto-jdtls.utils").jdtls_keymaps() 30 | vim.keymap.set("n", "rM", ":RunMvnSpringBoot", { desc = "Run Maven Sping Boot" }) 31 | vim.keymap.set("n", "rG", ":RunGradleSpringBoot", { desc = "Run Gradle Sping Boot" }) 32 | vim.keymap.set("n", "rm", ":RunMaven", { desc = "Run Maven Project" }) 33 | vim.keymap.set("n", "rg", ":RunGradle", { desc = "Run Gradle Project" }) 34 | end, 35 | }, 36 | { 37 | "nvim-neotest/neotest", 38 | dependencies = { 39 | "nvim-neotest/nvim-nio", 40 | "nvim-lua/plenary.nvim", 41 | "antoinemadec/FixCursorHold.nvim", 42 | "nvim-treesitter/nvim-treesitter", 43 | "andy-bell101/neotest-java", 44 | }, 45 | -- enabled = vim.fn.findfile("build.gradle", vim.fn.getcwd()) == "build.gradle" or false, 46 | config = function() 47 | require("auto-jdtls.create_maven_project") 48 | require("neotest").setup({ 49 | adapters = { 50 | require("neotest-java"), 51 | }, 52 | }) 53 | end, 54 | -- stylua: ignore 55 | keys = { 56 | { "T","",desc="  Test"}, 57 | { "Tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, 58 | { "Tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, 59 | { "TT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" }, 60 | { "Tl", function() require("neotest").run.run_last() end, desc = "Run Last" }, 61 | { "Ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" }, 62 | { "To", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" }, 63 | { "TO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" }, 64 | { "TS", function() require("neotest").run.stop() end, desc = "Stop" }, 65 | }, 66 | }, 67 | { 68 | "rockerBOO/symbols-outline.nvim", 69 | cmd = "SymbolsOutline", 70 | config = function() 71 | local icons = require("pcode.user.icons").kind 72 | require("symbols-outline").setup({ 73 | symbols = { 74 | File = { icon = icons.File, hl = "@text.uri" }, 75 | Module = { icon = icons.Module, hl = "@namespace" }, 76 | Namespace = { icon = icons.Namespace, hl = "@namespace" }, 77 | Package = { icon = icons.Package, hl = "@namespace" }, 78 | Class = { icon = icons.Class, hl = "@type" }, 79 | Method = { icon = icons.Method, hl = "@method" }, 80 | Property = { icon = icons.Property, hl = "@method" }, 81 | Field = { icon = icons.Field, hl = "@field" }, 82 | Constructor = { icon = icons.Constructor, hl = "@constructor" }, 83 | Enum = { icon = icons.Enum, hl = "@type" }, 84 | Interface = { icon = icons.Interface, hl = "@type" }, 85 | Function = { icon = icons.Function, hl = "@function" }, 86 | Variable = { icon = icons.Variable, hl = "@constant" }, 87 | Constant = { icon = icons.Constant, hl = "@constant" }, 88 | String = { icon = icons.String, hl = "@string" }, 89 | Number = { icon = icons.Number, hl = "@number" }, 90 | Boolean = { icon = icons.Boolean, hl = "@boolean" }, 91 | Array = { icon = icons.Array, hl = "@constant" }, 92 | Object = { icon = icons.Object, hl = "@type" }, 93 | Key = { icon = icons.Key, hl = "@type" }, 94 | Null = { icon = icons.Null, hl = "@type" }, 95 | EnumMember = { icon = icons.EnumMember, hl = "@field" }, 96 | Struct = { icon = icons.Struct, hl = "@type" }, 97 | Event = { icon = icons.Event, hl = "@type" }, 98 | Operator = { icon = icons.Operator, hl = "@operator" }, 99 | TypeParameter = { icon = icons.TypeParameter, hl = "@parameter" }, 100 | Component = { icon = icons.Component, hl = "@function" }, 101 | Fragment = { icon = icons.Fragment, hl = "@constant" }, 102 | }, 103 | }) 104 | end, 105 | keys = { 106 | { "Js", "SymbolsOutline", desc = "Toggle Outline" }, 107 | }, 108 | }, 109 | } 110 | 111 | return M 112 | -------------------------------------------------------------------------------- /lua/pcode/plugins/lang/java2.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-java/nvim-java", 3 | -- event = "VeryLazy", 4 | ft = { "java" }, 5 | dependencies = { 6 | "MunifTanjim/nui.nvim", 7 | "neovim/nvim-lspconfig", 8 | "mfussenegger/nvim-dap", 9 | "williamboman/mason.nvim", 10 | }, 11 | config = function() 12 | require("java").setup({ 13 | notifications = { 14 | dap = false, 15 | }, 16 | jdk = { 17 | auto_install = false, 18 | }, 19 | }) 20 | require("lspconfig").jdtls.setup({ 21 | settings = { 22 | java = { 23 | configuration = { 24 | runtimes = { 25 | { 26 | name = "JavaSE-17", 27 | path = os.getenv("JAVA_HOME") or "", 28 | default = true, 29 | }, 30 | }, 31 | }, 32 | }, 33 | }, 34 | }) 35 | end, 36 | keys = { 37 | { "rg", "", desc = "Gradle" }, 38 | { "rgp", "JavaProfile", desc = "Java Profile" }, 39 | { "rgg", "terminalgradle run", desc = "Run Gradle" }, 40 | { "rgb", "JavaBuildBuildWorkspace", desc = "Java Build Workspace" }, 41 | { "rgd", "JavaDapConfig", desc = "Java Configure DAP" }, 42 | { "T", "", desc = "Test" }, 43 | { "Tc", "JavaTestRunCurrentClass", desc = "Test Current Class" }, 44 | { "Tm", "JavaTestRunCurrentMethod", desc = "Test Current Method" }, 45 | { "Th", "JavaTestViewLastReport", desc = "View Test Last Report" }, 46 | }, 47 | } 48 | -------------------------------------------------------------------------------- /lua/pcode/plugins/lang/java4.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-java/nvim-java", 3 | -- ft = { "java" }, 4 | dependencies = { 5 | "MunifTanjim/nui.nvim", 6 | "neovim/nvim-lspconfig", 7 | "mfussenegger/nvim-dap", 8 | "williamboman/mason.nvim", 9 | }, 10 | opts = { 11 | notifications = { 12 | dap = false, 13 | }, 14 | jdk = { 15 | auto_install = false, 16 | }, 17 | 18 | -- NOTE: One of these files must be in your project root directory. 19 | -- Otherwise the debugger will end in the wrong directory and fail. 20 | root_markers = { 21 | "settings.gradle", 22 | "settings.gradle.kts", 23 | "pom.xml", 24 | "build.gradle", 25 | "mvnw", 26 | "gradlew", 27 | "build.gradle", 28 | "build.gradle.kts", 29 | ".git", 30 | }, 31 | }, 32 | } 33 | -------------------------------------------------------------------------------- /lua/pcode/plugins/lang/kotlin.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- install treesitter 3 | { 4 | "nvim-treesitter/nvim-treesitter", 5 | opts = function(_, opts) 6 | opts.ensure_installed = opts.ensure_installed or {} 7 | vim.list_extend(opts.ensure_installed, { "kotlin" }) 8 | end, 9 | }, 10 | { 11 | "williamboman/mason-lspconfig.nvim", 12 | opts = function(_, opts) 13 | opts.ensure_installed = opts.ensure_installed or {} 14 | vim.list_extend(opts.ensure_installed, { "kotlin_language_server" }) 15 | end, 16 | }, 17 | { 18 | "pojokcodeid/auto-conform.nvim", 19 | event = "VeryLazy", 20 | opts = function(_, opts) 21 | opts.formatters_by_ft = opts.formatters_by_ft or {} 22 | local package = "ktfmt" 23 | vim.list_extend(opts.ensure_installed, { package }) 24 | opts.formatters_by_ft.kotlin = { package } 25 | end, 26 | }, 27 | { 28 | "pojokcodeid/auto-lint.nvim", 29 | optional = true, 30 | opts = function(_, opts) 31 | opts.linters_by_ft = opts.linters_by_ft or {} 32 | vim.list_extend(opts.ensure_installed, { "ktlint" }) 33 | opts.linters_by_ft.kotlin = { "ktlint" } 34 | end, 35 | }, 36 | { 37 | "mason.nvim", 38 | opts = { 39 | ensure_installed = { "kotlin-debug-adapter" }, 40 | }, 41 | }, 42 | { 43 | "rcarriga/nvim-dap-ui", 44 | lazy = true, 45 | event = "BufRead", 46 | dependencies = { 47 | { "mfussenegger/nvim-dap", lazy = true }, 48 | { "nvim-neotest/nvim-nio", lazy = true }, 49 | }, 50 | opts = function() 51 | require("pcode.user.dapui") 52 | local dap = require("dap") 53 | if not dap.adapters.kotlin then 54 | dap.adapters.kotlin = { 55 | type = "executable", 56 | command = "kotlin-debug-adapter", 57 | options = { auto_continue_if_many_stopped = false }, 58 | } 59 | end 60 | 61 | dap.configurations.kotlin = { 62 | { 63 | type = "kotlin", 64 | request = "launch", 65 | name = "This file", 66 | -- may differ, when in doubt, whatever your project structure may be, 67 | -- it has to correspond to the class file located at `build/classes/` 68 | -- and of course you have to build before you debug 69 | mainClass = function() 70 | local root = vim.uv.cwd() 71 | local fname = vim.api.nvim_buf_get_name(0) 72 | fname = fname:gsub(root, "") 73 | fname = fname:gsub("/app/src/main/kotlin/", "") 74 | fname = fname:gsub(".kt", "Kt"):gsub("/", ".") 75 | -- src/main/kotlin/websearch/Main.kt -> websearch.MainKt 76 | return fname 77 | end, 78 | projectRoot = "${workspaceFolder}", 79 | jsonLogFile = "", 80 | enableJsonLogging = false, 81 | }, 82 | { 83 | -- Use this for unit tests 84 | -- First, run 85 | -- ./gradlew --info cleanTest test --debug-jvm 86 | -- then attach the debugger to it 87 | type = "kotlin", 88 | request = "attach", 89 | name = "Attach to debugging session", 90 | port = 5005, 91 | args = {}, 92 | projectRoot = vim.fn.getcwd, 93 | hostName = "localhost", 94 | timeout = 2000, 95 | }, 96 | } 97 | end, 98 | keys = { 99 | { "d", "", desc = "  Debug" }, 100 | { "dt", "lua require'dap'.toggle_breakpoint()", desc = "Toggle Breakpoint" }, 101 | { "db", "lua require'dap'.step_back()", desc = "Step Back" }, 102 | { "dc", "lua require'dap'.continue()", desc = "Continue" }, 103 | { "dC", "lua require'dap'.run_to_cursor()", desc = "Run To Cursor" }, 104 | { "dd", "lua require'dap'.disconnect()", desc = "Disconnect" }, 105 | { "dg", "lua require'dap'.session()", desc = "Get Session" }, 106 | { "di", "lua require'dap'.step_into()", desc = "Step Into" }, 107 | { "do", "lua require'dap'.step_over()", desc = "Step Over" }, 108 | { "du", "lua require'dap'.step_out()", desc = "Step Out" }, 109 | { "dp", "lua require'dap'.pause()", desc = "Pause" }, 110 | { "dr", "lua require'dap'.repl.toggle()", desc = "Toggle Repl" }, 111 | { "ds", "lua require'dap'.continue()", desc = "Start" }, 112 | { "dq", "lua require'dap'.close()", desc = "Quit" }, 113 | { "dU", "lua require'dapui'.toggle({reset = true})", desc = "Toggle UI" }, 114 | -- setting cek 115 | -- https://stackoverflow.com/questions/9356543/logging-while-testing-through-gradle 116 | { "T", "", desc = " Test" }, 117 | { "Ta", "terminal gradle test", desc = "Run All" }, 118 | { 119 | "Tu", 120 | function() 121 | -- local current_word = vim.fn.expand("") 122 | local current_word = "" 123 | local input = vim.fn.getline(".") 124 | current_word = all_trim((input:gsub("class", "")):gsub("{", "")) -- hilangkan bagian class 125 | current_word = current_word:gsub("fun", "") 126 | current_word = current_word:gsub("%(%)", "") 127 | current_word = current_word:gsub("{", "") 128 | current_word = current_word:gsub("@Test", "") 129 | vim.cmd("terminal gradle test --tests *." .. all_trim(current_word)) 130 | end, 131 | desc = "Run Under Cursor", 132 | }, 133 | { "rg", "terminalgradle run", desc = "Run Gradle", mode = "n" }, 134 | }, 135 | }, 136 | } 137 | -------------------------------------------------------------------------------- /lua/pcode/plugins/lang/markdown.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "pojokcodeid/auto-conform.nvim", 4 | event = "VeryLazy", 5 | optional = true, 6 | opts = function(_, opts) 7 | vim.list_extend(opts.formatters, { 8 | ["markdown-toc"] = { 9 | condition = function(_, ctx) 10 | for _, line in ipairs(vim.api.nvim_buf_get_lines(ctx.buf, 0, -1, false)) do 11 | if line:find("") then 12 | return true 13 | end 14 | end 15 | end, 16 | }, 17 | ["markdownlint-cli2"] = { 18 | condition = function(_, ctx) 19 | local diag = vim.tbl_filter(function(d) 20 | return d.source == "markdownlint" 21 | end, vim.diagnostic.get(ctx.buf)) 22 | return #diag > 0 23 | end, 24 | }, 25 | }) 26 | vim.list_extend(opts.formatters_by_ft, { 27 | ["markdown"] = { "prettier", "markdownlint-cli2", "markdown-toc" }, 28 | ["markdown.mdx"] = { "prettier", "markdownlint-cli2", "markdown-toc" }, 29 | }) 30 | end, 31 | }, 32 | { 33 | "williamboman/mason.nvim", 34 | opts = function(_, opts) 35 | vim.list_extend(opts.ensure_installed, { "markdownlint-cli2", "markdown-toc" }) 36 | end, 37 | }, 38 | { 39 | "pojokcodeid/auto-lint.nvim", 40 | event = "VeryLazy", 41 | opts = function(_, opts) 42 | vim.list_extend(opts.ensure_installed, { "markdownlint-cli2" }) 43 | end, 44 | config = function(_, opts) 45 | require("auto-lint").setup(opts) 46 | end, 47 | }, 48 | { 49 | "williamboman/mason-lspconfig.nvim", 50 | opts = function(_, opts) 51 | opts.ensure_installed = opts.ensure_installed or {} 52 | vim.list_extend(opts.ensure_installed, { "marksman" }) 53 | end, 54 | }, 55 | -- Markdown preview 56 | { 57 | "iamcco/markdown-preview.nvim", 58 | cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, 59 | build = function() 60 | require("lazy").load({ plugins = { "markdown-preview.nvim" } }) 61 | vim.fn["mkdp#util#install"]() 62 | end, 63 | keys = { 64 | { 65 | "Cp", 66 | ft = "markdown", 67 | "MarkdownPreviewToggle", 68 | desc = "Markdown Preview", 69 | }, 70 | }, 71 | config = function() 72 | vim.cmd([[do FileType]]) 73 | end, 74 | }, 75 | 76 | { 77 | "MeanderingProgrammer/render-markdown.nvim", 78 | opts = { 79 | code = { 80 | sign = false, 81 | width = "block", 82 | right_pad = 1, 83 | }, 84 | heading = { 85 | sign = false, 86 | icons = {}, 87 | }, 88 | }, 89 | ft = { "markdown", "norg", "rmd", "org" }, 90 | config = function(_, opts) 91 | require("render-markdown").setup(opts) 92 | end, 93 | keys = { 94 | { "C", "", desc = "  Markdown" }, 95 | { 96 | "Cr", 97 | "RenderMarkdown", 98 | desc = "Render Markdown", 99 | }, 100 | }, 101 | }, 102 | } 103 | -------------------------------------------------------------------------------- /lua/pcode/plugins/lang/prisma.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/nvim-treesitter", 4 | opts = function(_, opts) 5 | opts.ensure_installed = opts.ensure_installed or {} 6 | vim.list_extend(opts.ensure_installed, { "prisma" }) 7 | end, 8 | }, 9 | { 10 | "williamboman/mason-lspconfig.nvim", 11 | opts = function(_, opts) 12 | opts.ensure_installed = opts.ensure_installed or {} 13 | vim.list_extend(opts.ensure_installed, { "prismals" }) 14 | vim.cmd([[ 15 | autocmd BufWritePost *.prisma silent! execute "!npx prisma format" 16 | ]]) 17 | end, 18 | keys = { 19 | { "p", "", desc = "  Prisma" }, 20 | { 21 | "pf", 22 | function() 23 | vim.cmd("execute '!npx prisma format'") 24 | end, 25 | desc = "Prisma Format", 26 | }, 27 | { 28 | "pm", 29 | function() 30 | vim.cmd("execute '!npx prisma init --datasource-provider mysql'") 31 | end, 32 | desc = "init MySQL", 33 | }, 34 | { 35 | "pp", 36 | function() 37 | vim.cmd("execute '!npx prisma init --datasource-provider postgresql'") 38 | end, 39 | desc = "init postgresql", 40 | }, 41 | { 42 | "pe", 43 | function() 44 | vim.cmd("execute '!npx prisma migrate dev --name init'") 45 | end, 46 | desc = "Migrate", 47 | }, 48 | { 49 | "ps", 50 | function() 51 | vim.cmd("terminal npx prisma studio") 52 | end, 53 | desc = "npx prisma Studio", 54 | }, 55 | }, 56 | }, 57 | } 58 | -------------------------------------------------------------------------------- /lua/pcode/plugins/lang/python.lua: -------------------------------------------------------------------------------- 1 | -- https://github.com/nvim-neotest/neotest-python 2 | -- https://docs.pytest.org/en/7.1.x/getting-started.html 3 | -- (ini untuk windows)********************************************* 4 | -- https://stackoverflow.com/questions/17737203/python-and-virtualenv-on-windows 5 | -- pip install virtualenv 6 | -- python -m virtualenv demoEnv 7 | -- demoEnv\Scripts\activate 8 | -- deactivate 9 | -- (di bawah ini untuk 10 | -- linux)*********************************************************** 11 | -- python3 -m venv my-virtual-env 12 | -- sudo python3 -m venv my-virtual-env 13 | -- . ./my-virtual-env/bin/activate 14 | -- sudo apt-get install python3-pytest 15 | 16 | -- DAP untuik linux tidak perlu tambahan pakai defaultnya saja 17 | -- ini config khusus windows 18 | local nvim_dap = { 19 | "mfussenegger/nvim-dap", 20 | event = "BufReadPre", 21 | dependencies = { 22 | "rcarriga/nvim-dap-ui", 23 | "theHamsta/nvim-dap-virtual-text", 24 | "nvim-neotest/nvim-nio", 25 | "williamboman/mason.nvim", 26 | "jay-babu/mason-nvim-dap.nvim", 27 | "mfussenegger/nvim-dap-python", 28 | }, 29 | config = function() 30 | require("nvim-dap-virtual-text").setup({ 31 | virt_text_pos = "eol", 32 | commented = true, 33 | }) 34 | local dap_python = require("dap-python") 35 | 36 | require("mason-nvim-dap").setup({ 37 | automatic_installation = true, 38 | automatic_setup = true, 39 | handlers = {}, 40 | ensure_installed = { "python" }, 41 | }) 42 | local mason_path = vim.fn.glob(vim.fn.stdpath("data") .. "/mason/") 43 | local debugpy_path = mason_path .. "packages/debugpy/venv/Scripts/python" 44 | 45 | dap_python.setup(debugpy_path) 46 | dap_python.default_port = 38000 47 | 48 | require("pcode.user.dapui") 49 | end, 50 | keys = { 51 | { "d", "", desc = "  Debug" }, 52 | { "dt", "lua require'dap'.toggle_breakpoint()", desc = "Toggle Breakpoint" }, 53 | { "db", "lua require'dap'.step_back()", desc = "Step Back" }, 54 | { "dc", "lua require'dap'.continue()", desc = "Continue" }, 55 | { "dC", "lua require'dap'.run_to_cursor()", desc = "Run To Cursor" }, 56 | { "dd", "lua require'dap'.disconnect()", desc = "Disconnect" }, 57 | { "dg", "lua require'dap'.session()", desc = "Get Session" }, 58 | { "di", "lua require'dap'.step_into()", desc = "Step Into" }, 59 | { "do", "lua require'dap'.step_over()", desc = "Step Over" }, 60 | { "du", "lua require'dap'.step_out()", desc = "Step Out" }, 61 | { "dp", "lua require'dap'.pause()", desc = "Pause" }, 62 | { "dr", "lua require'dap'.repl.toggle()", desc = "Toggle Repl" }, 63 | { "ds", "lua require'dap'.continue()", desc = "Start" }, 64 | { "dq", "lua require'dap'.close()", desc = "Quit" }, 65 | { "dU", "lua require'dapui'.toggle({reset = true})", desc = "Toggle UI" }, 66 | }, 67 | } 68 | local M = { 69 | { 70 | "nvim-neotest/neotest", 71 | dependencies = { 72 | "mfussenegger/nvim-dap-python", 73 | "antoinemadec/FixCursorHold.nvim", 74 | "nvim-neotest/nvim-nio", 75 | "nvim-neotest/neotest-python", 76 | }, 77 | config = function() 78 | local mason_path = vim.fn.glob(vim.fn.stdpath("data") .. "/mason/") 79 | pcall(function() 80 | require("dap-python").setup(mason_path .. "packages/debugpy/venv/bin/python") 81 | end) 82 | require("neotest").setup({ 83 | adapters = { 84 | require("neotest-python")({ 85 | dap = { justMyCode = false }, 86 | args = { "--log-level", "DEBUG" }, 87 | runner = "pytest", 88 | python = vim.fn.has("win32") == 0 and "python3" or "python", 89 | }), 90 | }, 91 | }) 92 | end, 93 | -- stylua: ignore 94 | keys = { 95 | { "T","",desc="  Test"}, 96 | { "Tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, 97 | { "Tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, 98 | { "TT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" }, 99 | { "Tl", function() require("neotest").run.run_last() end, desc = "Run Last" }, 100 | { "Ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" }, 101 | { "To", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" }, 102 | { "TO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" }, 103 | { "TS", function() require("neotest").run.stop() end, desc = "Stop" }, 104 | }, 105 | }, 106 | { 107 | "nvim-treesitter/nvim-treesitter", 108 | opts = function(_, opts) 109 | opts.ensure_installed = opts.ensure_installed or {} 110 | vim.list_extend(opts.ensure_installed, { "python" }) 111 | end, 112 | }, 113 | { 114 | "williamboman/mason-lspconfig.nvim", 115 | opts = function(_, opts) 116 | opts.ensure_installed = opts.ensure_installed or {} 117 | vim.list_extend(opts.ensure_installed, { "pyright" }) 118 | end, 119 | }, 120 | { 121 | "pojokcodeid/auto-conform.nvim", 122 | event = "VeryLazy", 123 | opts = function(_, opts) 124 | vim.list_extend(opts.ensure_installed, { "flake8", "black", "debugpy" }) 125 | opts.formatters_by_ft.python = { "black" } 126 | end, 127 | }, 128 | } 129 | 130 | if vim.fn.has("win32") ~= 0 then 131 | table.insert(M, nvim_dap) 132 | end 133 | 134 | return M 135 | -------------------------------------------------------------------------------- /lua/pcode/plugins/lang/rust.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/nvim-treesitter", 4 | opts = function(_, opts) 5 | opts.ensure_installed = opts.ensure_installed or {} 6 | vim.list_extend(opts.ensure_installed, { "rust" }) 7 | end, 8 | }, 9 | { 10 | "williamboman/mason-lspconfig.nvim", 11 | opts = function(_, opts) 12 | opts.skip_config = opts.skip_config or {} 13 | opts.ensure_installed = opts.ensure_installed or {} 14 | vim.list_extend(opts.ensure_installed, { "rust_analyzer" }) 15 | vim.list_extend(opts.skip_config, { "rust_analyzer" }) 16 | end, 17 | }, 18 | { 19 | "pojokcodeid/auto-conform.nvim", 20 | event = "VeryLazy", 21 | opts = function(_, opts) 22 | opts.formatters_by_ft.rust = { "lsp_fmt" } 23 | end, 24 | }, 25 | -- disable none-ls 26 | { 27 | "nvimtools/none-ls.nvim", 28 | enabled = false, 29 | }, 30 | { 31 | "rust-lang/rust.vim", 32 | ft = "rust", 33 | init = function() 34 | vim.g.rustfmt_autosave = 1 35 | end, 36 | }, 37 | { 38 | "saecki/crates.nvim", 39 | tag = "stable", 40 | ft = { "toml" }, 41 | config = function() 42 | require("crates").setup() 43 | end, 44 | }, 45 | { 46 | "mrcjkb/rustaceanvim", 47 | version = "^4", 48 | ft = { "rust" }, 49 | dependencies = "neovim/nvim-lspconfig", 50 | config = function() 51 | -- local on_attach = require("user.lsp.handlers").on_attach 52 | -- local capabilities = require("user.lsp.handlers").capabilities 53 | local on_attach = require("auto-lsp.lsp.handlers").on_attach 54 | local capabilities = require("auto-lsp.lsp.handlers").capabilities 55 | 56 | vim.g.rustaceanvim = { 57 | server = { 58 | on_attach = on_attach, 59 | capabilities = capabilities, 60 | }, 61 | } 62 | end, 63 | keys = { 64 | { "rt", "lua vim.cmd.RustLsp('run')", desc = "Run Rust" }, 65 | }, 66 | }, 67 | { 68 | "nvim-neotest/neotest", 69 | dependencies = { 70 | "nvim-neotest/nvim-nio", 71 | "nvim-lua/plenary.nvim", 72 | "antoinemadec/FixCursorHold.nvim", 73 | "nvim-treesitter/nvim-treesitter", 74 | }, 75 | config = function() 76 | require("neotest").setup({ 77 | adapters = { 78 | require("rustaceanvim.neotest"), 79 | }, 80 | }) 81 | end, 82 | -- stylua: ignore 83 | keys = { 84 | { "T","",desc="  Test"}, 85 | { "Tt", function() require("neotest").run.run(vim.fn.expand("%")) end, desc = "Run File" }, 86 | { "Tr", function() require("neotest").run.run() end, desc = "Run Nearest" }, 87 | { "TT", function() require("neotest").run.run(vim.loop.cwd()) end, desc = "Run All Test Files" }, 88 | { "Tl", function() require("neotest").run.run_last() end, desc = "Run Last" }, 89 | { "Ts", function() require("neotest").summary.toggle() end, desc = "Toggle Summary" }, 90 | { "To", function() require("neotest").output.open({ enter = true, auto_close = true }) end, desc = "Show Output" }, 91 | { "TO", function() require("neotest").output_panel.toggle() end, desc = "Toggle Output Panel" }, 92 | { "TS", function() require("neotest").run.stop() end, desc = "Stop" }, 93 | }, 94 | }, 95 | { 96 | "mfussenegger/nvim-dap", 97 | event = "BufReadPre", 98 | dependencies = { 99 | "rcarriga/nvim-dap-ui", 100 | "theHamsta/nvim-dap-virtual-text", 101 | "nvim-neotest/nvim-nio", 102 | "williamboman/mason.nvim", 103 | "jay-babu/mason-nvim-dap.nvim", 104 | }, 105 | config = function() 106 | require("nvim-dap-virtual-text").setup({ 107 | virt_text_pos = "eol", 108 | commented = true, 109 | }) 110 | 111 | require("mason-nvim-dap").setup({ 112 | automatic_installation = true, 113 | automatic_setup = true, 114 | handlers = {}, 115 | ensure_installed = { "codelldb" }, 116 | }) 117 | local mason_path = vim.fn.glob(vim.fn.stdpath("data") .. "/mason/") 118 | local debugrs_path = mason_path .. "packages/codelldb/extension/adapter/codelldb" 119 | require("pcode.user.dapui") 120 | local dap = require("dap") 121 | dap.adapters.codelldb = { 122 | type = "server", 123 | port = "${port}", 124 | executable = { 125 | -- CHANGE THIS to your path! 126 | command = debugrs_path, 127 | args = { "--port", "${port}" }, 128 | 129 | -- On windows you may have to uncomment this: 130 | detached = vim.fn.has("win32") and false or true, 131 | }, 132 | } 133 | end, 134 | keys = { 135 | { "d", "", desc = "  Debug" }, 136 | { "dt", "lua require'dap'.toggle_breakpoint()", desc = "Toggle Breakpoint" }, 137 | { "db", "lua require'dap'.step_back()", desc = "Step Back" }, 138 | { "dc", "lua require'dap'.continue()", desc = "Continue" }, 139 | { "dC", "lua require'dap'.run_to_cursor()", desc = "Run To Cursor" }, 140 | { "dd", "lua require'dap'.disconnect()", desc = "Disconnect" }, 141 | { "dg", "lua require'dap'.session()", desc = "Get Session" }, 142 | { "di", "lua require'dap'.step_into()", desc = "Step Into" }, 143 | { "do", "lua require'dap'.step_over()", desc = "Step Over" }, 144 | { "du", "lua require'dap'.step_out()", desc = "Step Out" }, 145 | { "dp", "lua require'dap'.pause()", desc = "Pause" }, 146 | { "dr", "lua require'dap'.repl.toggle()", desc = "Toggle Repl" }, 147 | { "ds", "lua require'dap'.continue()", desc = "Start" }, 148 | { "dq", "lua require'dap'.close()", desc = "Quit" }, 149 | { "dU", "lua require'dapui'.toggle({reset = true})", desc = "Toggle UI" }, 150 | }, 151 | }, 152 | } 153 | -------------------------------------------------------------------------------- /lua/pcode/plugins/lang/sql.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "kristijanhusak/vim-dadbod-ui", 3 | dependencies = { 4 | { "tpope/vim-dadbod", lazy = true }, 5 | { "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" }, lazy = true }, 6 | }, 7 | init = function() 8 | -- Your DBUI configuration 9 | vim.g.db_ui_show_database_icon = 1 10 | vim.g.db_ui_use_nerd_fonts = 1 11 | vim.g.db_ui_show_help = 0 12 | end, 13 | config = function() 14 | local function db_completion() 15 | require("cmp").setup.buffer({ 16 | sources = { { name = "vim-dadbod-completion" } }, 17 | }) 18 | end 19 | vim.g.db_ui_save_location = vim.fn.stdpath("config") .. require("plenary.path").path.sep .. "db_ui" 20 | 21 | vim.api.nvim_create_autocmd("FileType", { 22 | pattern = { 23 | "sql", 24 | }, 25 | command = [[setlocal omnifunc=vim_dadbod_completion#omni]], 26 | }) 27 | 28 | vim.api.nvim_create_autocmd("FileType", { 29 | pattern = { 30 | "sql", 31 | "mysql", 32 | "plsql", 33 | }, 34 | callback = function() 35 | vim.schedule(db_completion) 36 | end, 37 | }) 38 | end, 39 | cmd = { 40 | "DBUIToggle", 41 | "DBUI", 42 | "DBUIAddConnection", 43 | "DBUIFindBuffer", 44 | "DBUIRenameBuffer", 45 | "DBUILastQueryInfo", 46 | }, 47 | -- stylua: ignore 48 | keys = { 49 | { "D", "", desc = " 󰆼 DBUI" }, 50 | { "Dd", "AlphaNvimTreeCloseDBUI", desc = "󰆼 DBUI Open" }, 51 | { "Dq", 52 | "DBUICloseBufferLineCloseOthersbd!lua require('auto-bufferline.configs.utils').bufremove()Alpha", 53 | desc = "󰅙 DBUI Close", 54 | }, 55 | }, 56 | } 57 | -------------------------------------------------------------------------------- /lua/pcode/plugins/lang/tailwind.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "williamboman/mason-lspconfig.nvim", 4 | opts = function(_, opts) 5 | opts.ensure_installed = opts.ensure_installed or {} 6 | vim.list_extend(opts.ensure_installed, { "tailwindcss" }) 7 | end, 8 | }, 9 | { 10 | "NvChad/nvim-colorizer.lua", 11 | opts = { 12 | user_default_options = { 13 | tailwind = true, 14 | }, 15 | }, 16 | }, 17 | { 18 | "hrsh7th/nvim-cmp", 19 | dependencies = { 20 | { "roobert/tailwindcss-colorizer-cmp.nvim", config = true }, 21 | }, 22 | opts = function(_, opts) 23 | -- original kind icon formatter 24 | local format_kinds = opts.formatting.format 25 | opts.formatting.format = function(entry, item) 26 | format_kinds(entry, item) -- add icons 27 | local lspkind = require("tailwindcss-colorizer-cmp").formatter(entry, item) 28 | if lspkind.kind == "XX" then 29 | lspkind.kind = " " 30 | end 31 | return lspkind 32 | end 33 | end, 34 | }, 35 | } 36 | -------------------------------------------------------------------------------- /lua/pcode/plugins/lualine.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "pojokcodeid/auto-lualine.nvim", 4 | event = { "InsertEnter", "BufRead", "BufNewFile" }, 5 | dependencies = { "nvim-lualine/lualine.nvim" }, 6 | opts = { 7 | setColor = "auto", 8 | setOption = "roundedall", 9 | setMode = 5, 10 | }, 11 | config = function(_, opts) 12 | require("auto-lualine").setup(opts) 13 | end, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /lua/pcode/plugins/notify.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "rcarriga/nvim-notify", 3 | lazy = true, 4 | event = "VeryLazy", 5 | keys = { 6 | { 7 | "uN", 8 | function() 9 | require("notify").dismiss({ silent = true, pending = true }) 10 | end, 11 | desc = "Delete all Notifications", 12 | }, 13 | }, 14 | opts = { 15 | timeout = 3000, 16 | max_height = function() 17 | return math.floor(vim.o.lines * 0.75) 18 | end, 19 | max_width = function() 20 | return math.floor(vim.o.columns * 0.4) 21 | end, 22 | render = "wrapped-compact", 23 | -- background_colour = "#00000000", 24 | }, 25 | config = function(_, opts) 26 | local notify = require("notify") 27 | notify.setup(opts) 28 | vim.notify = notify.notify 29 | end, 30 | } 31 | -------------------------------------------------------------------------------- /lua/pcode/plugins/nvimlint.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "pojokcodeid/auto-lint.nvim", 3 | dependencies = { 4 | "mfussenegger/nvim-lint", 5 | event = "VeryLazy", 6 | }, 7 | event = "VeryLazy", 8 | opts = function(_, opts) 9 | opts.map_lang = opts.map_lang or {} 10 | opts.map_name = opts.map_name or {} 11 | opts.add_new = opts.add_new or {} 12 | opts.ignore = opts.ignore or {} 13 | opts.ensure_installed = opts.ensure_installed or {} 14 | end, 15 | config = function(_, opts) 16 | require("auto-lint").setup(opts) 17 | end, 18 | } 19 | -------------------------------------------------------------------------------- /lua/pcode/plugins/nvimtree.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-tree/nvim-tree.lua", 3 | cmd = { "NvimTreeFindFileToggle", "NvimTree", "NvimTreeOpen", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" }, 4 | keys = { 5 | { "e", "NvimTreeToggle", desc = "󰙅 Explorer" }, 6 | }, 7 | opts = function(_, opts) 8 | local icons = require("pcode.user.icons") 9 | opts.disable_netrw = true 10 | opts.hijack_cursor = true 11 | opts.sync_root_with_cwd = true 12 | opts.update_focused_file = { 13 | enable = true, 14 | update_root = false, 15 | } 16 | opts.view = { 17 | adaptive_size = false, 18 | centralize_selection = true, 19 | width = 30, 20 | side = "left", 21 | preserve_window_proportions = false, 22 | number = false, 23 | relativenumber = false, 24 | signcolumn = "yes", 25 | float = { 26 | enable = false, 27 | quit_on_focus_loss = true, 28 | open_win_config = { 29 | relative = "editor", 30 | border = "rounded", 31 | width = 30, 32 | height = 30, 33 | row = 1, 34 | col = 1, 35 | }, 36 | }, 37 | } 38 | opts.renderer = { 39 | root_folder_label = false, 40 | highlight_git = true, 41 | indent_markers = { enable = true }, 42 | --[[ indent_markers = { 43 | enable = true, 44 | inline_arrows = true, 45 | icons = { 46 | corner = "└", 47 | edge = "│", 48 | item = "│", 49 | none = " ", 50 | }, 51 | }, ]] 52 | icons = { 53 | webdev_colors = true, 54 | git_placement = "before", 55 | padding = " ", 56 | symlink_arrow = " ➛ ", 57 | show = { 58 | file = true, 59 | folder = true, 60 | folder_arrow = true, 61 | git = true, 62 | }, 63 | glyphs = { 64 | default = icons.ui.Text, 65 | symlink = icons.ui.FileSymlink, 66 | bookmark = icons.ui.BookMark, 67 | folder = { 68 | arrow_closed = icons.ui.ChevronShortRight, 69 | arrow_open = icons.ui.ChevronShortDown, 70 | default = icons.ui.Folder, 71 | open = icons.ui.FolderOpen, 72 | empty = icons.ui.EmptyFolder, 73 | empty_open = icons.ui.EmptyFolderOpen, 74 | symlink = icons.ui.FolderSymlink, 75 | symlink_open = icons.ui.FolderOpen, 76 | }, 77 | git = { 78 | unstaged = icons.git.FileUnstaged, 79 | staged = icons.git.FileStaged, 80 | unmerged = icons.git.FileUnmerged, 81 | renamed = icons.git.FileRenamed, 82 | untracked = icons.git.FileUntracked, 83 | deleted = icons.git.FileDeleted, 84 | ignored = icons.git.FileIgnored, 85 | }, 86 | }, 87 | }, 88 | special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" }, 89 | symlink_destination = true, 90 | } 91 | opts.filters = { 92 | dotfiles = false, 93 | git_clean = false, 94 | no_buffer = false, 95 | custom = { "node_modules", "\\.cache", "\\.git" }, 96 | exclude = { 97 | ".gitignore", 98 | ".prettierignore", 99 | }, 100 | } 101 | opts.notify = { 102 | threshold = vim.log.levels.INFO, 103 | } 104 | opts.git = { 105 | enable = true, 106 | ignore = false, 107 | show_on_dirs = true, 108 | show_on_open_dirs = true, 109 | disable_for_dirs = {}, 110 | timeout = 400, 111 | } 112 | return opts 113 | end, 114 | config = function(_, opts) 115 | require("nvim-tree").setup(opts) 116 | local api = require("nvim-tree.api") 117 | api.events.subscribe(api.events.Event.FileCreated, function(file) 118 | vim.cmd("edit " .. file.fname) 119 | end) 120 | end, 121 | } 122 | -------------------------------------------------------------------------------- /lua/pcode/plugins/telecope.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-telescope/telescope.nvim", 3 | lazy = true, 4 | cmd = "Telescope", 5 | version = false, 6 | opts = function() 7 | local find_files = { 8 | hidden = true, 9 | } 10 | local live_grep = { 11 | only_sort_text = true, 12 | additional_args = function() 13 | return { "--multiline" } 14 | end, 15 | } 16 | local actions = require("telescope.actions") 17 | vim.g.theme_switcher_loaded = true 18 | return { 19 | defaults = { 20 | vimgrep_arguments = { 21 | "rg", 22 | "-L", 23 | "--color=never", 24 | "--no-heading", 25 | "--with-filename", 26 | "--line-number", 27 | "--column", 28 | "--smart-case", 29 | }, 30 | prompt_prefix = "  ", 31 | selection_caret = " ", 32 | entry_prefix = " ", 33 | initial_mode = "insert", 34 | selection_strategy = "reset", 35 | sorting_strategy = "ascending", 36 | layout_strategy = "horizontal", 37 | layout_config = { 38 | horizontal = { 39 | prompt_position = "top", 40 | preview_width = 0.55, 41 | results_width = 0.8, 42 | }, 43 | vertical = { 44 | mirror = false, 45 | }, 46 | width = 0.87, 47 | height = 0.80, 48 | preview_cutoff = 120, 49 | }, 50 | file_sorter = require("telescope.sorters").get_fuzzy_file, 51 | file_ignore_patterns = { "node_modules" }, 52 | generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, 53 | path_display = { "smart" }, 54 | winblend = 0, 55 | border = {}, 56 | borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, 57 | color_devicons = true, 58 | set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil, 59 | file_previewer = require("telescope.previewers").vim_buffer_cat.new, 60 | grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, 61 | qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, 62 | -- Developer configurations: Not meant for general override 63 | buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker, 64 | mappings = { 65 | n = { ["q"] = require("telescope.actions").close }, 66 | }, 67 | }, 68 | 69 | extensions_list = { "themes", "terms" }, 70 | 71 | pickers = { 72 | find_files = find_files, 73 | live_grep = live_grep, 74 | grep_string = { 75 | only_sort_text = true, 76 | }, 77 | buffers = { 78 | initial_mode = "normal", 79 | mappings = { 80 | i = { 81 | [""] = actions.delete_buffer, 82 | }, 83 | n = { 84 | ["dd"] = actions.delete_buffer, 85 | }, 86 | }, 87 | }, 88 | planets = { 89 | show_pluto = true, 90 | show_moon = true, 91 | }, 92 | git_files = { 93 | hidden = true, 94 | show_untracked = true, 95 | }, 96 | colorscheme = { 97 | enable_preview = true, 98 | }, 99 | }, 100 | 101 | mappings = { 102 | i = { 103 | [""] = actions.cycle_history_next, 104 | [""] = actions.cycle_history_prev, 105 | 106 | [""] = actions.move_selection_next, 107 | [""] = actions.move_selection_previous, 108 | 109 | [""] = actions.close, 110 | 111 | [""] = actions.move_selection_next, 112 | [""] = actions.move_selection_previous, 113 | 114 | [""] = actions.select_default, 115 | [""] = actions.select_horizontal, 116 | [""] = actions.select_vertical, 117 | [""] = actions.select_tab, 118 | 119 | [""] = actions.preview_scrolling_up, 120 | [""] = actions.preview_scrolling_down, 121 | 122 | [""] = actions.results_scrolling_up, 123 | [""] = actions.results_scrolling_down, 124 | 125 | [""] = actions.toggle_selection + actions.move_selection_worse, 126 | [""] = actions.toggle_selection + actions.move_selection_better, 127 | [""] = actions.send_to_qflist + actions.open_qflist, 128 | [""] = actions.send_selected_to_qflist + actions.open_qflist, 129 | [""] = actions.complete_tag, 130 | [""] = actions.which_key, -- keys from pressing 131 | }, 132 | 133 | n = { 134 | [""] = actions.close, 135 | [""] = actions.select_default, 136 | [""] = actions.select_horizontal, 137 | [""] = actions.select_vertical, 138 | [""] = actions.select_tab, 139 | 140 | [""] = actions.toggle_selection + actions.move_selection_worse, 141 | [""] = actions.toggle_selection + actions.move_selection_better, 142 | [""] = actions.send_to_qflist + actions.open_qflist, 143 | [""] = actions.send_selected_to_qflist + actions.open_qflist, 144 | 145 | ["j"] = actions.move_selection_next, 146 | ["k"] = actions.move_selection_previous, 147 | ["H"] = actions.move_to_top, 148 | ["M"] = actions.move_to_middle, 149 | ["L"] = actions.move_to_bottom, 150 | 151 | [""] = actions.move_selection_next, 152 | [""] = actions.move_selection_previous, 153 | ["gg"] = actions.move_to_top, 154 | ["G"] = actions.move_to_bottom, 155 | 156 | [""] = actions.preview_scrolling_up, 157 | [""] = actions.preview_scrolling_down, 158 | 159 | [""] = actions.results_scrolling_up, 160 | [""] = actions.results_scrolling_down, 161 | 162 | ["?"] = actions.which_key, 163 | }, 164 | }, 165 | } 166 | end, 167 | config = function(_, opts) 168 | require("telescope").setup(opts) 169 | -- load extensions 170 | pcall(function() 171 | for _, ext in ipairs(opts.extensions_list) do 172 | require("telescope").load_extension(ext) 173 | end 174 | end) 175 | end, 176 | keys = { 177 | { "s", "", desc = "  Search", mode = "n" }, 178 | { "f", "Telescope find_files", desc = " Find files", mode = "n" }, 179 | { "F", "Telescope live_grep", desc = " Find Text", mode = "n" }, 180 | { "sb", "Telescope git_branches", desc = "Checkout branch", mode = "n" }, 181 | { "sc", "Telescope colorscheme", desc = "Colorscheme", mode = "n" }, 182 | { "sh", "Telescope help_tags", desc = "Find Help", mode = "n" }, 183 | { "sM", "Telescope man_pages", desc = "Man Pages", mode = "n" }, 184 | { "sr", "Telescope oldfiles", desc = "Open Recent File", mode = "n" }, 185 | { "sR", "Telescope registers", desc = "Registers", mode = "n" }, 186 | { "sk", "Telescope keymaps", desc = "Keymaps", mode = "n" }, 187 | { "sC", "Telescope commands", desc = "Commands", mode = "n" }, 188 | }, 189 | } 190 | -------------------------------------------------------------------------------- /lua/pcode/plugins/theme/catppuccin.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "catppuccin/nvim", 3 | name = "catppuccin", 4 | priority = 1000, 5 | config = function() 6 | local transparent = false 7 | require("catppuccin").setup({ 8 | flavour = "auto", -- latte, frappe, macchiato, mocha 9 | background = { -- :h background 10 | light = "latte", 11 | dark = "mocha", 12 | }, 13 | transparent_background = transparent, -- disables setting the background color. 14 | show_end_of_buffer = false, -- shows the '~' characters after the end of buffers 15 | term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`) 16 | dim_inactive = { 17 | enabled = false, -- dims the background color of inactive window 18 | shade = "dark", 19 | percentage = 0.15, -- percentage of the shade to apply to the inactive window 20 | }, 21 | no_italic = false, -- Force no italic 22 | no_bold = false, -- Force no bold 23 | no_underline = false, -- Force no underline 24 | styles = { -- Handles the styles of general hi groups (see `:h highlight-args`): 25 | comments = { "italic" }, -- Change the style of comments 26 | conditionals = { "italic" }, 27 | loops = {}, 28 | functions = {}, 29 | keywords = { "italic" }, 30 | strings = {}, 31 | variables = {}, 32 | numbers = {}, 33 | booleans = {}, 34 | properties = {}, 35 | types = {}, 36 | operators = {}, 37 | -- miscs = {}, -- Uncomment to turn off hard-coded styles 38 | }, 39 | color_overrides = {}, 40 | custom_highlights = function(colors) 41 | return { 42 | NvimTreeNormal = { fg = colors.text, bg = transparent and colors.none or colors.base }, 43 | NvimTreeWinSeparator = { fg = colors.mantle, bg = transparent and colors.none or colors.none }, 44 | Pmenu = { fg = colors.text, bg = transparent and colors.none or colors.base }, 45 | WhichKeyFloat = { fg = colors.text, bg = transparent and colors.none or colors.base }, 46 | WhichKey = { fg = colors.text, bg = transparent and colors.none or colors.base }, 47 | WhichKeyBorder = { fg = colors.text, bg = transparent and colors.none or colors.base }, 48 | NormalFloat = { fg = colors.text, bg = transparent and colors.none or colors.base }, 49 | Normal = { fg = colors.text, bg = transparent and colors.none or colors.base }, 50 | NormalNC = { fg = colors.text, bg = transparent and colors.none or colors.base }, 51 | StatusLine = { fg = colors.text, bg = colors.none }, 52 | } 53 | end, 54 | highlight_overrides = { 55 | all = function(colors) 56 | return { 57 | ["@markup.link.url"] = { fg = colors.rosewater, style = { "italic" } }, 58 | } 59 | end, 60 | }, 61 | default_integrations = true, 62 | integrations = { 63 | cmp = true, 64 | gitsigns = true, 65 | nvimtree = true, 66 | treesitter = true, 67 | notify = false, 68 | mini = { 69 | enabled = true, 70 | indentscope_color = "", 71 | }, 72 | -- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations) 73 | }, 74 | }) 75 | end, 76 | } 77 | -------------------------------------------------------------------------------- /lua/pcode/plugins/theme/dracula.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "Mofiqul/dracula.nvim", 3 | priority = 1000, 4 | opts=function() 5 | local colors = require("dracula").colors() 6 | return{ 7 | colors = { 8 | -- purple = "#FCC76A", 9 | menu = colors.bg, 10 | selection = "#363848", 11 | }, 12 | italic_comment = true, 13 | lualine_bg_color = colors.bg, 14 | overrides = { 15 | Keywords = { fg = colors.cyan, italic = true }, 16 | ["@keyword"] = { fg = colors.pink, italic = true }, 17 | ["@keyword.function"] = { fg = colors.cyan, italic = true }, 18 | ["@function"] = { fg = colors.green, italic = true }, 19 | ["@tag.attribute"] = { fg = colors.green, italic = true }, 20 | ["@tag.builtin.javascript"] = { fg = colors.pink }, 21 | ["@tag.delimiter.javascript"] = { fg = colors.fg }, 22 | ["@type.javascript"] = { fg = colors.fg }, 23 | ["@property.css"] = { fg = colors.cyan }, 24 | ["@type.css"] = { fg = colors.green }, 25 | ["@tag.css"] = { fg = colors.pink }, 26 | ["@keyword.css"] = { fg = colors.fg }, 27 | ["@string.css"] = { fg = colors.pink }, 28 | NvimTreeFolderIcon = { fg = "#6776a7" }, 29 | CmpItemAbbr = { fg = "#ABB2BF" }, 30 | CmpItemKind = { fg = "#ABB2BF" }, 31 | CmpItemAbbrDeprecated = { fg = "#ABB2BF" }, 32 | CmpItemAbbrMatch = { fg = "#8BE9FD" }, 33 | htmlLink = { fg = "#BD93F9", underline = false }, 34 | Underlined = { fg = "#8BE9FD" }, 35 | NvimTreeSpecialFile = { fg = "#FF79C6" }, 36 | SpellBad = { fg = "#FF6E6E" }, 37 | illuminatedWord = { bg = "#3b4261" }, 38 | illuminatedCurWord = { bg = "#3b4261" }, 39 | IlluminatedWordText = { bg = "#3b4261" }, 40 | IlluminatedWordRead = { bg = "#3b4261" }, 41 | IlluminatedWordWrite = { bg = "#3b4261" }, 42 | DiffChange = { fg = colors.fg }, 43 | StatusLine = { fg = colors.fg, bg = colors.bg }, 44 | StatusLineTerm = { fg = colors.fg, bg = colors.bg }, 45 | BufferLineFill = { bg = colors.bg }, 46 | Pmenu = { fg = colors.fg, bg = colors.bg }, 47 | LspInfoBorder = { fg = colors.fg }, 48 | LspReferenceText = { bg = "#3b4261" }, 49 | LspReferenceRead = { bg = "#3b4261" }, 50 | LspReferenceWrite = { bg = "#3b4261" }, 51 | WinBar = { bg = colors.bg }, 52 | WinBarNC = { fg = colors.fg, bg = colors.bg }, 53 | }, 54 | transparent_bg = false, 55 | } 56 | end, 57 | config = function(_,opts) 58 | require("dracula").setup(opts) 59 | local colorscheme = pcode.themes.dracula or "dracula" 60 | vim.cmd("colorscheme " .. colorscheme) 61 | end, 62 | } 63 | -------------------------------------------------------------------------------- /lua/pcode/plugins/theme/evatheme.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "sharpchen/Eva-Theme.nvim", 3 | lazy = false, 4 | priority = 1000, 5 | config = function() 6 | require("Eva-Theme").setup({}) 7 | local color = {} 8 | if pcode.localcode then 9 | color = require("Eva-Theme.palette").dark_base 10 | else 11 | color = require("Eva-Theme.palette").dark 12 | end 13 | vim.api.nvim_create_autocmd("ColorScheme", { 14 | pattern = "*", 15 | callback = function() 16 | local hi = vim.api.nvim_set_hl 17 | hi(0, "LspInfoBorder", { fg = color.comment }) 18 | hi(0, "FloatBorder", { fg = color.comment }) 19 | hi(0, "StatusLine", { bg = color.background }) 20 | hi(0, "StatusLineNC", { bg = color.background }) 21 | hi(0, "WinBar", { bg = color.background }) 22 | hi(0, "WinBarNC", { bg = color.background }) 23 | hi(0, "NormalFloat", { bg = color.background }) 24 | hi(0, "TabLine", { bg = color.background }) 25 | hi(0, "NormalNC", { bg = color.background }) 26 | hi(0, "@tag.delimiter.javascript", { fg = color.punctuation }) 27 | hi(0, "@tag.delimiter.tsx", { fg = color.punctuation }) 28 | -- git 29 | hi(0, "NvimTreeGitNewIcon", { bg = color.dark, fg = color.git.added }) 30 | hi(0, "NvimTreeGitRenamedIcon", { bg = color.dark, fg = color.git.added }) 31 | hi(0, "NvimTreeGitDeletedIcon", { bg = color.dark, fg = color.git.stagedDeleted }) 32 | hi(0, "NvimTreeGitDirtyIcon", { bg = color.dark, fg = color.git.diffModified }) 33 | hi(0, "NvimTreeGitIgnoredIcon", { bg = color.dark, fg = color.git.ignored }) 34 | hi(0, "NvimTreeGitMergeIcon", { bg = color.dark, fg = color.git.diffModified }) 35 | hi(0, "NvimTreeGitStagedIcon", { bg = color.dark, fg = color.git.stagedModified }) 36 | hi(0, "NvimTreeWinSeparator", { bg = color.dark, fg = color.comment }) 37 | hi(0, "MiniIndentscopeSymbol", { bg = color.dark, fg = color.parameter }) 38 | -- cursor 39 | -- hi(0, "Cursor", { bg = "#838FA7", fg = "#838FA7" }) 40 | hi(0, "CursorColumn", { bg = color.dark, fg = color.punctuation }) 41 | hi(0, "TermCursor", { bg = color.digit, fg = color.dark }) 42 | hi(0, "TermCursorNC", { bg = color.digit, fg = color.dark }) 43 | hi(0, "MiniIndentscopeSymbol", { fg = color.digit }) 44 | hi(0, "MiniIndentscopeSymbolOff", { fg = color.digit }) 45 | end, 46 | }) 47 | end, 48 | } 49 | -------------------------------------------------------------------------------- /lua/pcode/plugins/theme/github.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "projekt0n/github-nvim-theme", 3 | lazy = false, -- make sure we load this during startup if it is your main colorscheme 4 | priority = 1000, -- make sure to load this before all the other start plugins 5 | config = function() 6 | local is_transparent = false 7 | local palette = require("github-theme.palette").load(pcode.themes.github or "github_dark_dimmed") 8 | require("github-theme").setup({ 9 | options = { 10 | -- Compiled file's destination location 11 | compile_path = vim.fn.stdpath("cache") .. "/github-theme", 12 | compile_file_suffix = "_compiled", -- Compiled file suffix 13 | hide_end_of_buffer = true, -- Hide the '~' character at the end of the buffer for a cleaner look 14 | hide_nc_statusline = true, -- Override the underline style for non-active statuslines 15 | transparent = is_transparent, -- Disable setting background 16 | terminal_colors = true, -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal` 17 | dim_inactive = false, -- Non focused panes set to alternative background 18 | module_default = true, -- Default enable value for modules 19 | styles = { -- Style to be applied to different syntax groups 20 | comments = "italic", -- Value is any valid attr-list value `:help attr-list` 21 | functions = "italic", 22 | keywords = "NONE", 23 | variables = "NONE", 24 | conditionals = "NONE", 25 | constants = "NONE", 26 | numbers = "NONE", 27 | operators = "NONE", 28 | strings = "NONE", 29 | types = "NONE", 30 | }, 31 | inverse = { -- Inverse highlight for different types 32 | match_paren = false, 33 | visual = false, 34 | search = false, 35 | }, 36 | darken = { -- Darken floating windows and sidebar-like windows 37 | floats = false, 38 | sidebars = { 39 | enable = true, 40 | list = {}, -- Apply dark background to specific windows 41 | }, 42 | }, 43 | modules = { -- List of various plugins and additional options 44 | -- ... 45 | }, 46 | }, 47 | palettes = { 48 | github_dark_dimmed = { 49 | bg0 = is_transparent and "NONE" or "bg1", 50 | bg1 = is_transparent and "NONE" or "bg", 51 | }, 52 | }, 53 | specs = {}, 54 | groups = { 55 | all = { 56 | illuminatedWord = { bg = "#3b4261" }, 57 | illuminatedCurWord = { bg = "#3b4261" }, 58 | IlluminatedWordText = { bg = "#3b4261" }, 59 | IlluminatedWordRead = { bg = "#3b4261" }, 60 | IlluminatedWordWrite = { bg = "#3b4261" }, 61 | ["@tag.attribute"] = { fg = "#77bdfb", style = "italic" }, 62 | ["@text.uri"] = { fg = palette.const, style = "italic" }, 63 | ["@keyword.return"] = { fg = "#fa7970", style = "italic" }, 64 | -- ["@tag.attribute.html"] = { fg = "#faa356", style = "italic" }, 65 | -- ["@operator.html"] = { fg = "#faa356" }, 66 | -- ["@tag.html"] = { fg = "#fa7970" }, 67 | -- ["@tag.delimiter.html"] = { fg = "#faa356" }, 68 | -- ["@tag.javascript"] = { fg = "#faa356" }, 69 | -- ["@tag.javascript"] = { fg = "#8ddb8c" }, 70 | ["@tag.builtin.javascript"] = { fg = "#8ddb8c" }, 71 | -- ["@tag.tsx"] = { fg = "#8ddb8c" }, 72 | ["@string.special.url"] = { fg = palette.const, style = "italic" }, 73 | ["@tag.delimiter.javascript"] = { fg = "fg1" }, 74 | ["@tag.tsx"] = { fg = "#faa356" }, 75 | ["@lsp.type.parameter"] = { fg = "#91cbff" }, 76 | ["@property.lua"] = { fg = "#91cbff", bg = is_transparent and "NONE" or "bg1" }, 77 | ["@lsp.type.property.lua"] = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" }, 78 | ["@lsp.type.variable.lua"] = { fg = "#91cbff", bg = is_transparent and "NONE" or "bg1" }, 79 | -- sparator new all 80 | NvimTreeNormal = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" }, 81 | NvimTreeSpecialFile = { fg = "#faa356", style = "italic" }, 82 | NvimTreeIndentMarker = { fg = "#3E4450" }, 83 | BufferLineFill = { bg = is_transparent and "NONE" or "bg1" }, 84 | BufferLineUnfocusedFill = { bg = is_transparent and "NONE" or "bg1" }, 85 | LualineNormal = { bg = is_transparent and "NONE" or "bg1" }, 86 | StatusLine = { bg = is_transparent and "NONE" or "bg1" }, 87 | StatusLineTerm = { bg = is_transparent and "NONE" or "bg1" }, 88 | Pmenu = { bg = is_transparent and "NONE" or "bg1" }, 89 | PmenuSel = { link = "CursorLine" }, 90 | WhichKeyFloat = { bg = is_transparent and "NONE" or "bg1" }, 91 | LazyNormal = { bg = is_transparent and "NONE" or "bg1" }, 92 | LazyBackground = { bg = is_transparent and "NONE" or "bg1" }, 93 | NormalSB = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" }, -- normal text 94 | NormalFloat = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" }, 95 | IblIndent = { fg = "#3E4450" }, 96 | WinBar = { bg = is_transparent and "NONE" or "bg1" }, 97 | WinBarNC = { bg = is_transparent and "NONE" or "bg1" }, 98 | }, 99 | github_dark_high_contrast = { 100 | NvimTreeSpecialFile = { fg = "#faa356", style = "italic" }, 101 | }, 102 | github_dark_dimmed = { 103 | -- As with specs and palettes, a specific style's value will be used over the `all`'s value. 104 | }, 105 | }, 106 | }) 107 | end, 108 | } 109 | -------------------------------------------------------------------------------- /lua/pcode/plugins/theme/gruvbox.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "ellisonleao/gruvbox.nvim", 3 | priority = 1000, 4 | opts = function() 5 | local color = require("gruvbox").palette 6 | return { 7 | terminal_colors = true, -- add neovim terminal colors 8 | undercurl = false, 9 | underline = false, 10 | bold = false, 11 | contrast = "", -- can be "hard", "soft" or empty string 12 | palette_overrides = {}, 13 | overrides = { 14 | ["NormalFloat"] = { bg = "NONE" }, 15 | ["NormalNC"] = { bg = "NONE" }, 16 | ["MiniIndentscopeSymbol"] = { fg = color.bright_yellow }, 17 | ["StatusLine"] = { bg = "NONE" }, 18 | ["FoldColumn"] = { bg = "NONE" }, 19 | ["Folded"] = { bg = "NONE" }, 20 | ["SignColumn"] = { bg = "NONE" }, 21 | }, 22 | } 23 | end, 24 | config = function(_, opts) 25 | vim.o.background = "dark" 26 | require("gruvbox").setup(opts) 27 | end, 28 | } 29 | -------------------------------------------------------------------------------- /lua/pcode/plugins/theme/jetbrains.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "pojokcodeid/darcula-dark.nvim", 3 | priority = 1000, 4 | lazy = false, 5 | config = function() 6 | require("darcula").setup({ 7 | colors = { 8 | lavender = "#9876AA", 9 | statusline = "NONE", 10 | }, 11 | }) 12 | vim.api.nvim_create_autocmd("ColorScheme", { 13 | pattern = "*", 14 | callback = function() 15 | local colors = require("darcula").colors() 16 | local hi = vim.api.nvim_set_hl 17 | hi(0, "@property.json", { fg = colors.lavender }) 18 | hi(0, "@property.jsonc", { fg = colors.lavender }) 19 | hi(0, "LineNr", { ctermfg = 11, fg = colors._39 }) 20 | -- hi(0, "@variable.member.sql", { fg = colors.olive_green }) 21 | -- telescope 22 | hi(0, "TelescopePromptBorder", { fg = colors.medium_gray }) 23 | hi(0, "TelescopeResultsBorder", { fg = colors.medium_gray }) 24 | hi(0, "TelescopePreviewBorder", { fg = colors.medium_gray }) 25 | hi(0, "TelescopeSelection", { bg = colors.dark_charcoal_gray }) 26 | hi(0, "TelescopeMultiSelection", { bg = colors.dark_charcoal_gray }) 27 | hi(0, "TelescopeNormal", { bg = colors.dark }) 28 | hi(0, "TelescopeMatching", { fg = colors.olive_green }) 29 | hi(0, "TelescopePromptPrefix", { fg = colors.red }) 30 | hi(0, "TelescopeResultsDiffDelete", { fg = colors.red }) 31 | hi(0, "TelescopeResultsDiffChange", { fg = colors.bright_cyan }) 32 | hi(0, "TelescopeResultsDiffAdd", { fg = colors.olive_green }) 33 | hi(0, "TelescopePromptNormal", { bg = colors.dark, fg = colors.grey }) 34 | hi(0, "TelescopePromptPrefix", { bg = colors.dark, fg = colors.red }) 35 | hi(0, "TelescopeResultsTitle", { bg = colors.olive_green, fg = colors.very_dark_gray }) 36 | end, 37 | }) 38 | local colorscheme = pcode.themes.jetbrains or "darcula-dark" 39 | vim.cmd("colorscheme " .. colorscheme) 40 | end, 41 | } 42 | -------------------------------------------------------------------------------- /lua/pcode/plugins/theme/onedarkpro.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "olimorris/onedarkpro.nvim", 3 | priority = 1000, 4 | config = function() 5 | local is_transparent = false 6 | require("onedarkpro").setup({ 7 | styles = { 8 | types = "NONE", 9 | methods = "NONE", 10 | numbers = "NONE", 11 | strings = "NONE", 12 | comments = "italic", 13 | keywords = "bold,italic", 14 | constants = "NONE", 15 | functions = "italic", 16 | operators = "NONE", 17 | variables = "NONE", 18 | parameters = "NONE", 19 | conditionals = "italic", 20 | virtual_text = "NONE", 21 | tags = "italic", 22 | }, 23 | colors = { 24 | bg_statusline = "#282c34", 25 | onedark = { 26 | green = "#99c379", 27 | gray = "#8094b4", 28 | red = "#e06c75", 29 | purple = "#c678dd", 30 | yellow = "#e5c07a", 31 | blue = "#61afef", 32 | cyan = "#56b6c2", 33 | indentline = "#3b4261", 34 | float_bg = "#282c34", 35 | }, 36 | onedark_dark = { 37 | bg_statusline = "#000", 38 | }, 39 | }, 40 | options = { 41 | cursorline = true, 42 | transparency = is_transparent, 43 | terminal_colors = true, 44 | }, 45 | highlights = { 46 | -- overide cursor line fill colors 47 | LineNr = { fg = "#49505E" }, -- Line number for ":number" and ":#" commands, and when 'number' or 'relativenumber' option is set. 48 | CursorLineNr = { fg = "${blue}" }, -- Like LineNr when 'cursorline' or 'relativenumber' is set for the cursor line. 49 | CursorLine = { bg = "#333842" }, 50 | Cursor = { fg = "${bg}", bg = "${fg}" }, -- character under the cursor 51 | lCursor = { fg = "${bg}", bg = "${fg}" }, -- the character under the cursor when |language-mapping| is used (see 'guicursor') 52 | CursorIM = { fg = "${bg}", bg = "${fg}" }, -- like Cursor, but used when in IME mode |CursorIM| 53 | CursorColumn = { bg = "#333842" }, -- Screen-column at the cursor, when 'cursorcolumn' is set. 54 | -- overide nvimtree folder icon fill color 55 | NvimTreeFolderIcon = { fg = "${gray}" }, 56 | -- overide nvimtree text fill color folder opened 57 | NvimTreeOpenedFolderName = { fg = "${blue}" }, 58 | -- overide nvimtree text fill color root folder 59 | NvimTreeRootFolder = { fg = "${yellow}" }, 60 | NvimTreeSpecialFile = { fg = "${orange}" }, 61 | NvimTreeWinSeparator = { fg = "#202329" }, 62 | NvimTreeIndentMarker = { fg = "#3E4450" }, 63 | -- overide nvimtree cursorline 64 | NvimTreeCursorLine = { bg = "#333842" }, 65 | -- overide indenline fill color 66 | IblIndent = { fg = "#3E4450" }, 67 | -- overide cmp cursorline fill color with #333842 68 | PmenuSel = { bg = "#333842" }, 69 | illuminatedWord = { bg = "#3b4261" }, 70 | illuminatedCurWord = { bg = "#3b4261" }, 71 | IlluminatedWordText = { bg = "#3b4261" }, 72 | IlluminatedWordRead = { bg = "#3b4261" }, 73 | IlluminatedWordWrite = { bg = "#3b4261" }, 74 | StatusLine = { fg = "#f8f8f2", bg = is_transparent and "NONE" or "${bg}" }, 75 | StatusLineTerm = { fg = "#f8f8f2", bg = "${bg}" }, 76 | BufferLineFill = { bg = is_transparent and "NONE" or "${bg}" }, 77 | ["@string.special.url.html"] = { fg = "${green}" }, 78 | ["@lsp.type.parameter"] = { fg = "${gray}" }, 79 | -- ["@text.uri.html"] = { fg = "${green}" }, 80 | -- ["@tag.javascript"] = { fg = "${red}" }, 81 | -- ["@tag.attribute"] = { fg = "${orange}", style = "italic" }, 82 | -- ["@constructor.javascript"] = { fg = "${red}" }, 83 | -- ["@variable"] = { fg = "${fg}", style = "NONE" }, -- various variable names 84 | -- ["@variable.builtin"] = { fg = "${red}", style = "NONE" }, 85 | -- ["@variable.member"] = "${cyan}", 86 | -- ["@variable.parameter"] = "${red}", 87 | -- ["@property"] = { fg = "${cyan}" }, -- similar to `@field` 88 | ["@property.lua"] = { fg = "${red}", bg = "NONE" }, 89 | ["@lsp.type.property.lua"] = { fg = "${cyan}", bg = "NONE" }, 90 | ["@lsp.type.variable.lua"] = { fg = "${red}", bg = "NONE" }, 91 | NvimTreeGitDirty = { fg = "${yellow}" }, 92 | Pmenu = { fg = "${fg}", bg = "${bg}" }, 93 | PmenuThumb = { bg = "${gray}" }, -- Popup menu: Thumb of the scrollbar. 94 | -- overide lualine fill color with bg color 95 | LualineNormal = { bg = "${bg}" }, 96 | -- overide lualine_c fill color with bg color 97 | LualineC = { bg = "${bg}" }, 98 | -- overide lualine_x fill color with bg color 99 | LualineX = { bg = "${bg}" }, 100 | -- overide which-key fill color with bg color 101 | -- WhichKey = { bg = "${bg}" }, 102 | -- -- overide which-key fill color with bg color 103 | -- WhichKeySeperator = { bg = "${bg}" }, 104 | -- -- overide which-key fill color with bg color 105 | -- WhichKeyDesc = { fg = "${red}" }, 106 | -- -- overide which-key fill color with bg color 107 | -- WhichKeyFloat = { bg = "${bg}" }, 108 | WhichKeyFloat = { bg = is_transparent and "NONE" or "${bg}" }, 109 | -- -- overide which-key fill color with bg color 110 | -- WhichKeyValue = { bg = "${bg}" }, 111 | -- -- overide which-key fill color with bg color 112 | -- WhichKeyBorder = { bg = "${bg}" }, 113 | LspInfoBorder = { fg = "${fg}" }, 114 | NormalFloat = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" }, 115 | Normal = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" }, 116 | NormalNC = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" }, 117 | FloatBorder = { fg = "${fg}", bg = is_transparent and "NONE" or "${bg}" }, 118 | NonText = { bg = "NONE", fg = "#3E4450" }, 119 | }, 120 | }) 121 | local colorscheme = pcode.themes.onedarkpro or "onedark" 122 | vim.cmd("colorscheme " .. colorscheme) 123 | end, 124 | } 125 | -------------------------------------------------------------------------------- /lua/pcode/plugins/theme/sublimetext.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "pojokcodeid/nvim-juliana", 3 | lazy = false, 4 | priority = 1000, 5 | opts = {}, 6 | config = function() 7 | vim.api.nvim_create_autocmd("ColorScheme", { 8 | pattern = "*", 9 | callback = function() 10 | -- get colors 11 | local colors = require("nvim-juliana").colors() 12 | -- custom hilights 13 | local hi = vim.api.nvim_set_hl 14 | hi(0, "FoldColumn", { bg = colors.bg2 }) 15 | end, 16 | }) 17 | end, 18 | } 19 | -------------------------------------------------------------------------------- /lua/pcode/plugins/theme/tokyonight.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/tokyonight.nvim", 3 | priority = 1000, 4 | config = function() 5 | local status_ok, tokyonight = pcall(require, "tokyonight") 6 | if not status_ok then 7 | return 8 | end 9 | local transp = false 10 | local sidebar = "normal" --"dark , transparent, normal" 11 | local hilight = "#292e42" 12 | local tras = pcode.transparent_mode or 0 13 | if tras == 1 then 14 | transp = true 15 | sidebar = "transparent" 16 | -- hilight = "#3E4254" 17 | -- hilight = "#353a56" 18 | hilight = "#292e42" 19 | end 20 | 21 | tokyonight.setup({ 22 | -- your configuration comes here 23 | -- or leave it empty to use the default settings 24 | style = "night", -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day` 25 | light_style = "day", -- The theme is used when the background is set to light 26 | transparent = transp, -- Enable this to disable setting the background color 27 | terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim 28 | styles = { 29 | -- Style to be applied to different syntax groups 30 | -- Value is any valid attr-list value for `:help nvim_set_hl` 31 | -- comments = { italic = true }, 32 | comments = { italic = true }, 33 | keywords = {}, 34 | functions = {}, 35 | variables = {}, 36 | -- Background styles. Can be "dark", "transparent" or "normal" 37 | sidebars = sidebar, -- style for sidebars, see below 38 | floats = sidebar, -- style for floating windows 39 | }, 40 | sidebars = { "qf", "help" }, -- Set a darker background on sidebar-like windows. For example: `["qf", "vista_kind", "terminal", "packer"]` 41 | day_brightness = 0.2, -- Adjusts the brightness of the colors of the **Day** style. Number between 0 and 1, from dull to vibrant colors 42 | 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**. 43 | dim_inactive = false, -- dims inactive windows 44 | lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold 45 | 46 | --- You can override specific color groups to use other groups or a hex color 47 | --- function will be called with a ColorScheme table 48 | -- @param colors ColorScheme 49 | on_colors = function(colors) 50 | colors.bg_highlight = hilight 51 | colors.bg_statusline = colors.none 52 | end, 53 | 54 | --- You can override specific highlights to use other groups or a hex color 55 | --- function will be called with a Highlights and ColorScheme table 56 | --@param highlights Highlights 57 | -- @param colors ColorScheme 58 | on_highlights = function(highlights, colors) 59 | highlights.NvimTreeFolderIcon = { 60 | bg = colors.none, 61 | fg = "#e0af68", 62 | } 63 | highlights.Underlined = { 64 | underline = false, 65 | } 66 | highlights.NvimTreeWinSeparator = { 67 | fg = colors.border, 68 | } 69 | highlights.BufferLineFill = { bg = colors.bg } 70 | highlights.NvimTreeSpecialFile = { fg = colors.purple, underline = false } 71 | highlights["@tag.attribute"] = { fg = colors.green1, italic = true } 72 | -- highlights["@keyword.function"] = { fg = colors.blue, italic = true } 73 | -- highlights["@function"] = { fg = colors.blue, italic = true } 74 | end, 75 | }) 76 | end, 77 | } 78 | -------------------------------------------------------------------------------- /lua/pcode/plugins/toggleterm.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "akinsho/toggleterm.nvim", 3 | lazy = true, 4 | cmd = { 5 | "ToggleTerm", 6 | "TermExec", 7 | "ToggleTermToggleAll", 8 | "ToggleTermSendCurrentLine", 9 | "ToggleTermSendVisualLines", 10 | "ToggleTermSendVisualSelection", 11 | }, 12 | branch = "main", 13 | enabled = true, 14 | opts = { 15 | size = 20, 16 | open_mapping = [[]], 17 | hide_numbers = true, 18 | shade_filetypes = {}, 19 | shade_terminals = true, 20 | shading_factor = 2, 21 | start_in_insert = true, 22 | insert_mappings = true, 23 | persist_size = true, 24 | direction = "float", 25 | close_on_exit = true, 26 | shell = vim.o.shell, 27 | float_opts = { 28 | border = "curved", 29 | winblend = 0, 30 | highlights = { 31 | border = "Normal", 32 | background = "Normal", 33 | }, 34 | }, 35 | }, 36 | config = function(_, opts) 37 | require("toggleterm").setup(opts) 38 | function _G.set_terminal_keymaps() 39 | local optsn = { noremap = true } 40 | vim.api.nvim_buf_set_keymap(0, "t", "", [[]], optsn) 41 | vim.api.nvim_buf_set_keymap(0, "t", "jk", [[]], optsn) 42 | vim.api.nvim_buf_set_keymap(0, "t", "", [[h]], optsn) 43 | vim.api.nvim_buf_set_keymap(0, "t", "", [[j]], optsn) 44 | vim.api.nvim_buf_set_keymap(0, "t", "", [[k]], optsn) 45 | vim.api.nvim_buf_set_keymap(0, "t", "", [[l]], optsn) 46 | end 47 | vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()") 48 | end, 49 | keys = { 50 | { "t", "", desc = "  Terminal", mode = "n" }, 51 | { "tx", "ToggleTermToggleAll!", desc = "Close Tab", mode = "n" }, 52 | { "tf", "ToggleTerm direction=float", desc = "Float", mode = "n" }, 53 | { "th", "ToggleTerm size=10 direction=horizontal", desc = "Horizontal", mode = "n" }, 54 | { "tv", "ToggleTerm size=80 direction=vertical", desc = "Vertical", mode = "n" }, 55 | { "ts", "ToggleTerm direction=tab", desc = "New Tab", mode = "n" }, 56 | }, 57 | } 58 | -------------------------------------------------------------------------------- /lua/pcode/plugins/webdevicon.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "kyazdani42/nvim-web-devicons", 3 | lazy = true, 4 | dependencies = "pojokcodeid/nvim-material-icon", 5 | opts = function() 6 | local material_icon_ok, material_icon = pcall(require, "nvim-material-icon") 7 | if not material_icon_ok then 8 | return 9 | end 10 | material_icon.setup({ 11 | override = {}, 12 | }) 13 | return { 14 | override = material_icon.get_icons(), 15 | override_by_filename = {}, 16 | } 17 | end, 18 | config = function(_, opts) 19 | require("nvim-web-devicons").setup(opts) 20 | end, 21 | } 22 | -------------------------------------------------------------------------------- /lua/pcode/plugins/whichkey.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/which-key.nvim", 3 | lazy = true, 4 | keys = { "", '"', "'", "`", "c", "v" }, 5 | event = "VeryLazy", 6 | opts = function() 7 | return { 8 | plugins = { 9 | marks = true, 10 | registers = true, 11 | spelling = { 12 | enabled = true, 13 | suggestions = 20, 14 | }, 15 | presets = { 16 | operators = false, 17 | motions = false, 18 | text_objects = false, 19 | windows = false, 20 | nav = false, 21 | z = false, 22 | g = false, 23 | }, 24 | }, 25 | icons = { 26 | mappings = false, 27 | }, 28 | win = { 29 | row = -1, 30 | border = "rounded", -- none, single, double, shadow 31 | padding = { 1, 2 }, -- extra window padding [top/bottom, right/left] 32 | title = true, 33 | title_pos = "center", 34 | zindex = 1000, 35 | bo = {}, 36 | wo = {}, 37 | }, 38 | layout = { 39 | height = { min = 4, max = 25 }, -- min and max height of the columns 40 | width = { min = 20, max = 50 }, -- min and max width of the columns 41 | spacing = 3, -- spacing between columns 42 | align = "left", -- align columns left, center or right 43 | }, 44 | show_help = true, -- show help message on the command line when the popup is visible 45 | show_keys = true, -- show the currently pressed key and its label as a message in the command line 46 | -- Disabled by default for Telescope 47 | disable = { 48 | buftypes = {}, 49 | filetypes = { "TelescopePrompt" }, 50 | }, 51 | ---@type false | "classic" | "modern" | "helix" 52 | preset = "classic", 53 | mappings = { 54 | { "S", "", desc = " 󱑠 Plugins(Lazy)", mode = "n" }, 55 | { "Si", "Lazy install", desc = "Install", mode = "n" }, 56 | { "Ss", "Lazy sync", desc = "Sync", mode = "n" }, 57 | { "SS", "Lazy clear", desc = "Status", mode = "n" }, 58 | { "Sc", "Lazy clean", desc = "Clean", mode = "n" }, 59 | { "Su", "Lazy update", desc = "Update", mode = "n" }, 60 | { "Sp", "Lazy profile", desc = "Profile", mode = "n" }, 61 | { "Sl", "Lazy log", desc = "Log", mode = "n" }, 62 | { "Sd", "Lazy debug", desc = "Debug", mode = "n" }, 63 | { "w", "w!", desc = "󰆓 Save", mode = "n" }, 64 | { "q", "q!", desc = "󰿅 Quit", mode = "n" }, 65 | { "h", "nohlsearch", desc = "󱪿 No Highlight", mode = "n" }, 66 | }, 67 | } 68 | end, 69 | config = function(_, opts) 70 | local which_key = require("which-key") 71 | which_key.setup(opts) 72 | which_key.add(opts.mappings) 73 | end, 74 | } 75 | -------------------------------------------------------------------------------- /lua/pcode/user/autocmd.lua: -------------------------------------------------------------------------------- 1 | local api = vim.api 2 | 3 | -- General Settings 4 | api.nvim_create_augroup("_general_settings", { clear = true }) 5 | 6 | -- api.nvim_create_autocmd("TextYankPost", { 7 | -- group = "_general_settings", 8 | -- callback = function() 9 | -- require("vim.highlight").on_yank({ higroup = "Visual", timeout = 200 }) 10 | -- end, 11 | -- }) 12 | 13 | api.nvim_create_autocmd("FileType", { 14 | group = "_general_settings", 15 | pattern = "qf", 16 | command = "set nobuflisted", 17 | }) 18 | 19 | -- Git Settings 20 | api.nvim_create_augroup("_git", { clear = true }) 21 | api.nvim_create_autocmd("FileType", { 22 | group = "_git", 23 | pattern = "gitcommit", 24 | command = "setlocal wrap spell", 25 | }) 26 | 27 | -- Markdown Settings 28 | api.nvim_create_augroup("_markdown", { clear = true }) 29 | api.nvim_create_autocmd("FileType", { 30 | group = "_markdown", 31 | pattern = "markdown", 32 | command = "setlocal wrap spell", 33 | }) 34 | 35 | -- Auto Resize 36 | api.nvim_create_augroup("_auto_resize", { clear = true }) 37 | api.nvim_create_autocmd("VimResized", { 38 | group = "_auto_resize", 39 | command = "tabdo wincmd =", 40 | }) 41 | 42 | -- Alpha Settings 43 | api.nvim_create_augroup("_alpha", { clear = true }) 44 | api.nvim_create_autocmd("User", { 45 | group = "_alpha", 46 | pattern = "AlphaReady", 47 | command = "set showtabline=0 | autocmd BufUnload set showtabline=2", 48 | }) 49 | 50 | -- Terminal Settings 51 | api.nvim_create_augroup("neovim_terminal", { clear = true }) 52 | api.nvim_create_autocmd("TermOpen", { 53 | group = "neovim_terminal", 54 | command = "startinsert | set nonumber norelativenumber | nnoremap i", 55 | }) 56 | 57 | -- Function to Create Non-Existent Directory on BufWrite 58 | local function MkNonExDir(file, buf) 59 | if vim.fn.empty(vim.fn.getbufvar(buf, "&buftype")) == 1 and not string.match(file, "^%w+://") then 60 | local dir = vim.fn.fnamemodify(file, ":h") 61 | if vim.fn.isdirectory(dir) == 0 then 62 | vim.fn.mkdir(dir, "p") 63 | end 64 | end 65 | end 66 | 67 | api.nvim_create_augroup("BWCCreateDir", { clear = true }) 68 | api.nvim_create_autocmd("BufWritePre", { 69 | group = "BWCCreateDir", 70 | callback = function(_) 71 | MkNonExDir(vim.fn.expand(""), vim.fn.expand("")) 72 | end, 73 | }) 74 | 75 | -- for fix error last close buffer 76 | vim.api.nvim_create_autocmd({ "QuitPre" }, { 77 | callback = function() 78 | vim.cmd("NvimTreeClose") 79 | end, 80 | }) 81 | 82 | local autocmd = vim.api.nvim_create_autocmd 83 | autocmd("VimEnter", { 84 | pattern = "*", 85 | callback = function() 86 | vim.opt.statusline = "%#normal# " 87 | end, 88 | }) 89 | 90 | vim.api.nvim_create_autocmd("FileType", { 91 | pattern = { "help", "alpha", "dashboard", "NvimTree", "Trouble", "lazy", "mason", "neotest-summary" }, 92 | callback = function() 93 | vim.b.miniindentscope_disable = true 94 | end, 95 | }) 96 | 97 | vim.filetype.add({ 98 | pattern = { 99 | [".*%.blade%.php"] = "blade", 100 | }, 101 | }) 102 | 103 | -- config cursor 104 | vim.opt.guicursor = { 105 | "n-v:block", -- Normal, Visual, Command mode: block cursor 106 | "i-ci-ve-c:ver25", -- Insert, Command-line Insert, Visual mode: vertical bar cursor 107 | "r-cr:hor20", -- Replace, Command-line Replace mode: horizontal bar cursor 108 | "o:hor50", -- Operator-pending mode: horizontal bar cursor 109 | "a:blinkwait700-blinkoff400-blinkon250", -- Blinking settings 110 | "sm:block-blinkwait175-blinkoff150-blinkon175", -- Select mode: block cursor with blinking 111 | } 112 | 113 | vim.api.nvim_create_autocmd("ExitPre", { 114 | group = vim.api.nvim_create_augroup("Exit", { clear = true }), 115 | 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", 116 | desc = "Set cursor back to beam when leaving Neovim.", 117 | }) 118 | 119 | -- Create an autocmd to set keymap for Java files 120 | -- vim.api.nvim_create_augroup("java_gradle_run", { clear = true }) 121 | -- vim.api.nvim_create_autocmd("FileType", { 122 | -- pattern = "java", 123 | -- callback = function() 124 | -- vim.api.nvim_set_keymap("n", "rg", "terminalgradle run", { noremap = true, silent = true }) 125 | -- end, 126 | -- }) 127 | -------------------------------------------------------------------------------- /lua/pcode/user/colorscheme.lua: -------------------------------------------------------------------------------- 1 | if pcode.themes then 2 | local theme = "" 3 | for _, value in pairs(pcode.themes or {}) do 4 | theme = value 5 | end 6 | pcall(vim.cmd.colorscheme, theme) 7 | end 8 | -------------------------------------------------------------------------------- /lua/pcode/user/custom.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- overidse dashboard 3 | { 4 | "goolord/alpha-nvim", 5 | opts = { 6 | dash_model = { 7 | [[ _ __ __ ]], 8 | [[ ___ ___ (____ / /__ _______ ___/ ___ ]], 9 | [[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]], 10 | [[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]], 11 | [[ /_/ |___/ ]], 12 | }, 13 | }, 14 | }, 15 | -- overide lualine 16 | { 17 | "pojokcodeid/auto-lualine.nvim", 18 | opts = { 19 | -- for more options check out https://github.com/pojokcodeid/auto-lualine.nvim 20 | setColor = "auto", 21 | setOption = "roundedall", 22 | setMode = 5, 23 | }, 24 | }, 25 | -- overide formatting 26 | { 27 | "pojokcodeid/auto-conform.nvim", 28 | opts = { 29 | format_on_save = true, 30 | format_timeout_ms = 5000, 31 | }, 32 | }, 33 | -- install treesitter 34 | { 35 | "nvim-treesitter/nvim-treesitter", 36 | opts = function(_, opts) 37 | vim.list_extend(opts.ensure_installed, { "lua", "c" }) 38 | end, 39 | }, 40 | -- install mason (lsp, dap, linters, formatters) 41 | { 42 | "williamboman/mason.nvim", 43 | opts = { ensure_installed = { "stylua" } }, 44 | }, 45 | -- overide lsp config 46 | { 47 | "williamboman/mason-lspconfig.nvim", 48 | opts = function(_, opts) 49 | vim.list_extend(opts.skip_config, {}) 50 | opts.virtual_text = true 51 | end, 52 | }, 53 | -- add whichkey mappings 54 | { 55 | "folke/which-key.nvim", 56 | opts = function(_, opts) 57 | opts.mappings = opts.mappings or {} 58 | vim.list_extend(opts.mappings, { 59 | { "h", "nohlsearch", desc = "󱪿 No Highlight", mode = "n" }, 60 | }) 61 | end, 62 | }, 63 | -- overide telescope 64 | { 65 | "nvim-telescope/telescope.nvim", 66 | opts = function(_, opts) 67 | opts.pickers = { 68 | find_files = { 69 | hidden = true, 70 | }, 71 | live_grep = { 72 | theme = "dropdown", 73 | only_sort_text = true, 74 | additional_args = function() 75 | return { "--multiline" } 76 | end, 77 | }, 78 | } 79 | end, 80 | }, 81 | -- add code runner 82 | { 83 | "CRAG666/code_runner.nvim", 84 | opts = function(_, opts) 85 | vim.list_extend(opts.filetype, { go = "go run $fileName" }) 86 | end, 87 | }, 88 | -- custem nvimtree 89 | { 90 | "nvim-tree/nvim-tree.lua", 91 | opts = function(_, opts) 92 | -- set nvimtree float view (default left side) 93 | -- opts.view = { 94 | -- adaptive_size = false, 95 | -- centralize_selection = true, 96 | -- side = "left", 97 | -- preserve_window_proportions = false, 98 | -- number = false, 99 | -- relativenumber = false, 100 | -- signcolumn = "yes", 101 | -- float = { 102 | -- enable = true, 103 | -- open_win_config = function() 104 | -- local screen_w = vim.opt.columns:get() 105 | -- local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get() 106 | -- local window_w = screen_w * 0.5 107 | -- local window_h = screen_h * 0.9 108 | -- local window_w_int = math.floor(window_w) 109 | -- local window_h_int = math.floor(window_h) 110 | -- local center_x = (screen_w - window_w) / 2 111 | -- local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get() 112 | -- return { 113 | -- border = "rounded", 114 | -- relative = "editor", 115 | -- row = center_y, 116 | -- col = center_x, 117 | -- width = window_w_int, 118 | -- height = window_h_int, 119 | -- } 120 | -- end, 121 | -- }, 122 | -- width = function() 123 | -- return math.floor(vim.opt.columns:get() * 0.5) 124 | -- end, 125 | -- } 126 | return opts 127 | end, 128 | }, 129 | } 130 | -------------------------------------------------------------------------------- /lua/pcode/user/dapui.lua: -------------------------------------------------------------------------------- 1 | -- local dap, dapui = require("dap"), require("dapui") 2 | 3 | local dap_status_ok, dap = pcall(require, "dap") 4 | if not dap_status_ok then 5 | return 6 | end 7 | 8 | local dap_ui_status_ok, dapui = pcall(require, "dapui") 9 | if not dap_ui_status_ok then 10 | return 11 | end 12 | 13 | -- dapui.setup() 14 | dapui.setup({ 15 | icons = { expanded = "▾", collapsed = "▸" }, 16 | mappings = { 17 | -- Use a table to apply multiple mappings 18 | expand = { "", "<2-LeftMouse>" }, 19 | open = "o", 20 | remove = "d", 21 | edit = "e", 22 | repl = "r", 23 | toggle = "t", 24 | }, 25 | -- Expand lines larger than the window 26 | -- Requires >= 0.7 27 | expand_lines = vim.fn.has("nvim-0.7"), 28 | -- Layouts define sections of the screen to place windows. 29 | -- The position can be "left", "right", "top" or "bottom". 30 | -- The size specifies the height/width depending on position. It can be an Int 31 | -- or a Float. Integer specifies height/width directly (i.e. 20 lines/columns) while 32 | -- Float value specifies percentage (i.e. 0.3 - 30% of available lines/columns) 33 | -- Elements are the elements shown in the layout (in order). 34 | -- Layouts are opened in order so that earlier layouts take priority in window sizing. 35 | layouts = { 36 | { 37 | elements = { 38 | -- Elements can be strings or table with id and size keys. 39 | { id = "scopes", size = 0.25 }, 40 | "breakpoints", 41 | -- "stacks", 42 | -- "watches", 43 | }, 44 | size = 40, -- 40 columns 45 | position = "right", 46 | }, 47 | { 48 | elements = { 49 | "repl", 50 | "console", 51 | }, 52 | size = 0.25, -- 25% of total lines 53 | position = "bottom", 54 | }, 55 | }, 56 | floating = { 57 | max_height = nil, -- These can be integers or a float between 0 and 1. 58 | max_width = nil, -- Floats will be treated as percentage of your screen. 59 | border = "single", -- Border style. Can be "single", "double" or "rounded" 60 | mappings = { 61 | close = { "q", "" }, 62 | }, 63 | }, 64 | windows = { indent = 1 }, 65 | render = { 66 | max_type_length = nil, -- Can be integer or nil. 67 | }, 68 | }) 69 | 70 | dap.listeners.after.event_initialized["dapui_config"] = function() 71 | -- dapui.setup() 72 | dapui.open() 73 | end 74 | dap.listeners.before.event_terminated["dapui_config"] = function() 75 | dapui.close() 76 | end 77 | dap.listeners.before.event_exited["dapui_config"] = function() 78 | dapui.close() 79 | end 80 | -- vim.fn.sign_define("DapBreakpoint", { text = "🟥", texthl = "", linehl = "", numhl = "" }) 81 | -- vim.fn.sign_define("DapBreakpoint", { text = "", texthl = "DiagnosticSignError", linehl = "", numhl = "" }) 82 | vim.fn.sign_define("DapBreakpoint", { text = "󰨰", texthl = "DiagnosticSignError", linehl = "", numhl = "" }) 83 | vim.fn.sign_define("DapStopped", { text = "▶️", texthl = "", linehl = "", numhl = "" }) 84 | -------------------------------------------------------------------------------- /lua/pcode/user/default.lua: -------------------------------------------------------------------------------- 1 | -- activate config spesific languages 2 | pcode.lang = { 3 | angular = false, 4 | cpp = false, 5 | sql = false, 6 | deno = false, 7 | golang = true, 8 | java = false, 9 | java2 = false, 10 | java3 = false, 11 | java4 = false, 12 | javascript = false, 13 | kotlin = false, 14 | markdown = false, 15 | php = false, 16 | prisma = false, 17 | python = false, 18 | rust = false, 19 | tailwind = false, 20 | } 21 | -- activate config extras 22 | pcode.extras = { 23 | autosave = false, 24 | bigfiles = false, 25 | codeiumnvim = false, 26 | liveserver = false, 27 | minianimate = false, 28 | neoscroll = false, 29 | nvimufo = false, 30 | refactoring = true, 31 | rest = false, 32 | treesittercontex = false, 33 | codeium = true, 34 | colorizer = true, 35 | dap = true, 36 | deviconcolor = true, 37 | illuminate = true, 38 | indentscupe = true, 39 | navic = true, 40 | nvimmenu = true, 41 | rainbowdelimiters = true, 42 | scrollview = true, 43 | smartsplit = true, 44 | verticalcolumn = true, 45 | visualmulti = true, 46 | yanky = true, 47 | zenmode = true, 48 | lspsignatur = false, 49 | telescopetreesiterinfo = true, 50 | } 51 | -- activate config themes 52 | pcode.themes = { 53 | -- note: open remark only one 54 | -- **:: Eva Theme ::** -- 55 | evatheme = "Eva-Dark", 56 | -- evatheme = "Eva-Dark-Italic", 57 | -- evatheme = "Eva-Dark-Bold", 58 | -- evatheme = "Eva-Light", 59 | -- 60 | -- **:: Dracula Theme ::** -- 61 | -- dracula = "dracula", 62 | -- dracula = "dracula-soft", 63 | -- 64 | -- **:: Onedarkpro Theme ::** -- 65 | -- onedarkpro = "onedark", 66 | -- onedarkpro = "onedark_vivid", 67 | -- onedarkpro = "onedark_dark", 68 | -- 69 | -- **:: Jetbrains Theme ::** -- 70 | -- jetbrains = "darcula-dark", 71 | -- 72 | -- **:: Sublimetext Theme ::** -- 73 | -- sublimetext = "juliana", 74 | -- 75 | -- **:: Tokyonight Theme ::** -- 76 | -- tokyonight = "tokyonight-night", 77 | -- tokyonight = "tokyonight-storm", 78 | -- tokyonight = "tokyonight-day", 79 | -- tokyonight = "tokyonight-moon", 80 | -- 81 | -- **:: Catppuccin Theme ::** -- 82 | -- catppuccin = "catppuccin", 83 | -- catppuccin = "catppuccin-latte", 84 | -- catppuccin = "catppuccin-frappe", 85 | -- catppuccin = "catppuccin-macchiato", 86 | -- catppuccin = "catppuccin-macchiato", 87 | -- 88 | -- **:: Gruvbox Theme ::** -- 89 | -- gruvbox = "gruvbox", 90 | -- 91 | -- **:: Github Theme ::** -- 92 | -- github = "github_dark_dimmed", 93 | } 94 | -- activate config transparent_bg 95 | pcode.transparent = false 96 | pcode.localcode = true 97 | pcode.snippets_path = vim.fn.stdpath("config") .. "/mysnippets" 98 | -------------------------------------------------------------------------------- /lua/pcode/user/icons.lua: -------------------------------------------------------------------------------- 1 | return { 2 | kind = { 3 | Boolean = "󰨙", 4 | Color = "", 5 | Codeium = "󰘦", 6 | Control = "", 7 | Collapsed = " ", 8 | Component = "󰅴", 9 | Copilot = "", 10 | CopilotOff = "", 11 | Folder = "󰉋", 12 | Keyword = "", 13 | Reference = "", 14 | Snippet = "", 15 | TabNine = "󰏚", 16 | Text = "", 17 | Unit = "", 18 | Value = "", 19 | File = "", 20 | Module = "", 21 | Namespace = "", 22 | Package = "", 23 | Class = "", 24 | Method = "", 25 | Property = "", 26 | Field = "", 27 | Constructor = "", 28 | Enum = "", 29 | Interface = "", 30 | Function = "", 31 | Fragment = "󰅴", 32 | Variable = "", 33 | Constant = "", 34 | String = "", 35 | Number = "", 36 | Array = "", 37 | Object = "", 38 | Key = "", 39 | Null = "", 40 | EnumMember = "", 41 | Struct = "", 42 | Event = "", 43 | Operator = "", 44 | TypeParameter = "", 45 | }, 46 | git = { 47 | LineAdded = "", 48 | LineModified = "", 49 | LineRemoved = "", 50 | FileDeleted = "", 51 | FileIgnored = "", 52 | FileRenamed = "", 53 | FileStaged = "S", 54 | FileUnmerged = "", 55 | FileUnstaged = "", 56 | FileUntracked = "U", 57 | Diff = "", 58 | Repo = "", 59 | Octoface = "", 60 | Branch = "", 61 | Branch2 = "", 62 | Branch3 = "󰘬", 63 | NoBranch = "󱓌", 64 | }, 65 | ui = { 66 | ArrowCircleDown = "", 67 | ArrowCircleLeft = "", 68 | ArrowCircleRight = "", 69 | ArrowCircleUp = "", 70 | BoldArrowDown = "", 71 | BoldArrowLeft = "", 72 | BoldArrowRight = "", 73 | BoldArrowUp = "", 74 | BoldClose = "", 75 | BoldDividerLeft = "", 76 | BoldDividerRight = "", 77 | BoldLineLeft = "▎", 78 | BookMark = "", 79 | BoxChecked = "", 80 | Bug = "", 81 | Stacks = "", 82 | Scopes = "", 83 | Watches = "󰂥", 84 | DebugConsole = "", 85 | Calendar = "", 86 | Check = "", 87 | ChevronRight = "", 88 | ChevronShortDown = "", 89 | ChevronShortLeft = "", 90 | ChevronShortRight = "", 91 | ChevronShortUp = "", 92 | ChevronShortDown2 = " ", 93 | ChevronShortLeft2 = "", 94 | ChevronShortRight2 = "", 95 | ChevronShortUp2 = "", 96 | Circle = " ", 97 | Close = "󰅖", 98 | CloudDownload = "", 99 | Code = "", 100 | Comment = "", 101 | Dashboard = "", 102 | DividerLeft = "", 103 | DividerRight = "", 104 | DoubleChevronRight = "»", 105 | Ellipsis = "", 106 | EmptyFolder = "󰉖", 107 | EmptyFolderOpen = "󰷏", 108 | File = "", 109 | FileSymlink = "", 110 | Files = "", 111 | FindFile = "󰈞", 112 | FindText = "󰊄", 113 | Fire = "", 114 | Folder = "󰉋", 115 | FolderOpen = "󰝰", 116 | FolderSymlink = "", 117 | Forward = "", 118 | Gear = "", 119 | History = "", 120 | Lightbulb = "", 121 | LineLeft = "▏", 122 | LineMiddle = "│", 123 | List = "", 124 | Lock = "", 125 | NewFile = "", 126 | Note = "", 127 | Package = "", 128 | Pencil = "󰏫", 129 | Plus = "", 130 | Project = "", 131 | Search = "", 132 | SignIn = "", 133 | SignOut = "", 134 | Tab = "󰌒", 135 | Table = "", 136 | Target = "󰀘", 137 | Telescope = "", 138 | Text = "", 139 | Tree = "", 140 | Triangle = "󰐊", 141 | TriangleShortArrowDown = "", 142 | TriangleShortArrowLeft = "", 143 | TriangleShortArrowRight = "", 144 | TriangleShortArrowUp = "", 145 | Neovim = "", 146 | Pending = " ", 147 | BlankCircle = " ", 148 | CheckCircle = " ", 149 | DotCircle = " ", 150 | Border = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, 151 | ProjekFolder = "󱧶", 152 | Bell = "󰂠", 153 | ft = "", 154 | not_loaded = "", 155 | Paint = "", 156 | }, 157 | folding = { 158 | vert = "▕", -- alternatives │ 159 | fold = " ", 160 | eob = " ", -- suppress ~ at EndOfBuffer 161 | diff = "╱", -- alternatives = ⣿ ░ ─ 162 | msgsep = "‾", 163 | foldopen = "▾", 164 | foldsep = "│", 165 | foldclose = "▸", 166 | plusBox = "󰜄", 167 | plusSircle = "󰐙", 168 | plus = "󰐕", 169 | minusBox = "󰛲", 170 | minusSircle = "󰍷", 171 | minus = "󰍴", 172 | }, 173 | diagnostics = { 174 | BoldError = "", 175 | Error = "", 176 | BoldWarning = "", 177 | Warning = "", 178 | BoldInformation = "", 179 | Information = "", 180 | BoldQuestion = "", 181 | Question = "", 182 | BoldHint = "", 183 | Hint = "󰌶", 184 | Debug = "", 185 | Trace = "✎", 186 | }, 187 | misc = { 188 | Robot = "󰚩", 189 | Squirrel = "", 190 | Tag = "", 191 | Watch = "", 192 | Smiley = "", 193 | Package = "", 194 | CircuitBoard = "", 195 | }, 196 | } 197 | -------------------------------------------------------------------------------- /lua/pcode/user/java.lua: -------------------------------------------------------------------------------- 1 | require("auto-jdtls2.create_gradle_project") 2 | require("auto-jdtls2.create_maven_project") 3 | require("auto-jdtls2.create_springboot_project") 4 | -------------------------------------------------------------------------------- /lua/pcode/user/keymaps.lua: -------------------------------------------------------------------------------- 1 | -- definiskanfunction name 2 | local keymap = vim.api.nvim_set_keymap 3 | local opts = { noremap = true, silent = true } 4 | 5 | -- Remap space leader keys 6 | keymap("", "", "", opts) 7 | vim.g.mapleader = " " 8 | vim.g.maplocalleader = " " 9 | 10 | -- MODES 11 | -- mormal mode = "n" 12 | -- insert mode = "i" 13 | -- visual mode = "v" 14 | -- visual block mode = "x" 15 | -- term mode = "t" 16 | -- command mode = "c" 17 | 18 | for _, mode in ipairs({ "i", "v", "n", "x" }) do 19 | -- duplicate line 20 | keymap(mode, "", "t.", opts) 21 | keymap(mode, "", "t -1", opts) 22 | -- save file 23 | keymap(mode, "", "silent! w", opts) 24 | end 25 | 26 | -- duplicate line visual block 27 | keymap("x", "", ":'<,'>t'>", opts) 28 | keymap("x", "", ":'<,'>t-1", opts) 29 | 30 | -- move text up and down 31 | keymap("x", "", ":move '>+1gv-gv", opts) 32 | keymap("x", "", ":move '<-2gv-gv", opts) 33 | keymap("n", "", "m+", opts) 34 | keymap("i", "", "m+", opts) 35 | keymap("n", "", "m-2", opts) 36 | keymap("i", "", "m-2", opts) 37 | 38 | -- create comment CTRL + / all mode 39 | keymap("v", "", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", opts) 40 | keymap("v", "", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", opts) 41 | keymap("i", "", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", opts) 42 | keymap("i", "", "lua require('Comment.api').toggle.linewise(vim.fn.visualmode())", opts) 43 | keymap("i", "", "lua require('Comment.api').toggle.linewise.current()", opts) 44 | keymap("i", "", "lua require('Comment.api').toggle.linewise.current()", opts) 45 | keymap("n", "", "lua require('Comment.api').toggle.linewise.current()", opts) 46 | keymap("n", "", "lua require('Comment.api').toggle.linewise.current()", opts) 47 | 48 | -- close windows 49 | keymap("n", "q", "q", opts) 50 | keymap("n", "f", "NvimTreeFindFileToggle", opts) 51 | 52 | -- window navigation 53 | keymap("n", "", "h", opts) 54 | keymap("n", "", "j", opts) 55 | keymap("n", "", "k", opts) 56 | keymap("n", "", "l", opts) 57 | keymap("n", "", "gg0v$G", opts) 58 | keymap("i", "", "gg0v$G", opts) 59 | keymap("n", "", '"+y', opts) 60 | keymap("v", "", '"+y', opts) 61 | keymap("x", "", '"+y', opts) 62 | keymap("n", "", '"+P', opts) 63 | keymap("v", "", '"+P', opts) 64 | keymap("i", "", "pa", opts) 65 | keymap("x", "", '"+P', opts) 66 | keymap("n", "", "undo", opts) 67 | keymap("x", "", "undo", opts) 68 | keymap("v", "", "undo", opts) 69 | keymap("i", "", "undo", opts) 70 | 71 | -- Navigate buffers 72 | keymap("n", "", ":bnext", opts) 73 | keymap("n", "", ":bnext", opts) 74 | keymap("n", "", ":bprevious", opts) 75 | keymap("n", "", ":bprevious", opts) 76 | 77 | -- Reordering Bufferline 78 | keymap("n", "", "BufferLineMovePrev", opts) 79 | keymap("n", "", "BufferLineMoveNext", opts) 80 | 81 | -- Press jk fast to exit insert mode 82 | keymap("i", "jk", "", opts) 83 | keymap("i", "kj", "", opts) 84 | 85 | -- Stay in indent mode 86 | keymap("v", "<", "", ">gv", opts) 88 | 89 | -- ALT + l to open terminal and run live-server 90 | keymap("n", "", "terminal live-server", opts) 91 | 92 | -- close current buffer 93 | keymap("n", "", "lua require('auto-bufferline.configs.utils').bufremove()", opts) 94 | -------------------------------------------------------------------------------- /lua/pcode/user/options.lua: -------------------------------------------------------------------------------- 1 | local options = { 2 | backspace = vim.opt.backspace + { "nostop" }, -- Jangan hentikan backspace saat insert 3 | clipboard = "unnamedplus", -- Koneksi ke clipboard sistem 4 | cmdheight = 0, -- Sembunyikan command line kecuali dibutuhkan 5 | completeopt = { "menuone", "noselect" }, -- Opsi untuk penyelesaian mode insert 6 | copyindent = true, -- Salin indentasi sebelumnya pada autoindenting 7 | cursorline = true, -- Sorot baris teks dari kursor 8 | expandtab = true, -- Aktifkan penggunaan spasi di tab 9 | fileencoding = "utf-8", -- Pengkodean konten file untuk buffer 10 | fillchars = { eob = " " }, -- Nonaktifkan `~` pada baris yang tidak ada 11 | history = 100, -- Jumlah perintah yang diingat dalam tabel riwayat 12 | ignorecase = true, -- Pencarian tidak peka huruf besar kecil 13 | laststatus = 3, -- globalstatus 14 | 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", 15 | lazyredraw = false, -- Layar digambar ulang dengan malas 16 | mouse = "a", -- Aktifkan dukungan mouse 17 | number = true, -- Tampilkan garis nomor 18 | preserveindent = true, -- Pertahankan struktur indentasi sebanyak mungkin 19 | pumheight = 10, -- Tinggi menu pop up 20 | relativenumber = true, -- Tampilkan garis nomor relatif 21 | scrolloff = 8, -- Jumlah baris untuk menjaga di atas dan di bawah kursor 22 | shiftwidth = 2, -- Jumlah spasi yang dimasukkan untuk indentasi 23 | showmode = false, -- Nonaktifkan menampilkan mode di command line 24 | showtabline = 2, -- Selalu tampilkan tabline 25 | sidescrolloff = 8, -- Jumlah kolom untuk menjaga di sisi kursor 26 | signcolumn = "yes", -- Selalu tampilkan kolom tanda 27 | smartcase = true, -- Pencarian peka huruf besar kecil 28 | splitbelow = true, -- Membagi jendela baru di bawah jendela saat ini 29 | splitright = true, -- Membagi jendela baru di kanan jendela saat ini 30 | swapfile = false, -- Nonaktifkan penggunaan swapfile untuk buffer 31 | tabstop = 2, -- Jumlah spasi dalam tab 32 | termguicolors = true, -- Aktifkan warna RGB 24-bit di TUI 33 | timeoutlen = 300, -- Panjang waktu tunggu untuk urutan yang dipetakan 34 | undofile = true, -- Aktifkan undo yang persisten 35 | updatetime = 300, -- Panjang waktu tunggu sebelum memicu plugin 36 | wrap = false, -- Nonaktifkan pembungkusan baris lebih panjang dari lebar jendela 37 | writebackup = false, -- Nonaktifkan membuat cadangan sebelum menimpa file 38 | guifont = "Hasklug Nerd Font:h15", -- font yang digunakan dalam aplikasi neovim grafis 39 | whichwrap = "bs<>[]hl", -- Kunci "horizontal" yang diizinkan untuk berpindah ke baris sebelumnya/selanjutnya 40 | } 41 | 42 | for k, v in pairs(options) do 43 | vim.opt[k] = v 44 | end 45 | 46 | -- vim.opt.shortmess = "ilmnrx" -- flags to shorten vim messages, see :help 'shortmess' 47 | -- vim.o.winbar = "%{%v:lua.require'nvim-navic'.get_location()%}" 48 | vim.opt.shortmess:append("c") -- don't give |ins-completion-menu| messages 49 | vim.opt.iskeyword:append("-") -- hyphenated words recognized by searches 50 | vim.opt.formatoptions:remove({ "t", "c", "q", "j" }) 51 | vim.opt.formatoptions = "croql" 52 | -- vim.opt.formatoptions:remove({ "c", "r", "o" }) -- don't insert the current comment leader automatically for auto-wrapping comments using 'textwidth', hitting in insert mode, or hitting 'o' or 'O' in normal mode. 53 | vim.opt.runtimepath:remove("/usr/share/vim/vimfiles") -- separate vim plugins from neovim in case vim still in use 54 | -- config for blink cursor in normal, visual and insert mode 55 | -- vim.opt.guicursor = { 56 | -- "n-v-c:block-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100", 57 | -- "i-ci:ver25-Cursor/lCursor-blinkwait1000-blinkon100-blinkoff100", 58 | -- "r:hor50-Cursor/lCursor-blinkwait100-blinkon100-blinkoff100", 59 | -- } 60 | vim.loader.enable() 61 | 62 | -- Disable statusline in dashboard 63 | vim.api.nvim_create_autocmd("FileType", { 64 | pattern = { "dbout", "dbui", "http", "httpResult" }, 65 | callback = function() 66 | local opt = vim.opt 67 | opt.number = false -- Print line number 68 | opt.preserveindent = false -- Preserve indent structure as much as possible 69 | opt.relativenumber = false 70 | end, 71 | }) 72 | 73 | vim.opt.guicursor = "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20" 74 | -------------------------------------------------------------------------------- /lua/pcode/user/snippets.lua: -------------------------------------------------------------------------------- 1 | local status_ok = pcall(require, "luasnip") 2 | if not status_ok then 3 | return 4 | end 5 | 6 | local lpath = pcode.snippets_path or vim.fn.stdpath("config") .. "/snippets" 7 | require("luasnip.loaders.from_vscode").lazy_load({ paths = lpath }) 8 | require("luasnip.loaders.from_vscode").load({ paths = lpath }) 9 | -------------------------------------------------------------------------------- /mysnippets/html/snippets.json: -------------------------------------------------------------------------------- 1 | { 2 | "consoledotLog": { 3 | "prefix": "console", 4 | "body": "console.log(${1:object});", 5 | "description": "Displays a message in the console" 6 | }, 7 | "alert": { 8 | "prefix": "alert", 9 | "body": "alert(${1:object});", 10 | "description": "Displays a message in the Popup Alert" 11 | }, 12 | "author": { 13 | "prefix": "@author", 14 | "body": [ 15 | "" 24 | ], 25 | "description": "@author = Pojok Code" 26 | }, 27 | "html5": { 28 | "prefix": "html5-All", 29 | "body": [ 30 | "", 31 | "", 36 | "", 37 | "\t", 38 | "\t\t$2", 39 | "\t\t", 40 | "\t\t", 41 | "\t\t", 42 | "\t\t", 43 | "\t", 44 | "\t", 45 | "\t\t$0", 46 | "\t\t", 47 | "\t", 48 | "" 49 | ], 50 | "description": "HTML-All - Defines a template for a html5 document Full", 51 | "scope": "text.html" 52 | }, 53 | "document.getElementById": { 54 | "prefix": "document.getElementById", 55 | "body": "document.getElementById(${1:object});", 56 | "description": "document.getElementById" 57 | }, 58 | "document.getElementsByName": { 59 | "prefix": "document.getElementsByName", 60 | "body": "document.getElementsByName(${1:object});", 61 | "description": "document.getElementsByName" 62 | }, 63 | "document.getElementsByTagName": { 64 | "prefix": "document.getElementsByTagName", 65 | "body": "document.getElementsByTagName(${1:object});", 66 | "description": "document.getElementsByTagName" 67 | }, 68 | "document.getElementsByClassName": { 69 | "prefix": "document.getElementsByClassName", 70 | "body": "document.getElementsByClassName(${1:object});", 71 | "description": "document.getElementsByClassName" 72 | }, 73 | "document.getElementsByTagNameNS": { 74 | "prefix": "document.getElementsByTagNameNS", 75 | "body": "document.getElementsByTagNameNS(${1:object});", 76 | "description": "document.getElementsByTagNameNS" 77 | }, 78 | "document.write": { 79 | "prefix": "document.write", 80 | "body": "document.write(${1:object});", 81 | "description": "document.write" 82 | }, 83 | "document.writeln": { 84 | "prefix": "document.writeln", 85 | "body": "document.writeln(${1:object});", 86 | "description": "document.writeln" 87 | } 88 | } -------------------------------------------------------------------------------- /mysnippets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "contributes": { 3 | "snippets": [ 4 | { 5 | "language": "html", 6 | "path": "./html/snippets.json" 7 | } 8 | ] 9 | } 10 | } -------------------------------------------------------------------------------- /queries/blade/folds.scm: -------------------------------------------------------------------------------- 1 | ((directive_start) @start 2 | (directive_end) @end.after 3 | (#set! role block)) 4 | 5 | 6 | ((bracket_start) @start 7 | (bracket_end) @end 8 | (#set! role block)) 9 | -------------------------------------------------------------------------------- /queries/blade/highlights.scm: -------------------------------------------------------------------------------- 1 | (directive) @tag 2 | (directive_start) @tag 3 | (directive_end) @tag 4 | (comment) @comment @spell 5 | -------------------------------------------------------------------------------- /queries/blade/injections.scm: -------------------------------------------------------------------------------- 1 | ((text) @injection.content 2 | (#not-has-ancestor? @injection.content "envoy") 3 | (#set! injection.combined) 4 | (#set! injection.language php)) 5 | 6 | ((text) @injection.content 7 | (#has-ancestor? @injection.content "envoy") 8 | (#set! injection.combined) 9 | (#set! injection.language bash)) 10 | 11 | 12 | ((php_only) @injection.content 13 | (#set! injection.combined) 14 | (#set! injection.language php_only)) 15 | ((parameter) @injection.content 16 | (#set! injection.language php_only)) 17 | -------------------------------------------------------------------------------- /queries/php/folds.scm: -------------------------------------------------------------------------------- 1 | ; inherits: php_only 2 | -------------------------------------------------------------------------------- /queries/php/highlights.scm: -------------------------------------------------------------------------------- 1 | ; inherits: php_only 2 | -------------------------------------------------------------------------------- /queries/php/indents.scm: -------------------------------------------------------------------------------- 1 | ; inherits: php_only 2 | -------------------------------------------------------------------------------- /queries/php/injections.scm: -------------------------------------------------------------------------------- 1 | ; inherits: php_only 2 | 3 | ((text) @injection.content 4 | (#set! injection.language "html") 5 | (#set! injection.combined)) 6 | -------------------------------------------------------------------------------- /queries/php/locals.scm: -------------------------------------------------------------------------------- 1 | ; inherits: php_only 2 | --------------------------------------------------------------------------------