Skip to content

Latest commit

 

History

83 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neovim Setup

Neovim 0.5.0+ New Features

  • all the IDE-like goodies:
  • LSP completion, go to def, hover and rename
  • treesitter syntax highlighting
  • ctrlp-like fuzzy finding
  • embedded terminals

Reference

Installation

Install Dependency Packages

# MacOS
brew install --HEAD tree-sitter luajit neovim fzf fd

# Archlinux
sudo pacman -S tree-sitter luajit neovim fzf fd
Install nvim-lspconfig

reference: https://github.com/neovim/nvim-lspconfig

Install nvim-lsp-installer

reference: https://github.com/williamboman/nvim-lsp-installer

Getting Started with Lua-Based Neovim config

Benefits

  • Lua is a much nicer language
  • More modular
  • Easier to customize
  • Easier to configure lua plugins

Lua Keybings

Set using vim.api.nvim_set_keymap({mode}, {keymap}, {mapped to}, {options})

Example
" Ctrl-s to Save
nmap <c-s> :w<CR>
imap <C-s> <Esc>:w<CR>a

" Ctrl+hjkl to navigate splits
nnoremap <c-h> <c-w>h
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-l> <c-w>l

Now converted to

local keymap = vim.api.nvim_set_keymap
keymap('n', '<c-s>', ':w<CR>', {})
keymap('i', '<c-s>', ':<Esc>:w<CR>a', {})

local opts = {noremap = true}
keymap('n', '<c-h>', '<c-w>h', opts)
keymap('n', '<c-j>', '<c-w>j', opts)
keymap('n', '<c-k>', '<c-w>k', opts)
keymap('n', '<c-l>', '<c-w>l', opts)

Package Management

Use Packer as the default plugin manager

In Archlinux, we can install from AUR: yay -S nvim-packer-git

Start with having packer manage itself:

require('packer').startup(function()
  use 'wbthomason/packer.nvim'
  -- add other use ... for other packages
end)

Then we can run :PackerSync which will download/install the list of defined plugins

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages