DEV Community

失魂魚
失魂魚

Posted on • Updated on

Setup NeoVim on macOS with plugin manager and Hop (easy-motion)

  1. brew install nvim
  2. vim-plug: sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  3. Open init.vim
" plugins
call plug#begin(stdpath('data') . '/plugged')
Plug 'phaazon/hop.nvim'
call plug#end()

" hop
lua << EOF
require'hop'.setup()
EOF

" remap leader leader to hop word
map <Leader><Leader> :HopWord <CR>
Enter fullscreen mode Exit fullscreen mode

Open a file in nvim and type in :PlugUpdate, you'll see installation process. Now type in \\ or double tap whatever your leader key is mapped to, and hop should be working.

Top comments (0)