1 -- since this is just an example spec, don't actually load anything here and return an empty spec
3 if true then return {} end
5 -- every spec file under config.plugins will be loaded automatically by lazy.nvim
7 -- In your plugin files, you can:
9 -- * disable/enabled LazyVim plugins
10 -- * override the configuration of LazyVim plugins
13 { "ellisonleao/gruvbox.nvim" },
15 -- Configure LazyVim to load gruvbox
19 colorscheme = "gruvbox",
23 -- change trouble config
26 -- opts will be merged with the parent spec
27 opts = { use_diagnostic_signs = true },
31 { "folke/trouble.nvim", enabled = false },
33 -- add symbols-outline
35 "simrat39/symbols-outline.nvim",
36 cmd = "SymbolsOutline",
37 keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
41 -- override nvim-cmp and add cmp-emoji
44 dependencies = { "hrsh7th/cmp-emoji" },
45 ---@param opts cmp.ConfigSchema
46 opts = function(_, opts)
47 local cmp = require("cmp")
48 opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } }))
52 -- change some telescope options and a keymap to browse plugin files
54 "nvim-telescope/telescope.nvim",
56 -- add a keymap to browse plugin files
60 function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
61 desc = "Find Plugin File",
64 -- change some options
67 layout_strategy = "horizontal",
68 layout_config = { prompt_position = "top" },
69 sorting_strategy = "ascending",
75 -- add telescope-fzf-native
79 "nvim-telescope/telescope-fzf-native.nvim",
82 require("telescope").load_extension("fzf")
87 -- add pyright to lspconfig
89 "neovim/nvim-lspconfig",
90 ---@class PluginLspOpts
92 ---@type lspconfig.options
94 -- pyright will be automatically installed with mason and loaded with lspconfig
100 -- add tsserver and setup with typescript.nvim instead of lspconfig
102 "neovim/nvim-lspconfig",
104 "jose-elias-alvarez/typescript.nvim",
106 require("lazyvim.util").on_attach(function(_, buffer)
108 vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
109 vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
113 ---@class PluginLspOpts
115 ---@type lspconfig.options
117 -- tsserver will be automatically installed with mason and loaded with lspconfig
120 -- you can do any additional lsp server setup here
121 -- return true if you don't want this server to be setup with lspconfig
122 ---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
124 -- example to setup with typescript.nvim
125 tsserver = function(_, opts)
126 require("typescript").setup({ server = opts })
129 -- Specify * to use this function as a fallback for any server
130 -- ["*"] = function(server, opts) end,
135 -- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
136 -- treesitter, mason and typescript.nvim. So instead of the above, you can use:
137 { import = "lazyvim.plugins.extras.lang.typescript" },
139 -- add more treesitter parsers
141 "nvim-treesitter/nvim-treesitter",
163 -- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
164 -- would overwrite `ensure_installed` with the new value.
165 -- If you'd rather extend the default config, use the code below instead:
167 "nvim-treesitter/nvim-treesitter",
168 opts = function(_, opts)
169 -- add tsx and treesitter
170 vim.list_extend(opts.ensure_installed, {
177 -- the opts function can also be used to change the default opts:
179 "nvim-lualine/lualine.nvim",
181 opts = function(_, opts)
182 table.insert(opts.sections.lualine_x, "😄")
186 -- or you can return new options to override all the defaults
188 "nvim-lualine/lualine.nvim",
192 --[[add your custom lualine config here]]
197 -- use mini.starter instead of alpha
198 { import = "lazyvim.plugins.extras.ui.mini-starter" },
200 -- add jsonls and schemastore ans setup treesitter for json, json5 and jsonc
201 { import = "lazyvim.plugins.extras.lang.json" },
203 -- add any tools you want to have installed below
205 "williamboman/mason.nvim",
216 -- Use <tab> for completion and snippets (supertab)
217 -- first: disable default <tab> and <s-tab> behavior in LuaSnip
224 -- then: setup supertab in cmp
230 ---@param opts cmp.ConfigSchema
231 opts = function(_, opts)
232 local has_words_before = function()
233 unpack = unpack or table.unpack
234 local line, col = unpack(vim.api.nvim_win_get_cursor(0))
235 return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
238 local luasnip = require("luasnip")
239 local cmp = require("cmp")
241 opts.mapping = vim.tbl_extend("force", opts.mapping, {
242 ["<Tab>"] = cmp.mapping(function(fallback)
243 if cmp.visible() then
244 cmp.select_next_item()
245 -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
246 -- they way you will only jump inside the snippet region
247 elseif luasnip.expand_or_jumpable() then
248 luasnip.expand_or_jump()
249 elseif has_words_before() then
255 ["<S-Tab>"] = cmp.mapping(function(fallback)
256 if cmp.visible() then
257 cmp.select_prev_item()
258 elseif luasnip.jumpable(-1) then