DEV Community

Ellison Leão
Ellison Leão

Posted on • Updated on

Meus 10 plugins favoritos para o Neovim em 2022

Uma breve lista dos melhores plugins pra usar agora e aumentar sua produtividade

Quando comecei a usar o Neovim, lá por 2017, depois de passar 6 anos usando Vim, não tinha sentido uma diferença tão grande porque primeiro a API lua era praticamente inexistente e minha configuração ainda era puramente vimscript e meus plugins também.

Mas tudo mudou quando fiz o upgrade pras versões 0.4.x e gradualmente comecei a me aventurar no mundo do Lua, no final de 2019. De lá pra ca já consegui migrar minhas configurações 100% para Lua e 99% dos plugins que uso hoje também são feitos na linguagem. Aqui vai minha lista dos 10 melhores plugins que acho indispensáveis hoje:

#10

GitHub logo wbthomason / packer.nvim

A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config

packer.nvim

Gitter

use-package inspired plugin/package management for Neovim.

Have questions? Start a discussion.

Have a problem or idea? Make an issue or a PR.

Packer is built on native packages. You may wish to read :h packages before continuing

Table of Contents

  1. Notices
  2. Features
  3. Requirements
  4. Quickstart
  5. Bootstrapping
  6. Usage
    1. The startup function
    2. Custom Initialization
    3. Specifying Plugins
    4. Performing plugin management operations
    5. Extending packer
    6. Compiling Lazy-Loaders
    7. User autocommands
    8. Using a floating window
  7. Profiling
  8. Debugging
  9. Status
  10. Contributors

Notices

  • 2021-07-31: If you're on macOS, note that building Neovim with the version of luv from homebrew will cause any packer command to crash. More about this issue at neovim/neovim#15054.
  • 2021-07-28: packer will now highlight commits/plugin names with potentially breaking changes (determined by looking for breaking change or breaking_change, case insensitive, in the update commit bodies and headers) as WarningMsg in the status window.
  • 2021-06-06: Your Neovim must include neovim/neovim#14659; packer

Começando por esse incrível gerenciador de plugins, que vai deixar sua vida bem mais fácil na hora de instalar, atualizar e configurar seus plugins, principalmente se você utiliza lua nas suas configurações. Tem suporte a instalação de pacotes do luarocks, lazy loading e mais.

#9

GitHub logo numToStr / Comment.nvim

🧠 💪 // Smart and powerful comment plugin for neovim. Supports treesitter, dot repeat, left-right/up-down motions, hooks, and more

// Comment.nvim

Smart and Powerful commenting plugin for neovim

Comment.nvim

