├── after └── plugin │ ├── gitsigns.rc.lua │ ├── ts-autotag.rc.lua │ ├── colorizer.rc.lua │ ├── tokyonight.rc.lua │ ├── autopairs.rc.lua │ ├── zen-mode.rc.lua │ ├── lsp-colors.rc.lua │ ├── git.rc.lua │ ├── mason.rc.lua │ ├── prettier.rc.lua │ ├── web-devicons.rc.lua │ ├── treesitter.rc.lua │ ├── bufferline.rc.lua │ ├── cmp.rc.lua │ ├── lspkind.rc.lua │ ├── lualine.rc.lua │ ├── neosolarized.rc.lua │ ├── toggleterm.rc.lua │ └── telescope.rc.lua ├── init.lua ├── plugin ├── lspsaga.rc.lua ├── null-ls.rc.lua ├── lspconfig.lua └── packer_compiled.lua ├── lua └── amyjuanli │ ├── maps.lua │ ├── options.lua │ └── plugins.lua └── README.md /after/plugin/gitsigns.rc.lua: -------------------------------------------------------------------------------- 1 | require('gitsigns').setup {} 2 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | print('init.lua is loaded!') 2 | 3 | require('amyjuanli.plugins') 4 | require('amyjuanli.options') 5 | require('amyjuanli.maps') 6 | -------------------------------------------------------------------------------- /after/plugin/ts-autotag.rc.lua: -------------------------------------------------------------------------------- 1 | local status, autotag = pcall(require, "nvim-ts-autotag") 2 | if (not status) then return end 3 | 4 | autotag.setup({}) 5 | -------------------------------------------------------------------------------- /after/plugin/colorizer.rc.lua: -------------------------------------------------------------------------------- 1 | local status, colorizer = pcall(require, "colorizer") 2 | if (not status) then return end 3 | 4 | colorizer.setup({ 5 | '*'; 6 | }) 7 | -------------------------------------------------------------------------------- /after/plugin/tokyonight.rc.lua: -------------------------------------------------------------------------------- 1 | vim.g.tokyonight_style = "night" 2 | vim.g.tokyonight_italic_functions = true 3 | vim.g.tokyonight_transparent = true 4 | vim.g.tokyonight_transparent_sidebar = true 5 | -------------------------------------------------------------------------------- /after/plugin/autopairs.rc.lua: -------------------------------------------------------------------------------- 1 | local status, autopairs = pcall(require, "nvim-autopairs") 2 | if (not status) then return end 3 | 4 | autopairs.setup({ 5 | disable_filetype = { "TelescopePrompt", "vim" }, 6 | }) 7 | -------------------------------------------------------------------------------- /after/plugin/zen-mode.rc.lua: -------------------------------------------------------------------------------- 1 | local status, zenMode = pcall(require, "zen-mode") 2 | if (not status) then return end 3 | 4 | zenMode.setup { 5 | } 6 | 7 | vim.keymap.set('n', 'o', 'ZenMode', { silent = true }) 8 | -------------------------------------------------------------------------------- /after/plugin/lsp-colors.rc.lua: -------------------------------------------------------------------------------- 1 | local status, colors = pcall(require, "lsp-colors") 2 | if (not status) then return end 3 | 4 | colors.setup { 5 | Error = "#db4b4b", 6 | Warning = "#e0af68", 7 | Information = "#0db9d7", 8 | Hint = "#10B981" 9 | } 10 | -------------------------------------------------------------------------------- /after/plugin/git.rc.lua: -------------------------------------------------------------------------------- 1 | local status, git = pcall(require, "git") 2 | if (not status) then return end 3 | 4 | git.setup({ 5 | keymaps = { 6 | -- Open blame window 7 | blame = "gb", 8 | -- Open file/folder in git repository 9 | browse = "go", 10 | } 11 | }) 12 | -------------------------------------------------------------------------------- /after/plugin/mason.rc.lua: -------------------------------------------------------------------------------- 1 | local status, mason = pcall(require, "mason") 2 | if (not status) then return end 3 | local status2, lspconfig = pcall(require, "mason-lspconfig") 4 | if (not status2) then return end 5 | 6 | mason.setup({ 7 | 8 | }) 9 | 10 | lspconfig.setup { 11 | ensure_installed = { "sumneko_lua", "tailwindcss" }, 12 | } 13 | -------------------------------------------------------------------------------- /after/plugin/prettier.rc.lua: -------------------------------------------------------------------------------- 1 | local status, prettier = pcall(require, "prettier") 2 | if (not status) then return end 3 | 4 | prettier.setup { 5 | bin = 'prettierd', 6 | filetypes = { 7 | "css", 8 | "javascript", 9 | "javascriptreact", 10 | "typescript", 11 | "typescriptreact", 12 | "json", 13 | "scss", 14 | "less" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /after/plugin/web-devicons.rc.lua: -------------------------------------------------------------------------------- 1 | local status, icons = pcall(require, "nvim-web-devicons") 2 | if (not status) then return end 3 | 4 | icons.setup { 5 | -- your personnal icons can go here (to override) 6 | -- DevIcon will be appended to `name` 7 | override = { 8 | }, 9 | -- globally enable default icons (default to false) 10 | -- will get overriden by `get_icons` option 11 | default = true 12 | } 13 | -------------------------------------------------------------------------------- /plugin/lspsaga.rc.lua: -------------------------------------------------------------------------------- 1 | local status, saga = pcall(require, "lspsaga") 2 | if (not status) then return end 3 | 4 | saga.init_lsp_saga { 5 | server_filetype_map = { 6 | typescript = 'typescript' 7 | } 8 | } 9 | 10 | local opts = { noremap = true, silent = true } 11 | vim.keymap.set('n', '', 'Lspsaga diagnostic_jump_next', opts) 12 | vim.keymap.set('n', 'K', 'Lspsaga hover_doc', opts) 13 | vim.keymap.set('n', 'gd', 'Lspsaga lsp_finder', opts) 14 | vim.keymap.set('i', '', 'Lspsaga signature_help', opts) 15 | vim.keymap.set('n', 'gp', 'Lspsaga preview_definition', opts) 16 | vim.keymap.set('n', 'gr', 'Lspsaga rename', opts) 17 | -------------------------------------------------------------------------------- /lua/amyjuanli/maps.lua: -------------------------------------------------------------------------------- 1 | local keymap = vim.keymap 2 | 3 | keymap.set('n', 'x', '"_x') 4 | 5 | -- Increment/decrement 6 | keymap.set('n', '+', '') 7 | keymap.set('n', '-', '') 8 | 9 | -- Select all 10 | keymap.set('n', '', 'ggG') 11 | 12 | -- New tab 13 | keymap.set('n', 'te', ':tabedit') 14 | 15 | -- Split window 16 | keymap.set('n', 'ss', ':splitw') 17 | keymap.set('n', 'sv', ':vsplitw') 18 | -- Move window 19 | keymap.set('n', '', 'w') 20 | keymap.set('', 'sh', 'h') 21 | keymap.set('', 'sk', 'k') 22 | keymap.set('', 'sj', 'j') 23 | keymap.set('', 'sl', 'l') 24 | -- Resize window 25 | keymap.set('n', '', '<') 26 | keymap.set('n', '', '>') 27 | keymap.set('n', '', '+') 28 | keymap.set('n', '', '-') 29 | -------------------------------------------------------------------------------- /after/plugin/treesitter.rc.lua: -------------------------------------------------------------------------------- 1 | local status, ts = pcall(require, "nvim-treesitter.configs") 2 | if (not status) then return end 3 | 4 | ts.setup { 5 | highlight = { 6 | enable = true, 7 | disable = {}, 8 | }, 9 | indent = { 10 | enable = true, 11 | disable = {}, 12 | }, 13 | ensure_installed = { 14 | "tsx", 15 | "fish", 16 | "json", 17 | "yaml", 18 | "css", 19 | "html", 20 | "lua", 21 | "markdown", 22 | "markdown_inline", 23 | "python", 24 | "graphql", 25 | "regex", 26 | "typescript", 27 | "javascript", 28 | }, 29 | --- Automatically install missing parsers when entering buffer 30 | auto_install = true, 31 | 32 | autotag = { 33 | enable = true, 34 | }, 35 | } 36 | 37 | local parser_config = require "nvim-treesitter.parsers".get_parser_configs() 38 | parser_config.tsx.filetype_to_parsername = { "javascript", "typescript.tsx" } 39 | -------------------------------------------------------------------------------- /after/plugin/bufferline.rc.lua: -------------------------------------------------------------------------------- 1 | local status, bufferline = pcall(require, "bufferline") 2 | if (not status) then return end 3 | 4 | bufferline.setup({ 5 | options = { 6 | mode = "tabs", 7 | separator_style = 'slant', 8 | always_show_bufferline = false, 9 | show_buffer_close_icons = false, 10 | show_close_icon = false, 11 | color_icons = true 12 | }, 13 | highlights = { 14 | separator = { 15 | fg = '#073642', 16 | bg = '#002b36', 17 | }, 18 | separator_selected = { 19 | fg = '#073642', 20 | }, 21 | background = { 22 | fg = '#657b83', 23 | bg = '#002b36' 24 | }, 25 | buffer_selected = { 26 | fg = '#fdf6e3', 27 | bold = true, 28 | }, 29 | fill = { 30 | bg = '#073642' 31 | } 32 | }, 33 | }) 34 | 35 | vim.keymap.set('n', '', 'BufferLineCycleNext', {}) 36 | vim.keymap.set('n', '', 'BufferLineCyclePrev', {}) 37 | -------------------------------------------------------------------------------- /after/plugin/cmp.rc.lua: -------------------------------------------------------------------------------- 1 | local status, cmp = pcall(require, "cmp") 2 | if (not status) then return end 3 | local lspkind = require 'lspkind' 4 | 5 | cmp.setup({ 6 | snippet = { 7 | expand = function(args) 8 | require('luasnip').lsp_expand(args.body) 9 | end, 10 | }, 11 | mapping = cmp.mapping.preset.insert({ 12 | [''] = cmp.mapping.scroll_docs(-4), 13 | [''] = cmp.mapping.scroll_docs(4), 14 | [''] = cmp.mapping.complete(), 15 | [''] = cmp.mapping.close(), 16 | [''] = cmp.mapping.confirm({ 17 | behavior = cmp.ConfirmBehavior.Replace, 18 | select = true 19 | }), 20 | }), 21 | sources = cmp.config.sources({ 22 | { name = 'nvim_lsp' }, 23 | { name = 'buffer' }, 24 | }), 25 | formatting = { 26 | format = lspkind.cmp_format({ with_text = false, maxwidth = 50 }) 27 | } 28 | }) 29 | 30 | vim.cmd [[ 31 | set completeopt=menuone,noinsert,noselect 32 | highlight! default link CmpItemKind CmpItemMenuDefault 33 | ]] 34 | -------------------------------------------------------------------------------- /after/plugin/lspkind.rc.lua: -------------------------------------------------------------------------------- 1 | local status, lspkind = pcall(require, "lspkind") 2 | if (not status) then return end 3 | 4 | lspkind.init({ 5 | -- enables text annotations 6 | -- 7 | -- default: true 8 | mode = 'symbol', 9 | 10 | -- default symbol map 11 | -- can be either 'default' (requires nerd-fonts font) or 12 | -- 'codicons' for codicon preset (requires vscode-codicons font) 13 | -- 14 | -- default: 'default' 15 | preset = 'codicons', 16 | 17 | -- override preset symbols 18 | -- 19 | -- default: {} 20 | symbol_map = { 21 | Text = "", 22 | Method = "", 23 | Function = "", 24 | Constructor = "", 25 | Field = "ﰠ", 26 | Variable = "", 27 | Class = "ﴯ", 28 | Interface = "", 29 | Module = "", 30 | Property = "ﰠ", 31 | Unit = "塞", 32 | Value = "", 33 | Enum = "", 34 | Keyword = "", 35 | Snippet = "", 36 | Color = "", 37 | File = "", 38 | Reference = "", 39 | Folder = "", 40 | EnumMember = "", 41 | Constant = "", 42 | Struct = "פּ", 43 | Event = "", 44 | Operator = "", 45 | TypeParameter = "" 46 | }, 47 | }) 48 | -------------------------------------------------------------------------------- /plugin/null-ls.rc.lua: -------------------------------------------------------------------------------- 1 | local status, null_ls = pcall(require, "null-ls") 2 | if (not status) then return end 3 | 4 | local diagnostics = null_ls.builtins.diagnostics 5 | local formatting = null_ls.builtins.formatting 6 | local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) 7 | local augroup_format = vim.api.nvim_create_augroup("Format", { clear = true }) 8 | 9 | null_ls.setup({ 10 | sources = { 11 | null_ls.builtins.diagnostics.eslint_d.with({ 12 | diagnostics_format = '[eslint]\n #{m}\n(#{c})' 13 | }), 14 | null_ls.builtins.diagnostics.fish, 15 | formatting.prettier, 16 | }, 17 | on_attach = function(client, bufnr) 18 | if client.server_capabilities.documentFormattingProvider then 19 | vim.api.nvim_clear_autocmds { buffer = bufnr, group = augroup_format } 20 | vim.api.nvim_create_autocmd("BufWritePre", { 21 | group = augroup_format, 22 | -- buffer = 0, 23 | callback = function() 24 | vim.lsp.buf.formatting_seq_sync() 25 | end 26 | }) 27 | end 28 | end, 29 | }) 30 | 31 | -- Auto commands 32 | vim.cmd([[ autocmd BufWritePre lua vim.lsp.buf.formatting_sync() ]]) 33 | -------------------------------------------------------------------------------- /after/plugin/lualine.rc.lua: -------------------------------------------------------------------------------- 1 | local status, lualine = pcall(require, "lualine") 2 | if (not status) then return end 3 | 4 | lualine.setup { 5 | options = { 6 | icons_enabled = true, 7 | theme = 'solarized_dark', 8 | section_separators = { left = '', right = '' }, 9 | component_separators = { left = '', right = '' }, 10 | disabled_filetypes = {} 11 | }, 12 | sections = { 13 | lualine_a = { 'mode' }, 14 | lualine_b = { 'branch' }, 15 | lualine_c = { { 16 | 'filename', 17 | file_status = true, -- displays file status (readonly status, modified status) 18 | path = 0 -- 0 = just filename, 1 = relative path, 2 = absolute path 19 | } }, 20 | lualine_x = { 21 | { 'diagnostics', sources = { "nvim_diagnostic" }, symbols = { error = ' ', warn = ' ', info = ' ', 22 | hint = ' ' } }, 23 | 'encoding', 24 | 'filetype' 25 | }, 26 | lualine_y = { 'progress' }, 27 | lualine_z = { 'location' } 28 | }, 29 | inactive_sections = { 30 | lualine_a = {}, 31 | lualine_b = {}, 32 | lualine_c = { { 33 | 'filename', 34 | file_status = true, -- displays file status (readonly status, modified status) 35 | path = 1 -- 0 = just filename, 1 = relative path, 2 = absolute path 36 | } }, 37 | lualine_x = { 'location' }, 38 | lualine_y = {}, 39 | lualine_z = {} 40 | }, 41 | tabline = {}, 42 | extensions = { 'fugitive' } 43 | } 44 | -------------------------------------------------------------------------------- /after/plugin/neosolarized.rc.lua: -------------------------------------------------------------------------------- 1 | local status, n = pcall(require, "neosolarized") 2 | if (not status) then return end 3 | 4 | n.setup({ 5 | comment_italics = true, 6 | }) 7 | 8 | local cb = require('colorbuddy.init') 9 | local Color = cb.Color 10 | local colors = cb.colors 11 | local Group = cb.Group 12 | local groups = cb.groups 13 | local styles = cb.styles 14 | 15 | Color.new('black', '#000000') 16 | Group.new('CursorLine', colors.none, colors.base03, styles.NONE, colors.base1) 17 | Group.new('CursorLineNr', colors.yellow, colors.black, styles.NONE, colors.base1) 18 | Group.new('Visual', colors.none, colors.base03, styles.reverse) 19 | 20 | local cError = groups.Error.fg 21 | local cInfo = groups.Information.fg 22 | local cWarn = groups.Warning.fg 23 | local cHint = groups.Hint.fg 24 | 25 | Group.new("DiagnosticVirtualTextError", cError, cError:dark():dark():dark():dark(), styles.NONE) 26 | Group.new("DiagnosticVirtualTextInfo", cInfo, cInfo:dark():dark():dark(), styles.NONE) 27 | Group.new("DiagnosticVirtualTextWarn", cWarn, cWarn:dark():dark():dark(), styles.NONE) 28 | Group.new("DiagnosticVirtualTextHint", cHint, cHint:dark():dark():dark(), styles.NONE) 29 | Group.new("DiagnosticUnderlineError", colors.none, colors.none, styles.undercurl, cError) 30 | Group.new("DiagnosticUnderlineWarn", colors.none, colors.none, styles.undercurl, cWarn) 31 | Group.new("DiagnosticUnderlineInfo", colors.none, colors.none, styles.undercurl, cInfo) 32 | Group.new("DiagnosticUnderlineHint", colors.none, colors.none, styles.undercurl, cHint) 33 | -------------------------------------------------------------------------------- /lua/amyjuanli/options.lua: -------------------------------------------------------------------------------- 1 | -- vim.cmd("autocmd!") 2 | 3 | vim.scriptencoding = 'utf-8' 4 | 5 | local opt=vim.opt 6 | opt.encoding = 'utf-8' 7 | opt.fileencoding = 'utf-8' 8 | 9 | vim.wo.number = true -- show window line numbers 10 | 11 | opt.title = true 12 | opt.autoindent = true 13 | opt.smartindent = true 14 | opt.hlsearch = true 15 | opt.backup = false 16 | opt.showcmd = true 17 | opt.cmdheight = 1 18 | opt.laststatus = 2 19 | opt.expandtab = true 20 | opt.scrolloff = 10 21 | opt.shell = 'fish' 22 | opt.backupskip = { '/tmp/*', '/private/tmp/*' } 23 | opt.inccommand = 'split' 24 | opt.ignorecase = true -- Case insensitive searching UNLESS /C or capital in search 25 | opt.smarttab = true 26 | opt.breakindent = true 27 | opt.linebreak = true -- Stop words being broken on wrap 28 | opt.shiftwidth = 2 29 | opt.tabstop = 2 30 | opt.wrap = true 31 | opt.backspace = { 'start', 'eol', 'indent' } 32 | opt.path:append { '**' } -- Finding files - Search down into subfolders 33 | opt.wildignore:append { '*/node_modules/*' } 34 | opt.mouse='a' -- Allow the use of mouse 35 | 36 | -- Color 37 | opt.cursorline = true 38 | opt.termguicolors = true 39 | opt.winblend = 0 40 | opt.wildoptions = 'pum' 41 | opt.pumblend = 5 42 | opt.background = 'dark' 43 | 44 | -- Undercurl 45 | -- vim.cmd([[let &t_Cs = "\e[4:3m"]]) 46 | -- vim.cmd([[let &t_Ce = "\e[4:0m"]]) 47 | 48 | -- Turn off paste mode when leaving insert 49 | vim.api.nvim_create_autocmd("InsertLeave", { 50 | pattern = '*', 51 | command = "set nopaste" 52 | }) 53 | 54 | -- Add asterisks in block comments 55 | opt.formatoptions:append { 'r' } 56 | 57 | opt.clipboard:append { 'unnamedplus' } 58 | -------------------------------------------------------------------------------- /after/plugin/toggleterm.rc.lua: -------------------------------------------------------------------------------- 1 | local status_ok, toggleterm = pcall(require, 'toggleterm') 2 | if not status_ok then 3 | return 4 | end 5 | 6 | toggleterm.setup({ 7 | size = 20, 8 | open_mapping = [[]], 9 | hide_numbers = true, 10 | shade_filetypes = {}, 11 | shade_terminals = true, 12 | shading_factor = 2, 13 | start_in_insert = true, 14 | insert_mappings = true, 15 | persiste_size = true, 16 | direction = "float", -- 'vertical' | 'horizontal' | 'tab' | 'float' 17 | close_on_exit = true, 18 | shell = vim.o.shell, 19 | float_opts = { 20 | border = "curved", 21 | winblend = 0, 22 | highlights = { 23 | border = "Normal", 24 | background = "Normal", 25 | }, 26 | }, 27 | }) 28 | 29 | function _G.set_terminal_keymaps() 30 | local opts = { buffer = 0 } 31 | vim.keymap.set('t', '', [[]], opts) 32 | vim.keymap.set('t', 'jk', [[]], opts) 33 | vim.keymap.set('t', '', [[wincmd h]], opts) 34 | vim.keymap.set('t', '', [[wincmd j]], opts) 35 | vim.keymap.set('t', '', [[wincmd k]], opts) 36 | vim.keymap.set('t', '', [[wincmd l]], opts) 37 | end 38 | 39 | -- if you only want these mappings for toggle term use term://*toggleterm#* instead 40 | vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()') 41 | 42 | local Terminal = require("toggleterm.terminal").Terminal 43 | local lazygit = Terminal:new({ cmd = "lazygit", hidden = true }) 44 | local node = Terminal:new({ cmd = "node", hidden = true }) 45 | 46 | function _LAZYGIT_TOGGLE() 47 | lazygit:toggle() 48 | end 49 | 50 | function _NODE_TOGGLE() 51 | node:toggle() 52 | end 53 | -------------------------------------------------------------------------------- /after/plugin/telescope.rc.lua: -------------------------------------------------------------------------------- 1 | local status, telescope = pcall(require, "telescope") 2 | if (not status) then return end 3 | local actions = require('telescope.actions') 4 | local builtin = require("telescope.builtin") 5 | 6 | local function telescope_buffer_dir() 7 | return vim.fn.expand('%:p:h') 8 | end 9 | 10 | local fb_actions = require "telescope".extensions.file_browser.actions 11 | 12 | telescope.setup { 13 | defaults = { 14 | mappings = { 15 | n = { 16 | ["q"] = actions.close 17 | }, 18 | }, 19 | }, 20 | extensions = { 21 | file_browser = { 22 | theme = "ivy", 23 | hijack_netrw = true, 24 | mappings = { 25 | -- your custom insert mode mappings 26 | ["i"] = { 27 | [""] = function() vim.cmd('normal vbd') end, 28 | }, 29 | ["n"] = { 30 | -- your custom normal mode mappings 31 | -- ["N"] = fb_actions.create, 32 | -- ["h"] = fb_actions.goto_parent_dir, 33 | ["/"] = function() 34 | vim.cmd('startinsert') 35 | end 36 | }, 37 | }, 38 | }, 39 | }, 40 | } 41 | 42 | 43 | vim.keymap.set('n', 'ff', 44 | function() 45 | builtin.find_files({ 46 | no_ignore = false, 47 | hidden = true 48 | }) 49 | end) 50 | vim.keymap.set('n', 'fg', function() 51 | builtin.live_grep() 52 | end) 53 | vim.keymap.set('n', 'fb', function() 54 | builtin.buffers() 55 | end) 56 | vim.keymap.set('n', 'fh', function() 57 | builtin.help_tags() 58 | end) 59 | -- vim.keymap.set('n', ';;', function() 60 | -- builtin.resume() 61 | -- end) 62 | -- vim.keymap.set('n', ';e', function() 63 | -- builtin.diagnostics() 64 | -- end) 65 | 66 | -- Load telescope-file-browser 67 | telescope.load_extension("file_browser") 68 | vim.keymap.set("n", "fb", function() 69 | telescope.extensions.file_browser.file_browser({ 70 | path = "%:p:h", 71 | cwd = telescope_buffer_dir(), 72 | respect_gitignore = false, 73 | hidden = true, 74 | grouped = true, 75 | -- previewer = false, 76 | initial_mode = "normal", 77 | -- layout_config = { height = 40 } 78 | }) 79 | end) 80 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Config Neovim in Lua 3 | Neovim-based text editor is a big part of my workflow as a developer. I will keep improving it to fit future projects. 4 | 5 | --- 6 | **Demo the Inline Diagnostics in Hover Window Provided by nvim-lspconfig Plugin** 7 | ![1_qC1md6d-XMzci9wNCw79yw](https://user-images.githubusercontent.com/93111441/195991340-32713056-2500-4f2e-bd03-4ad845b10f5d.gif) 8 | 9 | **Demo the Highly Performant LSP UI Provided by Lspsaga Plugin** 10 | ![lspsaga-tsx-keystrokes](https://user-images.githubusercontent.com/93111441/195991360-6d2949d0-39ae-4c0a-b2b9-2f93e475c6fd.gif) 11 | 12 | --- 13 | ## Neovim Plugins 14 | Requirements: Neovim | Lua 15 | 16 | - [packer](https://github.com/wbthomason/packer.nvim) - A plugin/package manager for neovim 17 | 18 | - [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter) 19 | 20 | - [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig) - A collection of configurations for Neovim's built-in LSP 21 | 22 | - [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) - A completion plugin for neovim coded in Lua 23 | 24 | - [lspsaga](https://github.com/glepnir/lspsaga.nvim) - LSP UI 25 | 26 | - [nvim-lsp-installer](https://github.com/williamboman/nvim-lsp-installer) 27 | 28 | - [telescope](https://github.com/nvim-telescope/telescope.nvim) - A fuzzy finder 29 | 30 | - [telescope-file-browser](https://github.com/nvim-telescope/telescope-file-browser.nvim) - A file extension for telescope 31 | 32 | --- 33 | ## How to use 34 | ### Install Neovim 35 | For Mac Users: 36 | ```bash 37 | brew install neovim 38 | ``` 39 | ### Download or Clone This Repo 40 | - Download or `git clone` this repo 41 | - Copy all the files, subdirectories of this repo to `~/.config/nvim` folder. 42 | 43 | --- 44 | ## Relevant Articles From My Medium Blog 45 | 1. [How I Learned to Love Vim and Transit from VS Code to a Vim-Terminal in a Month](https://amy-juan-li.medium.com/how-i-learned-to-love-vim-9b7fe53a4615) 46 | 2. [A Step-by-Step Guide to Configuring LSP in Neovim for Coding in Next.js (React), TypeScript, and TailWindCSS](https://amy-juan-li.medium.com/a-step-by-step-guide-to-configuring-lsp-in-neovim-for-coding-in-next-js-a052f500da2) 47 | 3. [Set Up a Next.js Application Workflow Using Neovim, TypeScript, and TailwindCSS](https://blog.devgenius.io/set-up-a-next-js-application-workflow-using-neovim-typescript-tailwind-23621a34ed38) 48 | 49 | --- 50 | ## About me 51 | - [Medium Blog](https://amy-juan-li.medium.com/) - Another blog platform. 52 | - [eBook: Become a software developer without computer science degree](https://amyjuanli.gumroad.com/l/wplun) 53 | - [SkillShare Class: Empower your life by becoming a software developer without a computer science degree.](https://www.skillshare.com/classes/Empower-your-life-Become-a-software-developer-without-a-CS-degree/1243883176) 54 | 55 | --- 56 | ## Useful Sources and Links 57 | I am inspired by Takuya Matsuyama and the beautiful workflow used by his coding projects. Actually I borrow many of his code to build up my current Neovim-based workflow. So Please check out his public repo - [craftzdog/dotfiles-public](https://github.com/craftzdog/dotfiles-public), as well as his YouTube videos for more detail. 58 | -------------------------------------------------------------------------------- /lua/amyjuanli/plugins.lua: -------------------------------------------------------------------------------- 1 | -- local fn = vim.fn 2 | -- local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim" 3 | -- if fn.empty(fn.glob(install_path)) > 0 then 4 | -- packer_bootstrap = fn.system({ 5 | -- "git", 6 | -- "clone", 7 | -- "--depth", 8 | -- "1", 9 | -- "https://github.com/wbthomason/packer.nvim", 10 | -- install_path, 11 | -- }) 12 | -- end 13 | 14 | local status, packer = pcall(require, "packer") 15 | if (not status) then 16 | print("Packer is not installed") 17 | return 18 | end 19 | -- vim.api.nvim_command("packadd packer.nvim") 20 | vim.cmd [[packadd packer.nvim]] 21 | 22 | packer.startup(function(use) 23 | use 'wbthomason/packer.nvim' 24 | 25 | use 'nvim-lua/plenary.nvim' -- Common utilities 26 | 27 | -- Color Scheme 28 | use { 29 | 'svrana/neosolarized.nvim', 30 | requires = { 'tjdevries/colorbuddy.nvim' } 31 | } 32 | use 'norcalli/nvim-colorizer.lua' 33 | use 'nvim-lualine/lualine.nvim' -- Statusline 34 | use { 35 | 'nvim-treesitter/nvim-treesitter', 36 | run = ':TSUpdate' 37 | } 38 | use 'kyazdani42/nvim-web-devicons' -- File icons 39 | 40 | -- Completions 41 | -- use({ 42 | -- "hrsh7th/nvim-cmp", 43 | -- requires = { 44 | -- { "hrsh7th/cmp-nvim-lsp" }, -- nvim-cmp source for neovim's built-in LSP 45 | -- { "hrsh7th/cmp-nvim-lua" }, 46 | -- { "hrsh7th/cmp-buffer" }, -- nvim-cmp source for buffer words 47 | -- { "hrsh7th/cmp-path" }, 48 | -- { "hrsh7th/cmp-cmdline" }, 49 | -- { "hrsh7th/vim-vsnip" }, 50 | -- { "hrsh7th/cmp-vsnip" }, 51 | -- { "hrsh7th/vim-vsnip-integ" }, 52 | -- { "hrsh7th/cmp-calc" }, 53 | -- { "rafamadriz/friendly-snippets" }, 54 | -- }, 55 | -- }) 56 | use 'hrsh7th/cmp-buffer' -- nvim-cmp source for buffer words 57 | use 'hrsh7th/cmp-nvim-lsp' -- nvim-cmp source for neovim's built-in LSP 58 | use 'hrsh7th/nvim-cmp' -- Completion 59 | use 'windwp/nvim-autopairs' 60 | use 'windwp/nvim-ts-autotag' 61 | 62 | -- LSP 63 | use 'onsails/lspkind-nvim' -- vscode-like pictograms 64 | use 'neovim/nvim-lspconfig' -- LSP 65 | use 'jose-elias-alvarez/null-ls.nvim' -- Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua 66 | use 'MunifTanjim/prettier.nvim' -- Prettier plugin for Neovim's built-in LSP client 67 | use 'williamboman/mason.nvim' 68 | use 'williamboman/mason-lspconfig.nvim' 69 | use 'princejoogie/tailwind-highlight.nvim' 70 | use 'glepnir/lspsaga.nvim' -- LSP UIs 71 | use 'L3MON4D3/LuaSnip' 72 | 73 | 74 | -- Toggle Terminal 75 | use 'akinsho/toggleterm.nvim' 76 | 77 | -- File Search 78 | use { 79 | 'nvim-telescope/telescope.nvim', tag = '0.1.0', 80 | requires = { { 'nvim-lua/plenary.nvim' } } 81 | } 82 | -- use({ 83 | -- "nvim-telescope/telescope.nvim", 84 | -- requires = { "nvim-lua/popup.nvim", "nvim-lua/plenary.nvim" }, 85 | -- cmd = "Telescope", 86 | -- }) 87 | 88 | use 'nvim-telescope/telescope-file-browser.nvim' 89 | 90 | use 'folke/zen-mode.nvim' 91 | use({ 92 | "iamcco/markdown-preview.nvim", 93 | run = function() vim.fn["mkdp#util#install"]() end, 94 | }) 95 | use 'akinsho/nvim-bufferline.lua' 96 | 97 | -- Git 98 | -- use 'github/copilot.vim' 99 | use 'lewis6991/gitsigns.nvim' 100 | use 'dinhhuy258/git.nvim' -- For git blame & browse 101 | end) 102 | -------------------------------------------------------------------------------- /plugin/lspconfig.lua: -------------------------------------------------------------------------------- 1 | local status, nvim_lsp = pcall(require, "lspconfig") 2 | if (not status) then return end 3 | 4 | local protocol = require('vim.lsp.protocol') 5 | 6 | local augroup_format = vim.api.nvim_create_augroup("Format", { clear = true }) 7 | local enable_format_on_save = function(_, bufnr) 8 | vim.api.nvim_clear_autocmds({ group = augroup_format, buffer = bufnr }) 9 | vim.api.nvim_create_autocmd("BufWritePre", { 10 | group = augroup_format, 11 | buffer = bufnr, 12 | callback = function() 13 | vim.lsp.buf.format({ bufnr = bufnr }) 14 | end, 15 | }) 16 | end 17 | 18 | -- Use an on_attach function to only map the following keys 19 | -- after the language server attaches to the current buffer 20 | local on_attach = function(client, bufnr) 21 | local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end 22 | 23 | --Enable completion triggered by 24 | --local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end 25 | --buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') 26 | 27 | -- Mappings. 28 | local opts = { noremap = true, silent = true } 29 | 30 | -- See `:help vim.lsp.*` for documentation on any of the below functions 31 | buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) 32 | --buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) 33 | buf_set_keymap('n', 'gi', 'lua vim.lsp.buf.implementation()', opts) 34 | --buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) 35 | vim.api.nvim_create_autocmd("CursorHold", { 36 | buffer = bufnr, 37 | callback = function() 38 | local opts_ = { 39 | focusable = false, 40 | close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" }, 41 | border = 'rounded', 42 | source = 'always', 43 | prefix = ' ', 44 | scope = 'cursor', 45 | } 46 | vim.diagnostic.open_float(nil, opts_) 47 | end 48 | }) 49 | end 50 | 51 | protocol.CompletionItemKind = { 52 | '', -- Text 53 | '', -- Method 54 | '', -- Function 55 | '', -- Constructor 56 | '', -- Field 57 | '', -- Variable 58 | '', -- Class 59 | 'ﰮ', -- Interface 60 | '', -- Module 61 | '', -- Property 62 | '', -- Unit 63 | '', -- Value 64 | '', -- Enum 65 | '', -- Keyword 66 | '﬌', -- Snippet 67 | '', -- Color 68 | '', -- File 69 | '', -- Reference 70 | '', -- Folder 71 | '', -- EnumMember 72 | '', -- Constant 73 | '', -- Struct 74 | '', -- Event 75 | 'ﬦ', -- Operator 76 | '', -- TypeParameter 77 | } 78 | 79 | -- Set up completion using nvim_cmp with LSP source 80 | local capabilities = require('cmp_nvim_lsp').default_capabilities( 81 | vim.lsp.protocol.make_client_capabilities() 82 | ) 83 | 84 | nvim_lsp.flow.setup { 85 | on_attach = on_attach, 86 | capabilities = capabilities 87 | } 88 | 89 | nvim_lsp.tsserver.setup { 90 | on_attach = on_attach, 91 | filetypes = { "typescript", "typescriptreact", "typescript.tsx" }, 92 | cmd = { "typescript-language-server", "--stdio" }, 93 | capabilities = capabilities 94 | } 95 | 96 | nvim_lsp.sourcekit.setup { 97 | on_attach = on_attach, 98 | } 99 | 100 | nvim_lsp.sumneko_lua.setup { 101 | on_attach = function(client, bufnr) 102 | on_attach(client, bufnr) 103 | enable_format_on_save(client, bufnr) 104 | end, 105 | capabilities = capabilities, 106 | settings = { 107 | Lua = { 108 | diagnostics = { 109 | -- Get the language server to recognize the `vim` global 110 | globals = { 'vim' }, 111 | }, 112 | 113 | workspace = { 114 | -- Make the server aware of Neovim runtime files 115 | library = vim.api.nvim_get_runtime_file("", true), 116 | checkThirdParty = false 117 | }, 118 | }, 119 | }, 120 | } 121 | 122 | local tw_highlight = require('tailwind-highlight') 123 | nvim_lsp.tailwindcss.setup({ 124 | on_attach = function(client, bufnr) 125 | tw_highlight.setup(client, bufnr, { 126 | single_column = false, 127 | mode = 'background', 128 | debounce = 200, 129 | }) 130 | end, 131 | capabilities = capabilities 132 | }) 133 | 134 | 135 | vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( 136 | vim.lsp.diagnostic.on_publish_diagnostics, { 137 | underline = true, 138 | update_in_insert = false, 139 | virtual_text = { spacing = 4, prefix = "●" }, 140 | severity_sort = true, 141 | }) 142 | 143 | -- Show line diagnostics automatically in hover window 144 | vim.o.updatetime = 250 145 | vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] 146 | 147 | -- Diagnostic symbols in the sign column (gutter) 148 | local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } 149 | for type, icon in pairs(signs) do 150 | local hl = "DiagnosticSign" .. type 151 | vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) 152 | end 153 | 154 | vim.diagnostic.config({ 155 | virtual_text = { 156 | prefix = '●' 157 | }, 158 | update_in_insert = true, 159 | float = { 160 | source = "always", -- Or "if_many" 161 | }, 162 | }) 163 | -------------------------------------------------------------------------------- /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 = false 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/juanli/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/juanli/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/juanli/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/juanli/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" 53 | local install_cpath_pattern = "/Users/juanli/.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 | LuaSnip = { 78 | loaded = true, 79 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/LuaSnip", 80 | url = "https://github.com/L3MON4D3/LuaSnip" 81 | }, 82 | ["cmp-buffer"] = { 83 | loaded = true, 84 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/cmp-buffer", 85 | url = "https://github.com/hrsh7th/cmp-buffer" 86 | }, 87 | ["cmp-calc"] = { 88 | loaded = true, 89 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/cmp-calc", 90 | url = "https://github.com/hrsh7th/cmp-calc" 91 | }, 92 | ["cmp-cmdline"] = { 93 | loaded = true, 94 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/cmp-cmdline", 95 | url = "https://github.com/hrsh7th/cmp-cmdline" 96 | }, 97 | ["cmp-nvim-lsp"] = { 98 | loaded = true, 99 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp", 100 | url = "https://github.com/hrsh7th/cmp-nvim-lsp" 101 | }, 102 | ["cmp-nvim-lua"] = { 103 | loaded = true, 104 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/cmp-nvim-lua", 105 | url = "https://github.com/hrsh7th/cmp-nvim-lua" 106 | }, 107 | ["cmp-path"] = { 108 | loaded = true, 109 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/cmp-path", 110 | url = "https://github.com/hrsh7th/cmp-path" 111 | }, 112 | ["cmp-vsnip"] = { 113 | loaded = true, 114 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/cmp-vsnip", 115 | url = "https://github.com/hrsh7th/cmp-vsnip" 116 | }, 117 | ["colorbuddy.nvim"] = { 118 | loaded = true, 119 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/colorbuddy.nvim", 120 | url = "https://github.com/tjdevries/colorbuddy.nvim" 121 | }, 122 | ["friendly-snippets"] = { 123 | loaded = true, 124 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/friendly-snippets", 125 | url = "https://github.com/rafamadriz/friendly-snippets" 126 | }, 127 | ["git.nvim"] = { 128 | loaded = true, 129 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/git.nvim", 130 | url = "https://github.com/dinhhuy258/git.nvim" 131 | }, 132 | ["gitsigns.nvim"] = { 133 | loaded = true, 134 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/gitsigns.nvim", 135 | url = "https://github.com/lewis6991/gitsigns.nvim" 136 | }, 137 | ["lspkind-nvim"] = { 138 | loaded = true, 139 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/lspkind-nvim", 140 | url = "https://github.com/onsails/lspkind-nvim" 141 | }, 142 | ["lspsaga.nvim"] = { 143 | loaded = true, 144 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/lspsaga.nvim", 145 | url = "https://github.com/glepnir/lspsaga.nvim" 146 | }, 147 | ["lualine.nvim"] = { 148 | loaded = true, 149 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/lualine.nvim", 150 | url = "https://github.com/nvim-lualine/lualine.nvim" 151 | }, 152 | ["markdown-preview.nvim"] = { 153 | loaded = true, 154 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/markdown-preview.nvim", 155 | url = "https://github.com/iamcco/markdown-preview.nvim" 156 | }, 157 | ["mason-lspconfig.nvim"] = { 158 | loaded = true, 159 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim", 160 | url = "https://github.com/williamboman/mason-lspconfig.nvim" 161 | }, 162 | ["mason.nvim"] = { 163 | loaded = true, 164 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/mason.nvim", 165 | url = "https://github.com/williamboman/mason.nvim" 166 | }, 167 | ["neosolarized.nvim"] = { 168 | loaded = true, 169 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/neosolarized.nvim", 170 | url = "https://github.com/svrana/neosolarized.nvim" 171 | }, 172 | ["null-ls.nvim"] = { 173 | loaded = true, 174 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/null-ls.nvim", 175 | url = "https://github.com/jose-elias-alvarez/null-ls.nvim" 176 | }, 177 | ["nvim-autopairs"] = { 178 | load_after = {}, 179 | loaded = true, 180 | needs_bufread = false, 181 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/opt/nvim-autopairs", 182 | url = "https://github.com/windwp/nvim-autopairs" 183 | }, 184 | ["nvim-bufferline.lua"] = { 185 | loaded = true, 186 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/nvim-bufferline.lua", 187 | url = "https://github.com/akinsho/nvim-bufferline.lua" 188 | }, 189 | ["nvim-cmp"] = { 190 | loaded = true, 191 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/nvim-cmp", 192 | url = "https://github.com/hrsh7th/nvim-cmp" 193 | }, 194 | ["nvim-colorizer.lua"] = { 195 | loaded = true, 196 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/nvim-colorizer.lua", 197 | url = "https://github.com/norcalli/nvim-colorizer.lua" 198 | }, 199 | ["nvim-lspconfig"] = { 200 | loaded = true, 201 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", 202 | url = "https://github.com/neovim/nvim-lspconfig" 203 | }, 204 | ["nvim-treesitter"] = { 205 | loaded = true, 206 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/nvim-treesitter", 207 | url = "https://github.com/nvim-treesitter/nvim-treesitter" 208 | }, 209 | ["nvim-ts-autotag"] = { 210 | loaded = true, 211 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/nvim-ts-autotag", 212 | url = "https://github.com/windwp/nvim-ts-autotag" 213 | }, 214 | ["nvim-web-devicons"] = { 215 | loaded = true, 216 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/nvim-web-devicons", 217 | url = "https://github.com/kyazdani42/nvim-web-devicons" 218 | }, 219 | ["packer.nvim"] = { 220 | loaded = true, 221 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/packer.nvim", 222 | url = "https://github.com/wbthomason/packer.nvim" 223 | }, 224 | ["plenary.nvim"] = { 225 | loaded = true, 226 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/plenary.nvim", 227 | url = "https://github.com/nvim-lua/plenary.nvim" 228 | }, 229 | ["popup.nvim"] = { 230 | loaded = true, 231 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/popup.nvim", 232 | url = "https://github.com/nvim-lua/popup.nvim" 233 | }, 234 | ["prettier.nvim"] = { 235 | loaded = true, 236 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/prettier.nvim", 237 | url = "https://github.com/MunifTanjim/prettier.nvim" 238 | }, 239 | ["tailwind-highlight.nvim"] = { 240 | loaded = true, 241 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/tailwind-highlight.nvim", 242 | url = "https://github.com/princejoogie/tailwind-highlight.nvim" 243 | }, 244 | ["telescope-file-browser.nvim"] = { 245 | loaded = true, 246 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/telescope-file-browser.nvim", 247 | url = "https://github.com/nvim-telescope/telescope-file-browser.nvim" 248 | }, 249 | ["telescope.nvim"] = { 250 | commands = { "Telescope" }, 251 | loaded = false, 252 | needs_bufread = true, 253 | only_cond = false, 254 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/opt/telescope.nvim", 255 | url = "https://github.com/nvim-telescope/telescope.nvim" 256 | }, 257 | ["toggleterm.nvim"] = { 258 | loaded = true, 259 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/toggleterm.nvim", 260 | url = "https://github.com/akinsho/toggleterm.nvim" 261 | }, 262 | ["vim-vsnip"] = { 263 | loaded = true, 264 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/vim-vsnip", 265 | url = "https://github.com/hrsh7th/vim-vsnip" 266 | }, 267 | ["vim-vsnip-integ"] = { 268 | loaded = true, 269 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/vim-vsnip-integ", 270 | url = "https://github.com/hrsh7th/vim-vsnip-integ" 271 | }, 272 | ["zen-mode.nvim"] = { 273 | loaded = true, 274 | path = "/Users/juanli/.local/share/nvim/site/pack/packer/start/zen-mode.nvim", 275 | url = "https://github.com/folke/zen-mode.nvim" 276 | } 277 | } 278 | 279 | time([[Defining packer_plugins]], false) 280 | -- Load plugins in order defined by `after` 281 | time([[Sequenced loading]], true) 282 | vim.cmd [[ packadd nvim-cmp ]] 283 | vim.cmd [[ packadd nvim-autopairs ]] 284 | time([[Sequenced loading]], false) 285 | 286 | -- Command lazy-loads 287 | time([[Defining lazy-load commands]], true) 288 | pcall(vim.cmd, [[command -nargs=* -range -bang -complete=file Telescope lua require("packer.load")({'telescope.nvim'}, { cmd = "Telescope", l1 = , l2 = , bang = , args = , mods = "" }, _G.packer_plugins)]]) 289 | time([[Defining lazy-load commands]], false) 290 | 291 | 292 | _G._packer.inside_compile = false 293 | if _G._packer.needs_bufread == true then 294 | vim.cmd("doautocmd BufRead") 295 | end 296 | _G._packer.needs_bufread = false 297 | 298 | if should_profile then save_profiles() end 299 | 300 | end) 301 | 302 | if not no_errors then 303 | error_msg = error_msg:gsub('"', '\\"') 304 | vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') 305 | end 306 | --------------------------------------------------------------------------------