Skip to content

jvegaf/vscode-vim-setup

Repository files navigation

VS Code Vim Setup - Neovim Migration Guide

This setup replicates your comprehensive Neovim configuration in VS Code with the Vim extension.

πŸš€ Quick Start

  1. Install extensions (automated):

    ./install-extensions.sh
  2. Copy configuration files:

    # For Linux/macOS
    cp settings.json ~/.config/Code/User/settings.json
    cp keybindings.json ~/.config/Code/User/keybindings.json
    
    # For Windows
    cp settings.json "%APPDATA%\Code\User\settings.json"
    cp keybindings.json "%APPDATA%\Code\User\keybindings.json"
  3. Restart VS Code

πŸ“‹ Extension Mapping

Core Functionality

Neovim Plugin VS Code Extension Description
lazy.nvim Built-in Extension Manager VS Code's native extension system
which-key.nvim vspacecode.whichkey Show available keybindings
nvim-tree Built-in Explorer + vscode-icons-team.vscode-icons File tree navigation
telescope.nvim tomrijndorp.find-it-faster Fuzzy finder
harpoon alefragnani.bookmarks + alefragnani.numbered-bookmarks Quick file navigation

Git Integration

Neovim Plugin VS Code Extension Description
gitsigns.nvim eamodio.gitlens Git integration in editor
lazygit.nvim eamodio.gitlens + mhutchie.git-graph Git workflow
neogit donjayamanne.git-extension-pack Advanced Git operations
git-blame.nvim eamodio.gitlens Git blame annotations
diffview.nvim Built-in Git diff + mhutchie.git-graph Diff viewing

LSP & Language Support

Neovim Plugin VS Code Extension Description
nvim-lspconfig Language-specific extensions LSP client
mason.nvim Automatic via language extensions LSP server management
nvim-cmp Built-in IntelliSense + visualstudioexptteam.vscodeintellicode Autocompletion
nvim-dap Built-in debugger + language-specific debug extensions Debugging
conform.nvim esbenp.prettier-vscode + language formatters Code formatting
nvim-lint ms-vscode.vscode-eslint + language linters Linting

UI & Themes

Neovim Plugin VS Code Extension Description
lualine.nvim Built-in status bar Status line
nvim-web-devicons pkief.material-icon-theme File icons
barbecue.nvim Built-in breadcrumbs LSP breadcrumbs
noice.nvim Built-in notifications Enhanced UI messages
onedark.nvim zhuangtongfa.material-theme Color scheme
tokyonight.nvim enkia.tokyo-night Color scheme

Coding Features

Neovim Plugin VS Code Extension Description
nvim-treesitter Built-in syntax highlighting + language extensions Syntax highlighting
nvim-autopairs Built-in bracket completion Auto-pairs
vim-commentary aaron-bond.better-comments Comment functionality
vim-visual-multi Built-in multi-cursor (Ctrl+D) Multiple cursors
trouble.nvim usernamehw.errorlens Diagnostics panel
actions-preview.nvim Built-in Quick Fix Code actions
refactoring.nvim p42ai.refactor Code refactoring

AI & Completion

Neovim Plugin VS Code Extension Description
copilot.lua github.copilot GitHub Copilot
copilot-chat.nvim github.copilot-chat Copilot Chat

🎯 Key Mappings

Core Navigation

  • <Space> - Leader key
  • , - Local leader key
  • jk - Exit insert mode
  • <Leader>ff - Find files (Find It Faster)
  • <Leader>fg - Live grep
  • <Leader>fb - Find buffers
  • <Leader>fr - Recent files

File Management

  • <Leader>e - Toggle file explorer
  • <Leader>E - File browser (Find It Faster)
  • W - Save file
  • Q - Close buffer
  • H/L - Navigate between tabs

Git Operations

  • <Leader>gs - Git status (Source Control view)
  • <Leader>gb - Git blame toggle
  • <Leader>gh - Git history
  • <Leader>gd - Git diff
  • <Leader>gg - Git graph (GitLens)

LSP Functions

  • gd - Go to definition
  • gr - Find references
  • gi - Go to implementation
  • gy - Go to type definition
  • K - Show hover information
  • <Leader>rn - Rename symbol
  • <Leader>xa - Code actions
  • <Leader>xx - Show diagnostics
  • gj/gk - Next/previous diagnostic

Debugging

  • <Leader>db - Toggle breakpoint
  • <Leader>dc - Continue debugging
  • <Leader>dj - Step over
  • <Leader>dk - Step into
  • <Leader>do - Step out
  • <Leader>dr - Restart debugging
  • <Leader>dt - Stop debugging

