From 7e4fa022a169c901584b166870e636793f737fb5 Mon Sep 17 00:00:00 2001 From: asep komarudin Date: Sat, 11 Feb 2023 09:41:39 +0700 Subject: [PATCH] tuning startuptime --- init.lua | 2 +- lazy-lock.json | 25 ++-- lua/plugins/cmp.lua | 83 ++++++++++++ lua/plugins/init.lua | 301 +++++++++++-------------------------------- lua/plugins/ui.lua | 161 +++++++++++++++++++++++ lua/user/cmdline.lua | 8 +- lua/user/cmp.lua | 42 +++--- 7 files changed, 356 insertions(+), 266 deletions(-) create mode 100644 lua/plugins/cmp.lua create mode 100644 lua/plugins/ui.lua diff --git a/init.lua b/init.lua index 916d9cf..273865c 100644 --- a/init.lua +++ b/init.lua @@ -9,4 +9,4 @@ require("user.bufferline") if onsave then require("user.format_onsave") end -require("user.chat_gpt") +-- require("user.chat_gpt") diff --git a/lazy-lock.json b/lazy-lock.json index bbae3c4..3c24758 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,35 +1,33 @@ { "Comment.nvim": { "branch": "master", "commit": "d9cfae1059b62f7eacc09dba181efe4894e3b086" }, "LuaSnip": { "branch": "master", "commit": "500981ff6cefc7343e3959ef0f939bd0bfd49ba9" }, - "alpha-nvim": { "branch": "main", "commit": "f4aa42b68e62efed26b92b86b844336cadaa0096" }, + "alpha-nvim": { "branch": "main", "commit": "54c9ba499209ac2563ddcefd47ba7bce35ae94ae" }, "bufdelete.nvim": { "branch": "master", "commit": "f79e9d186b42fba5f1b1362006e7c70240db97a4" }, "bufferline.nvim": { "branch": "main", "commit": "028a87933d99f8bb88f2f70a4def3ff9574f3594" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" }, "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, "cmp-nvim-lua": { "branch": "main", "commit": "f3491638d123cfd2c8048aefaf66d246ff250ca6" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp-tabnine": { "branch": "main", "commit": "ee1341c53e7b82f55c6e83287828f652c2ac35e1" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "code_runner.nvim": { "branch": "main", "commit": "a010649236fe245eaab2641a13228cd601499715" }, "dressing.nvim": { "branch": "master", "commit": "db716a0f1279f79a886c0e0b6ab3c3d5ffdb42fe" }, "fidget.nvim": { "branch": "main", "commit": "9dc6d15fdb877b2fb09ea0ba2dfde9beccb5965a" }, - "friendly-snippets": { "branch": "main", "commit": "a6f7a1609addb4e57daa6bedc300f77f8d225ab7" }, + "friendly-snippets": { "branch": "main", "commit": "80597f3ea824946c87fd29f82b5ed4f24ef473f3" }, "gitsigns.nvim": { "branch": "main", "commit": "bb808fc7376ed7bac0fbe8f47b83d4bf01738167" }, "impatient.nvim": { "branch": "main", "commit": "969f2c5c90457612c09cf2a13fee1adaa986d350" }, "indent-blankline.nvim": { "branch": "master", "commit": "8299fe7703dfff4b1752aeed271c3b95281a952d" }, "jaq-nvim": { "branch": "master", "commit": "236296aae555657487d1bb4d066cbde9d79d8cd4" }, - "lazy.nvim": { "branch": "main", "commit": "48c9b37294f31e3875435bca41d0c923fdd6eea4" }, + "lazy.nvim": { "branch": "main", "commit": "d13fe9353594bce58a5b9fc6d7166d183e0fc035" }, "live-server": { "branch": "main", "commit": "ecd7c1418823b65dd2bca710587c80afe42c973e" }, "lualine.nvim": { "branch": "master", "commit": "0050b308552e45f7128f399886c86afefc3eb988" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "7a97a77eee486ae152d2c559a459eda7c8aa12aa" }, "mason-null-ls.nvim": { "branch": "main", "commit": "13c6ab4a4f810cbbb1799a9cf4d4a27fd862d885" }, - "mason.nvim": { "branch": "main", "commit": "0efc7ceb29a933317e625544d3eb160e7c46dc81" }, + "mason.nvim": { "branch": "main", "commit": "14ae1ca58440b158a0a35cf90773013caddf788a" }, "mini.indentscope": { "branch": "main", "commit": "cbabbf3be4a59c7f23725b74ed15e0fba951e328" }, "neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" }, - "null-ls.nvim": { "branch": "main", "commit": "60b4a7167c79c7d04d1ff48b55f2235bf58158a7" }, + "null-ls.nvim": { "branch": "main", "commit": "ab4e9261843236d773f49a23fcfb3d2167a3c500" }, "nvim-autopairs": { "branch": "master", "commit": "4fc96c8f3df89b6d23e5092d31c866c53a346347" }, - "nvim-cmp": { "branch": "main", "commit": "983453e32cb35533a119725883c04436d16c0120" }, + "nvim-cmp": { "branch": "main", "commit": "cfafe0a1ca8933f7b7968a287d39904156f2c57d" }, "nvim-colorizer.lua": { "branch": "master", "commit": "760e27df4dd966607e8fb7fd8b6b93e3c7d2e193" }, "nvim-lsp-installer": { "branch": "main", "commit": "17e0bfa5f2c8854d1636fcd036dc8284db136baa" }, "nvim-lspconfig": { "branch": "master", "commit": "255e07ce2a05627d482d2de77308bba51b90470c" }, @@ -44,15 +42,16 @@ "nvim-web-devicons": { "branch": "master", "commit": "ade34ca7d19543904b28b903e606be8930fb9ee3" }, "plenary.nvim": { "branch": "master", "commit": "9d81624fbcedd3dd43b38d7e13a1e7b3f873d8cd" }, "smart-splits.nvim": { "branch": "master", "commit": "fdd158ce7554dc830fb86e0fe952cd9476cdf726" }, - "telescope.nvim": { "branch": "master", "commit": "c1a2af0af69e80e14e6b226d3957a064cd080805" }, + "telescope.nvim": { "branch": "master", "commit": "203bf5609137600d73e8ed82703d6b0e320a5f36" }, "todo-comments.nvim": { "branch": "main", "commit": "077c59586d9d0726b0696dc5680eb863f4e04bc5" }, "toggleterm.nvim": { "branch": "main", "commit": "2a787c426ef00cb3488c11b14f5dcf892bbd0bda" }, - "tokyonight.nvim": { "branch": "main", "commit": "e52c41314e83232840d6970e6b072f9fba242eb9" }, - "trouble.nvim": { "branch": "main", "commit": "2fceec1ee299689f42483252ca50b5ba44a0ebdb" }, + "tokyonight.nvim": { "branch": "main", "commit": "a0abe53df53616d13da327636cb0bcac3ea7f5af" }, + "trouble.nvim": { "branch": "main", "commit": "556ef3089709a6e253df1e500381fec5eb48e48a" }, "vim-bbye": { "branch": "master", "commit": "903f5eb17f72ebf7b0b1524bbb792c0b36761af6" }, - "vim-illuminate": { "branch": "master", "commit": "d6ca7f77eeaf61b3e6ce9f0e5a978d606df44298" }, + "vim-illuminate": { "branch": "master", "commit": "49062ab1dd8fec91833a69f0a1344223dd59d643" }, "vim-startuptime": { "branch": "master", "commit": "5f52ed26e0296a3e1d1453935f417e5808eefab8" }, "vim-visual-multi": { "branch": "master", "commit": "1c9207b28c8898ab01b54e6d6b61b0b820a814bc" }, - "which-key.nvim": { "branch": "main", "commit": "16ed12a8493628c377606da2ebac50d80736ed37" }, + "which-key.nvim": { "branch": "main", "commit": "5224c261825263f46f6771f1b644cae33cd06995" }, + "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" }, "yanky.nvim": { "branch": "main", "commit": "9fb1c211775b5a6c83b9fe806cfd99f68c65f8a0" } } \ No newline at end of file diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua new file mode 100644 index 0000000..580a46e --- /dev/null +++ b/lua/plugins/cmp.lua @@ -0,0 +1,83 @@ +return { + "hrsh7th/nvim-cmp", + version = false, -- last release is way too old + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-nvim-lua", + }, + opts = function() + local cmp = require("cmp") + local luasnip = require("luasnip") + + local check_backspace = function() + local col = vim.fn.col(".") - 1 + return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") + end + + return { + completion = { + completeopt = "menu,menuone,noinsert", + }, + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expandable() then + luasnip.expand() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif check_backspace() then + fallback() + else + fallback() + end + end, { + "i", + "s", + }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + }), + formatting = { + fields = { "kind", "abbr", "menu" }, + format = function(entry, vim_item) + vim_item.kind = string.format("%s", require("user.icons")["kind"][vim_item.kind]) + vim_item.menu = ({ + nvim_lsp = "(LSP)", + luasnip = "(Snippet)", + buffer = "(Buffer)", + path = "(Path)", + })[entry.source.name] + return vim_item + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + experimental = { + ghost_text = { + hl_group = "LspCodeLens", + }, + }, + } + end, +} diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 7c79e97..337cfd9 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,88 +1,13 @@ -local build = "powershell ./install.ps1" -if vim.fn.has("win32") == 0 then - build = "./install.sh" -end +-- local build = "powershell ./install.ps1" +-- if vim.fn.has("win32") == 0 then +-- build = "./install.sh" +-- end return { -- plugin ini merupakan penyedia library neovim lua { "nvim-lua/plenary.nvim", - event = "BufRead", + lazy = true, }, - -- color scheme - { - "folke/tokyonight.nvim", - -- commit = "66bfc2e8f754869c7b651f3f47a2ee56ae557764", - lazy = true, -- make sure we load this during startup if it is your main colorscheme - -- priority = 1000, -- make sure to load this before all the other start plugins - config = function() - local is_transparant = false - if is_transparant then - require("user.tokyonight_transparant") - else - require("user.tokyonight") - end - end, - }, - -- { - -- "navarasu/onedark.nvim", - -- init = function() - -- require("user.onedark") - -- require("onedark").load() - -- end, - -- }, - -- { "lunarvim/lunar.nvim" }, - -- { "arcticicestudio/nord-vim" }, - -- { - -- "catppuccin/nvim", - -- name = "catppuccin", - -- init = function() - -- require("user.catppuccin") - -- end, - -- }, - -- { - -- "ellisonleao/gruvbox.nvim", - -- init = function() - -- require("gruvbox").setup({ - -- undercurl = true, - -- underline = true, - -- bold = true, - -- italic = true, - -- strikethrough = true, - -- invert_selection = false, - -- invert_signs = false, - -- invert_tabline = false, - -- invert_intend_guides = false, - -- inverse = true, -- invert background for search, diffs, statuslines and errors - -- contrast = "", -- can be "hard", "soft" or empty string - -- palette_overrides = {}, - -- overrides = {}, - -- dim_inactive = false, - -- transparent_mode = false, - -- }) - -- vim.o.background = "dark" -- or "light" for light mode - -- end, - -- }, - -- { "sainnhe/sonokai" }, - -- { "EdenEast/nightfox.nvim" }, - -- { - -- "marko-cerovac/material.nvim", - -- init = function() - -- vim.g.material_style = "darker" - -- end, - -- }, - - -- include treesitter - -- require("plugins.treesitter"), - -- { - -- "nvim-treesitter/nvim-treesitter", - -- commit = "8e763332b7bf7b3a426fd8707b7f5aa85823a5ac", - -- run = ":TSUpdate", - -- event = "BufWinEnter", - -- opts = function() - -- require("user.treesitter") - -- end, - -- }, - -- coding start -- coloring code { @@ -136,59 +61,69 @@ return { { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, }, }, - -- auto completion - { - "hrsh7th/nvim-cmp", - event = "BufWinEnter", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - "saadparwaiz1/cmp_luasnip", - "hrsh7th/cmp-nvim-lua", - { - "tzachar/cmp-tabnine", - build = build, - event = "BufWinEnter", - config = function() - require("user.tabnine") - end, - }, - { - "hrsh7th/cmp-cmdline", - event = "BufWinEnter", - -- config = function() - -- require("user.cmdline") - -- end, - }, - }, - opts = function() - require("user.cmp") - end, - }, + -- -- auto completion (dipindah supaya loading lebih cepat) + -- { + -- "hrsh7th/nvim-cmp", + -- version = false, -- last release is way too old + -- event = "InsertEnter", + -- dependencies = { + -- "hrsh7th/cmp-nvim-lsp", + -- "hrsh7th/cmp-buffer", + -- "hrsh7th/cmp-path", + -- "saadparwaiz1/cmp_luasnip", + -- "hrsh7th/cmp-nvim-lua", + -- { + -- "tzachar/cmp-tabnine", + -- build = build, + -- event = "BufWinEnter", + -- config = function() + -- require("user.tabnine") + -- end, + -- }, + -- -- { + -- -- "hrsh7th/cmp-cmdline", + -- -- event = "BufWinEnter", + -- -- config = function() + -- -- require("user.cmdline") + -- -- end, + -- -- }, + -- }, + -- opts = function() + -- require("user.cmp") + -- end, + -- }, + -- { "neovim/nvim-lspconfig", event = "BufWinEnter", + dependencies = { + "williamboman/mason-lspconfig.nvim", + }, config = function() require("user.lsp") end, }, + -- { + -- "williamboman/mason.nvim", + -- event = "VeryLazy", + -- cmd = { + -- "Mason", + -- "MasonInstall", + -- "MasonUninstall", + -- "MasonUninstallAll", + -- "MasonLog", + -- }, + -- dependencies = { "williamboman/mason-lspconfig.nvim" }, + -- init = function() + -- vim.tbl_map(function(plugin) + -- pcall(require, plugin) + -- end, { "lspconfig", "null-ls" }) + -- end, + -- }, { "williamboman/mason.nvim", - event = "VeryLazy", - cmd = { - "Mason", - "MasonInstall", - "MasonUninstall", - "MasonUninstallAll", - "MasonLog", - }, - dependencies = { "williamboman/mason-lspconfig.nvim" }, - init = function() - vim.tbl_map(function(plugin) - pcall(require, plugin) - end, { "lspconfig", "null-ls" }) - end, + cmd = "Mason", + keys = { { "cm", "Mason", desc = "Mason" } }, }, -- for formater linter { "RRethy/vim-illuminate", event = "BufRead" }, @@ -255,72 +190,6 @@ return { require("user.indentline") end, }, - -- dashboard - { - "goolord/alpha-nvim", - module = "alpha", - event = "BufWinEnter", - config = function() - require("user.alpha") - end, - }, - -- line info bootom - { - "nvim-lualine/lualine.nvim", - dependencies = { "kyazdani42/nvim-web-devicons", opt = true }, - event = "BufWinEnter", - opts = function() - local model = 2 - if model == 1 then - require("user.lualine1") - elseif model == 2 then - require("user.lualine2") - else - require("user.lualine") - end - end, - }, - -- for show icon - { - "kyazdani42/nvim-web-devicons", - event = "VeryLazy", - config = function() - require("user.webdevicons") - end, - }, - -- for tree exploler - { - "kyazdani42/nvim-tree.lua", - event = "BufWinEnter", - cmd = "NvimTreeToggle", - dependencies = "kyazdani42/nvim-web-devicons", - init = function() - require("user.nvim-tree") - end, - }, - -- for file tab - { - "akinsho/bufferline.nvim", - dependencies = { - "kyazdani42/nvim-web-devicons", - { "famiu/bufdelete.nvim", event = "BufRead" }, - }, - event = "BufRead", - -- config = function() - -- require("user.bufferline") - -- end, - }, - -- for delete buffers (close files) without closing your windows or messing up your layout. - { "moll/vim-bbye", event = "BufRead" }, - -- for view terminal - { - "akinsho/toggleterm.nvim", - cmd = "Toggleterm", - event = "BufWinEnter", - init = function() - require("user.toggleterm") - end, - }, -- { "ahmedkhalf/project.nvim", commit = "628de7e433dd503e782831fe150bb750e56e55d6", event = "VeryLazy" }, -- for Speed up loading Lua modules in Neovim to improve startup time. { @@ -330,24 +199,6 @@ return { require("user.impatient") end, }, - -- key mapping - { - "folke/which-key.nvim", - event = "BufWinEnter", - init = function() - require("user.whichkey") - end, - }, - -- for search - { - "nvim-telescope/telescope.nvim", - event = "VeryLazy", - dependencies = { { "nvim-lua/plenary.nvim" } }, - cmd = "Telescope", - init = function() - require("user.telescope") - end, - }, -- for live server html,css,js { "manzeloth/live-server", cmd = { "LiveServer" }, event = "BufRead" }, -- for multi cursor select @@ -365,7 +216,7 @@ return { { "CRAG666/code_runner.nvim", event = "BufRead", - dependencies = "nvim-lua/plenary.nvim", + -- dependencies = "nvim-lua/plenary.nvim", cmd = { "RunCode", "RunFile", "RunProject", "RunClose" }, config = function() require("user.coderunner") @@ -565,20 +416,20 @@ return { end, }, -- for auto complate commond mode - -- { - -- "gelguy/wilder.nvim", - -- event = "BufWinEnter", - -- config = function() - -- local wilder = require("wilder") - -- wilder.setup({ modes = { ":", "/", "?" } }) - -- wilder.set_option( - -- "renderer", - -- wilder.popupmenu_renderer({ - -- highlighter = wilder.basic_highlighter(), - -- left = { " ", wilder.popupmenu_devicons() }, - -- right = { " ", wilder.popupmenu_scrollbar() }, - -- }) - -- ) - -- end, - -- }, + { + "gelguy/wilder.nvim", + event = "BufWinEnter", + config = function() + local wilder = require("wilder") + wilder.setup({ modes = { ":", "/", "?" } }) + wilder.set_option( + "renderer", + wilder.popupmenu_renderer({ + highlighter = wilder.basic_highlighter(), + left = { " ", wilder.popupmenu_devicons() }, + right = { " ", wilder.popupmenu_scrollbar() }, + }) + ) + end, + }, } diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua new file mode 100644 index 0000000..ea2e5cc --- /dev/null +++ b/lua/plugins/ui.lua @@ -0,0 +1,161 @@ +return { + -- color scheme + { + "folke/tokyonight.nvim", + -- commit = "66bfc2e8f754869c7b651f3f47a2ee56ae557764", + lazy = true, -- make sure we load this during startup if it is your main colorscheme + -- priority = 1000, -- make sure to load this before all the other start plugins + config = function() + local is_transparant = false + if is_transparant then + require("user.tokyonight_transparant") + else + require("user.tokyonight") + end + end, + }, + -- { + -- "navarasu/onedark.nvim", + -- init = function() + -- require("user.onedark") + -- require("onedark").load() + -- end, + -- }, + -- { "lunarvim/lunar.nvim" }, + -- -- { "arcticicestudio/nord-vim" }, + -- { + -- "catppuccin/nvim", + -- name = "catppuccin", + -- init = function() + -- require("user.catppuccin") + -- end, + -- }, + -- { + -- "ellisonleao/gruvbox.nvim", + -- init = function() + -- require("gruvbox").setup({ + -- undercurl = true, + -- underline = true, + -- bold = true, + -- italic = true, + -- strikethrough = true, + -- invert_selection = false, + -- invert_signs = false, + -- invert_tabline = false, + -- invert_intend_guides = false, + -- inverse = true, -- invert background for search, diffs, statuslines and errors + -- contrast = "", -- can be "hard", "soft" or empty string + -- palette_overrides = {}, + -- overrides = {}, + -- dim_inactive = false, + -- transparent_mode = false, + -- }) + -- vim.o.background = "dark" -- or "light" for light mode + -- end, + -- }, + -- { "sainnhe/sonokai" }, + -- -- { "EdenEast/nightfox.nvim" }, + -- { + -- "marko-cerovac/material.nvim", + -- init = function() + -- vim.g.material_style = "darker" + -- end, + -- }, + + -- include treesitter + -- require("plugins.treesitter"), + -- { + -- "nvim-treesitter/nvim-treesitter", + -- commit = "8e763332b7bf7b3a426fd8707b7f5aa85823a5ac", + -- run = ":TSUpdate", + -- event = "BufWinEnter", + -- opts = function() + -- require("user.treesitter") + -- end, + -- }, + -- dashboard + { + "goolord/alpha-nvim", + module = "alpha", + event = "BufWinEnter", + config = function() + require("user.alpha") + end, + }, + -- line info bootom + { + "nvim-lualine/lualine.nvim", + -- dependencies = { "kyazdani42/nvim-web-devicons", opt = true }, + event = "BufWinEnter", + config = function() + local model = 0 + if model == 1 then + require("user.lualine1") + elseif model == 2 then + require("user.lualine2") + else + require("user.lualine") + end + end, + }, + -- for show icon + { + "kyazdani42/nvim-web-devicons", + event = "BufRead", + config = function() + require("user.webdevicons") + end, + }, + -- for tree exploler + { + "kyazdani42/nvim-tree.lua", + -- event = "BufRead", + cmd = "NvimTreeToggle", + -- dependencies = "kyazdani42/nvim-web-devicons", + config = function() + require("user.nvim-tree") + end, + }, + -- for file tab + { + "famiu/bufdelete.nvim", + event = "BufRead", + }, + { + "akinsho/bufferline.nvim", + event = "BufRead", + -- config = function() + -- require("user.bufferline") + -- end, + }, + -- for delete buffers (close files) without closing your windows or messing up your layout. + { "moll/vim-bbye", event = "BufRead" }, + -- for view terminal + { + "akinsho/toggleterm.nvim", + cmd = "Toggleterm", + event = "BufWinEnter", + init = function() + require("user.toggleterm") + end, + }, + -- key mapping + { + "folke/which-key.nvim", + event = "BufWinEnter", + init = function() + require("user.whichkey") + end, + }, + -- for search + { + "nvim-telescope/telescope.nvim", + -- event = "BufRead", + -- dependencies = { { "nvim-lua/plenary.nvim" } }, + cmd = "Telescope", + version = false, -- telescope did only one release, so use HEAD for now + config = function() + require("user.telescope") + end, + }, +} diff --git a/lua/user/cmdline.lua b/lua/user/cmdline.lua index 5dc91d8..fc39835 100644 --- a/lua/user/cmdline.lua +++ b/lua/user/cmdline.lua @@ -1,8 +1,4 @@ -local status_ok, ncmp = pcall(require, "cmp") -if not status_ok then - return -end -ncmp.setup.cmdline({ "/", "?" }, { +require("cmp").setup.cmdline({ "/", "?" }, { mapping = require("cmp").mapping.preset.cmdline({ [""] = { c = function() @@ -19,7 +15,7 @@ ncmp.setup.cmdline({ "/", "?" }, { sources = require("cmp").config.sources({ { name = "buffer", keyword_length = 1 } }), }) -ncmp.setup.cmdline(":", { +require("cmp").setup.cmdline(":", { mapping = require("cmp").mapping.preset.cmdline({ [""] = { c = function() diff --git a/lua/user/cmp.lua b/lua/user/cmp.lua index ac39f40..820cbdd 100644 --- a/lua/user/cmp.lua +++ b/lua/user/cmp.lua @@ -141,24 +141,24 @@ cmp.setup({ }) -- for cmd line -cmp.setup.cmdline("/", { - mapping = cmp.mapping.preset.cmdline(), - sources = { - { name = "buffer" }, - }, -}) - --- `:` cmdline setup. -cmp.setup.cmdline(":", { - mapping = cmp.mapping.preset.cmdline(), - sources = cmp.config.sources({ - { name = "path" }, - }, { - { - name = "cmdline", - option = { - ignore_cmds = { "Man", "!" }, - }, - }, - }), -}) +-- cmp.setup.cmdline("/", { +-- mapping = cmp.mapping.preset.cmdline(), +-- sources = { +-- { name = "buffer" }, +-- }, +-- }) +-- +-- -- `:` cmdline setup. +-- cmp.setup.cmdline(":", { +-- mapping = cmp.mapping.preset.cmdline(), +-- sources = cmp.config.sources({ +-- { name = "path" }, +-- }, { +-- { +-- name = "cmdline", +-- option = { +-- ignore_cmds = { "Man", "!" }, +-- }, +-- }, +-- }), +-- })