├── .luarc.json ├── init.lua ├── lazy-lock.json └── lua ├── misc.lua └── plugins ├── bufferline.lua ├── comment.lua ├── completion.lua ├── git.lua ├── lsp.lua ├── lualine.lua ├── nonels.lua ├── nvimtree.lua ├── nvterm.lua ├── onedark.lua ├── telescope.lua └── treesitter.lua /.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "diagnostics.globals": [ 3 | "vim" 4 | ] 5 | } -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 | if not (vim.uv or vim.loop).fs_stat(lazypath) then 3 | vim.fn.system({ 4 | "git", 5 | "clone", 6 | "--filter=blob:none", 7 | "https://github.com/folke/lazy.nvim.git", 8 | "--branch=stable", -- latest stable release 9 | lazypath, 10 | }) 11 | end 12 | 13 | vim.opt.rtp:prepend(lazypath) 14 | require("misc") 15 | require("lazy").setup("plugins") 16 | -------------------------------------------------------------------------------- /lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, 3 | "LuaSnip": { "branch": "master", "commit": "7552e6504ee95a9c8cfc6db53e389122ded46cd4" }, 4 | "bufferline.nvim": { "branch": "main", "commit": "2e3c8cc5a57ddd32f1edd2ffd2ccb10c09421f6c" }, 5 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, 6 | "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, 7 | "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, 8 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 9 | "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, 10 | "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, 11 | "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, 12 | "gitsigns.nvim": { "branch": "main", "commit": "58bd9e98d8e3c5a1c98af312e85247ee1afd3ed2" }, 13 | "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, 14 | "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, 15 | "mason-lspconfig.nvim": { "branch": "main", "commit": "62360f061d45177dda8afc1b0fd1327328540301" }, 16 | "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, 17 | "neogit": { "branch": "master", "commit": "2b74a777b963dfdeeabfabf84d5ba611666adab4" }, 18 | "none-ls.nvim": { "branch": "main", "commit": "cfa65d86e21eeb60544d5e823f6db43941322a53" }, 19 | "nvim-autopairs": { "branch": "master", "commit": "e38c5d837e755ce186ae51d2c48e1b387c4425c6" }, 20 | "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, 21 | "nvim-lspconfig": { "branch": "master", "commit": "81a19de18990208b678be084597613e2dbe66912" }, 22 | "nvim-tree.lua": { "branch": "master", "commit": "f9ff00bc06d7cb70548a3847d7a2a05e928bc988" }, 23 | "nvim-treesitter": { "branch": "master", "commit": "1aad04ecde5ebf8f2b3eea5c6f39d38b251757f5" }, 24 | "nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" }, 25 | "nvterm": { "branch": "main", "commit": "9d7ba3b6e368243175d38e1ec956e0476fd86ed9" }, 26 | "onedarkpro.nvim": { "branch": "main", "commit": "c825a3490dc3f6fb413607ed2602c1280a127756" }, 27 | "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, 28 | "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, 29 | "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" } 30 | } 31 | -------------------------------------------------------------------------------- /lua/misc.lua: -------------------------------------------------------------------------------- 1 | -- set leader key ke spasi 2 | vim.g.mapleader = " " 3 | 4 | 5 | -- set clipboard options 6 | vim.opt.clipboard = "unnamedplus" 7 | 8 | -- set ukuran tab menjadi 4 spasi 9 | vim.o.tabstop = 4 10 | vim.o.expandtab = true 11 | vim.o.softtabstop = 4 12 | vim.o.shiftwidth = 4 13 | 14 | 15 | -- set powershell sebagai shell default 16 | vim.o.shell = "powershell.exe" 17 | 18 | vim.o.shellxquote = "" 19 | vim.o.shellcmdflag = "-NoLogo -NoProfile -ExecutionPolicy RemoteSigned -Command " 20 | vim.o.shellquote = "" 21 | vim.o.shellpipe = "| Out-File -Encoding UTF8 %s" 22 | vim.o.shellredir = "| Out-File -Encoding UTF8 %s" 23 | 24 | 25 | -- set relative line number 26 | vim.wo.relativenumber = true 27 | 28 | -- line break 29 | vim.opt.breakindent = true 30 | vim.opt.formatoptions:remove "t" 31 | vim.opt.linebreak = true 32 | 33 | -- incremental search 34 | vim.opt.incsearch = true 35 | 36 | -- terminal color 37 | vim.opt.termguicolors = true 38 | 39 | -- tampilin minimal 10 line terbawah pas scroll, kaya padding 40 | vim.opt.scrolloff = 10 41 | 42 | vim.opt.signcolumn = "yes" 43 | vim.opt.isfname:append "@-@" 44 | vim.opt.updatetime = 50 45 | 46 | -- keymap pindah pindah window 47 | -- pindah ke kanan 48 | vim.keymap.set("n", "", "h", {}) 49 | -- pindah ke kiri 50 | vim.keymap.set("n", "", "l", {}) 51 | -- pindah ke bawah 52 | vim.keymap.set("n", "", "j", {}) 53 | -- pindah ke atas 54 | vim.keymap.set("n", "", "k", {}) 55 | 56 | -- keymap untuk indent 57 | vim.keymap.set("v", "<", "", ">gv", {}) 59 | 60 | -- escape terminal mode 61 | vim.keymap.set("t", "", vim.api.nvim_replace_termcodes("", true, true, true)) 62 | 63 | -- line number 64 | -- toggle lineNumber 65 | vim.keymap.set("n", "n", " set nu! ") 66 | -- toggle relativelinenumber 67 | vim.keymap.set("n", "rn", " set rnu! ") 68 | 69 | -- matiin shift Q 70 | vim.keymap.set("n", "Q", "") 71 | 72 | -- biar text gak terlalu mepet ke bawah pas scroll 73 | vim.keymap.set("n", "", "zz") 74 | 75 | -- biar text gak terlalu mepet ke atas pas scroll 76 | vim.keymap.set("n", "", "zz") 77 | 78 | vim.keymap.set("n", "n", "nzzzv") 79 | vim.keymap.set("n", "N", "Nzzzv") 80 | vim.keymap.set("n", "J", "mzJ`z") 81 | -------------------------------------------------------------------------------- /lua/plugins/bufferline.lua: -------------------------------------------------------------------------------- 1 | return {'akinsho/bufferline.nvim', 2 | version = "*", 3 | dependencies = 'nvim-tree/nvim-web-devicons', 4 | config = function() 5 | require("bufferline").setup{} 6 | vim.keymap.set("n", "", ":BufferLineCycleNext", { noremap = true, silent = true }) 7 | vim.keymap.set("n", "", ":BufferLineCyclePrev", { noremap = true, silent = true }) 8 | vim.keymap.set("n", "x", ":bdelete!", { noremap = true, silent = true }) 9 | end 10 | } 11 | -------------------------------------------------------------------------------- /lua/plugins/comment.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'numToStr/Comment.nvim', 3 | opts = { 4 | toggler = { line = '/', block = 'gcb' }, 5 | opleader = { line = '/', block = 'gb' }, 6 | }, 7 | lazy = false, 8 | } 9 | -------------------------------------------------------------------------------- /lua/plugins/completion.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "L3MON4D3/LuaSnip", 4 | dependencies = { "rafamadriz/friendly-snippets" }, 5 | }, 6 | { 7 | "saadparwaiz1/cmp_luasnip", 8 | "hrsh7th/cmp-buffer", 9 | "hrsh7th/cmp-nvim-lsp", 10 | "hrsh7th/cmp-path", 11 | "hrsh7th/cmp-nvim-lua", 12 | }, 13 | { 14 | "hrsh7th/nvim-cmp", 15 | lazy = true, 16 | event = "InsertEnter", 17 | config = function() 18 | local cmp = require("cmp") 19 | require("luasnip.loaders.from_vscode").lazy_load() 20 | 21 | cmp.setup({ 22 | snippet = { 23 | -- REQUIRED - you must specify a snippet engine 24 | expand = function(args) 25 | require("luasnip").lsp_expand(args.body) 26 | end, 27 | }, 28 | window = { 29 | completion = cmp.config.window.bordered(), 30 | documentation = cmp.config.window.bordered(), 31 | }, 32 | mapping = cmp.mapping.preset.insert({ 33 | 34 | [""] = cmp.mapping.select_prev_item(), 35 | [""] = cmp.mapping.select_next_item(), 36 | 37 | [""] = cmp.mapping.scroll_docs(-4), 38 | [""] = cmp.mapping.scroll_docs(4), 39 | [""] = cmp.mapping.complete(), 40 | [""] = cmp.mapping.close(), 41 | [""] = cmp.mapping.confirm({ 42 | behavior = cmp.ConfirmBehavior.Insert, 43 | select = true, 44 | }), 45 | 46 | -- Tab untuk next completion 47 | [""] = cmp.mapping(function(fallback) 48 | if cmp.visible() then 49 | cmp.select_next_item() 50 | elseif require("luasnip").expand_or_jumpable() then 51 | vim.fn.feedkeys( 52 | vim.api.nvim_replace_termcodes("luasnip-expand-or-jump", true, true, true), 53 | "" 54 | ) 55 | else 56 | fallback() 57 | end 58 | end, { 59 | "i", 60 | "s", 61 | }), 62 | 63 | -- Shift+Tab untuk prev completion 64 | [""] = cmp.mapping(function(fallback) 65 | if cmp.visible() then 66 | cmp.select_prev_item() 67 | elseif require("luasnip").jumpable(-1) then 68 | vim.fn.feedkeys( 69 | vim.api.nvim_replace_termcodes("luasnip-jump-prev", true, true, true), 70 | "" 71 | ) 72 | else 73 | fallback() 74 | end 75 | end, { 76 | "i", 77 | "s", 78 | }), 79 | }), 80 | sources = cmp.config.sources({ 81 | { name = "nvim_lsp" }, 82 | { name = "buffer" }, 83 | { name = "luasnip" }, 84 | { name = "path" }, 85 | { name = "nvim_lua" }, 86 | }), 87 | }) 88 | 89 | -- Set configuration for specific filetype. 90 | cmp.setup.filetype("gitcommit", { 91 | sources = cmp.config.sources({ 92 | { name = "git" }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git). 93 | }, { 94 | { name = "buffer" }, 95 | }), 96 | }) 97 | 98 | end, 99 | }, 100 | { 101 | "windwp/nvim-autopairs", 102 | config = function() 103 | require("nvim-autopairs").setup({}) 104 | local cmp_autopairs = require("nvim-autopairs.completion.cmp") 105 | local cmp = require("cmp") 106 | cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) 107 | end, 108 | opts = { 109 | fast_wrap = {}, 110 | disable_filetype = { "TelescopePrompt" }, 111 | }, 112 | }, 113 | } 114 | -------------------------------------------------------------------------------- /lua/plugins/git.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "lewis6991/gitsigns.nvim", 4 | config = function() 5 | require("gitsigns").setup({ 6 | signs = { 7 | add = { text = "┃" }, 8 | change = { text = "┃" }, 9 | delete = { text = "_" }, 10 | topdelete = { text = "‾" }, 11 | changedelete = { text = "~" }, 12 | untracked = { text = "┆" }, 13 | }, 14 | signs_staged = { 15 | add = { text = "┃" }, 16 | change = { text = "┃" }, 17 | delete = { text = "_" }, 18 | topdelete = { text = "‾" }, 19 | changedelete = { text = "~" }, 20 | untracked = { text = "┆" }, 21 | }, 22 | signs_staged_enable = true, 23 | signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` 24 | numhl = false, -- Toggle with `:Gitsigns toggle_numhl` 25 | linehl = false, -- Toggle with `:Gitsigns toggle_linehl` 26 | word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` 27 | watch_gitdir = { 28 | follow_files = true, 29 | }, 30 | auto_attach = true, 31 | attach_to_untracked = false, 32 | current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` 33 | current_line_blame_opts = { 34 | virt_text = true, 35 | virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' 36 | delay = 1000, 37 | ignore_whitespace = false, 38 | virt_text_priority = 100, 39 | }, 40 | current_line_blame_formatter = ", - ", 41 | sign_priority = 6, 42 | update_debounce = 100, 43 | status_formatter = nil, -- Use default 44 | max_file_length = 40000, -- Disable if file is longer than this (in lines) 45 | preview_config = { 46 | -- Options passed to nvim_open_win 47 | border = "single", 48 | style = "minimal", 49 | relative = "cursor", 50 | row = 0, 51 | col = 1, 52 | }, 53 | }) 54 | 55 | local opts = { noremap = true, silent = true } 56 | 57 | -- preview_hunk_inline 58 | vim.keymap.set("n", "gh", " Gitsigns preview_hunk_inline", opts) 59 | 60 | -- preview floating 61 | vim.keymap.set("n", "gH", " Gitsigns preview_hunk", opts) 62 | 63 | -- toggle line blame 64 | vim.keymap.set("n", "gb", " Gitsigns toggle_current_line_blame", opts) 65 | end, 66 | }, 67 | { 68 | "NeogitOrg/neogit", 69 | dependencies = { 70 | "nvim-lua/plenary.nvim", -- required 71 | "sindrets/diffview.nvim", -- optional - Diff integration 72 | 73 | -- Only one of these is needed, not both. 74 | "nvim-telescope/telescope.nvim", -- optional 75 | }, 76 | 77 | -- trigger when space gt press 78 | keys = { 79 | { "gt", "Neogit" }, 80 | }, 81 | config = function() 82 | local neogit = require("neogit") 83 | 84 | neogit.setup({ 85 | disable_hint = false, 86 | disable_context_highlighting = false, 87 | disable_signs = false, 88 | disable_insert_on_commit = "auto", 89 | filewatcher = { 90 | interval = 1000, 91 | enabled = true, 92 | }, 93 | graph_style = "ascii", 94 | git_services = { 95 | ["github.com"] = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1", 96 | ["bitbucket.org"] = "https://bitbucket.org/${owner}/${repository}/pull-requests/new?source=${branch_name}&t=1", 97 | ["gitlab.com"] = "https://gitlab.com/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}", 98 | }, 99 | telescope_sorter = function() 100 | return require("telescope").extensions.fzf.native_fzf_sorter() 101 | end, 102 | remember_settings = true, 103 | use_per_project_settings = true, 104 | ignored_settings = { 105 | "NeogitPushPopup--force-with-lease", 106 | "NeogitPushPopup--force", 107 | "NeogitPullPopup--rebase", 108 | "NeogitCommitPopup--allow-empty", 109 | "NeogitRevertPopup--no-edit", 110 | }, 111 | highlight = { 112 | italic = true, 113 | bold = true, 114 | underline = true, 115 | }, 116 | use_default_keymaps = true, 117 | auto_refresh = true, 118 | sort_branches = "-committerdate", 119 | kind = "tab", 120 | disable_line_numbers = true, 121 | console_timeout = 2000, 122 | auto_show_console = true, 123 | status = { 124 | recent_commit_count = 10, 125 | }, 126 | commit_editor = { 127 | kind = "auto", 128 | }, 129 | commit_select_view = { 130 | kind = "tab", 131 | }, 132 | commit_view = { 133 | kind = "vsplit", 134 | verify_commit = os.execute("which gpg") == 0, 135 | }, 136 | log_view = { 137 | kind = "tab", 138 | }, 139 | rebase_editor = { 140 | kind = "auto", 141 | }, 142 | reflog_view = { 143 | kind = "tab", 144 | }, 145 | merge_editor = { 146 | kind = "auto", 147 | }, 148 | tag_editor = { 149 | kind = "auto", 150 | }, 151 | preview_buffer = { 152 | kind = "split", 153 | }, 154 | popup = { 155 | kind = "split", 156 | }, 157 | signs = { 158 | hunk = { "", "" }, 159 | item = { ">", "v" }, 160 | section = { ">", "v" }, 161 | }, 162 | integrations = { 163 | telescope = true, 164 | diffview = nil, 165 | fzf_lua = nil, 166 | }, 167 | sections = { 168 | sequencer = { 169 | folded = false, 170 | hidden = false, 171 | }, 172 | untracked = { 173 | folded = false, 174 | hidden = false, 175 | }, 176 | unstaged = { 177 | folded = false, 178 | hidden = false, 179 | }, 180 | staged = { 181 | folded = false, 182 | hidden = false, 183 | }, 184 | stashes = { 185 | folded = true, 186 | hidden = false, 187 | }, 188 | unpulled_upstream = { 189 | folded = true, 190 | hidden = false, 191 | }, 192 | unmerged_upstream = { 193 | folded = false, 194 | hidden = false, 195 | }, 196 | unpulled_pushRemote = { 197 | folded = true, 198 | hidden = false, 199 | }, 200 | unmerged_pushRemote = { 201 | folded = false, 202 | hidden = false, 203 | }, 204 | recent = { 205 | folded = true, 206 | hidden = false, 207 | }, 208 | rebase = { 209 | folded = true, 210 | hidden = false, 211 | }, 212 | }, 213 | mappings = { 214 | commit_editor = { 215 | ["q"] = "Close", 216 | [""] = "Submit", 217 | [""] = "Abort", 218 | }, 219 | commit_editor_I = { 220 | [""] = "Submit", 221 | [""] = "Abort", 222 | }, 223 | rebase_editor = { 224 | ["p"] = "Pick", 225 | ["r"] = "Reword", 226 | ["e"] = "Edit", 227 | ["s"] = "Squash", 228 | ["f"] = "Fixup", 229 | ["x"] = "Execute", 230 | ["d"] = "Drop", 231 | ["b"] = "Break", 232 | ["q"] = "Close", 233 | [""] = "OpenCommit", 234 | ["gk"] = "MoveUp", 235 | ["gj"] = "MoveDown", 236 | [""] = "Submit", 237 | [""] = "Abort", 238 | ["[c"] = "OpenOrScrollUp", 239 | ["]c"] = "OpenOrScrollDown", 240 | }, 241 | rebase_editor_I = { 242 | [""] = "Submit", 243 | [""] = "Abort", 244 | }, 245 | finder = { 246 | [""] = "Select", 247 | [""] = "Close", 248 | [""] = "Close", 249 | [""] = "Next", 250 | [""] = "Previous", 251 | [""] = "Next", 252 | [""] = "Previous", 253 | [""] = "MultiselectToggleNext", 254 | [""] = "MultiselectTogglePrevious", 255 | [""] = "NOP", 256 | }, 257 | -- Setting any of these to `false` will disable the mapping. 258 | popup = { 259 | ["?"] = "HelpPopup", 260 | ["A"] = "CherryPickPopup", 261 | ["D"] = "DiffPopup", 262 | ["M"] = "RemotePopup", 263 | ["P"] = "PushPopup", 264 | ["X"] = "ResetPopup", 265 | ["Z"] = "StashPopup", 266 | ["b"] = "BranchPopup", 267 | ["B"] = "BisectPopup", 268 | ["c"] = "CommitPopup", 269 | ["f"] = "FetchPopup", 270 | ["l"] = "LogPopup", 271 | ["m"] = "MergePopup", 272 | ["p"] = "PullPopup", 273 | ["r"] = "RebasePopup", 274 | ["v"] = "RevertPopup", 275 | ["w"] = "WorktreePopup", 276 | }, 277 | status = { 278 | ["k"] = "MoveUp", 279 | ["j"] = "MoveDown", 280 | ["q"] = "Close", 281 | ["o"] = "OpenTree", 282 | ["I"] = "InitRepo", 283 | ["1"] = "Depth1", 284 | ["2"] = "Depth2", 285 | ["3"] = "Depth3", 286 | ["4"] = "Depth4", 287 | [""] = "Toggle", 288 | ["x"] = "Discard", 289 | ["s"] = "Stage", 290 | ["S"] = "StageUnstaged", 291 | [""] = "StageAll", 292 | ["K"] = "Untrack", 293 | ["u"] = "Unstage", 294 | ["U"] = "UnstageStaged", 295 | ["$"] = "CommandHistory", 296 | ["Y"] = "YankSelected", 297 | [""] = "RefreshBuffer", 298 | [""] = "GoToFile", 299 | [""] = "VSplitOpen", 300 | [""] = "SplitOpen", 301 | [""] = "TabOpen", 302 | ["{"] = "GoToPreviousHunkHeader", 303 | ["}"] = "GoToNextHunkHeader", 304 | ["[c"] = "OpenOrScrollUp", 305 | ["]c"] = "OpenOrScrollDown", 306 | }, 307 | }, 308 | }) 309 | 310 | vim.keymap.set("n", "gt", "Neogit", { noremap = true, silent = true }) 311 | end, 312 | }, 313 | } 314 | -------------------------------------------------------------------------------- /lua/plugins/lsp.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "williamboman/mason.nvim", 4 | config = function() 5 | require("mason").setup({}) 6 | end, 7 | }, 8 | { 9 | "williamboman/mason-lspconfig.nvim", 10 | config = function() 11 | require("mason-lspconfig").setup({ 12 | ensure_installed = { 13 | "lua_ls", 14 | "cssls", 15 | "html", 16 | "emmet_ls", 17 | "tsserver", 18 | "gopls", 19 | "svelte", 20 | "stylua", 21 | }, 22 | }) 23 | end, 24 | }, 25 | { 26 | "neovim/nvim-lspconfig", 27 | config = function() 28 | local lspconfig = require("lspconfig") 29 | local lsp_capabilities = vim.lsp.protocol.make_client_capabilities() 30 | lsp_capabilities.textDocument.completion.completionItem.snippetSupport = true 31 | 32 | lspconfig.emmet_ls.setup({ 33 | capabilities = lsp_capabilities, 34 | filetypes = { 35 | "css", 36 | "html", 37 | "javascript", 38 | "javascriptreact", 39 | "sass", 40 | "scss", 41 | "svelte", 42 | "typescriptreact", 43 | }, 44 | init_options = { 45 | html = { 46 | options = { 47 | -- For possible options, see: https://github.com/emmetio/emmet/blob/master/src/config.ts#L79-L267 48 | ["bem.enabled"] = true, 49 | }, 50 | }, 51 | }, 52 | }) 53 | 54 | lspconfig.html.setup({ 55 | capabilities = lsp_capabilities, 56 | }) 57 | lspconfig.cssls.setup({ 58 | capabilities = lsp_capabilities, 59 | }) 60 | 61 | -- lsp lua 62 | lspconfig.lua_ls.setup({ 63 | capabilities = lsp_capabilities, 64 | on_attach = function(client) 65 | client.server_capabilities.documentFormattingProvider = true 66 | end, 67 | }) 68 | -- lsp javascript 69 | lspconfig.tsserver.setup({ 70 | capabilities = lsp_capabilities, 71 | on_attach = function(client) 72 | client.server_capabilities.documentFormattingProvider = true 73 | end, 74 | }) 75 | -- lsp svelte 76 | lspconfig.svelte.setup({ 77 | capabilities = lsp_capabilities, 78 | on_attach = function(client) 79 | client.server_capabilities.documentFormattingProvider = true 80 | end, 81 | }) 82 | -- lsp go 83 | lspconfig.gopls.setup({ 84 | capabilities = lsp_capabilities, 85 | on_attach = function(client) 86 | client.server_capabilities.documentFormattingProvider = true 87 | end, 88 | }) 89 | 90 | local opts = { noremap = true, silent = true } 91 | 92 | vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) 93 | vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) 94 | vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts) 95 | 96 | -- code actions 97 | vim.keymap.set("n", "ca", "lua vim.lsp.buf.code_action()", opts) 98 | 99 | vim.keymap.set("n", "", vim.diagnostic.goto_prev, opts) 100 | vim.keymap.set("n", "", vim.diagnostic.goto_next, opts) 101 | vim.keymap.set("n", "", vim.lsp.buf.rename, opts) 102 | 103 | vim.keymap.set("n", "", vim.lsp.buf.signature_help, opts) 104 | vim.keymap.set("n", "wa", vim.lsp.buf.add_workspace_folder, opts) 105 | vim.keymap.set("n", "wr", vim.lsp.buf.remove_workspace_folder, opts) 106 | vim.keymap.set("n", "wl", function() 107 | print(vim.inspect(vim.lsp.buf.list_workspace_folders())) 108 | end, opts) 109 | vim.keymap.set("n", "D", vim.lsp.buf.type_definition, opts) 110 | vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) 111 | vim.keymap.set("n", "E", vim.diagnostic.open_float, opts) 112 | vim.keymap.set("n", "q", vim.diagnostic.setloclist, opts) 113 | end, 114 | }, 115 | } 116 | -------------------------------------------------------------------------------- /lua/plugins/lualine.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'nvim-lualine/lualine.nvim', 3 | dependencies = { 'nvim-tree/nvim-web-devicons' }, 4 | config = function() 5 | require('lualine').setup { 6 | options = { theme = "onedark" }, 7 | } 8 | end 9 | } 10 | -------------------------------------------------------------------------------- /lua/plugins/nonels.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvimtools/none-ls.nvim", 3 | config = function() 4 | local null_ls = require("null-ls") 5 | -- setting formater yang akan dipakai 6 | 7 | null_ls.setup({ 8 | sources = { 9 | -- stylua 10 | null_ls.builtins.formatting.stylua, 11 | 12 | -- prettier 13 | null_ls.builtins.formatting.prettier.with { 14 | filetypes = { "css", "html", "javascript", "typescript", "json", "yaml" }, 15 | dynamic_command = function() 16 | return "prettier" 17 | end, 18 | } 19 | } 20 | }) 21 | 22 | 23 | vim.keymap.set("n","fm", vim.lsp.buf.format, {}) 24 | 25 | end 26 | } 27 | -------------------------------------------------------------------------------- /lua/plugins/nvimtree.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-tree/nvim-tree.lua", 3 | version = "*", 4 | lazy = false, 5 | dependencies = { 6 | "nvim-tree/nvim-web-devicons", 7 | }, 8 | config = function() 9 | require("nvim-tree").setup({}) 10 | 11 | -- toggle file tree 12 | vim.keymap.set("n", "", " NvimTreeToggle ", {}) 13 | 14 | -- focus 15 | vim.keymap.set("n", "e", " NvimTreeFocus ", { noremap = true, silent = true }) 16 | end, 17 | } 18 | -------------------------------------------------------------------------------- /lua/plugins/nvterm.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "NvChad/nvterm", 3 | config = function () 4 | require("nvterm").setup() 5 | 6 | -- ini terminal mode 7 | -- toggle floating terminal 8 | vim.keymap.set("t","",function() 9 | require("nvterm.terminal").toggle "float" 10 | end,{}) 11 | 12 | -- toggle terminal horizontal 13 | vim.keymap.set("t","",function() 14 | require("nvterm.terminal").toggle "horizontal" 15 | end,{}) 16 | 17 | -- toggle terminal vertical 18 | vim.keymap.set("t","",function() 19 | require("nvterm.terminal").toggle "vertical" 20 | end,{}) 21 | 22 | -- ini normal mode 23 | -- toggle floating terminal 24 | vim.keymap.set("n","",function() 25 | require("nvterm.terminal").toggle "float" 26 | end,{}) 27 | 28 | -- toggle terminal horizontal 29 | vim.keymap.set("n","",function() 30 | require("nvterm.terminal").toggle "horizontal" 31 | end,{}) 32 | 33 | -- toggle terminal vertical 34 | vim.keymap.set("n","",function() 35 | require("nvterm.terminal").toggle "vertical" 36 | end,{}) 37 | end, 38 | } 39 | -------------------------------------------------------------------------------- /lua/plugins/onedark.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "olimorris/onedarkpro.nvim", 3 | priority = 1000, -- Ensure it loads first, 4 | config = function() 5 | vim.cmd("colorscheme onedark") 6 | end 7 | } 8 | -------------------------------------------------------------------------------- /lua/plugins/telescope.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | 'nvim-telescope/telescope.nvim', tag = '0.1.6', 4 | lazy = true, 5 | cmd = "Telescope", 6 | dependencies = { 'nvim-lua/plenary.nvim' }, 7 | config = function() 8 | -- tambahin variable builtin 9 | local builtin = require("telescope.builtin") 10 | 11 | -- cari file 12 | vim.keymap.set('n', 'ff', builtin.find_files, {}) 13 | 14 | -- cari keyword (grep) di semua file 15 | vim.keymap.set('n', 'fw', builtin.live_grep, {}) 16 | 17 | -- cari keyword di buffer yang terbuka 18 | vim.keymap.set('n', 'fb', builtin.buffers, {}) 19 | 20 | -- cari keyword di help page 21 | vim.keymap.set('n', 'fh', builtin.help_tags, {}) 22 | 23 | -- cari semua, show hidden file 24 | vim.keymap.set('n', 'fa', " Telescope find_files follow=true no_ignore=true hidden=true ", {}) 25 | 26 | -- cari keyword di buffer saat ini 27 | vim.keymap.set('n', 'fz', " Telescope current_buffer_fuzzy_find ", {}) 28 | end 29 | }, 30 | { 31 | 'nvim-telescope/telescope-ui-select.nvim', 32 | config = function() 33 | require("telescope").setup { 34 | extensions = { 35 | ["ui-select"] = { 36 | require("telescope.themes").get_dropdown {} 37 | } 38 | } 39 | } 40 | require("telescope").load_extension("ui-select") 41 | end 42 | }, 43 | } 44 | -------------------------------------------------------------------------------- /lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-treesitter/nvim-treesitter", 3 | build = ":TSUpdate", 4 | config = function() 5 | local configs = require("nvim-treesitter.configs") 6 | 7 | configs.setup({ 8 | ensure_installed = { 9 | "lua", 10 | "html", 11 | "css", 12 | "javascript", 13 | "typescript", 14 | "tsx", 15 | "svelte", 16 | "go", 17 | "json", 18 | }, 19 | sync_install = false, 20 | highlight = { enable = true }, 21 | indent = { enable = true }, 22 | auto_install = true, 23 | }) 24 | end, 25 | } 26 | --------------------------------------------------------------------------------