Skip to content

Latest commit

 

History

History
82 lines (69 loc) · 3.95 KB

2-plugins.md

File metadata and controls

82 lines (69 loc) · 3.95 KB

Step 2: Plugins

Plugins allow you to extend Neovim's capabilities, and add new features.

Package manager

We recomend using the lazy.nvim package manager to manage all plugins.

To "install" it (download it if it's not already there) and bootstrap it in, add the following to your ~/.config/nvim/init.lua:

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

In order to keep things clean, we'll save all plugin configuration in a plugins folder, and create a dummy init.lua file:

mkdir ~/.config/nvim/lua/plugins/ && cd ~/.config/nvim/lua/plugins/
echo return {} > init.lua

And add this line to your nvim/init.lua to import your folder:

require("lazy").setup("plugins")

To add any new plugin, just create a new file inside the plugins folder.
You can tipically find this code in the instalation instructions of the plugin, but they all follow the same overall scheme due to how lazy.nvim works:

-- example_nvim.lua
return {  -- this will be passed to the require("lazy").setup() function
    "plugin_guy/example.nvim",  -- github repo of the plugin
    opts = {},  -- [optional] plugin configuration
    dependencies = {}  -- [optional] plugin dependencies
}

Note: when installing new plugins, lazy.nvim will show an UI. To exit that UI, just use :q.

Plugins

We recomend looking through plugins and slowly integrating them if you think it will benefit your workflow/experience.
As with most things, it's often better to slowly build your tools as you adquire new knowledge than entering nvim blindly with a bunch of plugins you don't know how to use (looking at you, LazyVim).

Here are some of our recomendations:

Ease of use

Files

Autocompletion & more

Fancy stuff

Integrations

  • gitsigns.nvim: Basic Git integrations (see which lines are modified, etc.).
  • neogit: Full Git TUI.
  • vimtex: $\LaTeX$ integration.