[!Deprecated] Easy-Motion (Navigation for Neovim inside VSCode)

Shaik Zahid
3 min readFeb 22, 2023

--

Note: Easy-Motion has stopped working in Neovim, and we have to look for the navigation plugin that supports Vscode. If you want to research furthur you can go to this issue in the official Neovim repository. Thankfully, Hop has extended its support for VsCode in its most recent versions, hence we can get the navigation functionality with no newer plugins. Head over to this updated configuration for required changes.

Visual Studio Code is one of the most popular text editors present in the programming world. Most of the programmers like vim features as it enhances productivity and better editing of the code. Neovim provides plugins that works well with Visual Studio Code when installed in our Neovim configuration. One such plugin is Easy-Motion. It provides better navigation of the code.

In our Neovim configuration, we have another plugin which works for the same cause i.e, Hop. Even though Hop is way better than Easy-Motion as it a bit younger and better in terms of functionalities, here we are implementing Easy-Motion as Hop does not provide compatibility with VSCode.

Requirements

Installation

  • Add the github repository in your plugins.lua file and install it using shift+i command by invoking lazy.
-- plugins.lua

return {

-- Alpha (Dashboard)
{
"goolord/alpha-nvim",
lazy = true,
},


-- Auto Pairs
{
"windwp/nvim-autopairs"
},

-- Bufferline
{
"akinsho/bufferline.nvim",
dependencies = {
"nvim-tree/nvim-web-devicons"
},
},

-- Colorscheme
{
"folke/tokyonight.nvim",
},

-- Comments
{
"numToStr/Comment.nvim",
config = function()
require("Comment").setup()
end
},

-- Easymotion (VScode)
-- Added this plugin
{
"ChristianChiarulli/vscode-easymotion",
},

-- Git Integration
{
"lewis6991/gitsigns.nvim",
},

-- Hop (Better Navigation)
{
"phaazon/hop.nvim",
lazy = true,
},

-- Indentation Highlighting
{
"lukas-reineke/indent-blankline.nvim",
},

-- Rainbow Highlighting
{
"HiPhish/nvim-ts-rainbow2"
},

-- Lualine
{
"nvim-lualine/lualine.nvim",
dependencies = {
"nvim-tree/nvim-web-devicons"
},
},


-- Language Support
{
"VonHeikemen/lsp-zero.nvim",
lazy = true,
branch = "v1.x",
dependencies = {
-- LSP Support
{"neovim/nvim-lspconfig"}, -- Required
{"williamboman/mason.nvim"}, -- Optional
{"williamboman/mason-lspconfig.nvim"}, -- Optional

-- Autocompletion
{"hrsh7th/nvim-cmp"}, -- Required
{"hrsh7th/cmp-nvim-lsp"}, -- Required
{"hrsh7th/cmp-buffer"}, -- Optional
{"hrsh7th/cmp-path"}, -- Optional
{"saadparwaiz1/cmp_luasnip"}, -- Optional
{"hrsh7th/cmp-nvim-lua"}, -- Optional

-- Snippets
{"L3MON4D3/LuaSnip"}, -- Required
{"rafamadriz/friendly-snippets"}, -- Optional
}
},


-- Nvim-tree (File Explorer)
{
'nvim-tree/nvim-tree.lua',
lazy = true,
dependencies = {
'nvim-tree/nvim-web-devicons',
},
},


-- Nvim-Surround (Manipulating Surroundings)
{
"kylechui/nvim-surround",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end
},


-- Telescope (Fuzzy Finder)
{
'nvim-telescope/telescope.nvim',
lazy = true,
dependencies = {
{'nvim-lua/plenary.nvim'},
}
},


-- Treesitter
{
"nvim-treesitter/nvim-treesitter",
},


-- Toggle Term
{
'akinsho/toggleterm.nvim',
config = true
},

-- Undo-Tree
{
"jiaoshijie/undotree",
dependencies = {
"nvim-lua/plenary.nvim",
},
},

-- Which-key
{
'folke/which-key.nvim',
lazy = true,
},

}

Configuration

  • Create a new file named easymotion-config.vim in your vscode directory. This file is implemented using Vim Script.
  • Add some keybindings for your VsCode configuration.
# easymotion-config.vim

let g:EasyMotion_smartcase = 1

nmap f <Plug>(easymotion-bd-f) // find any letter anywhere

Keybindings

  • f :- Search any letter anywhere on the screen

--

--