GuideOctober 14, 20256 min read

Syncing Vim/Neovim Config Across Machines

Your Neovim config is a living document that evolves over months. Here's how to keep it perfectly in sync across every machine without manually copying files.

What to Sync

A Vim or Neovim setup typically consists of several configuration files and directories. Which ones matter depends on whether you use classic Vim, Neovim, or both:

  • ~/.vimrc — classic Vim configuration
  • ~/.config/nvim/init.lua — Neovim entry point (Lua-based configs)
  • ~/.config/nvim/init.vim — Neovim entry point (Vimscript-based configs)
  • ~/.config/nvim/lua/ — Lua modules for plugin configs, keymaps, options

Most modern Neovim setups put everything under ~/.config/nvim/. If you have migrated fully to Lua, your entire configuration lives in that directory.

Adding Vim/Neovim to ConfigSync

ConfigSync detects your editor setup and tracks the right files:

Add the Vim module
configsync add module vim

This tracks ~/.vimrc (if it exists) and the entire ~/.config/nvim/ directory. For a typical Neovim setup with lazy.nvim, that includes:

What gets tracked
~/.config/nvim/ init.lua lua/ config/ keymaps.lua options.lua autocmds.lua plugins/ lsp.lua treesitter.lua telescope.lua ui.lua ...

Every file in your Neovim config directory is captured. Push once and all of it is available on every machine:

Push and pull
# Save your config configsync push -m "nvim config with lazy.nvim" # Restore on new machine configsync pull

Plugin Managers: Config Syncs, Plugins Install

A common concern: do you need to sync the actual plugin files? No. Plugin managers like lazy.nvim, packer, and vim-plug are designed to install plugins from a lockfile or spec. You sync the configuration, and the plugin manager handles the rest.

First open after restore
# After configsync pull, open Neovim nvim # lazy.nvim detects missing plugins and installs them # Or trigger manually: :Lazy sync

With lazy.nvim, the lazy-lock.json file pins exact plugin versions. ConfigSync tracks this lockfile alongside your config, so every machine gets the same plugin versions — not just the same plugin list.

Key point: Sync your config and lockfile, not the plugin binaries. Plugin managers will download and compile plugins on first launch. This keeps your ConfigSync snapshots small and fast.

Handling Platform Differences

Clipboard integration is the most common difference between macOS and Linux Neovim setups. macOS uses pbcopy/pbpaste, while Linux uses xclip or wl-copy. ConfigSync templates handle this:

lua/config/options.lua with platform template
-- Clipboard configuration {{#if platform == "darwin"}} vim.opt.clipboard = "unnamedplus" -- macOS: works out of the box with pbcopy {{else}} vim.opt.clipboard = "unnamedplus" -- Linux: requires xclip or wl-clipboard -- Install: sudo apt install xclip {{/if}} -- Common options vim.opt.number = true vim.opt.relativenumber = true vim.opt.shiftwidth = 2 vim.opt.tabstop = 2 vim.opt.expandtab = true

You can also use templates for font settings in GUI Neovim clients (Neovide, VimR) or for paths to language servers that differ between operating systems.

Syncing .ideavimrc for JetBrains Users

Many Vim users also work in JetBrains IDEs with the IdeaVim plugin. The ~/.ideavimrc file configures Vim keybindings inside IntelliJ, PyCharm, WebStorm, and other JetBrains editors. ConfigSync has a dedicated module for this:

Add JetBrains Vim config
configsync add module jetbrains

This tracks ~/.ideavimrc so your JetBrains Vim bindings stay in sync with your Neovim keymaps. If you maintain parity between the two, changes on one machine propagate everywhere.

Example .ideavimrc
" Source shared mappings from .vimrc source ~/.vimrc " IdeaVim-specific plugins set surround set commentary set argtextobj set highlightedyank " IDE actions mapped to Vim keys nmap <leader>ff :action GotoFile<CR> nmap <leader>fg :action FindInPath<CR> nmap <leader>ca :action ShowIntentionActions<CR> nmap <leader>rn :action RenameElement<CR>

The Complete Vim/Neovim Sync

Here is a typical setup for a developer who uses Neovim as their primary editor and IdeaVim in JetBrains:

Full setup
# Neovim config (init.lua + all lua modules) configsync add module vim # JetBrains IdeaVim configsync add module jetbrains # Push everything configsync push -m "editor configs" # On a new machine: # 1. Install Neovim # 2. configsync pull # 3. Open nvim — lazy.nvim installs plugins automatically # 4. Open JetBrains IDE — .ideavimrc is ready

From a fresh install to your fully configured editor in about a minute. Your keymaps, plugins, colorscheme, LSP configuration, and every custom option restored exactly as you left them. No copying files from a dotfiles repo and hoping nothing changed since your last manual update.

Ready to try ConfigSync?

Sync your entire dev environment across machines in minutes. Free forever for up to 3 devices.