Features

  • Supports treesitter. Read more
  • Supports commentstring. Read more
  • Supports line (//) and block (/* */) comments
  • Dot (.) repeat support for gcc, gbc and friends
  • Count support for [count]gcc and [count]gbc
  • Left-right (gcw gc$) and Up-Down (gc2j gc4k) motions
  • Use with text-objects (gci{ gbat)
  • Supports pre and post hooks
  • Ignore certain lines, powered by Lua regex

🚀 Installation

use {
    'numToStr/Comment.nvim'
    config = function()
        require('Comment').setup()
    end
}
Enter fullscreen mode Exit fullscreen mode
Plug 'numToStr/Comment.nvim'

" Somewhere after plug#end()
lua require('Comment').setup()
Enter fullscreen mode Exit fullscreen mode

⚒️ Setup

First you need to call the setup() method to create the default mappings.

NOTE: If you are facing Keybindings are mapped but

Um poderoso plugin para inserir e remover comentários em códigos. Tem suporte ao treesitter, que vamos falar mais pra frente.

#8

GitHub logo neovim / nvim-lspconfig

Quickstart configs for Nvim LSP

nvim-lspconfig

Configs for the Nvim LSP client (:help lsp).

  • Do not file Nvim LSP client issues here. The Nvim LSP client does not live here. This is only a collection of LSP configs.
  • If you found a bug in the Nvim LSP client, report it at the Nvim core repo.
  • These configs are best-effort and unsupported. See contributions.

See also :help lspconfig.

Install

  • Requires Neovim latest stable release or Nightly. Update Nvim and nvim-lspconfig before reporting an issue.
  • Install nvim-lspconfig like any other Vim plugin, e.g. with packer.nvim
    local use = require('packer').use
    require('packer').startup(function()
      use 'wbthomason/packer.nvim' -- Package manager
      use 'neovim/nvim-lspconfig' -- Configurations for Nvim LSP
    end)
    Enter fullscreen mode Exit fullscreen mode

Quickstart

  1. Install a language server, e.g. pyright
    npm i -g pyright
    Enter fullscreen mode Exit fullscreen mode
  2. Add the language server setup to…

Plugin obrigatório para quem quer utilizar o maravilhoso cliente nativo LSP. Com esse plugin a configuração dos LSP servers das linguagens fica extremamente fácil.

#7

GitHub logo williamboman / nvim-lsp-installer

Neovim plugin that allow you to seamlessly manage LSP servers with :LspInstall. With full Windows support!

nvim-lsp-installer

About

Neovim plugin that allow you to manage LSP servers (servers are installed inside :echo stdpath("data") by default) It works in tandem with lspconfig1 by registering a hook that enhances the PATH environment variable, allowing neovim's LSP client to locate the server executable installed by nvim-lsp-installer.2

On top of just providing commands for installing & uninstalling LSP servers, it:

  • provides a graphical UI
  • provides the ability to check for, and upgrade to, new server versions through a single interface
  • supports installing custom versions of LSP servers (for example :LspInstall rust_analyzer@nightly)
  • relaxes the minimum requirements by attempting multiple different utilities (for example, only one of wget, curl, or Invoke-WebRequest is required for HTTP requests)
  • hosts a suite of system tests for all supported servers
  • has full support for Windows…

Plugin que fornece todo suporte para uma rápida instalação dos LSP servers com uma excelente UX. É um plugin que funciona em conjunto com o nvim-lspconfig

#6

GitHub logo jose-elias-alvarez / null-ls.nvim

Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua.

null-ls.nvim

Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua.

Motivation

Neovim's LSP ecosystem is growing, and plugins like telescope.nvim and trouble.nvim make it a joy to work with LSP features like code actions and diagnostics.

Unlike the VS Code and coc.nvim ecosystems, Neovim doesn't provide a way for non-LSP sources to hook into its LSP client. null-ls is an attempt to bridge that gap and simplify the process of creating, sharing, and setting up LSP sources using pure Lua.

null-ls is also an attempt to reduce the boilerplate required to set up general-purpose language servers and improve performance by removing the need for external processes.

Status

null-ls is in beta status. Please see below for steps to follow if something doesn't work the way you expect (or doesn't work at all).

At the moment, null-is is compatible with Neovim 0.7 (stable)…

Gere diagnósticos, formate, realize ações de código e mais, utilizando esse plugin que utiliza o neovim como um servidor LSP, e faz a ponte entre ferramentas que não fazem uma conexão direta com o cliente nativo LSP. Entre os exemplos podemos citar:

  • Formatar código ao salvar o buffer com o prettier
  • Gerar relatório de erros e warnings com golangci-lint para Go
  • Formatar código Lua com stylua

e mais!

#5

GitHub logo nvim-treesitter / nvim-treesitter

Nvim Treesitter configurations and abstraction layer

nvim-treesitter

Zulip Chat Linting and Style Syntax files

Logo

Treesitter configurations and abstraction layer for Neovim

Logo by @steelsojka

The goal of nvim-treesitter is both to provide a simple and easy way to use the interface for tree-sitter in Neovim and to provide some basic functionality such as highlighting based on it:

cpp example

Traditional highlighting (left) vs Treesitter-based highlighting (right) More examples can be found in our gallery.

Warning: Treesitter and nvim-treesitter highlighting are an experimental feature of Neovim Please consider the experience with this plug-in as experimental until Tree-Sitter support in Neovim is stable! We recommend using the nightly builds of Neovim if possible. You can find the current roadmap here. The roadmap and all features of this plugin are open to change, and any suggestion will be highly appreciated!

Nvim-treesitter is based on three interlocking features: language parsers, queries, and modules, where modules provide features – e.g., highlighting – based on…

Um plugin que faz interface com o excelente projeto tree-sitter e traz funcionalides como _syntax highlighting _, indentação, seleção incremental, movimentação, folding, entre outros.

#4

GitHub logo L3MON4D3 / LuaSnip

Snippet Engine for Neovim written in Lua.

LuaSnip

LuaSnip

javadoc.mp4

Features

  • Tabstops
  • Text-Transformations using Lua functions
  • Conditional Expansion
  • Defining nested Snippets
  • Filetype-specific Snippets
  • Choices
  • Dynamic Snippet creation
  • Regex-Trigger
  • Autotriggered Snippets
  • Easy Postfix Snippets
  • Fast
  • Parse LSP-Style Snippets either directly in lua, as a vscode package or a snipmate snippet collection.
  • Expand LSP-Snippets with nvim-compe (or its' successor, nvim-cmp (requires cmp_luasnip))
  • Snippet history (jump back into older snippets)
  • Resolve filetype at the cursor using Treesitter

Drawbacks

  • Snippets that make use of the entire functionality of this plugin have to be defined in Lua (but 95% of snippets can be written in lsp-syntax).
  • The LSP-parser does not support Regex-Transformations.

Requirements

Neovim >= 0.5 (extmarks)

Setup

Install

Ie. With vim-plug

Keymaps

" press <Tab> to expand or jump in a snippet. These can also be mapped separately
" via <Plug>luasnip-expand-snippet and <Plug>luasnip-jump-next.
imap <silent><expr> <Tab> luasnip#expand_or_jumpable() ? '<Plug>luasnip-expand-or-jump' : '<Tab>'
" -1 for jumping backwards.
Enter fullscreen mode Exit fullscreen mode

O melhor script para criação de snippets do Neovim. Simples assim. Tem uma curva de aprendizado um pouco alta, mas quando se pega o jeito, você não vai querer largar nunca. Aqui um vídeo explicando mais sobre as funcionalidades dele (Em inglês)

#3

GitHub logo hrsh7th / nvim-cmp

A completion plugin for neovim coded in Lua.

nvim-cmp

A completion engine plugin for neovim written in Lua Completion sources are installed from external repositories and "sourced".

Kapture.2021-10-27.at.13.32.44.mp4

Readme!

  1. There is a Github issue that documents breaking changes for nvim-cmp. Subscribe to the issue to be notified of upcoming breaking changes.
  2. This is my hobby project. You can support me via GitHub sponsors.
  3. Bug reports are welcome, but don't expect a fix unless you provide minimal configuration and steps to reproduce your issue.

Concept

  • Full support for LSP completion related capabilities
  • Powerful customizability via Lua functions
  • Smart handling of key mappings
  • No flicker

Setup

Recommended Configuration

This example configuration uses vim-plug as the plugin manager and vim-vsnip as a snippet plugin.

call plug#begin(s:plug_dir)
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'
" For vsnip users.
Plug 'hrsh7th/cmp-vsnip'
Enter fullscreen mode Exit fullscreen mode

Seguindo o melhor plugin para snippets, esse com certeza vai ser o melhor plugin para autocomplete que você irá ter no mercado até o momento. Seu design flexível permite incluir vários tipos diferentes de sources, desde sugestões de LSP, snippets, etc. A lista é gigantesca e você também conta com uma excelente documentação caso queira criar os seus próprios sources também.

#2

GitHub logo nvim-lualine / lualine.nvim

A blazing fast and easy to configure neovim statusline plugin written in pure lua.

lualine.nvim

code size license

A blazing fast and easy to configure Neovim statusline written in Lua.

lualine.nvim requires Neovim >= 0.5.

Contributing

Feel free to create an issue/PR if you want to see anything else implemented If you have some question or need help with configuration, start a discussion.

Please read CONTRIBUTING.md before opening a PR. You can also help with documentation in the wiki.

Screenshots

Here is a preview of what lualine can look like.

Screenshots of all available themes are listed in THEMES.md

For those who want to break the norms, you can create custom looks for lualine.

Example :

Performance compared to other plugins

Unlike other statusline plugins, lualine loads only the components you specify, and nothing else.

Startup time performance measured with an amazing plugin dstein64/vim-startuptime

Times are measured with a clean init.vim with only vim-startuptime vim-plug and given statusline plugin installed. In…

Minha escolha para plugin de statusline. Simples, rápido e bem flexível.

#1

GitHub logo nvim-telescope / telescope.nvim

Find, Filter, Preview, Pick. All lua, all the time.

telescope.nvim

Gitter

Gaze deeply into unknown regions using the power of the moon.

What Is Telescope?

telescope.nvim is a highly extendable fuzzy finder over lists. Built on the latest awesome features from neovim core. Telescope is centered around modularity, allowing for easy customization.

Community driven builtin pickers, sorters and previewers.

Preview For more showcases of Telescope, please visit the Showcase section in the Telescope Wiki

Telescope Table of Contents

Getting Started

This section should guide you to run your first builtin pickers.

Neovim (v0.7.0) or the latest neovim nightly commit is required for telescope.nvim to work.

Required dependencies

Suggested dependencies

We also suggest you install one native telescope sorter to significantly improve sorting performance. Take a look at either telescope-fzf-native.nvim or telescope-fzy-native.nvim

Talvez o plugin mais essencial de todos hoje. Faça buscas por arquivo, texto e muito mais, numa velocidade absurda, com esse plugin fantástico.

Conclusão

Com o ecossistema Lua se desenvolvendo cada dia mais, muitos plugins estão surgindo todos os dias e com certeza essa lista provavelmente precisará ser atualizada em um futuro próximo.

Faltou algum plugin nessa lista? Me conta ae nos comentários!

Top comments (2)

Collapse
 
vinibispo profile image
Vinícius Bispo

nvim-dap, trouble, plenary e nvim-notify

Collapse
 
voyeg3r profile image
Sérgio Araújo • Edited

Vou sugerir firulas, mas todo geek que se presa gosta de visually pleasing interfaces

Use ...

-- change to fit your needs
-- for loading plugin specific settings
function get_setup(name)
    return string.format('require("plugins/%s")', name)
end

-- smooth scrolling
use({
        "karb94/neoscroll.nvim",                   16     opt = true,
        event = "WinScrolled",                     14     keys = {'<C-u>', '<C-d>',-- '<C-b>',          '<C-f>',
        '<C-y>', '<C-e>', 'zt', 'zz', 'zb'},
        config = get_setup("neoscroll"),
    })
Enter fullscreen mode Exit fullscreen mode

essas linhas não se relacionam diretamente com plugins mas ébom usar

local colorscheme = "material"
local status_ok, _ = pcall(vim.cmd, "colorscheme " .. colorscheme)
if not status_ok then
    vim.notify("colorscheme " .. colorscheme .. " not found!")
    return
end
Enter fullscreen mode Exit fullscreen mode

se o plugin der pau o protected call evita a tela lorada de mensagens de erro.