commit 01a16a70ab134783241ff10db048edb7833c05f8 Author: c-my Date: Thu Apr 14 15:33:17 2022 +0800 initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..858e573 --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# My Neovim Config + +## Plugins + +* [packer.nvim](https://github.com/wbthomason/packer.nvim) +* [auto-pairs](https://github.com/jiangmiao/auto-pairs) +* [better-escape.nvim](https://github.com/max397574/better-escape.nvim) +* [hrsh7th/nvim-cmp](https://github.com/hrsh7th/nvim-cmp) +* [ewis6991/gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) +* [williamboman/nvim-lsp-installer](https://github.com/williamboman/nvim-lsp-installer) +* [rcarriga/nvim-notify](https://github.com/rcarriga/nvim-notify) +* [kyazdani42/nvim-tree.lua](https://github.com/kyazdani42/nvim-tree.lua) +* [nvim-telescope/telescope.nvim](https://github.com/nvim-telescope/telescope.nvim) + +## Themes + +* [catppuccin/nvim](https://github.com/catppuccin/nvim) +* [folke/tokyonight.nvim](https://github.com/folke/tokyonight.nvim) + +## TODOs + +- [x] LSP +- [x] 调整配置文件缩进 +- [ ] Telescope 选择主题配色 +- [ ] Notify 配置 +- [ ] Packer Plugins 懒加载 +- [x] CMP snip换行后tab数量问题 +- [x] CMP command 不区分大小写 +- [ ] CMP document border +- [x] CMP highlight 首个 +- [x] CMP ghost +- [ ] CMP 函数自动加括号 +- [x] LSP 放在 CMP sources 最前面 +- [ ] Autopairs 配置 +- [ ] 注释插件 +- [ ] shift 块后保持选择 diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..a277756 --- /dev/null +++ b/init.lua @@ -0,0 +1,15 @@ +require 'configs.options' +require 'configs.keymaps' +require 'configs.plugins.packer' + +-- Plugins settings +require 'configs.plugins.themes' +require 'configs.plugins.cmp' +require 'configs.plugins.lsp_installer' +require 'configs.plugins.better_escape' +require 'configs.plugins.autopairs' +require 'configs.plugins.gitsigns' + +require 'configs.plugins.nvimtree' +-- require 'plugins.notify' + diff --git a/lua/configs/keymaps.lua b/lua/configs/keymaps.lua new file mode 100644 index 0000000..bd661cb --- /dev/null +++ b/lua/configs/keymaps.lua @@ -0,0 +1,44 @@ +local opts = { + noremap = true, + silent = true +} + +vim.api.nvim_set_keymap('', '', '', opts) +vim.g.mapleader = ' ' +vim.g.maplocalleader = ' ' + +-- Moving line +-- == re-indents the line to suit its new position +-- gc reselects the last visual block +-- = re-indents the block +vim.api.nvim_set_keymap('n', '', ':m .+1==', opts) +vim.api.nvim_set_keymap('n', '', ':m .-2==', opts) +vim.api.nvim_set_keymap('i', '', ':m .+1==gi', opts) +vim.api.nvim_set_keymap('i', '', ':m .-2==gi', opts) +vim.api.nvim_set_keymap('v', '', ":m '>+1gv=gv", opts) +vim.api.nvim_set_keymap('v', '', ":m '<-2gv=gv", opts) + +-- Navigating window +vim.api.nvim_set_keymap('n', '', 'h', opts) +vim.api.nvim_set_keymap('n', '', 'j', opts) +vim.api.nvim_set_keymap('n', '', 'k', opts) +vim.api.nvim_set_keymap('n', '', 'l', opts) + +-- Keymaps for NvimTree +vim.api.nvim_set_keymap('n', '', ':NvimTreeFindFileToggle ', opts) + +-- Keymaps for Telescope +vim.api.nvim_set_keymap('n', 'ff', ':Telescope find_files ', opts) +vim.api.nvim_set_keymap('n', 'fg', ':Telescope live_grep ', opts) +vim.api.nvim_set_keymap('n', 'fb', ':Telescope buffers ', opts) +vim.api.nvim_set_keymap('n', 'fh', ':Telescope help_tags ', opts) + +-- Keymaps for LSP +-- Mappings. +-- See `:help vim.diagnostic.*` for documentation on any of the below functions +vim.api.nvim_set_keymap('n', 'e', 'lua vim.diagnostic.open_float()', opts) +vim.api.nvim_set_keymap('n', '[d', 'lua vim.diagnostic.goto_prev()', opts) +vim.api.nvim_set_keymap('n', ']d', 'lua vim.diagnostic.goto_next()', opts) +vim.api.nvim_set_keymap('n', 'q', 'lua vim.diagnostic.setloclist()', opts) + + diff --git a/lua/configs/options.lua b/lua/configs/options.lua new file mode 100644 index 0000000..1f78788 --- /dev/null +++ b/lua/configs/options.lua @@ -0,0 +1,28 @@ +vim.opt.clipboard = 'unnamedplus' +vim.opt.number = true +vim.opt.numberwidth = 2 +vim.opt.wrap = false +vim.opt.fileencoding = 'utf-8' +vim.opt.mouse = 'a' +vim.opt.updatetime = 250 +vim.opt.timeoutlen = 400 + +vim.opt.smartcase = true +vim.opt.ignorecase = true +vim.opt.wildignorecase = true +vim.opt.wildmenu = false + +vim.opt.smartindent = true +vim.opt.smarttab = true +vim.opt.expandtab = true +vim.opt.tabstop = 4 +vim.opt.softtabstop = 4 +vim.opt.shiftwidth = 4 + +vim.opt.termguicolors = true + +vim.opt.splitbelow = true +vim.opt.splitright = true + +vim.opt.completeopt = 'menu,menuone,noinsert' + diff --git a/lua/configs/plugins/autopairs.lua b/lua/configs/plugins/autopairs.lua new file mode 100644 index 0000000..9eb0284 --- /dev/null +++ b/lua/configs/plugins/autopairs.lua @@ -0,0 +1,7 @@ +local present, autopairs = pcall(require, "nvim-autopairs") + +if not present then + return +end + +autopairs.setup() diff --git a/lua/configs/plugins/better_escape.lua b/lua/configs/plugins/better_escape.lua new file mode 100644 index 0000000..0500035 --- /dev/null +++ b/lua/configs/plugins/better_escape.lua @@ -0,0 +1,10 @@ +local present, escape = pcall(require, 'better_escape') + +if not present then + print "no escape" + return +end + +escape.setup({ + mapping = {'jk'}, +}) diff --git a/lua/configs/plugins/cmp.lua b/lua/configs/plugins/cmp.lua new file mode 100644 index 0000000..bf92c11 --- /dev/null +++ b/lua/configs/plugins/cmp.lua @@ -0,0 +1,153 @@ +local present_cmp, cmp = pcall(require, 'cmp') +if not present_cmp then + print 'no cmp' + return +end + +local present_lua, luasnip = pcall(require, 'luasnip') +if not present_lua then + print 'no luasnip' + return +end + +require("luasnip.loaders.from_vscode").lazy_load() + +local kind_icons = { + Text = "", + Method = "", + Function = "", + Constructor = "", + Field = "", + Variable = "", + Class = "ﴯ", + Interface = "", + Module = "", + Property = "ﰠ", + Unit = "", + Value = "", + Enum = "", + Keyword = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "", + Event = "", + Operator = "", + TypeParameter = "" +} + +cmp.setup({ + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + -- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. + luasnip.lsp_expand(args.body) + -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + -- require('snippy').expand_snippet(args.body) -- For `snippy` users. + -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. + end + }, + formatting = { + fields = {'kind', 'abbr', 'menu'}, + format = function(entry, vim_item) + vim_item.abbr = string.format('%s', vim_item.abbr) + vim_item.kind = string.format('%s', kind_icons[vim_item.kind]) + + vim_item.menu = ({ + nvim_lsp = '[LSP]', + luasnip = '[Snippet]', + buffer = '[BUF]', + path = '[Path]' + })[entry.source.name] + + return vim_item + end + }, + mapping = { + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item({ + -- Select but noinsert + behavior = cmp.SelectBehavior.Select + }) + else + fallback() + end + end, {'i', 'c'}), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item({ + behavior = cmp.SelectBehavior.Select + }) + else + fallback() + end + end, {'i', 'c'}), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping(cmp.mapping.complete(), {'i', 'c'}), -- d + [''] = cmp.mapping({ + i = cmp.mapping.abort(), + c = cmp.mapping.close() + }), + [''] = cmp.mapping(function (fallback) + if cmp.visible() then + cmp.confirm() + else + fallback() + end + end, {'i', 'c'}), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.confirm({ + select = true + }) + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, {'i', 'c'}), + [''] = cmp.mapping(function(fallback) + if luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, {'i', 's'}) + }, + completion = { + -- Highlight first item + completeopt = 'menu,menuone,noinsert' + }, + experimental = { + -- ghost_text = true + }, + sources = {{ + name = 'nvim_lsp' + }, { + name = 'luasnip' + }, { + name = 'buffer' + }, { + name = 'path' + }, { + name = 'cmdline' + }} +}) + +require'cmp'.setup.cmdline(':', { + sources = {{ + name = 'cmdline' + }} +}) + +require'cmp'.setup.cmdline('/', { + sources = {{ + name = 'buffer' + }} +}) diff --git a/lua/configs/plugins/gitsigns.lua b/lua/configs/plugins/gitsigns.lua new file mode 100644 index 0000000..51b2d25 --- /dev/null +++ b/lua/configs/plugins/gitsigns.lua @@ -0,0 +1,8 @@ +local present, gitsigns = pcall(require, "gitsigns") + +if not present then + print "no gitsigns" + return +end + +gitsigns.setup() diff --git a/lua/configs/plugins/lsp_installer.lua b/lua/configs/plugins/lsp_installer.lua new file mode 100644 index 0000000..b2fcd41 --- /dev/null +++ b/lua/configs/plugins/lsp_installer.lua @@ -0,0 +1,72 @@ +local present, lsp_installer = pcall(require, 'nvim-lsp-installer') + +if not present then + print 'no lsp installer' + return +end + +-- Use an on_attach function to only map the following keys +-- after the language server attaches to the current buffer +local on_attach = function(client, bufnr) + local opts = { + noremap = true, + silent = true + } + -- Enable completion triggered by + vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + + -- Mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', 'lua vim.lsp.buf.declaration()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', 'lua vim.lsp.buf.definition()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', 'lua vim.lsp.buf.hover()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', 'lua vim.lsp.buf.implementation()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', '', 'lua vim.lsp.buf.signature_help()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'wl', + 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'D', 'lua vim.lsp.buf.type_definition()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'rn', 'lua vim.lsp.buf.rename()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'ca', 'lua vim.lsp.buf.code_action()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', 'lua vim.lsp.buf.references()', opts) + vim.api.nvim_buf_set_keymap(bufnr, 'n', 'f', 'lua vim.lsp.buf.formatting()', opts) +end + +-- Register a handler that will be called for each installed server when it's ready (i.e. when installation is finished +-- or if the server is already installed). +lsp_installer.on_server_ready(function(server) + local opts = { + on_attach = on_attach, + flags = { + -- This will be the default in neovim 0.7+ + debounce_text_changes = 150 + }, + capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()), + } + + if server.name == 'sumneko_lua' then + local sumneko_lua_opts = require('configs.plugins.lsp_settings.sumneko_lua') + opts.settings = sumneko_lua_opts + end + -- (optional) Customize the options passed to the server + -- if server.name == "tsserver" then + -- opts.root_dir = function() ... end + -- end + + -- This setup() function will take the provided server configuration and decorate it with the necessary properties + -- before passing it onwards to lspconfig. + -- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md + server:setup(opts) +end) + +lsp_installer.settings({ + ui = { + icons = { + server_installed = "✓", + server_pending = "➜", + server_uninstalled = "✗" + } + } +}) + diff --git a/lua/configs/plugins/lsp_settings/sumneko_lua.lua b/lua/configs/plugins/lsp_settings/sumneko_lua.lua new file mode 100644 index 0000000..d521d46 --- /dev/null +++ b/lua/configs/plugins/lsp_settings/sumneko_lua.lua @@ -0,0 +1,7 @@ +return { + Lua = { + diagnostics = { + globals = { "vim" }, + }, + } +} diff --git a/lua/configs/plugins/notify.lua b/lua/configs/plugins/notify.lua new file mode 100644 index 0000000..f3c8ad2 --- /dev/null +++ b/lua/configs/plugins/notify.lua @@ -0,0 +1,9 @@ +local present, notify = pcall(requird, 'notify') + +if not present then + print 'no notify' + return +end + +vim.notify = notify +notify.setup() diff --git a/lua/configs/plugins/nvimtree.lua b/lua/configs/plugins/nvimtree.lua new file mode 100644 index 0000000..422b5e8 --- /dev/null +++ b/lua/configs/plugins/nvimtree.lua @@ -0,0 +1,7 @@ +local present, nvimtree = pcall(require, "nvim-tree") + +if not present then + return +end + +nvimtree.setup() diff --git a/lua/configs/plugins/packer.lua b/lua/configs/plugins/packer.lua new file mode 100644 index 0000000..374f10d --- /dev/null +++ b/lua/configs/plugins/packer.lua @@ -0,0 +1,70 @@ +local fn = vim.fn +local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim' +if fn.empty(fn.glob(install_path)) > 0 then + packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', + install_path}) +end + +-- Only required if you have packer configured as `opt` +vim.cmd [[packadd packer.nvim]] + +local status_ok, packer = pcall(require, 'packer') +if not status_ok then + return +end + +packer.init { + display = { + open_fn = function() + return require('packer.util').float { + border = 'rounded' + } + end + } +} +return packer.startup(function(use) + -- My plugins here + use 'wbthomason/packer.nvim' + use 'windwp/nvim-autopairs' + use {'lewis6991/gitsigns.nvim' -- tag = 'release' -- To use the latest release + } + use {'max397574/better-escape.nvim'} + use {'hrsh7th/nvim-cmp'} + use {'hrsh7th/cmp-nvim-lsp'} + use {'hrsh7th/cmp-buffer'} + use {'hrsh7th/cmp-path'} + use {'hrsh7th/cmp-cmdline'} + use {'L3MON4D3/LuaSnip'} + use {'rafamadriz/friendly-snippets'} + -- LSP + use {'neovim/nvim-lspconfig'} + use {'williamboman/nvim-lsp-installer'} + -- UI Plugins + use { + 'kyazdani42/nvim-tree.lua', + requires = {'kyazdani42/nvim-web-devicons' -- optional, for file icon + } + } + use { + 'nvim-telescope/telescope.nvim', + cmd = 'Telescope', + requires = {{'nvim-lua/plenary.nvim'}} + } + use {'rcarriga/nvim-notify'} + + -- Themes + use { + "catppuccin/nvim", + as = "catppuccin" + } + use {'folke/tokyonight.nvim'} + -- use 'hrsh7th/cmp-cmdline' + -- use 'foo1/bar1.nvim' + -- use 'foo2/bar2.nvim' + + -- Automatically set up your configuration after cloning packer.nvim + -- Put this at the end after all plugins + if packer_bootstrap then + require('packer').sync() + end +end) diff --git a/lua/configs/plugins/themes.lua b/lua/configs/plugins/themes.lua new file mode 100644 index 0000000..9e8ba81 --- /dev/null +++ b/lua/configs/plugins/themes.lua @@ -0,0 +1,8 @@ +local catppuccin = require('catppuccin') +-- configure it +catppuccin.setup() + +vim.g.tokyonight_style = "night" + +-- vim.cmd[[colorscheme catppuccin]] +vim.cmd[[colorscheme tokyonight]] diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua new file mode 100644 index 0000000..7c6c217 --- /dev/null +++ b/plugin/packer_compiled.lua @@ -0,0 +1,191 @@ +-- Automatically generated packer.nvim plugin loader code + +if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then + vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') + return +end + +vim.api.nvim_command('packadd packer.nvim') + +local no_errors, error_msg = pcall(function() + + local time + local profile_info + local should_profile = false + if should_profile then + local hrtime = vim.loop.hrtime + profile_info = {} + time = function(chunk, start) + if start then + profile_info[chunk] = hrtime() + else + profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 + end + end + else + time = function(chunk, start) end + end + +local function save_profiles(threshold) + local sorted_times = {} + for chunk_name, time_taken in pairs(profile_info) do + sorted_times[#sorted_times + 1] = {chunk_name, time_taken} + end + table.sort(sorted_times, function(a, b) return a[2] > b[2] end) + local results = {} + for i, elem in ipairs(sorted_times) do + if not threshold or threshold and elem[2] > threshold then + results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' + end + end + + _G._packer = _G._packer or {} + _G._packer.profile_output = results +end + +time([[Luarocks path setup]], true) +local package_path_str = "C:\\Users\\CaiMY\\AppData\\Local\\Temp\\nvim\\packer_hererocks\\2.1.0-beta3\\share\\lua\\5.1\\?.lua;C:\\Users\\CaiMY\\AppData\\Local\\Temp\\nvim\\packer_hererocks\\2.1.0-beta3\\share\\lua\\5.1\\?\\init.lua;C:\\Users\\CaiMY\\AppData\\Local\\Temp\\nvim\\packer_hererocks\\2.1.0-beta3\\lib\\luarocks\\rocks-5.1\\?.lua;C:\\Users\\CaiMY\\AppData\\Local\\Temp\\nvim\\packer_hererocks\\2.1.0-beta3\\lib\\luarocks\\rocks-5.1\\?\\init.lua" +local install_cpath_pattern = "C:\\Users\\CaiMY\\AppData\\Local\\Temp\\nvim\\packer_hererocks\\2.1.0-beta3\\lib\\lua\\5.1\\?.so" +if not string.find(package.path, package_path_str, 1, true) then + package.path = package.path .. ';' .. package_path_str +end + +if not string.find(package.cpath, install_cpath_pattern, 1, true) then + package.cpath = package.cpath .. ';' .. install_cpath_pattern +end + +time([[Luarocks path setup]], false) +time([[try_loadstring definition]], true) +local function try_loadstring(s, component, name) + local success, result = pcall(loadstring(s), name, _G.packer_plugins[name]) + if not success then + vim.schedule(function() + vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) + end) + end + return result +end + +time([[try_loadstring definition]], false) +time([[Defining packer_plugins]], true) +_G.packer_plugins = { + LuaSnip = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\LuaSnip", + url = "https://github.com/L3MON4D3/LuaSnip" + }, + ["better-escape.nvim"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\better-escape.nvim", + url = "https://github.com/max397574/better-escape.nvim" + }, + catppuccin = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\catppuccin", + url = "https://github.com/catppuccin/nvim" + }, + ["cmp-buffer"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\cmp-buffer", + url = "https://github.com/hrsh7th/cmp-buffer" + }, + ["cmp-cmdline"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\cmp-cmdline", + url = "https://github.com/hrsh7th/cmp-cmdline" + }, + ["cmp-nvim-lsp"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\cmp-nvim-lsp", + url = "https://github.com/hrsh7th/cmp-nvim-lsp" + }, + ["cmp-path"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\cmp-path", + url = "https://github.com/hrsh7th/cmp-path" + }, + ["friendly-snippets"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\friendly-snippets", + url = "https://github.com/rafamadriz/friendly-snippets" + }, + ["gitsigns.nvim"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\gitsigns.nvim", + url = "https://github.com/lewis6991/gitsigns.nvim" + }, + ["nvim-autopairs"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\nvim-autopairs", + url = "https://github.com/windwp/nvim-autopairs" + }, + ["nvim-cmp"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\nvim-cmp", + url = "https://github.com/hrsh7th/nvim-cmp" + }, + ["nvim-lsp-installer"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\nvim-lsp-installer", + url = "https://github.com/williamboman/nvim-lsp-installer" + }, + ["nvim-lspconfig"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\nvim-lspconfig", + url = "https://github.com/neovim/nvim-lspconfig" + }, + ["nvim-notify"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\nvim-notify", + url = "https://github.com/rcarriga/nvim-notify" + }, + ["nvim-tree.lua"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\nvim-tree.lua", + url = "https://github.com/kyazdani42/nvim-tree.lua" + }, + ["nvim-web-devicons"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\nvim-web-devicons", + url = "https://github.com/kyazdani42/nvim-web-devicons" + }, + ["packer.nvim"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\packer.nvim", + url = "https://github.com/wbthomason/packer.nvim" + }, + ["plenary.nvim"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\plenary.nvim", + url = "https://github.com/nvim-lua/plenary.nvim" + }, + ["telescope.nvim"] = { + commands = { "Telescope" }, + loaded = false, + needs_bufread = true, + only_cond = false, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\opt\\telescope.nvim", + url = "https://github.com/nvim-telescope/telescope.nvim" + }, + ["tokyonight.nvim"] = { + loaded = true, + path = "C:\\Users\\CaiMY\\AppData\\Local\\nvim-data\\site\\pack\\packer\\start\\tokyonight.nvim", + url = "https://github.com/folke/tokyonight.nvim" + } +} + +time([[Defining packer_plugins]], false) + +-- Command lazy-loads +time([[Defining lazy-load commands]], true) +pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Telescope lua require("packer.load")({'telescope.nvim'}, { cmd = "Telescope", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) +time([[Defining lazy-load commands]], false) + +if should_profile then save_profiles() end + +end) + +if not no_errors then + error_msg = error_msg:gsub('"', '\\"') + vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') +end