diff --git a/lazy-lock.json b/lazy-lock.json index 45b240c..3889682 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,7 +1,7 @@ { "Comment.nvim": { "branch": "master", "commit": "d9cfae1059b62f7eacc09dba181efe4894e3b086" }, "LuaSnip": { "branch": "master", "commit": "500981ff6cefc7343e3959ef0f939bd0bfd49ba9" }, - "alpha-nvim": { "branch": "main", "commit": "4b0ba68022d8612b04b26844f1ce5e708c0d23b0" }, + "alpha-nvim": { "branch": "main", "commit": "906649c3991903d14cef8fae1fe5557193ca743c" }, "bufdelete.nvim": { "branch": "master", "commit": "8933abc09df6c381d47dc271b1ee5d266541448e" }, "bufferline.nvim": { "branch": "main", "commit": "b337fd393cef2e3679689d220e2628722c20ddcb" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, @@ -12,15 +12,14 @@ "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "code_runner.nvim": { "branch": "main", "commit": "a010649236fe245eaab2641a13228cd601499715" }, "dressing.nvim": { "branch": "master", "commit": "5f44f829481640be0f96759c965ae22a3bcaf7ce" }, + "fidget.nvim": { "branch": "main", "commit": "688b4fec4517650e29c3e63cfbb6e498b3112ba1" }, "friendly-snippets": { "branch": "main", "commit": "009887b76f15d16f69ae1341f86a7862f61cf2a1" }, "gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" }, - "gruvbox-baby": { "branch": "main", "commit": "ea71b4225d0140103d99748ca4a33ecf22c03f62" }, "impatient.nvim": { "branch": "main", "commit": "969f2c5c90457612c09cf2a13fee1adaa986d350" }, "indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" }, "jaq-nvim": { "branch": "master", "commit": "236296aae555657487d1bb4d066cbde9d79d8cd4" }, - "lazy.nvim": { "branch": "main", "commit": "14075657131b9a19883a8845c47f1ab65461cd6f" }, + "lazy.nvim": { "branch": "main", "commit": "5b4444f0d7e556deba3f7ca949a2ba0e2c3369fb" }, "live-server": { "branch": "main", "commit": "ecd7c1418823b65dd2bca710587c80afe42c973e" }, - "lsp-progress.nvim": { "branch": "main", "commit": "9c0cf47587ee3cf2c9267ff2296876f214e631e5" }, "lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "a31e011135a79d63c71254c250c9158e1056a1cb" }, "mason-null-ls.nvim": { "branch": "main", "commit": "29ce60f9a16fef3de682a9365ef635f24ae92bf9" }, @@ -52,9 +51,11 @@ "telescope.nvim": { "branch": "master", "commit": "a3f17d3baf70df58b9d3544ea30abe52a7a832c2" }, "todo-comments.nvim": { "branch": "main", "commit": "077c59586d9d0726b0696dc5680eb863f4e04bc5" }, "toggleterm.nvim": { "branch": "main", "commit": "a5638b2206c3930a16a24e5c184dddd572f8cd34" }, + "tokyonight.nvim": { "branch": "main", "commit": "663657d65254a7920c05b5c0d67a28d003967c2f" }, "trouble.nvim": { "branch": "main", "commit": "67337644e38144b444d026b0df2dc5fa0038930f" }, "vim-bbye": { "branch": "master", "commit": "903f5eb17f72ebf7b0b1524bbb792c0b36761af6" }, "vim-illuminate": { "branch": "master", "commit": "49062ab1dd8fec91833a69f0a1344223dd59d643" }, + "vim-repeat": { "branch": "master", "commit": "8106e142dfdc278ff3eaaadd7b362ad7949d4357" }, "vim-startuptime": { "branch": "master", "commit": "5f52ed26e0296a3e1d1453935f417e5808eefab8" }, "vim-visual-multi": { "branch": "master", "commit": "1c9207b28c8898ab01b54e6d6b61b0b820a814bc" }, "which-key.nvim": { "branch": "main", "commit": "2a0c2d80c0a60f041afb1b789cfedbd510e2b2b6" }, diff --git a/lua/core/config.lua b/lua/core/config.lua index 6e416a6..a174cc8 100644 --- a/lua/core/config.lua +++ b/lua/core/config.lua @@ -40,6 +40,8 @@ config = { cmpcalc = opt("cmpcalc", false), cmptag = opt("cmptag", false), lsp_virtualtext = opt("lsp_virtualtext", false), + lspghost_text = opt("lspghost_text", false), + loadnvimtree_lazy = opt("loadnvimtree_lazy", false), } return config diff --git a/lua/core/init.lua b/lua/core/init.lua index 79dffcd..cd14d3f 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -4,7 +4,7 @@ require("config.lazy") require("user.colorscheme") require("user.keymaps") require("user.snip") -require("user.nvim-tree") +-- require("user.nvim-tree") -- require("user.options") -- require("user.keymaps") -- require("user.autocommands") diff --git a/lua/custom/default.lua b/lua/custom/default.lua index 37b9e96..6b02dbd 100644 --- a/lua/custom/default.lua +++ b/lua/custom/default.lua @@ -12,7 +12,7 @@ -- catppuccin, catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha -- dracula -- nightfox, dayfox, dawnfox, duskfox, nordfox, terafox, carbonfox -vim.g.pcode_colorscheme = "gruvbox-baby" +vim.g.pcode_colorscheme = "tokyonight" -- custom transparent mode -- only support @@ -31,7 +31,7 @@ vim.g.pcode_transparent_mode = 0 -- 0 disable progress -- 1 lualine lsp progress -- 2 fidget progress -vim.g.pcode_progress = 1 +vim.g.pcode_progress = 2 -- style -- 0 = default @@ -85,7 +85,10 @@ vim.g.pcode_lsp_installer = { } -- use for lsp diagnostics virtual text -vim.g.pcode_lsp_virtualtext = false +vim.g.pcode_lsp_virtualtext = true + +-- use for lsp ghost text config +vim.g.pcode_lspghost_text = true -- untuk referesi support language kunjungi link dibawah -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md @@ -145,3 +148,6 @@ vim.g.pcode_coderunner = { vim.g.pcode_cmprg = false --https://github.com/lukas-reineke/cmp-rg vim.g.pcode_cmpcalc = false --https://github.com/hrsh7th/cmp-calc vim.g.pcode_cmptag = false --https://github.com/quangnguyen30192/cmp-nvim-tags + +-- load nvim-tree or not +vim.g.pcode_loadnvimtree_lazy = true diff --git a/lua/custom/plugins/cmdline.lua b/lua/custom/plugins/cmdline.lua index 37b0646..7d110b5 100644 --- a/lua/custom/plugins/cmdline.lua +++ b/lua/custom/plugins/cmdline.lua @@ -1,3 +1,4 @@ +vim.opt.lazyredraw = false return { { "gelguy/wilder.nvim", enabled = false }, { @@ -7,23 +8,92 @@ return { "rcarriga/nvim-notify", "nvim-treesitter/nvim-treesitter", }, - event = "BufWinEnter", - config = function() - vim.opt.lazyredraw = false - require("noice").setup({ - messages = { + -- event = "BufWinEnter", + event = "VeryLazy", + opts = { + messages = { + enabled = false, + }, + notify = { + enabled = false, + }, + lsp = { + progress = { enabled = false, }, - notify = { - enabled = false, - }, - lsp = { - progress = { - enabled = false, - }, - }, - }) - end, + }, + }, + keys = { + { + "", + function() + require("noice").redirect(vim.fn.getcmdline()) + end, + mode = "c", + desc = "Redirect Cmdline", + }, + { + "snl", + function() + require("noice").cmd("last") + end, + desc = "Noice Last Message", + }, + { + "snh", + function() + require("noice").cmd("history") + end, + desc = "Noice History", + }, + { + "sna", + function() + require("noice").cmd("all") + end, + desc = "Noice All", + }, + { + "", + function() + if not require("noice.lsp").scroll(4) then + return "" + end + end, + silent = true, + expr = true, + desc = "Scroll forward", + mode = { "i", "n", "s" }, + }, + { + "", + function() + if not require("noice.lsp").scroll(-4) then + return "" + end + end, + silent = true, + expr = true, + desc = "Scroll backward", + mode = { "i", "n", "s" }, + }, + }, + -- config = function() + -- vim.opt.lazyredraw = false + -- require("noice").setup({ + -- messages = { + -- enabled = false, + -- }, + -- notify = { + -- enabled = false, + -- }, + -- lsp = { + -- progress = { + -- enabled = false, + -- }, + -- }, + -- }) + -- end, }, { "hrsh7th/cmp-cmdline", diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 04c9c02..f95649b 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -1,11 +1,13 @@ local cmprg = false local cmpcalc = false local cmptag = false +local lspghost_text = false local data_exists, custom_cmp = pcall(require, "core.config") if data_exists then cmprg = custom_cmp.cmprg cmpcalc = custom_cmp.cmpcalc cmptag = custom_cmp.cmptag + lspghost_text = custom_cmp.lspghost_text end return { "hrsh7th/nvim-cmp", @@ -90,7 +92,7 @@ return { documentation = cmp.config.window.bordered(), }, experimental = { - ghost_text = true, + ghost_text = lspghost_text, native_menu = false, }, } diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 653e5de..baf4e2c 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -163,7 +163,7 @@ return { -- for Speed up loading Lua modules in Neovim to improve startup time. { "lewis6991/impatient.nvim", - event = "BufRead", + event = "VeryLazy", config = function() require("user.impatient") end, @@ -217,8 +217,26 @@ return { -- for popup alert { "rcarriga/nvim-notify", - event = "BufWinEnter", - config = function() + keys = { + { + "un", + function() + require("notify").dismiss({ silent = true, pending = true }) + end, + desc = "Delete all Notifications", + }, + }, + opts = { + timeout = 3000, + max_height = function() + return math.floor(vim.o.lines * 0.75) + end, + max_width = function() + return math.floor(vim.o.columns * 0.75) + end, + }, + -- event = "BufWinEnter", + init = function() local notify = require("notify") -- this for transparency notify.setup({ background_colour = "#000000" }) @@ -237,12 +255,20 @@ return { -- for popup input { "stevearc/dressing.nvim", - event = "BufWinEnter", - config = function() - require("user.dressing") + lazy = true, + init = function() + ---@diagnostic disable-next-line: duplicate-set-field + vim.ui.select = function(...) + require("lazy").load({ plugins = { "dressing.nvim" } }) + return vim.ui.select(...) + end + ---@diagnostic disable-next-line: duplicate-set-field + vim.ui.input = function(...) + require("lazy").load({ plugins = { "dressing.nvim" } }) + return vim.ui.input(...) + end end, - }, - -- mini scrollview + }, -- mini scrollview { "karb94/neoscroll.nvim", event = "BufRead", @@ -275,5 +301,6 @@ return { require("user.gitsigns") end, }, - -- for loading info + -- remove duplicate + { "tpope/vim-repeat", event = "VeryLazy" }, } diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 25119ad..29511ec 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -32,9 +32,14 @@ return { -- event = "BufWinEnter", cmd = { "NvimTree", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" }, -- dependencies = "kyazdani42/nvim-web-devicons", - -- config = function() - -- require("user.nvim-tree") - -- end, + config = function() + local data_exists, treeconfig = pcall(require, "core.config") + if data_exists then + if treeconfig.loadnvimtree_lazy then + require("user.nvim-tree") + end + end + end, }, -- for file tab {