Last Updated on March 26, 2023 by mishou

I. Tutorials

I have learned from:

  1. https://github.com/wbthomason/packer.nvim
  2. How to Install and Set Up Neovim for Code Editing
  3. Turning Neovim into a Full-Fledged Code Editor with Lua

II. What you will get

nvim cow

II. File structure

If you install Packer to the default directory, your file structures will be:

If you install Packer to the ~/.config/nvim/site/pack/packer/start directory as shown in the tutorial 3, your file structures will be:

III. How to install Packer

I was able to set up Neovim by follwoing mainly the tutorial 2 and 3 showed on I Tutorials. However, I have changed the following setting.

1.The directory that I installed Packer to

I have installed Packer to the default directory. On Unix systems, you can clone the repository into the directory by running the following command, which you can find in tutorial 1 on I:

git clone --depth 1 https://github.com/wbthomason/packer.nvim\
 ~/.local/share/nvim/site/pack/packer/start/packer.nvim

When you installed Packer to the default directory, plugins.lua (you can name it “plug.lua”) should be:

-- [[ plugins.lua ]]
return require('packer').startup(function(use)
  -- Plugins Go Here
end)

When you installed Packer to ~/.config/nvim/site/pack/packer/start/packer.nvim, plug.lua should be:

2.keys.lua

I added these lines to the keys.lua file:

--[[ keys.lua ]]
local map = vim.api.nvim_set_keymap

-- remap the key used to leave insert mode
map('i', 'jk', '', {})
-- Toggle nvim-tree
map('n', '<Leader>n', [[:NvimTreeToggle]], {})
-- Toggle more plugins
map('n', '<Leader>l', [[:IndentLinesToggle]], {})
map('n', '<Leader>t', [[:TagbarToggle]], {})
map('n', '<Leader>ff', [[:Telescope find_files]], {})
map('n', '<Leader>fg', [[:Telescope live_grep]], {})

IV. Configure the built-in LSP

I have configured LSP following the tutorial:

Neovim for Beginners — LSP (Part 1)

By mishou

Leave a Reply

Your email address will not be published. Required fields are marked *