Notes on Neovim

text-editors neovim
Table of Contents

As I continue using neovim as my daily driver, this post is a collection of things that I learn on the way towards understanding neovim.

Windows Environment Setup

Install Neovim

Install neovim on windows by following this github link

Install Lazyvim

Installing lazyvim on window by following this link.

Config Paths

When you run neovim for the first time, all the plugins and configs are downloaded at %LOCALAPPDATA%\nvim-data.

The Lazyvim related configs and keymaps are stored at %LOCALAPPDATA%\nvim-data\lazy\LazyVim\lua\lazyvim\config.

Custom changes to plugins, keymaps etc can be made at %LOCALAPPDATA%\nvim\lua\config

Theme changes

Permanently set theme to dark mode - :set background=dark.

In the lazy.lua file, change the colorscheme to catppuccin-latte.

Keymap changes

Add one local keymap change to %LOCALAPPDATA%\nvim\lua\config\keymaps.lua.

In insert mode typing the keys jk in quick succession escapes out of insert mode.

local map1 = vim.keymap.set
map1("i", "jk", "<esc>")

Change the terminal to powershell

Add this to the %LOCALAPPDATA%\nvim\lua\config\options.lua file.

-- Check if 'pwsh' is executable and set the shell accordingly
if vim.fn.executable("pwsh") == 1 then
  vim.o.shell = "pwsh"
else
  vim.o.shell = "powershell"
end

-- Setting shell command flags
vim.o.shellcmdflag =
  "-NoLogo -ExecutionPolicy RemoteSigned -Command [Console]::InputEncoding=[Console]::OutputEncoding=[System.Text.UTF8Encoding]::new();$PSDefaultParameterValues['Out-File:Encoding']='utf8';"

-- Setting shell redirection
vim.o.shellredir = '2>&1 | %{ "$_" } | Out-File %s; exit $LastExitCode'

-- Setting shell pipe
vim.o.shellpipe = '2>&1 | %{ "$_" } | Tee-Object %s; exit $LastExitCode'

-- Setting shell quote options
vim.o.shellquote = ""
vim.o.shellxquote = ""