Skip to content

Neovim

Common Commands

:w !python % # runs current file in python
:vsplit # splits screen vertically
:term # opens terminal obvi...

Getting Started

  • Create our init.lua file
  • Install lazy.vim our package manager
    • custom theme settings for nvim
  • Add colorscheme to init file: colorscheme (catppuccin)
  • Add plugins
    • Treesitter # fancier syntax highlighting (cause some files aren't supported in nvim by default)
    • telescope.nvim

How to port .vimrc to init.lua

Create an init.lua file in ~/.config/nvim/

For vim, you use the :set command, which in Lua is vim.o

vim.o.number = true -- in init.lua
:vim.o.number -- directly in nvim

To use other vim functions in lua

vim.api.nvim_set_hl(0, "LineNr", { ctermfg = "LightBlue", })

The vim.cmd runs vimscript rather than lua in-built functions, so its slower

vim.cmd("colorscheme elflord")
vim.cmd.colorscheme(elflord) -- same as above

Lua

Vim