robin/lynn.nvim
native-first neovim plugin manager with charm
git clone https://git.robinwobin.dev/robin/lynn.nvim
b7c0845
main
1*lynn.txt* A small plugin manager built around vim.pack 2 3============================================================================== 41. Contents *lynn-contents* 5 61. Contents..........................|lynn-contents| 72. Usage.............................|lynn-usage| 83. Plugin Specification..............|lynn-spec| 94. Plugin Configuration..............|lynn-config| 105. Lazy Loading......................|lynn-lazy| 116. User Commands.....................|lynn-commands| 12 13============================================================================== 142. Usage *lynn-usage* 15 16You must include `require("lynn").setup(modname)` somewhere in your lua 17configuration (likely `init.lua` but it can be elsewhere). `modname` is the 18module containing your plugin specs. For a description of lynn's plugin spec 19see |lynn-spec|. An example configuration could be: 20>lua 21 require("lynn").setup("plugins") 22< 23And then `lua/plugins.lua` would contain the specs 24>lua 25 return { 26 "tpope/vim-fugitive", 27 { 28 "eraserhd/parinfer-rust", 29 build="cargo build --release", 30 }, 31 } 32< 33 34Note that lynn requires that the plugin module returns the plugin specs. 35 36Alternatively the argument to `setup()` can be an array of plugin specs, like 37so: 38>lua 39 require("lynn").setup({ 40 { "comfysage/artio.nvim" }, 41 { "everviolet/nvim", name = "evergarden" }, 42 }) 43< 44 45To configure your installed plugins, add a lua file to 46`config/<plugname>.lua`. See |lynn-config| for details. 47============================================================================== 483. Plugin Specification *lynn-spec* 49 50Lynn plugin specs have the following fields: 51 - {1}? (string) Same as {url} 52 53 - {name}? (string) Optional name to pass vim.pack; see |vim.pack.Spec| 54 55 - {url}? (string) URL of the repo. Can be in the form of "owner/repo", 56 which resolves to a github url by default. Optionally you can 57 add a prefix (separated by a colon) that specifies the code 58 forge. Supported prefixes are "github", "gitlab", 59 "srht" (Sourcehut) and "codeberg". 60 61 - {path}? (string) Filesystem path in case of a local plugin. If {path} 62 and {url} are both defined, then {url} is used 63 64 - {version}? (string|vim.VersionRange) see |vim.pack.Spec| 65 66 - {ensure}? (boolean) Defaults to true, determines whether the package 67 will be installed. 68 69 - {lazy}? (boolean) Determines whether the plugin will be loaded lazily. 70 See |lynn-lazy| 71 72 - {event}? (string|string[]) Event to lazy load on, see |lynn-lazy|. If 73 this is defined, then the plugin will be lazy-loaded 74 regardless of the value of {lazy} 75 76 - {init}? (function): Function run before loading the plugin 77 78 - {load}? (function): Function run to load the plugin 79 80 - {config}? (function): Function run after loading the plugin. However 81 you should prefer creating dedicated config files; see 82 |lynn-config|. 83 84 - {build}? (string|function) system command/function that runs after 85 installing or updating a plugin. 86 87 88Notice that there is no "opts" field, Lynn does not automatically call the 89plugin's setup function. You will have to do that yourself in the plugin's 90configuration, see |lynn-config|. 91 92============================================================================== 934. Plugin Configuration *lynn-config* 94 95When loading a plugin named `foo`, Lynn will source the lua file 96`config/foo.lua`. That is, if there is a lua file with the same name as your 97plugin in the config subfolder of your neovim configuration, Lynn will run it 98after the plugin is loaded. 99 100The name that Lynn uses to check for these files is the same name that is used 101in `vim.pack`. By default, this is the name of the repo with vim/nvim prefixes 102and postfixes removed. As an example, `nvim-lspconfig` becomes `lspconfig` and 103`fugitive.vim` becomes `fugitive`. 104 105You can optionally define this name yourself in lynn's spec, see |lynn-spec|. 106 107You should put all your plugin-specific configuration in that file, including 108but not limited to calling the plugin's setup function. 109 110============================================================================== 1115. Lazy Loading *lynn-lazy* 112 113When a plugin spec (see |lynn-spec|) has {lazy} or {event} defined, lynn 114defers loading it until necessary. {event} can be a string or an array of 115strings. 116 117In the case of a single string, lynn also supports setting |autocmd-pattern|s. 118You do this by separating the event and pattern by a space, i.e. to have a 119plugin load in markdown files you could use `"BufEnter *.md"` or `"FileType 120markdown"`. 121 122Note that this mechanism is not supported if you pass in a list of strings 123instead. 124 125If {lazy} is true and {event} is not defined, then the plugin will not load at 126all, until it is manually loaded with `lynn.load()`. Please see the source 127code for the documentation of the lynn api. 128 129============================================================================== 1306. User Commands *lynn-commands* 131 132Lynn defines a number of quality of life commands to help manage your plugins. 133 134 *:PackUpdate* 135:PackUpdate [plugin] 136 Updates all plugins. If [plugin] is supplied then 137 [plugin] is the only plugin that is updated. You can 138 pass multiple plugins separated by spaces 139 140 *:PackSync* 141:PackSync 142 Updates all plugins. 143 144 *:PackClean* 145:PackClean 146 Removes the directories of inactive plugins. 147 vim:tw=78:ts=8:noet:ft=help:norl: