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

NOTICE:

This repository is currently unmaintained. For the time being (as of August, 2023), it is recommended to use one of the following plugin managers instead:

  • lazy.nvim: Most stable and maintained plugin manager for Nvim.
  • pckr.nvim: Spiritual successor of packer.nvim. Functional but not as stable as lazy.nvim.

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. Features
  2. Requirements
  3. Quickstart
  4. Bootstrapping
  5. 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
  6. Profiling
  7. Debugging
  8. Compatibility and known issues
  9. Contributors

Features

  • Declarative plugin specification
  • Support for dependencies
  • Support for Luarocks dependencies
  • Expressive configuration and lazy-loading options
  • Automatically compiles efficient lazy-loading code to improve startup time

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 :h comment.commentstring
  • 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

-- add this to your lua/plugins.lua, lua/plugins/init.lua,  or the file you keep your other plugins:
{
    'numToStr/Comment.nvim',
    opts = {
        -- add any options here
    }
}
Enter fullscreen mode Exit fullscreen mode
use {
    'numToStr/Comment.nvim',
    config = function()
        require('Comment').setup()
    end
}
Enter fullscreen mode Exit fullscreen mode
Plug 'numToStr/Comment.nvim'
" Somewhere after plug#end()
Enter fullscreen mode Exit fullscreen mode

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

nvim-lspconfig is a "data only" repo, providing basic, default Nvim LSP client configurations for various LSP servers.

View the documentation for all configs or :help lspconfig-all from Nvim.

Important ⚠️

  • If you found a bug in the Nvim LSP functionality (:help lsp), report it to Neovim core
    • Do not report it here. Only configuration data lives here.
  • These configs are best-effort and supported by the community. See contributions.
  • Note: This repo only provides configurations. Its programmatic API is deprecated and should not be used externally.
    • Work is planned to selectively upstream the "framework" parts (not the configs) of nvim-lspconfig, to Nvim core, and deprecate them in nvim-lspconfig.

Install

LuaRocks

  • Requires Nvim 0.9 above. Update Nvim and nvim-lspconfig before reporting an issue.
  • Install nvim-lspconfig using Vim's "packages" feature:
    git clone https://github.com/neovim/nvim-lspconfig ~/.config/nvim/pack/nvim/start/nvim-lspconfig
    
  • Or use a 3rd-party plugin manager (consult the documentation for your plugin manager).

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

Further development has moved to https://github.com/williamboman/mason.nvim!

ℹ️ Project status

This is an excerpt from the announcement here.

nvim-lsp-installer is no longer maintained.

mason.nvim is the next generation version of nvim-lsp-installer. It builds on top of the very same foundation as nvim-lsp-installer (which means it's easy to migrate), but with a majority of internals refactored to improve extensibility and testability.

More importantly, the scope of mason.nvim has also been widened to target more than just LSP servers. mason.nvim supports DAP servers, linters, formatters, and more. As of writing, mason.nvim provides 150+ packages for 100+ languages. It can be thought of as a general-purpose package manager, native to Neovim, that runs everywhere Neovim runs (Windows, macOS, Linux, etc.).

Another big change with mason.nvim is that executables are now linked to a single, shared, location, allowing seamless access from Neovim builtins (shell, terminal, etc.) as well as other 3rd party plugins.

There have also been other improvements…

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.

ARCHIVED

null-ls is now archived and will no longer receive updates. Please see this issue for details.

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…

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

Matrix 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:

example-cpp

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).

Requirements

Neovim >= 0.7 (extmarks) jsregexp for lsp-snippet-transformations (see here for some tips on installing it).

Setup

Install

  • With your preferred plugin manager i.e. vim-plug, Packer or lazy
    Packer:

    use({
        "L3MON4D3/LuaSnip"
        -- follow latest release.
        tag = "v2.*", -- Replace <CurrentMajor> by the latest released major (first
    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".

demo.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.
  4. The cmp.mapping.preset.* is pre-defined configuration that aims to mimic neovim's native like behavior. It can be changed without announcement. Please manage key-mapping by yourself.

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'
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.7.

For previous versions of neovim please use compatability tags for example compat-nvim-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…




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 LuaRocks

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.9.0) or the latest neovim nightly commit is required for telescope.nvim to work. The neovim version also needs to be compiled with LuaJIT, we currently do not support Lua5.1 because of some ongoing issues.

Required dependencies

Suggested dependencies

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.