├── .gitignore ├── lua ├── plugin-config │ ├── nvim-colorizer.lua │ ├── lspsaga.lua │ ├── nvim-cursorline.lua │ ├── nvim-lastplace.lua │ ├── dadod.lua │ ├── treesitter.lua │ ├── nvim-notify.lua │ ├── nvim-scrollbar.lua │ ├── dashboard.lua │ ├── telescope.lua │ ├── bufferline.lua │ ├── formatter.lua │ ├── gitsigns.lua │ ├── toggleterm.lua │ ├── nvim-tree.lua │ └── nvim-cmp.lua ├── lsp │ ├── config │ │ ├── json.lua │ │ ├── volar.lua │ │ ├── lua.lua │ │ └── tsserver.lua │ └── setup.lua ├── bind.lua ├── core.lua ├── basic.lua ├── options.lua ├── mapping.lua └── plugins.lua ├── init.lua ├── static └── neovim.cat ├── plugin ├── difftools.vim ├── nicefold.vim └── packer_compiled.lua ├── README.md └── lazy-lock.json /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | lazy-lock.json 3 | lua/.luarc.json 4 | -------------------------------------------------------------------------------- /lua/plugin-config/nvim-colorizer.lua: -------------------------------------------------------------------------------- 1 | require "colorizer".setup() -------------------------------------------------------------------------------- /lua/plugin-config/lspsaga.lua: -------------------------------------------------------------------------------- 1 | local lspsagaCore = require("lspsaga") 2 | 3 | lspsagaCore.setup( 4 | { 5 | symbol_in_winbar = { 6 | enable = true 7 | } 8 | } 9 | ) 10 | 11 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | require "core" 2 | 3 | 4 | -- Basic Settings 5 | -- require("basic") 6 | 7 | -- shortcut keymap 8 | -- require("keybind") 9 | 10 | -- seetting for plugin 11 | -- require("plugins") 12 | -------------------------------------------------------------------------------- /lua/lsp/config/json.lua: -------------------------------------------------------------------------------- 1 | -- vim.cmd [[packadd schemastore.nvim]] 2 | return { 3 | settings = { 4 | json = { 5 | validate = { enable = true }, 6 | schemas = require("schemastore").json.schemas() 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /lua/plugin-config/nvim-cursorline.lua: -------------------------------------------------------------------------------- 1 | require("nvim-cursorline").setup { 2 | cursorline = { 3 | enable = true, 4 | timeout = 1000, 5 | number = false 6 | }, 7 | cursorword = { 8 | enable = true, 9 | min_length = 3, 10 | hl = {underline = true} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lua/plugin-config/nvim-lastplace.lua: -------------------------------------------------------------------------------- 1 | require("nvim-lastplace").setup( 2 | { 3 | -- 那些 buffer 类型不记录光标位置 4 | lastplace_ignore_buftype = {"quickfix", "nofile", "help"}, 5 | -- 那些文件类型不记录光标位置 6 | lastplace_ignore_filetype = {"gitcommit", "gitrebase", "svn", "hgcommit"}, 7 | lastplace_open_folds = true 8 | } 9 | ) 10 | -------------------------------------------------------------------------------- /lua/bind.lua: -------------------------------------------------------------------------------- 1 | local bind = {} 2 | 3 | -- bind options 4 | function bind.bind_option(options) 5 | for k, v in pairs(options) do 6 | if v == true or v == false then 7 | vim.api.nvim_command("set " .. k) 8 | else 9 | vim.api.nvim_command("set " .. k .. "=" .. v) 10 | end 11 | end 12 | end 13 | 14 | return bind 15 | -------------------------------------------------------------------------------- /lua/plugin-config/dadod.lua: -------------------------------------------------------------------------------- 1 | vim.cmd [[packadd vim-dadbod]] 2 | vim.g.db_ui_show_help = 0 3 | vim.g.db_ui_win_position = "left" 4 | vim.g.db_ui_use_nerd_fonts = 1 5 | vim.g.db_ui_winwidth = 35 6 | vim.g.db_ui_save_location = os.getenv("HOME") .. "/.cache/vim/db_ui_queries" 7 | vim.g.dbs = { 8 | dev = "mysql://root@172.16.2.226/suyi_cinema" 9 | } 10 | -------------------------------------------------------------------------------- /lua/core.lua: -------------------------------------------------------------------------------- 1 | local options = require "options" 2 | 3 | local leader_map = function() 4 | vim.g.mapleader = " " 5 | vim.api.nvim_set_keymap("n", " ", "", {noremap = true}) 6 | vim.api.nvim_set_keymap("x", " ", "", {noremap = true}) 7 | end 8 | 9 | local load_core = function() 10 | leader_map() 11 | 12 | options:load_options() 13 | require("mapping") 14 | require("plugins") 15 | end 16 | 17 | load_core() 18 | -------------------------------------------------------------------------------- /lua/plugin-config/treesitter.lua: -------------------------------------------------------------------------------- 1 | vim.opt.foldmethod = 'expr' 2 | vim.opt.foldexpr = 'nvim_treesitter#foldexpr()' 3 | 4 | require "nvim-treesitter.configs".setup { 5 | ensure_installed = "all", 6 | highlight = { 7 | enable = true 8 | }, 9 | indent = { 10 | enable = true 11 | }, 12 | rainbow = { 13 | enable = true 14 | }, 15 | textobjects = { 16 | select = { 17 | enable = true, 18 | lookahead = true, 19 | keymaps = { 20 | -- You can use the capture groups defined in textobjects.scm 21 | ["af"] = "@function.outer", 22 | ["if"] = "@function.inner", 23 | ["ac"] = "@class.outer", 24 | ["ic"] = "@class.inner" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lua/plugin-config/nvim-notify.lua: -------------------------------------------------------------------------------- 1 | local notify_opts = { 2 | -- 动画样式 3 | -- fade_in_slide_out 4 | -- fade 5 | -- slide 6 | -- static 7 | stages = "fade", 8 | -- 超时时间,默认 5s 9 | timeout = 2000 10 | } 11 | 12 | -- 如果是透明背景,则需要设置背景色 13 | if vim.g.background_transparency then 14 | notify_opts.background_colour = "#ffffff" 15 | end 16 | 17 | vim.notify = require("notify") 18 | 19 | vim.notify.setup(notify_opts) 20 | -- 使用案例: 21 | -- 信息、级别、标题 22 | -- 级别有:info、warn、error、debug、trace 23 | -- 示例: 24 | -- vim.notify("hello world", "info", {title = "info"}) 25 | 26 | -- 显示历史弹窗记录 27 | vim.api.nvim_set_keymap( 28 | "n", 29 | "fn", 30 | "lua require('telescope').extensions.notify.notify()", 31 | {silent = true, noremap = true} 32 | ) 33 | -------------------------------------------------------------------------------- /lua/plugin-config/nvim-scrollbar.lua: -------------------------------------------------------------------------------- 1 | local colors = { 2 | color = "#292E42", 3 | Search = "#FC867", 4 | Error = "#FD6883", 5 | Warn = "#FFD886", 6 | Info = "A9DC76", 7 | Hint = "#78DCE8", 8 | Misc = "#AB9DF2" 9 | } 10 | 11 | require("scrollbar").setup( 12 | { 13 | handle = { 14 | -- 滚动条颜色 15 | color = colors.color 16 | }, 17 | marks = { 18 | -- 诊断颜色,需要 LSP 支持 19 | Search = {color = colors.Search}, 20 | Error = {color = colors.Error}, 21 | Warn = {color = colors.Warn}, 22 | Info = {color = colors.Info}, 23 | Hint = {color = colors.Hint}, 24 | Misc = {color = colors.Misc} 25 | } 26 | } 27 | ) 28 | -------------------------------------------------------------------------------- /lua/plugin-config/dashboard.lua: -------------------------------------------------------------------------------- 1 | local db = require("dashboard") 2 | db.setup( 3 | { 4 | theme = "hyper", 5 | config = { 6 | week_header = { 7 | enable = true 8 | }, 9 | shortcut = { 10 | {desc = " Update", group = "@property", action = "Lazy update", key = "u"}, 11 | { 12 | desc = " Files", 13 | group = "Label", 14 | action = "Telescope find_files", 15 | key = "f" 16 | }, 17 | { 18 | desc = " Apps", 19 | group = "DiagnosticHint", 20 | action = "Telescope app", 21 | key = "a" 22 | }, 23 | { 24 | desc = " dotfiles", 25 | group = "Number", 26 | action = "Telescope dotfiles", 27 | key = "d" 28 | } 29 | } 30 | } 31 | } 32 | ) 33 | -------------------------------------------------------------------------------- /lua/plugin-config/telescope.lua: -------------------------------------------------------------------------------- 1 | -- vim.cmd [[packadd plenary.nvim]] 2 | -- vim.cmd [[packadd popup.nvim]] 3 | require("telescope").setup { 4 | defaults = { 5 | sorting_strategy = "ascending", 6 | layout_config = { 7 | horizontal = { prompt_position = 'top', results_width = 0.6 }, 8 | vertical = { mirror = false }, 9 | }, 10 | prompt_prefix = "🔭 ", 11 | selection_caret = " ", 12 | preview_width = 0.6, 13 | file_previewer = require "telescope.previewers".vim_buffer_cat.new, 14 | grep_previewer = require "telescope.previewers".vim_buffer_vimgrep.new, 15 | qflist_previewer = require "telescope.previewers".vim_buffer_qflist.new, 16 | mappings = { 17 | i = { 18 | [""] = require("telescope.actions").move_selection_next, 19 | [""] = require("telescope.actions").move_selection_previous 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lua/lsp/config/volar.lua: -------------------------------------------------------------------------------- 1 | local util = require "lspconfig.util" 2 | 3 | local function get_typescript_server_path(root_dir) 4 | -- local global_ts = os.getenv('NPM_MODULES') .. '/typescript/lib' 5 | -- local global_ts = '/usr/local/lib/node_modules/typescript/lib' 6 | local found_ts = '' 7 | local function check_dir(path) 8 | found_ts = util.path.join(path, 'node_modules', 'typescript', 'lib') 9 | if util.path.exists(found_ts) then 10 | return path 11 | end 12 | end 13 | if util.search_ancestors(root_dir, check_dir) then 14 | return found_ts 15 | else 16 | return global_ts 17 | end 18 | end 19 | 20 | return { 21 | filetypes = {'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue', 'json'}, 22 | -- on_new_config = function(new_config, new_root_dir) 23 | -- new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir) 24 | -- end 25 | } 26 | -------------------------------------------------------------------------------- /lua/plugin-config/bufferline.lua: -------------------------------------------------------------------------------- 1 | local status, bufferline = pcall(require, "bufferline") 2 | if not status then 3 | vim.notify("not found bufferline") 4 | return 5 | end 6 | bufferline.setup( 7 | { 8 | options = { 9 | -- To close the Tab command, use moll/vim-bbye's :Bdelete command here 10 | close_command = "Bdelete! %d", 11 | right_mouse_command = "Bdelete! %d", 12 | -- Using nvim's built-in LSP will be configured later in the course 13 | diagnostics = "nvim_lsp", 14 | -- Optional, show LSP error icon 15 | ---@diagnostic disable-next-line: unused-local 16 | diagnostics_indicator = function(count, level, diagnostics_dict, context) 17 | local s = " " 18 | for e, n in pairs(diagnostics_dict) do 19 | local sym = e == "error" and " " or (e == "warning" and " " or "") 20 | s = s .. n .. sym 21 | end 22 | return s 23 | end 24 | } 25 | } 26 | ) 27 | -------------------------------------------------------------------------------- /lua/lsp/config/lua.lua: -------------------------------------------------------------------------------- 1 | local runtime_path = vim.split(package.path, ";") 2 | table.insert(runtime_path, "lua/?.lua") 3 | table.insert(runtime_path, "lua/?/init.lua") 4 | 5 | return { 6 | settings = { 7 | Lua = { 8 | runtime = { 9 | -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) 10 | version = "LuaJIT", 11 | -- Setup your lua path 12 | path = runtime_path 13 | }, 14 | diagnostics = { 15 | -- Get the language server to recognize the `vim` global 16 | globals = {"vim"} 17 | }, 18 | workspace = { 19 | -- Make the server aware of Neovim runtime files 20 | library = vim.api.nvim_get_runtime_file("", true), 21 | checkThirdParty = false 22 | }, 23 | -- Do not send telemetry data containing a randomized but unique identifier 24 | telemetry = { 25 | enable = false 26 | } 27 | } 28 | }, 29 | flags = { 30 | debounce_text_changes = 150 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /lua/plugin-config/formatter.lua: -------------------------------------------------------------------------------- 1 | function Prettier() 2 | return { 3 | exe = "./node_modules/.bin/prettier", 4 | args = {"--stdin-filepath", vim.api.nvim_buf_get_name(0)}, 5 | stdin = true 6 | } 7 | end 8 | require("formatter").setup( 9 | { 10 | logging = false, 11 | filetype = { 12 | javascript = { 13 | -- prettier 14 | Prettier 15 | }, 16 | typescript = { 17 | -- prettier 18 | Prettier 19 | }, 20 | typescriptreact = { 21 | -- prettier 22 | Prettier 23 | }, 24 | javascriptreact = { 25 | -- prettier 26 | Prettier 27 | }, 28 | vue = { 29 | -- prettier 30 | Prettier 31 | }, 32 | lua = { 33 | -- luafmt 34 | function() 35 | return { 36 | exe = "luafmt", 37 | args = {"--indent-count", 2, "--stdin"}, 38 | stdin = true 39 | } 40 | end 41 | } 42 | } 43 | } 44 | ) 45 | -------------------------------------------------------------------------------- /lua/lsp/config/tsserver.lua: -------------------------------------------------------------------------------- 1 | 2 | local util = require "lspconfig.util" 3 | 4 | local function get_typescript_server_path(root_dir) 5 | -- local global_ts = os.getenv('NPM_MODULES') .. '/typescript/lib' 6 | local global_ts = '/usr/local/lib/node_modules/typescript/lib' 7 | local found_ts = '' 8 | local function check_dir(path) 9 | found_ts = util.path.join(path, 'node_modules', '@vue', 'typescript-plugin') 10 | if util.path.exists(found_ts) then 11 | return path 12 | end 13 | end 14 | if util.search_ancestors(root_dir, check_dir) then 15 | return found_ts 16 | else 17 | return global_ts 18 | end 19 | end 20 | 21 | return { 22 | init_options = { 23 | plugins = { 24 | { 25 | name = "@vue/typescript-plugin", 26 | location = "node_modules/@vue/typescript-plugin", 27 | languages = {"javascript", "typescript", "vue"}, 28 | }, 29 | }, 30 | }, 31 | filetypes = { 32 | "javascript", 33 | "typescript", 34 | "vue", 35 | }, 36 | on_new_config = function(new_config, new_root_dir) 37 | new_config.init_options.plugins[0].location = get_typescript_server_path(new_root_dir) 38 | end 39 | } 40 | -------------------------------------------------------------------------------- /static/neovim.cat: -------------------------------------------------------------------------------- 1 | 2 |   3 | ███████████ █████ ██ 4 | ███████████ █████  5 | ████████████████ ███████████ ███ ███████ 6 | ████████████████ ████████████ █████ ██████████████ 7 | █████████████████████████████ █████ █████ ████ █████ 8 | ██████████████████████████████████ █████ █████ ████ █████ 9 | ██████ ███ █████████████████ ████ █████ █████ ████ ██████ 10 | ██████ ██ ███████████████ ██ █████████████████ 11 | ██████ ██ ███████████████ ██ █████████████████ 12 | -------------------------------------------------------------------------------- /lua/plugin-config/gitsigns.lua: -------------------------------------------------------------------------------- 1 | -- vim.cmd [[packadd plenary.nvim]] 2 | require("gitsigns").setup { 3 | on_attach = function(bufnr) 4 | local gs = package.loaded.gitsigns 5 | 6 | local function gitsignsMap(mode, l, r, opts) 7 | opts = opts or { noremap = true, silent = true } 8 | opts.buffer = bufnr 9 | vim.keymap.set(mode, l, r, opts) 10 | end 11 | 12 | -- Navigation 13 | gitsignsMap("n", "j", ":Gitsigns next_hunk") 14 | gitsignsMap("n", "k", ":Gitsigns prev_hunk") 15 | -- Actions 16 | 17 | gitsignsMap({ "n", "v" }, "hs", ":Gitsigns stage_hunk") 18 | gitsignsMap({ "n", "v" }, "hr", ":Gitsigns reset_hunk") 19 | gitsignsMap("n", "hS", gs.stage_buffer) 20 | gitsignsMap("n", "hu", gs.undo_stage_hunk) 21 | gitsignsMap("n", "hR", gs.reset_buffer) 22 | gitsignsMap("n", "hp", gs.preview_hunk) 23 | gitsignsMap("n", "hb", function() 24 | gs.blame_line({ full = true }) 25 | end) 26 | gitsignsMap("n", "tb", gs.toggle_current_line_blame) 27 | gitsignsMap("n", "hd", gs.diffthis) 28 | gitsignsMap("n", "hD", function() 29 | gs.diffthis("~") 30 | end) 31 | gitsignsMap("n", "td", gs.toggle_deleted) 32 | 33 | -- Text object 34 | gitsignsMap({ "o", "x" }, "ih", ":Gitsigns select_hunk") 35 | end, 36 | current_line_blame = true, 37 | current_line_blame_opts = { 38 | delay = 100, 39 | virt_text_pos = "eol" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lua/lsp/setup.lua: -------------------------------------------------------------------------------- 1 | local mason = require("mason") 2 | local mason_lspconfig = require("mason-lspconfig") 3 | local lspconfig = require("lspconfig") 4 | 5 | -- vim.cmd([[packadd cmp-nvim-lsp]]) 6 | -- local capabilities = vim.lsp.protocol.make_client_capabilities() 7 | -- capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities) 8 | -- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers.. 9 | local capabilities = require('cmp_nvim_lsp').default_capabilities() 10 | 11 | local servers = { 12 | jsonls = require("lsp.config.json"), 13 | volar = require("lsp.config.volar"), 14 | cssls = {}, 15 | eslint = {}, 16 | html = {}, 17 | tailwindcss = {}, 18 | pyright = {}, 19 | vtsls = {}, 20 | lua_ls=require("lsp.config.lua"), 21 | tsserver=require("lsp.config.tsserver"), 22 | } 23 | 24 | mason.setup {} 25 | mason_lspconfig.setup { 26 | ensure_installed = {"lua_ls", "cssls", "eslint", "html", "jsonls", "tailwindcss", "volar", "emmet_ls", "pyright", "vtsls", "tsserver"} 27 | } 28 | 29 | for name, config in pairs(servers) do 30 | config.capabilities = capabilities 31 | lspconfig[name].setup(config) 32 | end 33 | 34 | local signs = { 35 | Error = " ", 36 | Warn = " ", 37 | Info = " ", 38 | Hint = " " 39 | } 40 | for type, icon in pairs(signs) do 41 | local hl = "DiagnosticSign" .. type 42 | vim.fn.sign_define(hl, {text = icon, texthl = hl, numhl = hl}) 43 | end 44 | 45 | vim.diagnostic.config( 46 | { 47 | signs = true, 48 | update_in_insert = false, 49 | underline = true, 50 | severity_sort = true, 51 | virtual_text = { 52 | source = true, 53 | prefix = '🔥', 54 | } 55 | } 56 | ) 57 | -------------------------------------------------------------------------------- /plugin/difftools.vim: -------------------------------------------------------------------------------- 1 | " Improve diff behavior 2 | " --- 3 | " 4 | " Behaviors: 5 | " - Update diff comparison once leaving insert mode 6 | " 7 | " Commands: 8 | " - DiffOrig: Show diff of unsaved changes 9 | 10 | if exists('g:loaded_difftools') 11 | finish 12 | endif 13 | let g:loaded_difftools = 1 14 | 15 | augroup plugin_difftools 16 | autocmd! 17 | autocmd InsertLeave * if &l:diff | diffupdate | endif 18 | autocmd BufWinLeave __diff call s:close_diff() 19 | augroup END 20 | 21 | function! s:open_diff() 22 | " Open diff window and start comparison 23 | let l:bnr = bufnr('%') 24 | call setwinvar(winnr(), 'diff_origin', l:bnr) 25 | vertical new __diff 26 | let l:diff_bnr = bufnr('%') 27 | nnoremap q :quit 28 | setlocal buftype=nofile bufhidden=wipe 29 | r ++edit # 30 | 0d_ 31 | diffthis 32 | setlocal readonly 33 | wincmd p 34 | let b:diff_bnr = l:diff_bnr 35 | nnoremap q :execute bufwinnr(b:diff_bnr) . 'q' 36 | diffthis 37 | endfunction 38 | 39 | function! s:close_diff() 40 | " Close diff window, switch to original window and disable diff 41 | " Credits: https://github.com/chemzqm/vim-easygit 42 | let wnr = +bufwinnr(+expand('')) 43 | let val = getwinvar(wnr, 'diff_origin') 44 | if ! len(val) | return | endif 45 | for i in range(1, winnr('$')) 46 | if i == wnr | continue | endif 47 | if len(getwinvar(i, 'diff_origin')) 48 | return 49 | endif 50 | endfor 51 | let wnr = bufwinnr(val) 52 | if wnr > 0 53 | execute wnr . 'wincmd w' 54 | diffoff 55 | endif 56 | endfunction 57 | 58 | " Display diff of unsaved changes 59 | command! -nargs=0 DiffOrig call s:open_diff() 60 | 61 | " vim: set ts=2 sw=2 tw=80 noet : 62 | 63 | -------------------------------------------------------------------------------- /lua/plugin-config/toggleterm.lua: -------------------------------------------------------------------------------- 1 | local Toggleterm = require("toggleterm") 2 | 3 | Toggleterm.setup( 4 | { 5 | -- 开启的终端默认进入插入模式 6 | start_in_insert = true, 7 | -- 设置终端打开的大小 8 | size = 6, 9 | -- 打开普通终端时,关闭拼写检查 10 | on_open = function() 11 | vim.cmd("setlocal nospell") 12 | end 13 | } 14 | ) 15 | -- 新建终端 16 | local Terminal = require("toggleterm.terminal").Terminal 17 | local function inInsert() 18 | -- 删除 Esc 的映射 19 | -- vim.keybinds.dgmap("t", "") 20 | end 21 | -- 新建浮动终端 22 | local floatTerm = 23 | Terminal:new( 24 | { 25 | hidden = true, 26 | direction = "float", 27 | float_opts = { 28 | border = "double" 29 | }, 30 | on_open = function(term) 31 | inInsert() 32 | -- 浮动终端中 Esc 是退出 33 | -- vim.keybinds.bmap(term.bufnr, "t", "", ":close", vim.keybinds.opts) 34 | end, 35 | on_close = function() 36 | -- 重新映射 Esc 37 | -- vim.keybinds.gmap("t", "", "", vim.keybinds.opts) 38 | end 39 | } 40 | ) 41 | -- 新建 lazygit 终端 42 | local lazyGit = 43 | Terminal:new( 44 | { 45 | cmd = "lazygit", 46 | hidden = true, 47 | direction = "float", 48 | float_opts = { 49 | border = "double" 50 | }, 51 | on_open = function(term) 52 | inInsert() 53 | -- lazygit 中 q 是退出 54 | -- vim.keybinds.bmap(term.bufnr, "i", "q", "close", vim.keybinds.opts) 55 | end, 56 | on_close = function() 57 | -- 重新映射 Esc 58 | -- vim.keybinds.gmap("t", "", "", vim.keybinds.opts) 59 | end 60 | } 61 | ) 62 | -- 定义新的方法 63 | Toggleterm.float_toggle = function() 64 | floatTerm:toggle() 65 | end 66 | Toggleterm.lazygit_toggle = function() 67 | lazyGit:toggle() 68 | end 69 | 70 | -------------------------------------------------------------------------------- /plugin/nicefold.vim: -------------------------------------------------------------------------------- 1 | " Nice Fold 2 | " --- 3 | " 4 | " Behaviors: 5 | " - Improve folds performance after modification 6 | " - Set a nice pattern for collapsed folds 7 | 8 | if exists('g:loaded_nicefold') 9 | finish 10 | endif 11 | let g:loaded_nicefold = 1 12 | 13 | " Fast fold 14 | " Credits: https://github.com/Shougo/shougo-s-github 15 | augroup plugin_fastfold 16 | autocmd! 17 | autocmd TextChangedI,TextChanged * 18 | \ if &l:foldenable && &l:foldmethod !=# 'manual' 19 | \| let b:foldmethod_save = &l:foldmethod 20 | \| let &l:foldmethod = 'manual' 21 | \| endif 22 | 23 | autocmd BufWritePost * 24 | \ if &l:foldmethod ==# 'manual' && exists('b:foldmethod_save') 25 | \| let &l:foldmethod = b:foldmethod_save 26 | \| execute 'normal! zx' 27 | \| endif 28 | augroup END 29 | 30 | if has('folding') 31 | set foldtext=FoldText() 32 | endif 33 | 34 | " Improved Vim fold-text 35 | " See: http://www.gregsexton.org/2011/03/improving-the-text-displayed-in-a-fold/ 36 | function! FoldText() 37 | " Get first non-blank line 38 | let fs = v:foldstart 39 | while getline(fs) =~? '^\s*$' | let fs = nextnonblank(fs + 1) 40 | endwhile 41 | if fs > v:foldend 42 | let line = getline(v:foldstart) 43 | else 44 | let line = substitute(getline(fs), '\t', repeat(' ', &tabstop), 'g') 45 | endif 46 | 47 | let w = winwidth(0) - &foldcolumn - (&number ? 8 : 0) 48 | let foldSize = 1 + v:foldend - v:foldstart 49 | let foldSizeStr = ' ' . foldSize . ' lines ' 50 | let foldLevelStr = repeat('+--', v:foldlevel) 51 | let lineCount = line('$') 52 | let foldPercentage = printf('[%.1f', (foldSize*1.0)/lineCount*100) . '%] ' 53 | let expansionString = repeat('.', w - strwidth(foldSizeStr.line.foldLevelStr.foldPercentage)) 54 | return line . expansionString . foldSizeStr . foldPercentage . foldLevelStr 55 | endfunction 56 | 57 | -------------------------------------------------------------------------------- /lua/basic.lua: -------------------------------------------------------------------------------- 1 | -- Search do not highlight 2 | vim.o.hlsearch = false 3 | -- Search as you type 4 | vim.o.incsearch = true 5 | -- The command line height is 2, providing enough display space 6 | vim.o.cmdheight = 1 7 | -- Automatically load when the file is modified by an external program 8 | vim.o.autoread = true 9 | vim.bo.autoread = true 10 | -- No line breaks 11 | vim.wo.wrap = false 12 | -- can jump to the next line when the cursor is at the beginning and end of the line 13 | vim.o.whichwrap = "<,>,[,]" 14 | -- Allows to hide modified buffers 15 | vim.o.hidden = true 16 | -- mouse support 17 | vim.o.mouse = "a" 18 | -- Disable creation of backup files 19 | vim.o.backup = false 20 | vim.o.writebackup = false 21 | vim.o.swapfile = false 22 | -- smaller updatetime 23 | vim.o.updatetime = 300 24 | -- Set timeoutlen to wait 500 milliseconds for the keyboard shortcut combo time, which can be set as needed 25 | vim.o.timeoutlen = 500 26 | -- split window appears from bottom and right 27 | vim.o.splitbelow = true 28 | vim.o.splitright = true 29 | -- Autocompletion is not automatically selected 30 | vim.g.completeopt = "menu,menuone,noselect,noinsert" 31 | -- Style 32 | vim.o.background = "dark" 33 | vim.o.termguicolors = true 34 | vim.opt.termguicolors = true 35 | -- Display of invisible characters, here only spaces are displayed as a dot 36 | vim.o.list = true 37 | vim.o.listchars = "space:·,tab:··,eol:↴" 38 | vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]] 39 | -- Completion enhancement 40 | vim.o.wildmenu = true 41 | -- Don't pass messages to |ins-completin menu| 42 | vim.o.shortmess = vim.o.shortmess .. "c" 43 | -- Completion displays up to 10 lines 44 | vim.o.pumheight = 10 45 | -- always show tabline 46 | vim.o.showtabline = 1 47 | -- vim's modal prompt is no longer required after using the enhanced status bar plugin 48 | vim.o.showmode = false 49 | 50 | vim.o.foldcolumn = "1" -- '0' is not bad 51 | vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value 52 | vim.o.foldlevelstart = 99 53 | vim.o.foldenable = true 54 | 55 | ------- Here is basical icon replace ------- 56 | vim.diagnostic.config({ 57 | virtual_text = true, 58 | signs = true, 59 | -- Also update the prompt in input mode, setting to true may affect performance 60 | update_in_insert = false, 61 | }) 62 | local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } 63 | for type, icon in pairs(signs) do 64 | local hl = "DiagnosticSign" .. type 65 | vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) 66 | end 67 | ------- Here is basical icon replace ------- 68 | 69 | -- some setting for specific language 70 | vim.g.zig_fmt_autosave = false 71 | 72 | -------------------------------------------------------------------------------- /lua/plugin-config/nvim-tree.lua: -------------------------------------------------------------------------------- 1 | vim.g.nvim_tree_allow_resize = 1 2 | 3 | local function on_attach(bufnr) 4 | local api = require('nvim-tree.api') 5 | local function opts(desc) 6 | return {desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true} 7 | end 8 | api.config.mappings.default_on_attach(bufnr) 9 | vim.keymap.set("n", "l", api.node.open.edit, opts("Open")) 10 | vim.keymap.set("n", "v", api.node.open.vertical, opts("Open: Vertical Split")) 11 | vim.keymap.set("n", "s", api.node.open.horizontal, opts("Open: Horizontal Split")) 12 | end 13 | 14 | require("nvim-tree").setup { 15 | on_attach = on_attach, 16 | disable_netrw = false, 17 | hijack_cursor = true, 18 | hijack_netrw = true, 19 | hijack_unnamed_buffer_when_opening = false, 20 | update_cwd = true, 21 | renderer = { 22 | indent_markers = { 23 | enable = true, 24 | icons = { 25 | corner = "└ ", 26 | edge = "│ ", 27 | none = " " 28 | } 29 | }, 30 | icons = { 31 | webdev_colors = true, 32 | git_placement = "before", 33 | padding = " ", 34 | symlink_arrow = " ➛ ", 35 | show = { 36 | file = true, 37 | folder = true, 38 | folder_arrow = true, 39 | git = true 40 | }, 41 | glyphs = { 42 | default = "", 43 | symlink = "", 44 | folder = { 45 | arrow_closed = "", 46 | arrow_open = "", 47 | default = "", 48 | empty = "", 49 | empty_open = "", 50 | open = "", 51 | symlink = "", 52 | symlink_open = "" 53 | }, 54 | git = { 55 | deleted = "", 56 | ignored = "", 57 | renamed = "", 58 | staged = "", 59 | unmerged = "", 60 | unstaged = "", 61 | untracked = "ﲉ" 62 | } 63 | } 64 | }, 65 | special_files = {"Cargo.toml", "Makefile", "README.md", "readme.md"} 66 | }, 67 | view = { 68 | width = 30, 69 | side = "left", 70 | preserve_window_proportions = false, 71 | number = false, 72 | relativenumber = false, 73 | signcolumn = "yes", 74 | }, 75 | hijack_directories = { 76 | enable = true, 77 | auto_open = true 78 | }, 79 | filters = { 80 | dotfiles = false, 81 | custom = {".DS_Store", "node_modules"}, 82 | }, 83 | actions = { 84 | use_system_clipboard = true, 85 | change_dir = { 86 | enable = true, 87 | global = false 88 | }, 89 | open_file = { 90 | quit_on_open = false, 91 | resize_window = false, 92 | window_picker = { 93 | enable = true, 94 | chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890", 95 | exclude = { 96 | filetype = {"notify", "packer", "qf", "diff", "fugitive", "fugitiveblame"}, 97 | buftype = {"nofile", "terminal", "help"} 98 | } 99 | } 100 | } 101 | } 102 | } 103 | 104 | vim.api.nvim_create_autocmd( 105 | "BufEnter", 106 | { 107 | group = vim.api.nvim_create_augroup("NvimTreeClose", {clear = true}), 108 | pattern = "NvimTree_*", 109 | callback = function() 110 | local layout = vim.api.nvim_call_function("winlayout", {}) 111 | if 112 | layout[1] == "leaf" and 113 | vim.api.nvim_buf_get_option(vim.api.nvim_win_get_buf(layout[2]), "filetype") == "NvimTree" and 114 | layout[3] == nil 115 | then 116 | vim.cmd("confirm quit") 117 | end 118 | end 119 | } 120 | ) 121 | -------------------------------------------------------------------------------- /lua/plugin-config/nvim-cmp.lua: -------------------------------------------------------------------------------- 1 | local cmp = require "cmp" 2 | local cmp_autopairs = require("nvim-autopairs.completion.cmp") 3 | local lspkind = require("lspkind") 4 | 5 | local has_words_before = function() 6 | local line, col = unpack(vim.api.nvim_win_get_cursor(0)) 7 | return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil 8 | end 9 | 10 | cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) 11 | 12 | lspkind.init( 13 | { 14 | mode = "symbol_text" 15 | -- preset = "codicons" 16 | } 17 | ) 18 | 19 | cmp.setup( 20 | { 21 | preselect = cmp.PreselectMode.Item, 22 | mapping = cmp.mapping.preset.insert( 23 | { 24 | [""] = function(fallback) 25 | if not cmp.select_next_item() then 26 | if vim.bo.buftype ~= "prompt" and has_words_before() then 27 | cmp.complete() 28 | else 29 | fallback() 30 | end 31 | end 32 | end, 33 | [""] = function(fallback) 34 | if not cmp.select_prev_item() then 35 | if vim.bo.buftype ~= "prompt" and has_words_before() then 36 | cmp.complete() 37 | else 38 | fallback() 39 | end 40 | end 41 | end, 42 | [""] = cmp.mapping.confirm { 43 | behavior = cmp.ConfirmBehavior.Replace, 44 | select = false 45 | }, 46 | [""] = function(fallback) 47 | if not cmp.select_next_item() then 48 | if vim.bo.buftype ~= "prompt" and has_words_before() then 49 | cmp.complete() 50 | else 51 | fallback() 52 | end 53 | end 54 | end, 55 | [""] = function(fallback) 56 | if not cmp.select_prev_item() then 57 | if vim.bo.buftype ~= "prompt" and has_words_before() then 58 | cmp.complete() 59 | else 60 | fallback() 61 | end 62 | end 63 | end, 64 | [""] = cmp.mapping.scroll_docs(-4), 65 | [""] = cmp.mapping.scroll_docs(4), 66 | [""] = cmp.mapping.abort(), 67 | ["CR>"] = cmp.mapping.complete({select = true}) 68 | } 69 | ), 70 | sources = cmp.config.sources( 71 | { 72 | {name = "nvim_lsp"}, 73 | {name = "async_path"}, 74 | {name = "buffer"} 75 | -- {name = "nvim_lsp_signature_help"} 76 | } 77 | ), 78 | formatting = { 79 | format = lspkind.cmp_format( 80 | { 81 | mode = "symbol_text", -- show only symbol annotations 82 | maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters) 83 | -- The function below will be called before any actual modifications from lspkind 84 | -- so that you can provide more controls on popup customization. (See [#30](https://github.com/onsails/lspkind-nvim/pull/30)) 85 | before = function(_, vim_item) 86 | return vim_item 87 | end 88 | } 89 | ) 90 | } 91 | } 92 | ) 93 | cmp.setup.cmdline( 94 | ":", 95 | { 96 | mapping = cmp.mapping.preset.cmdline(), 97 | sources = cmp.config.sources( 98 | { 99 | {name = "path"} 100 | }, 101 | { 102 | {name = "cmdline"} 103 | } 104 | ) 105 | } 106 | ) 107 | cmp.setup.cmdline( 108 | "/", 109 | { 110 | mapping = cmp.mapping.preset.cmdline(), 111 | sources = {{name = "buffer"}} 112 | } 113 | ) 114 | -------------------------------------------------------------------------------- /lua/options.lua: -------------------------------------------------------------------------------- 1 | local bind = require "bind" 2 | local options = setmetatable({}, {__index = {global_local = {}, window_local = {}}}) 3 | 4 | function options:load_options() 5 | self.global_local = { 6 | termguicolors = true, 7 | mouse = "nv", 8 | errorbells = true, 9 | visualbell = true, 10 | hidden = true, 11 | fileformats = "unix,mac,dos", 12 | magic = true, 13 | virtualedit = "block", 14 | encoding = "utf-8", 15 | viewoptions = "folds,cursor,curdir,slash,unix", 16 | sessionoptions = "curdir,help,tabpages,winsize", 17 | clipboard = "unnamedplus", 18 | wildignorecase = true, 19 | wildignore = ".git,.hg,.svn,*.pyc,*.o,*.out,*.jpg,*.jpeg,*.png,*.gif,*.zip,**/tmp/**,*.DS_Store,**/node_modules/**,**/bower_modules/**", 20 | backup = false, 21 | writebackup = false, 22 | swapfile = false, 23 | history = 2000, 24 | shada = "!,'300,<50,@100,s10,h", 25 | backupskip = "/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*,*/shm/*,/private/var/*,.vault.vim", 26 | smarttab = true, 27 | shiftround = true, 28 | timeout = true, 29 | ttimeout = true, 30 | timeoutlen = 500, 31 | ttimeoutlen = 10, 32 | updatetime = 100, 33 | redrawtime = 1500, 34 | ignorecase = true, 35 | smartcase = true, 36 | infercase = true, 37 | incsearch = true, 38 | wrapscan = true, 39 | complete = ".,w,b,k", 40 | inccommand = "nosplit", 41 | grepformat = "%f:%l:%c:%m", 42 | grepprg = "rg --hidden --vimgrep --smart-case --", 43 | breakat = [[\ \ ;:,!?]], 44 | startofline = false, 45 | whichwrap = "h,l,<,>,[,],~", 46 | splitbelow = true, 47 | splitright = true, 48 | switchbuf = "useopen", 49 | backspace = "indent,eol,start", 50 | diffopt = "filler,iwhite,internal,algorithm:patience", 51 | completeopt = "menuone,noselect", 52 | jumpoptions = "stack", 53 | showmode = false, 54 | shortmess = "aoOTIcF", 55 | scrolloff = 8, 56 | sidescrolloff = 8, 57 | foldlevelstart = 99, 58 | ruler = false, 59 | list = true, 60 | showtabline = 2, 61 | winwidth = 30, 62 | winminwidth = 10, 63 | pumheight = 15, 64 | helpheight = 12, 65 | previewheight = 12, 66 | showcmd = false, 67 | cmdheight = 2, 68 | cmdwinheight = 5, 69 | equalalways = false, 70 | laststatus = 2, 71 | display = "lastline", 72 | showbreak = "↳ ", 73 | listchars = "tab:»·,nbsp:+,trail:·,extends:→,precedes:←", 74 | pumblend = 10, 75 | winblend = 10, 76 | hlsearch = false, 77 | } 78 | 79 | self.bw_local = { 80 | undofile = true, 81 | synmaxcol = 2500, 82 | formatoptions = "1jcroql", 83 | textwidth = 80, 84 | expandtab = true, 85 | autoindent = true, 86 | tabstop = 2, 87 | shiftwidth = 2, 88 | softtabstop = -1, 89 | breakindentopt = "shift:2,min:20", 90 | wrap = false, 91 | linebreak = true, 92 | number = true, 93 | relativenumber = true, 94 | colorcolumn = "80", 95 | foldenable = true, 96 | signcolumn = "yes", 97 | conceallevel = 2, 98 | concealcursor = "niv", 99 | } 100 | 101 | if vim.loop.os_uname().sysname == "Darwin" then 102 | vim.g.clipboard = { 103 | name = "macOS-clipboard", 104 | copy = { 105 | ["+"] = "pbcopy", 106 | ["*"] = "pbcopy" 107 | }, 108 | paste = { 109 | ["+"] = "pbpaste", 110 | ["*"] = "pbpaste" 111 | }, 112 | cache_enabled = 0 113 | } 114 | end 115 | for name, value in pairs(self.global_local) do 116 | vim.o[name] = value 117 | end 118 | bind.bind_option(self.bw_local) 119 | end 120 | -- https://stackoverflow.com/questions/44480829/how-to-copy-to-clipboard-in-vim-of-bash-on-windows 121 | vim.cmd([[ 122 | augroup fix_yank 123 | autocmd! 124 | autocmd TextYankPost * if v:event.operator ==# 'y' | call system('/mnt/c/Windows/System32/clip.exe', @0) | endif 125 | augroup END 126 | ]]) 127 | 128 | 129 | return options 130 | -------------------------------------------------------------------------------- /lua/mapping.lua: -------------------------------------------------------------------------------- 1 | vim.keybinds = { 2 | gmap = vim.api.nvim_set_keymap, 3 | bmap = vim.api.nvim_buf_set_keymap, 4 | dgmap = vim.api.nvim_del_keymap, 5 | dbmap = vim.api.nvim_buf_del_keymap, 6 | opts = {noremap = true, silent = true} 7 | } 8 | 9 | -- Write buffer (save) 10 | vim.api.nvim_set_keymap("i", "", ":write", {noremap = true}) 11 | vim.api.nvim_set_keymap("n", "", ":write", {noremap = true}) 12 | vim.api.nvim_set_keymap("n", "", ":wq", {}) 13 | 14 | vim.api.nvim_set_keymap("i", "", "", {}) 15 | vim.api.nvim_set_keymap("i", "", "", {noremap = true}) 16 | vim.api.nvim_set_keymap("i", "", ":w", {}) 17 | vim.api.nvim_set_keymap("i", "", ":wq", {}) 18 | 19 | -- switch window 20 | vim.api.nvim_set_keymap("n", "", "h", {noremap = true}) 21 | vim.api.nvim_set_keymap("n", "", "l", {noremap = true}) 22 | vim.api.nvim_set_keymap("n", "", "j", {noremap = true}) 23 | vim.api.nvim_set_keymap("n", "", "k", {noremap = true}) 24 | vim.api.nvim_set_keymap("n", "", ":bp", {noremap = true}) 25 | vim.api.nvim_set_keymap("n", "", ":bn", {noremap = true}) 26 | vim.api.nvim_set_keymap("n", "ws", ":sp", {noremap = true}) 27 | vim.api.nvim_set_keymap("n", "wv", ":vs", {noremap = true}) 28 | 29 | -- vsnip Expand or jump 30 | vim.api.nvim_set_keymap("i", "", "vsnip#available(1) ? '(vsnip-expand-or-jump)' : ''", {expr = true}) 31 | vim.api.nvim_set_keymap("s", "", "vsnip#available(1) ? '(vsnip-expand-or-jump)' : ''", {expr = true}) 32 | 33 | -- fuzzyfind 模糊搜索 快捷键 34 | vim.api.nvim_set_keymap("n", "bb", ":Telescope buffers", {silent = true, noremap = true}) 35 | vim.api.nvim_set_keymap("n", "fa", ":Telescope live_grep", {silent = true, noremap = true}) 36 | vim.api.nvim_set_keymap("n", "ff", ":Telescope find_files", {silent = true, noremap = true}) 37 | vim.api.nvim_set_keymap("n", "fh", ":Telescope oldfiles", {silent = true, noremap = true}) 38 | 39 | -- 文件管理 40 | vim.api.nvim_set_keymap("n", "e", ":NvimTreeToggle", {silent = true, noremap = true}) 41 | vim.api.nvim_set_keymap("n", "F", ":NvimTreeFindFile", {silent = true, noremap = true}) 42 | 43 | vim.api.nvim_set_keymap("n", "o", ":LSoutlineToggle", {silent = true, noremap = true}) 44 | 45 | -- BufferLine 46 | vim.api.nvim_set_keymap("n", "1", "BufferLineGoToBuffer 1", {silent = true, noremap = true}) 47 | vim.api.nvim_set_keymap("n", "2", "BufferLineGoToBuffer 2", {silent = true, noremap = true}) 48 | vim.api.nvim_set_keymap("n", "3", "BufferLineGoToBuffer 3", {silent = true, noremap = true}) 49 | vim.api.nvim_set_keymap("n", "4", "BufferLineGoToBuffer 4", {silent = true, noremap = true}) 50 | vim.api.nvim_set_keymap("n", "5", "BufferLineGoToBuffer 5", {silent = true, noremap = true}) 51 | vim.api.nvim_set_keymap("n", "6", "BufferLineGoToBuffer 6", {silent = true, noremap = true}) 52 | vim.api.nvim_set_keymap("n", "7", "BufferLineGoToBuffer 7", {silent = true, noremap = true}) 53 | vim.api.nvim_set_keymap("n", "8", "BufferLineGoToBuffer 8", {silent = true, noremap = true}) 54 | vim.api.nvim_set_keymap("n", "9", "BufferLineGoToBuffer 9", {silent = true, noremap = true}) 55 | 56 | -- LSP 57 | vim.api.nvim_set_keymap("n", "[e", "LspUI diagnostic prev", {silent = true, noremap = true}) 58 | vim.api.nvim_set_keymap("n", "]e", "LspUI diagnostic next", {silent = true, noremap = true}) 59 | vim.api.nvim_set_keymap("n", "K", "LspUI hover", {silent = true, noremap = true}) 60 | vim.api.nvim_set_keymap("n", "gd", "LspUI definition", {silent = true, noremap = true}) 61 | vim.api.nvim_set_keymap("n", "gD", "lua vim.lsp.buf.implementation()", {silent = true, noremap = true}) 62 | -- vim.api.nvim_set_keymap("n", "gs", "Lspsaga signature_help", {silent = true, noremap = true}) 63 | vim.api.nvim_set_keymap("n", "gr", "LspUI rename", {silent = true, noremap = true}) 64 | vim.api.nvim_set_keymap("n", "gt", "lua vim.lsp.buf.type_definition()", {silent = true, noremap = true}) 65 | vim.api.nvim_set_keymap("n", "gw", "lua vim.lsp.buf.workspace_symbol()", {silent = true, noremap = true}) 66 | vim.api.nvim_set_keymap("n", "ga", "LspUI code_action", {silent = true, noremap = true}) 67 | 68 | vim.api.nvim_set_keymap("t", "", "", {silent = true, noremap = true}) 69 | vim.api.nvim_set_keymap("n", "tt", "exe v:count.'ToggleTerm'", {silent = true, noremap = true}) 70 | vim.api.nvim_set_keymap( 71 | "n", 72 | "tf", 73 | "lua require('toggleterm').float_toggle()", 74 | {silent = true, noremap = true} 75 | ) 76 | vim.api.nvim_set_keymap("n", "ta", "ToggleTermToggleAll", {silent = true, noremap = true}) 77 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nvim 2 | 3 | nvim config 4 | 5 | > 此配置来自于 6 | > [ThinkVim](https://github.com/hardcoreplayers/ThinkVim),可以认为本配置是 7 | > ThinkVim 的私人定制版本。非常感谢 ThinkVim 作者开源的 vim 配置 8 | > 现在配置全部基于 lua 重写,需要 neovim 6.0 9 | 10 | PS: 目前 ThinkVim 已经不维护,大神目前在用的配置是这个[配置](https://github.com/glepnir/nvim) 11 | 12 | ## Table of Contents 13 | 14 | 1. [特性](#特性) 15 | 2. [key](#key) 16 | 1. [Normal](#Normal) 17 | 2. [Window](#Window) 18 | 3. [Find](#Find) 19 | 4. [File](#File) 20 | 5. [Outline](#Outline) 21 | 6. [Operator Surround](#Operator-Surround) 22 | 8. [Lightspeed](#Lightspeed) 23 | 24 | ![Snipaste_2021-03-24_23-27-05](https://user-images.githubusercontent.com/19209958/112338634-ea43f680-8cf9-11eb-8df9-04f9d9a11532.png) 25 | 26 | ## 特性 27 | 28 | - [wbthomason/packer.nvim](https://github.com/wbthomason/packer.nvim) 29 | - [hrsh7th/nvim-cmp](https://github.com/hrsh7th/nvim-cmp) 30 | - [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) 31 | - [lewis6991/gitsigns.nvim](https://github.com/lewis6991/gitsigns.nvim) 32 | - [akinsho/nvim-bufferline.lua](https://github.com/akinsho/nvim-bufferline.lua) 33 | - [nvim-tree.lua](https://github.com/kyazdani42/nvim-tree.lua) 34 | - [lualine](https://github.com/nvim-lualine/lualine.nvim) 35 | - [alpha-nvim](https://github.com/goolord/alpha-nvim) 36 | - [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) 37 | - [onedarkpro.nvim](https://github.com/olimorris/onedarkpro.nvim) 38 | - [telescope](https://github.com/nvim-telescope/telescope.nvim) 39 | - [nvim-colorizer](https://github.com/norcalli/nvim-colorizer.lua) 40 | - [nvim-comment](https://github.com/terrortylor/nvim-comment) 41 | 42 | - [awesome-neovim](https://github.com/rockerBOO/awesome-neovim) 43 | 44 | ## Key 45 | 46 | ### Normal 47 | 48 | | KeyMap | Mode | Description | 49 | | ------------ | ---- | --------------------------------------------------------- | 50 | | `j` | N | [accelerated-jk](https://github.com/rhysd/accelerated-jk) | 51 | | `k` | N | [accelerated-jk](https://github.com/rhysd/accelerated-jk) | 52 | | `Ctrl` + `s` | IN | Save buffer | 53 | | `Ctrl` + `h` | I | backspace | 54 | | `Ctrl` + `d` | I | delete | 55 | | `Ctrl` + `S` | I | Save buffer | 56 | | `Ctrl` + `Q` | I | Save buffer and Quit | 57 | | `]` + `e` | N | Prev diagnostic | 58 | | `[` + `e` | N | Next diagnostic | 59 | | `[` + `g` | N | Prev git chunkinfo | 60 | | `[` + `g` | N | Next git chunkinfo | 61 | | `g` + `d` | N | Jump to definition | 62 | | `g` + `y` | N | Jump type definition | 63 | | `g` + `i` | N | Jump implementation | 64 | | `g` + `r` | N | rename | 65 | | `K` | N | Show document | 66 | 67 | ### Window 68 | 69 | | KeyMap | Mode | Description | 70 | | --------------- | ---- | ------------------ | 71 | | `Ctrl` + `h` | N | jump left window | 72 | | `Ctrl` + `j` | N | jump bottom window | 73 | | `Ctrl` + `k` | N | jump top window | 74 | | `Ctrl` + `l` | N | jump right window | 75 | | `Leader` + `ws` | N | horizontally split | 76 | | `Leader` + `wv` | N | vertical split | 77 | 78 | ### Find 79 | 80 | | KeyMap | Mode | Description | 81 | | --------------- | ---- | ----------------- | 82 | | `Leader` + `fa` | N | Find input char | 83 | | `Leader` + `ff` | N | Find file | 84 | | `Leader` + `fh` | N | Find history file | 85 | | `Leader` + `bb` | N | Find Buffer | 86 | 87 | ### File 88 | 89 | | KeyMap | Mode | Description | 90 | | -------------- | ---- | ----------------------------- | 91 | | `Leader` + `e` | N | Open file tree | 92 | | `Leader` + `F` | N | Open file with current buffer | 93 | 94 | ### Outline 95 | 96 | | KeyMap | Mode | Description | 97 | | -------------- | ---- | ------------ | 98 | | `Leader` + `v` | N | Open Outline | 99 | 100 | ### Operator Surround 101 | 102 | | KeyMap | Mode | Description | 103 | | ------ | ---- | ------------------------- | 104 | | `sa` | V | operator-surround-append | 105 | | `sd` | V | operator-surround-delete | 106 | | `sr` | V | operator-surround-replace | 107 | 108 | ### Lightspeed 109 | 110 | | KeyMap | Mode | Description | 111 | | ------ | ---- | ----------- | 112 | | `s` | N | Search Word | 113 | 114 | -------------------------------------------------------------------------------- /lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "LspUI.nvim": { "branch": "main", "commit": "7e560f493f36c4403c24dacf4ac1a65b9502ac54" }, 3 | "bufferline.nvim": { "branch": "main", "commit": "aa16dafdc642594c7ade7e88d31a6119feb189d6" }, 4 | "cmp-async-path": { "branch": "main", "commit": "9d581eec5acf812316913565c135b0d1ee2c9a71" }, 5 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, 6 | "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, 7 | "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, 8 | "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" }, 9 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 10 | "dashboard-nvim": { "branch": "master", "commit": "e6e33b848f0e2fe5c13f6553c568764555c390a3" }, 11 | "editorconfig-vim": { "branch": "master", "commit": "8b7da79e9daee7a3f3a8d4fe29886b9756305aff" }, 12 | "fast-cursor-move.nvim": { "branch": "main", "commit": "9ab80d0184861be18833647e983086725b9905f9" }, 13 | "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, 14 | "formatter.nvim": { "branch": "master", "commit": "ad246d34ce7a32f752071ed81b09b94e6b127fad" }, 15 | "gitsigns.nvim": { "branch": "main", "commit": "375c44bdfdde25585466a966f00c2e291db74f2d" }, 16 | "glow.nvim": { "branch": "main", "commit": "238070a686c1da3bccccf1079700eb4b5e19aea4" }, 17 | "hlsearch.nvim": { "branch": "main", "commit": "fdeb60b890d15d9194e8600042e5232ef8c29b0e" }, 18 | "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, 19 | "lazy.nvim": { "branch": "main", "commit": "f918318d21956b0874a65ab35ce3d94d9057aabf" }, 20 | "leap.nvim": { "branch": "main", "commit": "c099aecaf858574909bd38cbadb8543c4dd16611" }, 21 | "lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" }, 22 | "lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, 23 | "lualine.nvim": { "branch": "master", "commit": "6a40b530539d2209f7dc0492f3681c8c126647ad" }, 24 | "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, 25 | "mason.nvim": { "branch": "main", "commit": "f96a31855fa8aea55599cea412fe611b85a874ed" }, 26 | "neoscroll.nvim": { "branch": "master", "commit": "a7f5953dbfbe7069568f2d0ed23a9709a56725ab" }, 27 | "nvim-autopairs": { "branch": "master", "commit": "78a4507bb9ffc9b00f11ae0ac48243d00cb9194d" }, 28 | "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, 29 | "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, 30 | "nvim-cursorline": { "branch": "main", "commit": "804f0023692653b2b2368462d67d2a87056947f9" }, 31 | "nvim-lastplace": { "branch": "main", "commit": "0bb6103c506315044872e0f84b1f736c4172bb20" }, 32 | "nvim-lspconfig": { "branch": "master", "commit": "cf97d2485fc3f6d4df1b79a3ea183e24c272215e" }, 33 | "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, 34 | "nvim-scrollbar": { "branch": "main", "commit": "d09f14aa16c9f2748e77008f9da7b1f76e4e7b85" }, 35 | "nvim-tree.lua": { "branch": "master", "commit": "f9ff00bc06d7cb70548a3847d7a2a05e928bc988" }, 36 | "nvim-treesitter": { "branch": "master", "commit": "4068e1c0966eee10bc8937b54f8cf8f68b76961f" }, 37 | "nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" }, 38 | "nvim-ts-context-commentstring": { "branch": "main", "commit": "6b5f95aa4d24f2c629a74f2c935c702b08dbde62" }, 39 | "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, 40 | "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, 41 | "schemastore.nvim": { "branch": "main", "commit": "46b3b7e58d00eea2e7d9dac186ab5379264dee52" }, 42 | "spellsitter.nvim": { "branch": "master", "commit": "4af8640d9d706447e78c13150ef7475ea2c16b30" }, 43 | "surround.nvim": { "branch": "master", "commit": "36c253d6470910692491b13382f54c9bab2811e1" }, 44 | "telescope.nvim": { "branch": "master", "commit": "bfcc7d5c6f12209139f175e6123a7b7de6d9c18a" }, 45 | "toggleterm.nvim": { "branch": "main", "commit": "cd55bf6aab3f88c259fa29ea86bbdcb1a325687d" }, 46 | "ts-comments.nvim": { "branch": "main", "commit": "c1f3168f90c8442eec2f62e572ac86b25ca854ff" }, 47 | "vim-bbye": { "branch": "master", "commit": "25ef93ac5a87526111f43e5110675032dbcacf56" }, 48 | "vim-dadbod": { "branch": "master", "commit": "7888cb7164d69783d3dce4e0283decd26b82538b" }, 49 | "vim-dadbod-ui": { "branch": "master", "commit": "acfb660447f41634b6a299039e034abac126653a" }, 50 | "vim-prettier": { "branch": "master", "commit": "7dbdbb12c50a9f4ba72390cce2846248e4368fd0" }, 51 | "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, 52 | "vim-vue-plugin": { "branch": "master", "commit": "04c3fb20ed5096a983f71af204afba07cdfa6d6f" }, 53 | "zephyr-nvim": { "branch": "main", "commit": "7fd86b7164442d3b5ec2c81b2694d040e716b5cf" } 54 | } -------------------------------------------------------------------------------- /lua/plugins.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 | if not vim.loop.fs_stat(lazypath) then 3 | vim.fn.system( 4 | { 5 | "git", 6 | "clone", 7 | "--filter=blob:none", 8 | "https://github.com/folke/lazy.nvim.git", 9 | "--branch=stable", -- latest stable release 10 | lazypath 11 | } 12 | ) 13 | end 14 | vim.opt.rtp:prepend(lazypath) 15 | 16 | local enable_lsp_filetype = { 17 | "go", 18 | "lua", 19 | "sh", 20 | "rust", 21 | "c", 22 | "cpp", 23 | "typescript", 24 | "typescriptreact", 25 | "javascript", 26 | "javascriptreact", 27 | "vue", 28 | "css", 29 | "html", 30 | "sass", 31 | "less", 32 | "stylus", 33 | "json", 34 | "python" 35 | } 36 | local lazy_config = { 37 | checker = { 38 | -- automatically check for plugin updates 39 | enabled = true, 40 | concurrency = nil, ---@type number? set to 1 to check for updates very slowly 41 | notify = false, -- get a notification when new updates are found 42 | frequency = 3600 -- check for updates every hour 43 | } 44 | } 45 | require("lazy").setup( 46 | { 47 | -- plugins manger 48 | "folke/lazy.nvim", 49 | -- Theme 50 | { 51 | "nvimdev/zephyr-nvim", 52 | dependencies = {"nvim-treesitter/nvim-treesitter"}, 53 | config = function() 54 | require("zephyr") 55 | end 56 | }, 57 | -- LSP 58 | { 59 | "williamboman/mason.nvim", 60 | dependencies = { 61 | "williamboman/mason-lspconfig.nvim", 62 | "b0o/schemastore.nvim" 63 | }, 64 | ft = enable_lsp_filetype 65 | }, 66 | { 67 | "neovim/nvim-lspconfig", 68 | ft = enable_lsp_filetype, 69 | config = function() 70 | require("lsp.setup") 71 | end 72 | }, 73 | -- lspui 74 | { 75 | "jinzhongjia/LspUI.nvim", 76 | branch = "main", 77 | after = "nvim-lspconfig", 78 | config = function() 79 | require("LspUI").setup() 80 | end 81 | }, 82 | -- {"nvimdev/lspsaga.nvim", after = "nvim-lspconfig", config = [[require("plugin-config.lspsaga")]]}, 83 | -- auto completion 84 | { 85 | "hrsh7th/nvim-cmp", 86 | config = function() 87 | require("plugin-config.nvim-cmp") 88 | end, 89 | event = "VeryLazy", 90 | dependencies = { 91 | {"hrsh7th/cmp-nvim-lsp"}, 92 | {"hrsh7th/cmp-buffer"}, 93 | {"FelipeLema/cmp-async-path"}, 94 | {"hrsh7th/cmp-path"}, 95 | {"hrsh7th/cmp-nvim-lsp-signature-help"}, 96 | {"hrsh7th/cmp-cmdline"}, 97 | {"onsails/lspkind-nvim"} 98 | } 99 | }, 100 | -- Navbar 101 | { 102 | "akinsho/bufferline.nvim", 103 | event = {"UIEnter"}, 104 | dependencies = {"nvim-tree/nvim-web-devicons", "moll/vim-bbye"}, 105 | config = function() 106 | require("plugin-config.bufferline") 107 | end 108 | }, 109 | -- Status bar 110 | { 111 | "nvim-lualine/lualine.nvim", 112 | event = "UIEnter", 113 | dependencies = { 114 | "nvim-tree/nvim-web-devicons" 115 | }, 116 | config = function() 117 | require("lualine").setup({}) 118 | end 119 | }, 120 | -- Dashboard 121 | { 122 | "glepnir/dashboard-nvim", 123 | config = function() 124 | require("plugin-config.dashboard") 125 | end 126 | }, 127 | -- Typing 128 | { 129 | "xiyaowong/fast-cursor-move.nvim", 130 | event = {"BufRead", "BufNewFile"} 131 | }, 132 | -- Comment 133 | { 134 | "folke/ts-comments.nvim", 135 | opts = {}, 136 | event = "VeryLazy", 137 | enabled = vim.fn.has("nvim-0.10.0") == 1 138 | }, 139 | -- f t 140 | { 141 | "ggandor/leap.nvim", 142 | dependencies = {"tpope/vim-repeat"}, 143 | config = function() 144 | require("leap").add_default_mappings() 145 | end 146 | }, 147 | -- 平滑滚动插件 半屏或者整屏翻页变为滚动效果 148 | { 149 | "karb94/neoscroll.nvim", 150 | event = {"BufRead", "BufNewFile"}, 151 | config = function() 152 | require("neoscroll").setup() 153 | end 154 | }, 155 | -- 增删改引号 156 | { 157 | "ur4ltz/surround.nvim", 158 | event = {"BufRead", "BufNewFile"}, 159 | config = function() 160 | require "surround".setup {mappings_style = "surround"} 161 | end 162 | }, 163 | -- 缩进线插件 164 | { 165 | "lukas-reineke/indent-blankline.nvim", 166 | event = {"BufRead", "BufNewFile"}, 167 | config = function() 168 | return require("ibl").setup() 169 | end 170 | }, 171 | -- 当前光标下划线 高亮 172 | { 173 | "yamatsum/nvim-cursorline", 174 | event = {"BufRead", "BufNewFile"}, 175 | config = function() 176 | require("plugin-config.nvim-cursorline") 177 | end 178 | }, 179 | -- 颜色荧光笔 180 | { 181 | "norcalli/nvim-colorizer.lua", 182 | event = {"BufRead", "BufNewFile"}, 183 | config = function() 184 | require("plugin-config.nvim-colorizer") 185 | end 186 | }, 187 | -- fuzzyfind 模糊搜索 188 | { 189 | "nvim-telescope/telescope.nvim", 190 | cmd = "Telescope", 191 | dependencies = { 192 | "nvim-lua/plenary.nvim" 193 | }, 194 | config = function() 195 | require("plugin-config.telescope") 196 | end 197 | }, 198 | -- 高亮 199 | { 200 | "nvim-treesitter/nvim-treesitter", 201 | dependencies = { 202 | {"nvim-treesitter/nvim-treesitter-textobjects"}, 203 | {"JoosepAlviste/nvim-ts-context-commentstring"}, 204 | { 205 | "lewis6991/spellsitter.nvim", 206 | after = "nvim-treesitter", 207 | config = function() 208 | require("spellsitter").setup() 209 | end 210 | } 211 | }, 212 | event = "BufRead", 213 | config = function() 214 | require("plugin-config.treesitter") 215 | end 216 | }, 217 | -- 文件管理 218 | { 219 | "nvim-tree/nvim-tree.lua", 220 | cmd = {"NvimTreeToggle", "NvimTreeFindFile"}, 221 | config = function() 222 | require("plugin-config.nvim-tree") 223 | end 224 | }, 225 | -- git信息展示 :SignifyDiff 226 | { 227 | "lewis6991/gitsigns.nvim", 228 | event = {"BufRead", "BufNewFile"}, 229 | config = function() 230 | require("plugin-config.gitsigns") 231 | end, 232 | dependencies = { 233 | "nvim-lua/plenary.nvim" 234 | } 235 | }, 236 | -- 自动括号括回 237 | { 238 | "windwp/nvim-autopairs", 239 | dependencies = "nvim-cmp", 240 | evnet = "InsertEnter", 241 | config = function() 242 | require("nvim-autopairs").setup {} 243 | end 244 | }, 245 | { 246 | "glepnir/hlsearch.nvim", 247 | event = "BufRead", 248 | config = function() 249 | require("hlsearch").setup() 250 | end 251 | }, 252 | -- 目前配置了lua和js,ts的格式化 253 | { 254 | "mhartington/formatter.nvim", 255 | cmd = "Format", 256 | config = function() 257 | require("plugin-config.formatter") 258 | end 259 | }, 260 | -- lang Prettier 用来格式化js ts文件,formatter 配置为默认使用项目下 261 | -- Prettier,这个是全局的 262 | {"prettier/vim-prettier", cmd = "Prettier", build = "yarn install"}, 263 | -- editorconfig 264 | -- 编辑器配置,个大编辑器都有实现或者有插件,用来统一项目的编辑格式,比如缩进等文件规范 265 | { 266 | "editorconfig/editorconfig-vim", 267 | ft = enable_lsp_filetype 268 | }, 269 | { 270 | "ellisonleao/glow.nvim", 271 | config = function() 272 | require("glow").setup() 273 | end, 274 | cmd = "Glow" 275 | }, 276 | { 277 | "kristijanhusak/vim-dadbod-ui", 278 | cmd = {"DBUIToggle", "DBUIAddConnection", "DBUI", "DBUIFindBuffer", "DBUIRenameBuffer"}, 279 | config = function() 280 | require("plugin-config.dadod") 281 | end, 282 | dependencies = {{"tpope/vim-dadbod"}} 283 | }, 284 | {"leafOfTree/vim-vue-plugin", ft = "vue"}, 285 | { 286 | "ethanholz/nvim-lastplace", 287 | event = {"BufRead", "BufNewFile"}, 288 | config = function() 289 | require("plugin-config.nvim-lastplace") 290 | end 291 | }, 292 | { 293 | "petertriho/nvim-scrollbar", 294 | event = {"BufRead", "BufNewFile"}, 295 | config = function() 296 | require("plugin-config.nvim-scrollbar") 297 | end 298 | }, 299 | { 300 | "akinsho/toggleterm.nvim", 301 | cmd = "ToggleTerm", 302 | config = function() 303 | require("plugin-config.toggleterm") 304 | end 305 | }, 306 | { 307 | "rcarriga/nvim-notify", 308 | config = function() 309 | require("plugin-config.nvim-notify") 310 | end 311 | }, 312 | { 313 | "j-hui/fidget.nvim", 314 | tag = "legacy", 315 | ft = enable_lsp_filetype, 316 | config = function() 317 | require("fidget").setup {} 318 | end 319 | }, 320 | { 321 | "ray-x/lsp_signature.nvim", 322 | event = "InsertEnter", 323 | config = function() 324 | require("lsp_signature").setup( 325 | { 326 | bind = true, 327 | handler_opts = { 328 | border = "rounded" 329 | }, 330 | hint_enable = false, 331 | floating_window = true, 332 | hi_parameter = "LspSignatureActiveParameter" 333 | } 334 | ) 335 | end 336 | } 337 | }, 338 | lazy_config 339 | ) 340 | -------------------------------------------------------------------------------- /plugin/packer_compiled.lua: -------------------------------------------------------------------------------- 1 | -- Automatically generated packer.nvim plugin loader code 2 | 3 | if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then 4 | vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') 5 | return 6 | end 7 | 8 | vim.api.nvim_command('packadd packer.nvim') 9 | 10 | local no_errors, error_msg = pcall(function() 11 | 12 | _G._packer = _G._packer or {} 13 | _G._packer.inside_compile = true 14 | 15 | local time 16 | local profile_info 17 | local should_profile = true 18 | if should_profile then 19 | local hrtime = vim.loop.hrtime 20 | profile_info = {} 21 | time = function(chunk, start) 22 | if start then 23 | profile_info[chunk] = hrtime() 24 | else 25 | profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 26 | end 27 | end 28 | else 29 | time = function(chunk, start) end 30 | end 31 | 32 | local function save_profiles(threshold) 33 | local sorted_times = {} 34 | for chunk_name, time_taken in pairs(profile_info) do 35 | sorted_times[#sorted_times + 1] = {chunk_name, time_taken} 36 | end 37 | table.sort(sorted_times, function(a, b) return a[2] > b[2] end) 38 | local results = {} 39 | for i, elem in ipairs(sorted_times) do 40 | if not threshold or threshold and elem[2] > threshold then 41 | results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' 42 | end 43 | end 44 | if threshold then 45 | table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)') 46 | end 47 | 48 | _G._packer.profile_output = results 49 | end 50 | 51 | time([[Luarocks path setup]], true) 52 | local package_path_str = "/Users/zhangyongqi/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/zhangyongqi/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/zhangyongqi/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/zhangyongqi/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" 53 | local install_cpath_pattern = "/Users/zhangyongqi/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" 54 | if not string.find(package.path, package_path_str, 1, true) then 55 | package.path = package.path .. ';' .. package_path_str 56 | end 57 | 58 | if not string.find(package.cpath, install_cpath_pattern, 1, true) then 59 | package.cpath = package.cpath .. ';' .. install_cpath_pattern 60 | end 61 | 62 | time([[Luarocks path setup]], false) 63 | time([[try_loadstring definition]], true) 64 | local function try_loadstring(s, component, name) 65 | local success, result = pcall(loadstring(s), name, _G.packer_plugins[name]) 66 | if not success then 67 | vim.schedule(function() 68 | vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) 69 | end) 70 | end 71 | return result 72 | end 73 | 74 | time([[try_loadstring definition]], false) 75 | time([[Defining packer_plugins]], true) 76 | _G.packer_plugins = { 77 | ["Comment.nvim"] = { 78 | config = { "\27LJ\2\n5\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\26plugin-config.Comment\frequire\0" }, 79 | loaded = false, 80 | needs_bufread = false, 81 | only_cond = false, 82 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/Comment.nvim", 83 | url = "https://github.com/numToStr/Comment.nvim" 84 | }, 85 | ["FixCursorHold.nvim"] = { 86 | loaded = false, 87 | needs_bufread = false, 88 | only_cond = false, 89 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/FixCursorHold.nvim", 90 | url = "https://github.com/antoinemadec/FixCursorHold.nvim" 91 | }, 92 | ["accelerated-jk.nvim"] = { 93 | config = { "\27LJ\2\nÓ\1\0\0\5\0\n\0\0156\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\4\0005\3\3\0=\3\5\0025\3\6\0=\3\a\0024\3\3\0005\4\b\0>\4\1\3=\3\t\2B\0\2\1K\0\1\0\23deceleration_table\1\3\0\0\3–\1\3N\23acceleration_table\1\t\0\0\3\a\3\f\3\17\3\21\3\24\3\26\3\28\3\30\rmappings\1\0\1\23acceleration_limit\3–\1\1\0\2\6k\agk\6j\agj\nsetup\19accelerated-jk\frequire\0" }, 94 | loaded = false, 95 | needs_bufread = false, 96 | only_cond = false, 97 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/accelerated-jk.nvim", 98 | url = "https://github.com/xiyaowong/accelerated-jk.nvim" 99 | }, 100 | ["bufferline.nvim"] = { 101 | config = { 'require("plugin-config.bufferline")' }, 102 | loaded = false, 103 | needs_bufread = false, 104 | only_cond = false, 105 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/bufferline.nvim", 106 | url = "https://github.com/akinsho/bufferline.nvim" 107 | }, 108 | ["cmp-buffer"] = { 109 | after = { "cmp-cmdline" }, 110 | after_files = { "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/cmp-buffer/after/plugin/cmp_buffer.lua" }, 111 | load_after = { 112 | ["nvim-cmp"] = true 113 | }, 114 | loaded = false, 115 | needs_bufread = false, 116 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/cmp-buffer", 117 | url = "https://github.com/hrsh7th/cmp-buffer" 118 | }, 119 | ["cmp-cmdline"] = { 120 | after_files = { "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/cmp-cmdline/after/plugin/cmp_cmdline.lua" }, 121 | load_after = { 122 | ["cmp-buffer"] = true 123 | }, 124 | loaded = false, 125 | needs_bufread = false, 126 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/cmp-cmdline", 127 | url = "https://github.com/hrsh7th/cmp-cmdline" 128 | }, 129 | ["cmp-nvim-lsp"] = { 130 | after_files = { "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lsp/after/plugin/cmp_nvim_lsp.lua" }, 131 | load_after = { 132 | ["nvim-lspconfig"] = true 133 | }, 134 | loaded = false, 135 | needs_bufread = false, 136 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lsp", 137 | url = "https://github.com/hrsh7th/cmp-nvim-lsp" 138 | }, 139 | ["cmp-nvim-lsp-signature-help"] = { 140 | after_files = { "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lsp-signature-help/after/plugin/cmp_nvim_lsp_signature_help.lua" }, 141 | load_after = { 142 | ["nvim-cmp"] = true 143 | }, 144 | loaded = false, 145 | needs_bufread = false, 146 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/cmp-nvim-lsp-signature-help", 147 | url = "https://github.com/hrsh7th/cmp-nvim-lsp-signature-help" 148 | }, 149 | ["cmp-path"] = { 150 | after_files = { "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/cmp-path/after/plugin/cmp_path.lua" }, 151 | load_after = { 152 | ["nvim-cmp"] = true 153 | }, 154 | loaded = false, 155 | needs_bufread = false, 156 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/cmp-path", 157 | url = "https://github.com/hrsh7th/cmp-path" 158 | }, 159 | ["cmp-vsnip"] = { 160 | after_files = { "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/cmp-vsnip/after/plugin/cmp_vsnip.lua" }, 161 | load_after = { 162 | ["nvim-cmp"] = true 163 | }, 164 | loaded = false, 165 | needs_bufread = false, 166 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/cmp-vsnip", 167 | url = "https://github.com/hrsh7th/cmp-vsnip" 168 | }, 169 | ["dashboard-nvim"] = { 170 | config = { 'require("plugin-config.dashboard")' }, 171 | loaded = true, 172 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/start/dashboard-nvim", 173 | url = "https://github.com/glepnir/dashboard-nvim" 174 | }, 175 | ["editorconfig-vim"] = { 176 | loaded = false, 177 | needs_bufread = true, 178 | only_cond = false, 179 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/editorconfig-vim", 180 | url = "https://github.com/editorconfig/editorconfig-vim" 181 | }, 182 | ["fidget.nvim"] = { 183 | config = { "\27LJ\2\n8\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\vfidget\frequire\0" }, 184 | loaded = false, 185 | needs_bufread = false, 186 | only_cond = false, 187 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/fidget.nvim", 188 | url = "https://github.com/j-hui/fidget.nvim" 189 | }, 190 | ["formatter.nvim"] = { 191 | commands = { "Format" }, 192 | config = { 'require("plugin-config.formatter")' }, 193 | loaded = false, 194 | needs_bufread = false, 195 | only_cond = false, 196 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/formatter.nvim", 197 | url = "https://github.com/mhartington/formatter.nvim" 198 | }, 199 | ["friendly-snippets"] = { 200 | loaded = true, 201 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/start/friendly-snippets", 202 | url = "https://github.com/rafamadriz/friendly-snippets" 203 | }, 204 | ["galaxyline.nvim"] = { 205 | config = { 'require("plugin-config.galaxyline")' }, 206 | loaded = true, 207 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/start/galaxyline.nvim", 208 | url = "https://github.com/glepnir/galaxyline.nvim" 209 | }, 210 | ["gitsigns.nvim"] = { 211 | config = { 'require("plugin-config.gitsigns")' }, 212 | loaded = false, 213 | needs_bufread = false, 214 | only_cond = false, 215 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/gitsigns.nvim", 216 | url = "https://github.com/lewis6991/gitsigns.nvim" 217 | }, 218 | ["glow.nvim"] = { 219 | commands = { "Glow" }, 220 | loaded = false, 221 | needs_bufread = false, 222 | only_cond = false, 223 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/glow.nvim", 224 | url = "https://github.com/npxbr/glow.nvim" 225 | }, 226 | ["hlsearch.nvim"] = { 227 | config = { "\27LJ\2\n6\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\rhlsearch\frequire\0" }, 228 | loaded = false, 229 | needs_bufread = false, 230 | only_cond = false, 231 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/hlsearch.nvim", 232 | url = "https://github.com/glepnir/hlsearch.nvim" 233 | }, 234 | ["impatient.nvim"] = { 235 | loaded = true, 236 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/start/impatient.nvim", 237 | url = "https://github.com/lewis6991/impatient.nvim" 238 | }, 239 | ["indent-blankline.nvim"] = { 240 | config = { "\27LJ\2\n—\4\0\0\4\0\n\0\f6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0005\3\4\0=\3\5\0025\3\6\0=\3\a\0025\3\b\0=\3\t\2D\0\2\0\21context_patterns\1\f\0\0\nclass\rfunction\vmethod\nblock\17list_literal\rselector\b^if\v^table\17if_statement\nwhile\bfor\20buftype_exclude\1\4\0\0\rterminal\vnofile\vprompt\21filetype_exclude\1\17\0\0\14dashboard\16DogicPrompt\blog\rfugitive\14gitcommit\vpacker\rmarkdown\tjson\btxt\nvista\thelp\ftodoist\rNvimTree\bgit\20TelescopePrompt\rundotree\1\0\6\25use_treesitter_scope\2\tchar\b│/show_current_context_start_on_current_line\1\31show_current_context_start\1\25show_current_context\1\28show_first_indent_level\2\nsetup\21indent_blankline\frequire\0" }, 241 | loaded = false, 242 | needs_bufread = false, 243 | only_cond = false, 244 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/indent-blankline.nvim", 245 | url = "https://github.com/lukas-reineke/indent-blankline.nvim" 246 | }, 247 | ["lightspeed.nvim"] = { 248 | keys = { { "", "Lightspeed_s" }, { "", "Lightspeed_S" }, { "", "Lightspeed_x" }, { "", "Lightspeed_X" }, { "", "Lightspeed_f" }, { "", "Lightspeed_F" }, { "", "Lightspeed_t" }, { "", "Lightspeed_T" } }, 249 | loaded = false, 250 | needs_bufread = false, 251 | only_cond = false, 252 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/lightspeed.nvim", 253 | url = "https://github.com/ggandor/lightspeed.nvim" 254 | }, 255 | ["lsp_signature.nvim"] = { 256 | config = { "\27LJ\2\n¶\1\0\0\4\0\6\0\t6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0005\3\4\0=\3\5\2B\0\2\1K\0\1\0\17handler_opts\1\0\1\vborder\frounded\1\0\4\tbind\2\17hi_parameter LspSignatureActiveParameter\20floating_window\2\16hint_enable\1\nsetup\18lsp_signature\frequire\0" }, 257 | loaded = false, 258 | needs_bufread = false, 259 | only_cond = false, 260 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/lsp_signature.nvim", 261 | url = "https://github.com/ray-x/lsp_signature.nvim" 262 | }, 263 | ["lspkind-nvim"] = { 264 | loaded = true, 265 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/start/lspkind-nvim", 266 | url = "https://github.com/onsails/lspkind-nvim" 267 | }, 268 | ["lspsaga.nvim"] = { 269 | config = { 'require("plugin-config.lspsaga")' }, 270 | load_after = { 271 | ["nvim-lspconfig"] = true 272 | }, 273 | loaded = false, 274 | needs_bufread = false, 275 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/lspsaga.nvim", 276 | url = "https://github.com/glepnir/lspsaga.nvim" 277 | }, 278 | ["mason-lspconfig.nvim"] = { 279 | loaded = true, 280 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim", 281 | url = "https://github.com/williamboman/mason-lspconfig.nvim" 282 | }, 283 | ["mason.nvim"] = { 284 | loaded = true, 285 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/start/mason.nvim", 286 | url = "https://github.com/williamboman/mason.nvim" 287 | }, 288 | ["neoscroll.nvim"] = { 289 | config = { "\27LJ\2\n7\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\14neoscroll\frequire\0" }, 290 | loaded = false, 291 | needs_bufread = false, 292 | only_cond = false, 293 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/neoscroll.nvim", 294 | url = "https://github.com/karb94/neoscroll.nvim" 295 | }, 296 | ["nvim-autopairs"] = { 297 | config = { "\27LJ\2\n@\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0" }, 298 | loaded = true, 299 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/start/nvim-autopairs", 300 | url = "https://github.com/windwp/nvim-autopairs" 301 | }, 302 | ["nvim-cmp"] = { 303 | after = { "cmp-nvim-lsp-signature-help", "cmp-vsnip", "vim-vsnip", "vim-vsnip-integ", "cmp-path", "cmp-buffer" }, 304 | config = { 'require("plugin-config.nvim-cmp")' }, 305 | loaded = false, 306 | needs_bufread = false, 307 | only_cond = false, 308 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/nvim-cmp", 309 | url = "https://github.com/hrsh7th/nvim-cmp" 310 | }, 311 | ["nvim-colorizer.lua"] = { 312 | config = { 'require("plugin-config.nvim-colorizer")' }, 313 | loaded = false, 314 | needs_bufread = false, 315 | only_cond = false, 316 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/nvim-colorizer.lua", 317 | url = "https://github.com/norcalli/nvim-colorizer.lua" 318 | }, 319 | ["nvim-cursorline"] = { 320 | config = { 'require("plugin-config.nvim-cursorline")' }, 321 | loaded = false, 322 | needs_bufread = false, 323 | only_cond = false, 324 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/nvim-cursorline", 325 | url = "https://github.com/yamatsum/nvim-cursorline" 326 | }, 327 | ["nvim-lastplace"] = { 328 | config = { "\27LJ\2\n<\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0!plugin-config.nvim-lastplace\frequire\0" }, 329 | loaded = false, 330 | needs_bufread = false, 331 | only_cond = false, 332 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/nvim-lastplace", 333 | url = "https://github.com/ethanholz/nvim-lastplace" 334 | }, 335 | ["nvim-lspconfig"] = { 336 | after = { "lspsaga.nvim", "cmp-nvim-lsp" }, 337 | config = { "\27LJ\2\n)\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\14lsp.setup\frequire\0" }, 338 | loaded = false, 339 | needs_bufread = false, 340 | only_cond = false, 341 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/nvim-lspconfig", 342 | url = "https://github.com/neovim/nvim-lspconfig" 343 | }, 344 | ["nvim-notify"] = { 345 | config = { "\27LJ\2\n9\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\30plugin-config.nvim-notify\frequire\0" }, 346 | loaded = true, 347 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/start/nvim-notify", 348 | url = "https://github.com/rcarriga/nvim-notify" 349 | }, 350 | ["nvim-scrollbar"] = { 351 | config = { "\27LJ\2\n<\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0!plugin-config.nvim-scrollbar\frequire\0" }, 352 | loaded = false, 353 | needs_bufread = false, 354 | only_cond = false, 355 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/nvim-scrollbar", 356 | url = "https://github.com/petertriho/nvim-scrollbar" 357 | }, 358 | ["nvim-tree.lua"] = { 359 | commands = { "NvimTreeToggle", "NvimTreeFindFile" }, 360 | config = { 'require("plugin-config.nvim-tree")' }, 361 | loaded = false, 362 | needs_bufread = false, 363 | only_cond = false, 364 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/nvim-tree.lua", 365 | url = "https://github.com/kyazdani42/nvim-tree.lua" 366 | }, 367 | ["nvim-treesitter"] = { 368 | after = { "nvim-treesitter-textobjects", "nvim-ts-context-commentstring", "spellsitter.nvim", "nvim-ts-rainbow" }, 369 | config = { 'require("plugin-config.treesitter")' }, 370 | load_after = { 371 | ["telescope.nvim"] = true 372 | }, 373 | loaded = false, 374 | needs_bufread = false, 375 | only_cond = false, 376 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/nvim-treesitter", 377 | url = "https://github.com/nvim-treesitter/nvim-treesitter" 378 | }, 379 | ["nvim-treesitter-textobjects"] = { 380 | load_after = { 381 | ["nvim-treesitter"] = true 382 | }, 383 | loaded = false, 384 | needs_bufread = false, 385 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/nvim-treesitter-textobjects", 386 | url = "https://github.com/nvim-treesitter/nvim-treesitter-textobjects" 387 | }, 388 | ["nvim-ts-context-commentstring"] = { 389 | load_after = { 390 | ["nvim-treesitter"] = true 391 | }, 392 | loaded = false, 393 | needs_bufread = false, 394 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/nvim-ts-context-commentstring", 395 | url = "https://github.com/JoosepAlviste/nvim-ts-context-commentstring" 396 | }, 397 | ["nvim-ts-rainbow"] = { 398 | load_after = { 399 | ["nvim-treesitter"] = true 400 | }, 401 | loaded = false, 402 | needs_bufread = false, 403 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/nvim-ts-rainbow", 404 | url = "https://github.com/p00f/nvim-ts-rainbow" 405 | }, 406 | ["nvim-web-devicons"] = { 407 | loaded = true, 408 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/start/nvim-web-devicons", 409 | url = "https://github.com/kyazdani42/nvim-web-devicons" 410 | }, 411 | ["packer.nvim"] = { 412 | loaded = true, 413 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/start/packer.nvim", 414 | url = "https://github.com/wbthomason/packer.nvim" 415 | }, 416 | ["plenary.nvim"] = { 417 | loaded = false, 418 | needs_bufread = false, 419 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/plenary.nvim", 420 | url = "https://github.com/nvim-lua/plenary.nvim" 421 | }, 422 | ["popup.nvim"] = { 423 | loaded = false, 424 | needs_bufread = false, 425 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/popup.nvim", 426 | url = "https://github.com/nvim-lua/popup.nvim" 427 | }, 428 | ["schemastore.nvim"] = { 429 | loaded = false, 430 | needs_bufread = false, 431 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/schemastore.nvim", 432 | url = "https://github.com/b0o/schemastore.nvim" 433 | }, 434 | ["spellsitter.nvim"] = { 435 | config = { "\27LJ\2\n9\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\16spellsitter\frequire\0" }, 436 | load_after = { 437 | ["nvim-treesitter"] = true 438 | }, 439 | loaded = false, 440 | needs_bufread = false, 441 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/spellsitter.nvim", 442 | url = "https://github.com/lewis6991/spellsitter.nvim" 443 | }, 444 | ["surround.nvim"] = { 445 | config = { "\27LJ\2\nU\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\1\19mappings_style\rsurround\nsetup\rsurround\frequire\0" }, 446 | loaded = false, 447 | needs_bufread = false, 448 | only_cond = false, 449 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/surround.nvim", 450 | url = "https://github.com/ur4ltz/surround.nvim" 451 | }, 452 | ["telescope.nvim"] = { 453 | after = { "nvim-treesitter" }, 454 | commands = { "Telescope" }, 455 | config = { 'require("plugin-config.telescope")' }, 456 | loaded = false, 457 | needs_bufread = true, 458 | only_cond = false, 459 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/telescope.nvim", 460 | url = "https://github.com/nvim-telescope/telescope.nvim" 461 | }, 462 | ["toggleterm.nvim"] = { 463 | commands = { "ToggleTerm" }, 464 | config = { "\27LJ\2\n8\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\29plugin-config.toggleterm\frequire\0" }, 465 | loaded = false, 466 | needs_bufread = false, 467 | only_cond = false, 468 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/toggleterm.nvim", 469 | url = "https://github.com/akinsho/toggleterm.nvim" 470 | }, 471 | ["vim-dadbod"] = { 472 | loaded = false, 473 | needs_bufread = false, 474 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/vim-dadbod", 475 | url = "https://github.com/tpope/vim-dadbod" 476 | }, 477 | ["vim-dadbod-ui"] = { 478 | commands = { "DBUIToggle", "DBUIAddConnection", "DBUI", "DBUIFindBuffer", "DBUIRenameBuffer" }, 479 | config = { 'require("plugin-config.dadod")' }, 480 | loaded = false, 481 | needs_bufread = true, 482 | only_cond = false, 483 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/vim-dadbod-ui", 484 | url = "https://github.com/kristijanhusak/vim-dadbod-ui" 485 | }, 486 | ["vim-prettier"] = { 487 | commands = { "Prettier" }, 488 | loaded = false, 489 | needs_bufread = true, 490 | only_cond = false, 491 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/vim-prettier", 492 | url = "https://github.com/prettier/vim-prettier" 493 | }, 494 | ["vim-vsnip"] = { 495 | config = { 'require("plugin-config.vsnip")' }, 496 | load_after = { 497 | ["nvim-cmp"] = true 498 | }, 499 | loaded = false, 500 | needs_bufread = true, 501 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/vim-vsnip", 502 | url = "https://github.com/hrsh7th/vim-vsnip" 503 | }, 504 | ["vim-vsnip-integ"] = { 505 | after_files = { "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/vim-vsnip-integ/after/plugin/vsnip_integ.vim" }, 506 | load_after = { 507 | ["nvim-cmp"] = true 508 | }, 509 | loaded = false, 510 | needs_bufread = false, 511 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/vim-vsnip-integ", 512 | url = "https://github.com/hrsh7th/vim-vsnip-integ" 513 | }, 514 | ["vim-vue-plugin"] = { 515 | loaded = false, 516 | needs_bufread = true, 517 | only_cond = false, 518 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/vim-vue-plugin", 519 | url = "https://github.com/leafOfTree/vim-vue-plugin" 520 | }, 521 | ["zephyr-nvim"] = { 522 | config = { "\27LJ\2\n&\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\vzephyr\frequire\0" }, 523 | loaded = true, 524 | path = "/Users/zhangyongqi/.local/share/nvim/site/pack/packer/start/zephyr-nvim", 525 | url = "https://github.com/glepnir/zephyr-nvim" 526 | } 527 | } 528 | 529 | time([[Defining packer_plugins]], false) 530 | -- Setup for: lightspeed.nvim 531 | time([[Setup for lightspeed.nvim]], true) 532 | try_loadstring("\27LJ\2\n­\6\0\0\f\0\25\00084\0\21\0005\1\0\0>\1\1\0005\1\1\0>\1\2\0005\1\2\0>\1\3\0005\1\3\0>\1\4\0005\1\4\0>\1\5\0005\1\5\0>\1\6\0005\1\6\0>\1\a\0005\1\a\0>\1\b\0005\1\b\0>\1\t\0005\1\t\0>\1\n\0005\1\n\0>\1\v\0005\1\v\0>\1\f\0005\1\f\0>\1\r\0005\1\r\0>\1\14\0005\1\14\0>\1\15\0005\1\15\0>\1\16\0005\1\16\0>\1\17\0005\1\17\0>\1\18\0005\1\18\0>\1\19\0005\1\19\0>\1\20\0006\1\20\0\18\3\0\0B\1\2\4X\4\b€6\6\21\0009\6\22\0069\6\23\6:\b\1\5:\t\2\5:\n\3\0055\v\24\0B\6\5\1E\4\3\3R\4ö\127K\0\1\0\1\0\1\vsilent\2\20nvim_set_keymap\bapi\bvim\vipairs\1\4\0\0\6o\6T\23Lightspeed_T\1\4\0\0\6o\6t\23Lightspeed_t\1\4\0\0\6x\6T\23Lightspeed_T\1\4\0\0\6x\6t\23Lightspeed_t\1\4\0\0\6n\6T\23Lightspeed_T\1\4\0\0\6n\6t\23Lightspeed_t\1\4\0\0\6o\6F\23Lightspeed_F\1\4\0\0\6o\6f\23Lightspeed_f\1\4\0\0\6x\6F\23Lightspeed_F\1\4\0\0\6x\6f\23Lightspeed_f\1\4\0\0\6n\6F\23Lightspeed_F\1\4\0\0\6n\6f\23Lightspeed_f\1\4\0\0\6o\6X\23Lightspeed_X\1\4\0\0\6o\6x\23Lightspeed_x\1\4\0\0\6o\6Z\23Lightspeed_S\1\4\0\0\6o\6z\23Lightspeed_s\1\4\0\0\6x\6S\23Lightspeed_S\1\4\0\0\6x\6s\23Lightspeed_s\1\4\0\0\6n\6S\23Lightspeed_S\1\4\0\0\6n\6s\23Lightspeed_s\0", "setup", "lightspeed.nvim") 533 | time([[Setup for lightspeed.nvim]], false) 534 | -- Config for: galaxyline.nvim 535 | time([[Config for galaxyline.nvim]], true) 536 | require("plugin-config.galaxyline") 537 | time([[Config for galaxyline.nvim]], false) 538 | -- Config for: zephyr-nvim 539 | time([[Config for zephyr-nvim]], true) 540 | try_loadstring("\27LJ\2\n&\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\vzephyr\frequire\0", "config", "zephyr-nvim") 541 | time([[Config for zephyr-nvim]], false) 542 | -- Config for: nvim-autopairs 543 | time([[Config for nvim-autopairs]], true) 544 | try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\19nvim-autopairs\frequire\0", "config", "nvim-autopairs") 545 | time([[Config for nvim-autopairs]], false) 546 | -- Config for: dashboard-nvim 547 | time([[Config for dashboard-nvim]], true) 548 | require("plugin-config.dashboard") 549 | time([[Config for dashboard-nvim]], false) 550 | -- Config for: nvim-notify 551 | time([[Config for nvim-notify]], true) 552 | try_loadstring("\27LJ\2\n9\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\30plugin-config.nvim-notify\frequire\0", "config", "nvim-notify") 553 | time([[Config for nvim-notify]], false) 554 | 555 | -- Command lazy-loads 556 | time([[Defining lazy-load commands]], true) 557 | pcall(vim.api.nvim_create_user_command, 'Telescope', function(cmdargs) 558 | require('packer.load')({'telescope.nvim'}, { cmd = 'Telescope', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins) 559 | end, 560 | {nargs = '*', range = true, bang = true, complete = function() 561 | require('packer.load')({'telescope.nvim'}, {}, _G.packer_plugins) 562 | return vim.fn.getcompletion('Telescope ', 'cmdline') 563 | end}) 564 | pcall(vim.api.nvim_create_user_command, 'DBUIAddConnection', function(cmdargs) 565 | require('packer.load')({'vim-dadbod-ui'}, { cmd = 'DBUIAddConnection', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins) 566 | end, 567 | {nargs = '*', range = true, bang = true, complete = function() 568 | require('packer.load')({'vim-dadbod-ui'}, {}, _G.packer_plugins) 569 | return vim.fn.getcompletion('DBUIAddConnection ', 'cmdline') 570 | end}) 571 | pcall(vim.api.nvim_create_user_command, 'DBUI', function(cmdargs) 572 | require('packer.load')({'vim-dadbod-ui'}, { cmd = 'DBUI', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins) 573 | end, 574 | {nargs = '*', range = true, bang = true, complete = function() 575 | require('packer.load')({'vim-dadbod-ui'}, {}, _G.packer_plugins) 576 | return vim.fn.getcompletion('DBUI ', 'cmdline') 577 | end}) 578 | pcall(vim.api.nvim_create_user_command, 'DBUIFindBuffer', function(cmdargs) 579 | require('packer.load')({'vim-dadbod-ui'}, { cmd = 'DBUIFindBuffer', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins) 580 | end, 581 | {nargs = '*', range = true, bang = true, complete = function() 582 | require('packer.load')({'vim-dadbod-ui'}, {}, _G.packer_plugins) 583 | return vim.fn.getcompletion('DBUIFindBuffer ', 'cmdline') 584 | end}) 585 | pcall(vim.api.nvim_create_user_command, 'DBUIRenameBuffer', function(cmdargs) 586 | require('packer.load')({'vim-dadbod-ui'}, { cmd = 'DBUIRenameBuffer', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins) 587 | end, 588 | {nargs = '*', range = true, bang = true, complete = function() 589 | require('packer.load')({'vim-dadbod-ui'}, {}, _G.packer_plugins) 590 | return vim.fn.getcompletion('DBUIRenameBuffer ', 'cmdline') 591 | end}) 592 | pcall(vim.api.nvim_create_user_command, 'Format', function(cmdargs) 593 | require('packer.load')({'formatter.nvim'}, { cmd = 'Format', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins) 594 | end, 595 | {nargs = '*', range = true, bang = true, complete = function() 596 | require('packer.load')({'formatter.nvim'}, {}, _G.packer_plugins) 597 | return vim.fn.getcompletion('Format ', 'cmdline') 598 | end}) 599 | pcall(vim.api.nvim_create_user_command, 'Prettier', function(cmdargs) 600 | require('packer.load')({'vim-prettier'}, { cmd = 'Prettier', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins) 601 | end, 602 | {nargs = '*', range = true, bang = true, complete = function() 603 | require('packer.load')({'vim-prettier'}, {}, _G.packer_plugins) 604 | return vim.fn.getcompletion('Prettier ', 'cmdline') 605 | end}) 606 | pcall(vim.api.nvim_create_user_command, 'DBUIToggle', function(cmdargs) 607 | require('packer.load')({'vim-dadbod-ui'}, { cmd = 'DBUIToggle', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins) 608 | end, 609 | {nargs = '*', range = true, bang = true, complete = function() 610 | require('packer.load')({'vim-dadbod-ui'}, {}, _G.packer_plugins) 611 | return vim.fn.getcompletion('DBUIToggle ', 'cmdline') 612 | end}) 613 | pcall(vim.api.nvim_create_user_command, 'Glow', function(cmdargs) 614 | require('packer.load')({'glow.nvim'}, { cmd = 'Glow', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins) 615 | end, 616 | {nargs = '*', range = true, bang = true, complete = function() 617 | require('packer.load')({'glow.nvim'}, {}, _G.packer_plugins) 618 | return vim.fn.getcompletion('Glow ', 'cmdline') 619 | end}) 620 | pcall(vim.api.nvim_create_user_command, 'NvimTreeToggle', function(cmdargs) 621 | require('packer.load')({'nvim-tree.lua'}, { cmd = 'NvimTreeToggle', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins) 622 | end, 623 | {nargs = '*', range = true, bang = true, complete = function() 624 | require('packer.load')({'nvim-tree.lua'}, {}, _G.packer_plugins) 625 | return vim.fn.getcompletion('NvimTreeToggle ', 'cmdline') 626 | end}) 627 | pcall(vim.api.nvim_create_user_command, 'NvimTreeFindFile', function(cmdargs) 628 | require('packer.load')({'nvim-tree.lua'}, { cmd = 'NvimTreeFindFile', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins) 629 | end, 630 | {nargs = '*', range = true, bang = true, complete = function() 631 | require('packer.load')({'nvim-tree.lua'}, {}, _G.packer_plugins) 632 | return vim.fn.getcompletion('NvimTreeFindFile ', 'cmdline') 633 | end}) 634 | pcall(vim.api.nvim_create_user_command, 'ToggleTerm', function(cmdargs) 635 | require('packer.load')({'toggleterm.nvim'}, { cmd = 'ToggleTerm', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins) 636 | end, 637 | {nargs = '*', range = true, bang = true, complete = function() 638 | require('packer.load')({'toggleterm.nvim'}, {}, _G.packer_plugins) 639 | return vim.fn.getcompletion('ToggleTerm ', 'cmdline') 640 | end}) 641 | time([[Defining lazy-load commands]], false) 642 | 643 | -- Keymap lazy-loads 644 | time([[Defining lazy-load keymaps]], true) 645 | vim.cmd [[noremap Lightspeed_T lua require("packer.load")({'lightspeed.nvim'}, { keys = "Plug>Lightspeed_T", prefix = "" }, _G.packer_plugins)]] 646 | vim.cmd [[noremap Lightspeed_t lua require("packer.load")({'lightspeed.nvim'}, { keys = "Plug>Lightspeed_t", prefix = "" }, _G.packer_plugins)]] 647 | vim.cmd [[noremap Lightspeed_X lua require("packer.load")({'lightspeed.nvim'}, { keys = "Plug>Lightspeed_X", prefix = "" }, _G.packer_plugins)]] 648 | vim.cmd [[noremap Lightspeed_F lua require("packer.load")({'lightspeed.nvim'}, { keys = "Plug>Lightspeed_F", prefix = "" }, _G.packer_plugins)]] 649 | vim.cmd [[noremap Lightspeed_f lua require("packer.load")({'lightspeed.nvim'}, { keys = "Plug>Lightspeed_f", prefix = "" }, _G.packer_plugins)]] 650 | vim.cmd [[noremap Lightspeed_S lua require("packer.load")({'lightspeed.nvim'}, { keys = "Plug>Lightspeed_S", prefix = "" }, _G.packer_plugins)]] 651 | vim.cmd [[noremap Lightspeed_s lua require("packer.load")({'lightspeed.nvim'}, { keys = "Plug>Lightspeed_s", prefix = "" }, _G.packer_plugins)]] 652 | vim.cmd [[noremap Lightspeed_x lua require("packer.load")({'lightspeed.nvim'}, { keys = "Plug>Lightspeed_x", prefix = "" }, _G.packer_plugins)]] 653 | time([[Defining lazy-load keymaps]], false) 654 | 655 | vim.cmd [[augroup packer_load_aucmds]] 656 | vim.cmd [[au!]] 657 | -- Filetype lazy-loads 658 | time([[Defining lazy-load filetype autocommands]], true) 659 | vim.cmd [[au FileType rust ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "rust" }, _G.packer_plugins)]] 660 | vim.cmd [[au FileType cpp ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "cpp" }, _G.packer_plugins)]] 661 | vim.cmd [[au FileType go ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "go" }, _G.packer_plugins)]] 662 | vim.cmd [[au FileType typescriptreact ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "typescriptreact" }, _G.packer_plugins)]] 663 | vim.cmd [[au FileType javascript ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "javascript" }, _G.packer_plugins)]] 664 | vim.cmd [[au FileType javascriptreact ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "javascriptreact" }, _G.packer_plugins)]] 665 | vim.cmd [[au FileType vue ++once lua require("packer.load")({'nvim-lspconfig', 'vim-vue-plugin', 'editorconfig-vim', 'fidget.nvim'}, { ft = "vue" }, _G.packer_plugins)]] 666 | vim.cmd [[au FileType css ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "css" }, _G.packer_plugins)]] 667 | vim.cmd [[au FileType html ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "html" }, _G.packer_plugins)]] 668 | vim.cmd [[au FileType sass ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "sass" }, _G.packer_plugins)]] 669 | vim.cmd [[au FileType less ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "less" }, _G.packer_plugins)]] 670 | vim.cmd [[au FileType stylus ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "stylus" }, _G.packer_plugins)]] 671 | vim.cmd [[au FileType python ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "python" }, _G.packer_plugins)]] 672 | vim.cmd [[au FileType lua ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "lua" }, _G.packer_plugins)]] 673 | vim.cmd [[au FileType c ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "c" }, _G.packer_plugins)]] 674 | vim.cmd [[au FileType json ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "json" }, _G.packer_plugins)]] 675 | vim.cmd [[au FileType typescript ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "typescript" }, _G.packer_plugins)]] 676 | vim.cmd [[au FileType sh ++once lua require("packer.load")({'nvim-lspconfig', 'editorconfig-vim', 'fidget.nvim'}, { ft = "sh" }, _G.packer_plugins)]] 677 | time([[Defining lazy-load filetype autocommands]], false) 678 | -- Event lazy-loads 679 | time([[Defining lazy-load event autocommands]], true) 680 | vim.cmd [[au BufRead * ++once lua require("packer.load")({'surround.nvim', 'nvim-treesitter', 'neoscroll.nvim', 'nvim-cursorline', 'nvim-lastplace', 'gitsigns.nvim', 'Comment.nvim', 'nvim-scrollbar', 'hlsearch.nvim', 'accelerated-jk.nvim', 'indent-blankline.nvim', 'bufferline.nvim', 'nvim-colorizer.lua'}, { event = "BufRead *" }, _G.packer_plugins)]] 681 | vim.cmd [[au BufNewFile * ++once lua require("packer.load")({'surround.nvim', 'neoscroll.nvim', 'nvim-cursorline', 'nvim-lastplace', 'gitsigns.nvim', 'Comment.nvim', 'nvim-scrollbar', 'accelerated-jk.nvim', 'indent-blankline.nvim', 'bufferline.nvim', 'nvim-colorizer.lua'}, { event = "BufNewFile *" }, _G.packer_plugins)]] 682 | vim.cmd [[au BufReadPre * ++once lua require("packer.load")({'FixCursorHold.nvim'}, { event = "BufReadPre *" }, _G.packer_plugins)]] 683 | vim.cmd [[au InsertEnter * ++once lua require("packer.load")({'nvim-cmp', 'lsp_signature.nvim'}, { event = "InsertEnter *" }, _G.packer_plugins)]] 684 | time([[Defining lazy-load event autocommands]], false) 685 | vim.cmd("augroup END") 686 | vim.cmd [[augroup filetypedetect]] 687 | time([[Sourcing ftdetect script at: /Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/vim-vue-plugin/ftdetect/vue.vim]], true) 688 | vim.cmd [[source /Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/vim-vue-plugin/ftdetect/vue.vim]] 689 | time([[Sourcing ftdetect script at: /Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/vim-vue-plugin/ftdetect/vue.vim]], false) 690 | time([[Sourcing ftdetect script at: /Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/editorconfig-vim/ftdetect/editorconfig.vim]], true) 691 | vim.cmd [[source /Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/editorconfig-vim/ftdetect/editorconfig.vim]] 692 | time([[Sourcing ftdetect script at: /Users/zhangyongqi/.local/share/nvim/site/pack/packer/opt/editorconfig-vim/ftdetect/editorconfig.vim]], false) 693 | vim.cmd("augroup END") 694 | 695 | _G._packer.inside_compile = false 696 | if _G._packer.needs_bufread == true then 697 | vim.cmd("doautocmd BufRead") 698 | end 699 | _G._packer.needs_bufread = false 700 | 701 | if should_profile then save_profiles(1) end 702 | 703 | end) 704 | 705 | if not no_errors then 706 | error_msg = error_msg:gsub('"', '\\"') 707 | vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') 708 | end 709 | --------------------------------------------------------------------------------