🌐 Detecting your location…
📢 Advertisement — Configure AdSense in Appearance → Customize → AdSense Settings

Guia completo do Neovim 2026: LazyVim, LSP e configuração produtiva

⏱️5 min read  ·  899 words

Neovim se tornou o editor preferido do desenvolvedor profissional em 2026. Com configuração baseada em Lua, suporte LSP nativo, preguiçoso.nvim para gerenciamento de plug-ins e um ecossistema vibrante de plug-ins, o Neovim rivaliza com o VS Code em funcionalidade, ao mesmo tempo que é dramaticamente mais rápido e personalizável. Este guia leva você do zero ao usuário produtivo do Neovim.

Por que Neovim em vez de VS Code?

  • Velocidade— inicia instantaneamente, sem tempo de carregamento de 2 segundos
  • Eficiência do teclado— a edição modal elimina a alternância entre as mãos do mouse
  • Personalização— configure tudo em Lua
  • Terminal nativo— funciona via SSH, no Docker, em qualquer lugar
  • Uso de recursos— 50 MB de RAM versus 500 MB+ do VS Code

Instalação

# macOS
brew install neovim

# Ubuntu/Debian (add official PPA for latest)
sudo add-apt-repository ppa:neovim-ppa/unstable
sudo apt update && sudo apt install neovim

# Or build from source for latest nightly
sudo apt install cmake gettext
git clone https://github.com/neovim/neovim
cd neovim && make CMAKE_BUILD_TYPE=Release
sudo make install

# Verify
nvim --version

# Install a distribution (skip config from scratch)
# LazyVim (recommended for beginners):
git clone https://github.com/LazyVim/starter ~/.config/nvim

Movimentos principais do Vim

Normal Mode Essentials:
  hjkl          — left/down/up/right
  w/b           — forward/backward word
  e             — end of word
  0/$           — start/end of line
  gg/G          — first/last line
  Ctrl+d/u      — half page down/up
  Ctrl+f/b      — full page down/up
  %             — jump to matching bracket
  */#           — search word under cursor forward/back
  ''            — jump to last position

Editing:
  i/a           — insert before/after cursor
  I/A           — insert at start/end of line
  o/O           — new line below/above
  r             — replace character
  R             — replace mode
  cw            — change word
  C             — change to end of line
  D             — delete to end of line
  u/Ctrl+r      — undo/redo
  .             — repeat last change

Visual Mode:
  v/V/Ctrl+v    — char/line/block visual
  y/d/c         — yank/delete/change selection
  >/<           — indent/dedent

Objetos de texto

Text object patterns: [operator][inner|around][object]

ci"   — change inside double quotes
ca"   — change around double quotes (includes quotes)
di{   — delete inside curly braces
da{   — delete around curly braces (includes braces)
yi(   — yank inside parentheses
yap   — yank around paragraph
cit   — change inside HTML tag
dat   — delete around HTML tag
ciw   — change inner word
daw   — delete around word (includes whitespace)
dis   — delete inner sentence

Configuração do LazyVim

-- ~/.config/nvim/lua/config/options.lua
local opt = vim.opt

-- UI
opt.number = true           -- line numbers
opt.relativenumber = true   -- relative line numbers
opt.cursorline = true       -- highlight current line
opt.signcolumn = "yes"      -- always show sign column

-- Indentation
opt.expandtab = true        -- spaces not tabs
opt.tabstop = 2
opt.shiftwidth = 2
opt.smartindent = true

-- Search
opt.ignorecase = true
opt.smartcase = true        -- case-sensitive if uppercase used
opt.hlsearch = false        -- no persistent highlight after search

-- Splits
opt.splitright = true       -- vertical splits go right
opt.splitbelow = true       -- horizontal splits go below

-- Performance
opt.updatetime = 200
opt.timeoutlen = 300        -- faster key combo detection

Plug-ins principais (lazy.nvim)

-- ~/.config/nvim/lua/plugins/essential.lua
return {
  -- Fuzzy finder
  {
    "nvim-telescope/telescope.nvim",
    dependencies = { "nvim-lua/plenary.nvim" },
    keys = {
      { "<leader>ff", "<cmd>Telescope find_files<cr>", desc = "Find files" },
      { "<leader>fg", "<cmd>Telescope live_grep<cr>",  desc = "Live grep" },
      { "<leader>fb", "<cmd>Telescope buffers<cr>",    desc = "Buffers" },
      { "<leader>fr", "<cmd>Telescope oldfiles<cr>",   desc = "Recent files" },
    },
  },

  -- File tree
  {
    "nvim-neo-tree/neo-tree.nvim",
    keys = { { "<leader>e", "<cmd>Neotree toggle<cr>", desc = "File tree" } },
  },

  -- LSP
  {
    "neovim/nvim-lspconfig",
    config = function()
      local lspconfig = require("lspconfig")
      -- Python
      lspconfig.pyright.setup({})
      -- TypeScript
      lspconfig.tsserver.setup({})
      -- Rust
      lspconfig.rust_analyzer.setup({})
      -- Go
      lspconfig.gopls.setup({})
    end,
  },

  -- Completion
  {
    "hrsh7th/nvim-cmp",
    dependencies = {
      "hrsh7th/cmp-nvim-lsp",
      "hrsh7th/cmp-buffer",
      "hrsh7th/cmp-path",
      "L3MON4D3/LuaSnip",
    },
  },

  -- Syntax highlighting
  { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },

  -- Git
  { "lewis6991/gitsigns.nvim" },
  { "kdheepak/lazygit.nvim",
    keys = { { "<leader>gg", "<cmd>LazyGit<cr>", desc = "LazyGit" } },
  },

  -- Formatting
  { "stevearc/conform.nvim",
    config = function()
      require("conform").setup({
        formatters_by_ft = {
          python = { "ruff_format" },
          javascript = { "prettier" },
          typescript = { "prettier" },
          rust = { "rustfmt" },
        },
        format_on_save = { timeout_ms = 500 },
      })
    end,
  },
}

Mapas de teclado essenciais

LazyVim Default (and common custom) keymaps:

Leader key = Space

<leader>ff  — find files (Telescope)
<leader>fg  — grep in files
<leader>e   — file explorer
<leader>gg  — LazyGit
<leader>ca  — code action (LSP)
<leader>rn  — rename symbol (LSP)
gd          — go to definition
gr          — go to references
K           — hover documentation
<leader>l   — LSP info
<leader>/   — comment line
<leader>bd  — close buffer
<leader>bn  — next buffer
<C-h/j/k/l> — navigate splits
:w          — save
:q          — quit
:wq         — save and quit
ZZ          — save and quit (normal mode)

Neovim em 2026 com LazyVim é genuinamente competitivo com VS Code para funcionalidade IDE completa, ao mesmo tempo que é dramaticamente mais rápido e nativo de terminal. Aprenda os movimentos principais (hjkl, w/b/e, c/d/y + objetos de texto) primeiro – eles fornecem 90% de eficiência. Adicione plug-ins de forma incremental, em vez de começar com uma configuração enorme.

✍️ Leave a Comment

Your email address will not be published. Required fields are marked *

🌐 Read in:🇬🇧 English🇩🇪 Deutsch🇧🇷 Português🇸🇦 العربية🇮🇳 हिन्दी🇧🇩 বাংলা