Published on

๐Ÿš€ Setup Neovim + LazyVim + Flutter Tools (for Flutter Devs)

Authors
  • avatar
    Name
    Haris Setiyono
    Twitter
thumbnail

This guide walks you through:

  1. Installing Neovim
  2. Setting up LazyVim
  3. Installing flutter-tools.nvim
  4. Using it for Flutter development

๐Ÿงฑ 1. Install Neovim

Make sure you have Neovim (latest)

macOS

brew install neovim

Ubuntu/Debian

sudo apt update
sudo apt install neovim

Windows (with Scoop)

scoop install neovim

โš™๏ธ 2. Setup LazyVim

LazyVim is a modern, opinionated Neovim setup.

Step-by-step:

# Backup your current config
mv ~/.config/nvim ~/.config/nvim.bak

# Clone LazyVim starter template
git clone https://github.com/LazyVim/starter ~/.config/nvim

# Install required tools
nvim

When you open Neovim for the first time, it will install plugins automatically.


๐Ÿ“ฆ 3. Install flutter-tools.nvim

Add the following plugin to LazyVim:

Edit your plugins

Create the file:

mkdir -p ~/.config/nvim/lua/plugins
nvim ~/.config/nvim/lua/plugins/flutter-tools.lua

Paste this config:

return {
  "akinsho/flutter-tools.nvim",
  dependencies = {
    "nvim-lua/plenary.nvim",
    "stevearc/dressing.nvim", -- Optional: UI enhancements
  },
  config = function()
    require("flutter-tools").setup {
      widget_guides = { enabled = true },
      closing_tags = {
        highlight = "Comment", -- highlight for closing tag
        prefix = "// ", -- character to use for close tag e.g. > //
        enabled = true
      },
      dev_log = {
        enabled = true,
        open_cmd = "tabedit", -- or "vsplit"
      },
    }
  end,
}

Install the plugin

Open Neovim and run:

:Lazy

Press l to update plugins


๐Ÿงช 4. How to Use flutter-tools.nvim

Commands

  • :FlutterRun โ€“ Launch Flutter app (emulator must be running)
  • :FlutterDevices โ€“ Switch device
  • :FlutterReload โ€“ Hot reload
  • :FlutterRestart โ€“ Hot restart
  • :FlutterDetach โ€“ Detach Flutter process
  • :FlutterQuit โ€“ Quit Flutter run
  • :FlutterLogClear โ€“ Clear dev logs

Auto LSP (Dart) Setup

flutter-tools.nvim auto-configures dartls (Dart language server), so youโ€™ll get:

  • Autocompletion
  • Diagnostics
  • Jump to definition
  • Hover docs

โœ… Bonus: Enable LSP Keybindings

LazyVim already includes LSP keymaps like:

  • gd โ€“ Go to definition
  • gr โ€“ References
  • K โ€“ Hover docs
  • <leader>rn โ€“ Rename
  • <leader>ca โ€“ Code action

๐Ÿง  Tips

  • Use fzf-lua or Telescope for file and symbol navigation
  • Enable format on save in LazyVim (:LspFormat)
  • Add more plugins via ~/.config/nvim/lua/plugins/

๐Ÿž Troubleshooting

  • Make sure flutter is in your $PATH
  • Make sure an emulator or device is running
  • Use :checkhealth to diagnose issues

๐Ÿ“š References


Feel free to clone My Setup Config: