Neovim
Common Commands
:w !python % # runs current file in python
:vsplit # splits screen vertically
:term # opens terminal obvi...
Getting Started
- Create our
init.luafile- https://neovim.io/doc/user/lua-guide.html#lua-guide-config
- Check if one is already exists
- Run
:echo stdpath('config')
- Run
- Install
lazy.vimour package manager- custom theme settings for
nvim
- custom theme settings for
- 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