PageSourceSearch

https://www.lazyvim.org/assets/js/4a588e30.80ed4e24.js

js lazyvim.org collected 2026-10-03 21:21:42 UTC 10,004 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunklazyvim=self.webpackChunklazyvim||[]).push([[767],{3905:(e,n,t)=>{t.d(n,{Zo:()=>u,kt:()=>g});var a=t(7294);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function r(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?l(Object(t),!0).forEach((function(n){i(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}function s(e,n){if(null==e)return{};var t,a,i=function(e,n){if(null==e)return{};var t,a,i={},l=Object.keys(e);for(a=0;a<l.length;a++)t=l[a],n.indexOf(t)>=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)t=l[a],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var o=a.createContext({}),p=function(e){var n=a.useContext(o),t=n;return e&&(t="function"==typeof e?e(n):r(r({},n),e)),t},u=function(e){var n=p(e.components);return a.createElement(o.Provider,{value:n},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},c=a.forwardRef((function(e,n){var t=e.components,i=e.mdxType,l=e.originalType,o=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),d=p(t),c=i,g=d["".concat(o,".").concat(c)]||d[c]||m[c]||l;return t?a.createElement(g,r(r({ref:n},u),{},{components:t})):a.createElement(g,r({ref:n},u))}));function g(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var l=t.length,r=new Array(l);r[0]=c;var s={};for(var o in n)hasOwnProperty.call(n,o)&&(s[o]=n[o]);s.originalType=e,s[d]="string"==typeof e?e:i,r[1]=s;for(var p=2;p<l;p++)r[p]=t[p];return a.createElement.apply(null,r)}return a.createElement.apply(null,t)}c.displayName="MDXCreateElement"},4998:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>o,contentTitle:()=>r,default:()=>d,frontMatter:()=>l,metadata:()=>s,toc:()=>p});var a=t(7462),i=(t(7294),t(3905));const l={sidebar_position:3},r="Plugins",s={unversionedId:"configuration/plugins",id:"configuration/plugins",title:"Plugins",description:"Configuring LazyVim plugins is exactly the same as using lazy.nvim to build",source:"@site/docs/configuration/plugins.md",sourceDirName:"configuration",slug:"/configuration/plugins",permalink:"/configuration/plugins",draft:!1,editUrl:"https://github.com/LazyVim/lazyvim.github.io/tree/main/docs/configuration/plugins.md",tags:[],version:"current",sidebarPosition:3,frontMatter:{sidebar_position:3},sidebar:"tutorialSidebar",previous:{title:"General Settings",permalink:"/configuration/general"},next:{title:"Keymaps",permalink:"/configuration/keymaps"}},o={},p=[{value:"\u2795 Adding Plugins",id:"-adding-plugins",level:2},{value:"\u274c Disabling Plugins",id:"-disabling-plugins",level:2},{value:"\u270f\ufe0f Customizing Plugin Specs",id:"\ufe0f-customizing-plugin-specs",level:2},{value:"\u2328\ufe0f Adding &amp; Disabling Plugin Keymaps",id:"\ufe0f-adding--disabling-plugin-keymaps",level:2}],u={toc:p};function d(e){let{components:n,...t}=e;return(0,i.kt)("wrapper",(0,a.Z)({},u,t,{components:n,mdxType:"MDXLayout"}),(0,i.kt)("h1",{id:"plugins"},"Plugins"),(0,i.kt)("p",null,"Configuring ",(0,i.kt)("strong",{parentName:"p"},"LazyVim")," plugins is exactly the same as using ",(0,i.kt)("strong",{parentName:"p"},"lazy.nvim")," to build\na config from scratch."),(0,i.kt)("p",null,"For the full plugin spec documentation please check the ",(0,i.kt)("strong",{parentName:"p"},"lazy.nvim"),"\n",(0,i.kt)("a",{parentName:"p",href:"https://github.com/folke/lazy.nvim"},"readme"),"."),(0,i.kt)("p",null,"Refer to the ",(0,i.kt)("strong",{parentName:"p"},"plugins")," section in the sidebar for configuring\nincluded plugins."),(0,i.kt)("h2",{id:"-adding-plugins"},"\u2795 Adding Plugins"),(0,i.kt)("p",null,"Adding a plugin is as simple as adding the plugin spec to one of the files\nunder ",(0,i.kt)("inlineCode",{parentName:"p"},"lua/plugins/*.lua"),". You can create as many files there as you want."),(0,i.kt)("p",null,"You can structure your ",(0,i.kt)("inlineCode",{parentName:"p"},"lua/plugins")," folder with a file per plugin,\nor a separate file containing all the plugin specs for some functionality."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-lua",metastring:'title="lua/plugins/lsp.lua"',title:'"lua/plugins/lsp.lua"'}
1,'return {\n  -- add symbols-outline\n  {\n    "simrat39/symbols-outline.nvim",\n    cmd = "SymbolsOutline",\n    keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },\n    opts = {\n      -- add your options that should be passed to the setup() function here\n      position = "right",\n    },\n  },\n}\n')),(0,i.kt)("h2",{id:"-disabling-plugins"},"\u274c Disabling Plugins"),(0,i.kt)("p",null,"In order to disable a plugin, add a spec with ",(0,i.kt)("inlineCode",{parentName:"p"},"enabled=false")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-lua",metastring:'title="lua/plugins/disabled.lua"',title:'"lua/plugins/disabled.lua"'},'return {\n  -- disable trouble\n  { "folke/trouble.nvim", enabled = false },\n}\n')),(0,i.kt)("h2",{id:"\ufe0f-customizing-plugin-specs"},"\u270f\ufe0f Customizing Plugin Specs"),(0,i.kt)("p",null,"Defaults merging rules:"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"cmd"),": the list of commands will be extended with your custom commands"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"event"),": the list of events will be extended with your custom events"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"ft"),": the list of filetypes will be extended with your custom filetypes"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"keys"),": the list of keymaps will be extended with your custom keymaps"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"opts"),": your custom opts will be merged with the default opts"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"dependencies"),": the list of dependencies will be extended with your custom dependencies"),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},(0,i.kt)("em",{parentName:"strong"},"any other property will override the defaults")))),(0,i.kt)("p",null,"For ",(0,i.kt)("inlineCode",{parentName:"p"},"ft"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"event"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"keys"),", ",(0,i.kt)("inlineCode",{parentName:"p"},"cmd")," and ",(0,i.kt)("inlineCode",{parentName:"p"},"opts")," you can instead also specify a ",(0,i.kt)("inlineCode",{parentName:"p"},"values")," function\nthat can make changes to the default values, or return new values to be used instead."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-lua"},'return {\n  -- change trouble config\n  {\n    "folke/trouble.nvim",\n    -- opts will be merged with the parent spec\n    opts = { use_diagnostic_signs = true },\n  }\n\n  -- add cmp-emoji\n  {\n    "hrsh7th/nvim-cmp",\n    dependencies = { "hrsh7th/cmp-emoji" },\n    ---@param opts cmp.ConfigSchema\n    opts = function(_, opts)\n      table.insert(opts.sources, { name = "emoji" })\n    end,\n  }\n}\n')),(0,i.kt)("h2",{id:"\ufe0f-adding--disabling-plugin-keymaps"},"\u2328\ufe0f Adding & Disabling Plugin Keymaps"),(0,i.kt)("p",null,"Adding ",(0,i.kt)("inlineCode",{parentName:"p"},"keys=")," follows the rules as explained above."),(0,i.kt)("p",null,"You can also disable a default keymap by setting it to ",(0,i.kt)("inlineCode",{parentName:"p"},"false"),".\nTo override a keymap, simply add one with the same ",(0,i.kt)("inlineCode",{parentName:"p"},"lhs")," and a new ",(0,i.kt)("inlineCode",{parentName:"p"},"rhs"),"."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-lua",metastring:'title="lua/plugins/telescope.lua"',title:'"lua/plugins/telescope.lua"'},'return {\n  "nvim-telescope/telescope.nvim",\n  keys = {\n    -- disable the keymap to grep files\n    {"<leader>/", false},\n    -- change a keymap\n    { "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files" },\n    -- add a keymap to browse plugin files\n    {\n      "<leader>fp",\n      function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,\n      desc = "Find Plugin File",\n    },\n  },\n},\n')),(0,i.kt)("admonition",{type:"caution"},(0,i.kt)("p",{parentName:"admonition"},"Make sure to use the exact same mode as the keymap you want to disable.\nYou don't have to specify a mode for ",(0,i.kt)("inlineCode",{parentName:"p"},"normal")," mode keymaps.")),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-lua",metastring:'title="lua/plugins/flash.lua"',title:'"lua/plugins/flash.lua"'},'return {\n  "folke/flash.nvim",\n  keys = {\n    -- disable the default flash keymap\n    { "s", mode = { "n", "x", "o" }, false },\n  },\n}\n')),(0,i.kt)("p",null,"You can also return a whole new set of keymaps to be used instead.\nOr return ",(0,i.kt)("inlineCode",{parentName:"p"},"{}")," to disable all keymaps for a plugin."),(0,i.kt)("pre",null,(0,i.kt)("code",{parentName:"pre",className:"language-lua",metastring:'title="lua/plugins/telescope.lua"',title:'"lua/plugins/telescope.lua"'},'return {\n  "nvim-telescope/telescope.nvim",\n  -- replace all Telescope keymaps with only one mapping\n  keys = function()\n    return {\n      { "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find Files" },\n    }\n  end,\n},\n')))}d.isMDXComponent=!0}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.