Harpoon-like Bookmarks

  • <Leader>ha - Add bookmark
  • <Leader>hh - Show bookmarks
  • <Leader>h1-9 - Jump to numbered bookmark

System Commands

  • <Leader>zc - Open settings
  • <Leader>zl - Show extensions
  • <Leader>zn - Show notifications
  • <Leader>ui - Toggle light/dark theme
  • <Leader>uc - Select theme

πŸ”§ Configuration Details

Vim Settings

"vim.leader": "<space>",
"vim.useSystemClipboard": true,
"vim.hlsearch": true,
"vim.smartcase": true,
"vim.easymotion": true,
"vim.surround": true,
"vim.camelCaseMotion.enable": true

Editor Settings

"editor.lineNumbers": "relative",
"editor.cursorStyle": "block",
"editor.tabSize": 2,
"editor.rulers": [80, 120],
"editor.wordWrap": "off"

🎨 Recommended Themes

Based on your Neovim colorschemes:

  • Tokyo Night (enkia.tokyo-night) - Matches tokyonight.nvim
  • Material Theme (zhuangtongfa.material-theme) - Clean, modern
  • Dracula (dracula-theme.theme-dracula) - Dark theme
  • Gruvbox Material (sainnhe.gruvbox-material) - Warm colors
  • GitHub Theme (github.github-vscode-theme) - GitHub-inspired

πŸ› οΈ Language-Specific Setup

TypeScript/JavaScript

  • Extensions: ms-vscode.vscode-typescript-next, bradlc.vscode-tailwindcss
  • Formatting: esbenp.prettier-vscode
  • Linting: ms-vscode.vscode-eslint

Python

  • Extensions: ms-python.python, ms-python.pylint, ms-python.black-formatter
  • Debugging: ms-python.debugpy
  • Formatting: charliermarsh.ruff

Rust

  • Extension: rust-lang.rust-analyzer
  • Debugging: vadimcn.vscode-lldb

Go

  • Extension: golang.go
  • Includes LSP, debugging, and formatting

Java

  • Extension: vscjava.vscode-java-pack
  • Complete Java development environment

C/C++

  • Extensions: ms-vscode.cpptools, ms-vscode.cmake-tools
  • Debugging: vadimcn.vscode-lldb

Flutter/Dart

  • Extensions: dart-code.dart-code, dart-code.flutter

πŸš€ Advanced Features

Find It Faster (Telescope Replacement)

  • Ctrl+Shift+P then "Find It Faster"
  • Supports fuzzy file finding
  • Live grep with regex support
  • Respects .gitignore

GitLens (Git Integration)

  • Inline blame annotations
  • Git graph visualization
  • File history
  • Branch comparison

Bookmarks (Harpoon Replacement)

  • Toggle bookmarks with <Leader>ha
  • Navigate between numbered bookmarks
  • Persistent across sessions

🎯 Tips for Neovim Users

  1. Use Command Palette: Ctrl+Shift+P - equivalent to : in Neovim
  2. Quick Open: Ctrl+P - similar to telescope file finder
  3. Go to Symbol: Ctrl+Shift+O - like telescope document symbols
  4. Global Symbol Search: Ctrl+T - workspace symbol search
  5. Multi-cursor: Ctrl+D - select next occurrence (vim-visual-multi)
  6. Zen Mode: Ctrl+K Z - distraction-free editing

πŸ”§ Customization

Adding Custom Keybindings

Edit keybindings.json to add your own shortcuts:

{
  "key": "space f r",
  "command": "workbench.action.openRecent",
  "when": "editorTextFocus && vim.mode == 'Normal'"
}

Custom Vim Mappings

Add to settings.json under vim.normalModeKeyBindings:

{
  "before": ["<leader>", "custom"],
  "commands": ["your.command.here"]
}

πŸ› Troubleshooting

Vim Extension Performance

  • Disable unused Vim plugins in settings
  • Adjust vim.timeout if keys feel laggy
  • Use performance monitoring extension

LSP Issues

  • Check output panel for language server logs
  • Restart language server via Command Palette
  • Verify extension is installed and enabled

Keybinding Conflicts

  • Check for conflicts in Keyboard Shortcuts editor
  • Use when clauses to scope keybindings
  • Test in clean VS Code profile

πŸ“š Additional Resources

Enjoy your Neovim-like experience in VS Code! πŸŽ‰

About

VSCode settings and keybindings for Vim users

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages