Skip to content
/ nvim Public

Don't let my boss see how much time I spend on this (it didn't make me a better dev)

License

Notifications You must be signed in to change notification settings

soejun/nvim

Repository files navigation

Neovim Config

I'm using LazyVim in another repo for the foreseeable future, this was fun to learn though. Til next time!

Oh we're so back.

Based on the starter template for πŸ’€ LazyVim.

πŸŽ“ LazyVim and General VIM Notes

Will contain a combination of snippets derived from LazyVim documentation and various VIM notes that include but aren't limited to its functionality, QoL, and quirks.

πŸ“‚ File Structure

~/.config/nvim
β”œβ”€β”€ lua
β”‚   β”œβ”€β”€ config
β”‚   β”‚   β”œβ”€β”€ autocmds.lua
β”‚   β”‚   β”œβ”€β”€ keymaps.lua
β”‚   β”‚   β”œβ”€β”€ lazy.lua
β”‚   β”‚   └── options.lua
β”‚   └── plugins
β”‚       β”œβ”€β”€ spec1.lua
β”‚       β”œβ”€β”€ **
β”‚       └── spec2.lua
└── init.lua
Property Default Merging Rule
cmd The list of commands will be extended with your custom commands.
event The list of events will be extended with your custom events.
ft The list of filetypes will be extended with your custom filetypes.
keys The list of keymaps will be extended with your custom keymaps.
opts Your custom options (opts) will be merged with the default options.
dependencies The list of dependencies will be extended with your custom dependencies.
Any other property Will override the defaults.

For ft, event, keys, cmd and opts you can instead also specify a values function that can make changes to the default values, or return new values to be used instead.

References

Mode Identifier
Normal Mode n
Insert Mode i
Character-wise Visual Mode v
Line-wise Visual Mode V
Block-wise Visual Mode ^V (Ctrl-v)
Replace Mode R
Virtual Replace Mode Rv
Command-Line Mode c
Terminal Mode t
Operator-Pending Mode o
Select Mode s
Ex-Mode !

Tips and Tricks (Normal VIM friendly)

  • Yanking an entire file: :%y+
    • + is a register that is tied to the system clipboard.

VIM API Commands

Getting current buffer path:

-- 0 stands for current buffer
-- https://neovim.io/doc/user/api.html#nvim_buf_get_name()
vim.api.nvim_buf_get_name(0)

Python

Reference for PyLsp LazyVim Configuration

  • Blob for PyLSP and Ruff heavily customized in the context of LazyVim.

Pyright and BasedPyright Stubs

Using Microsoft python-type-stubs with Pyright

Essentially:

  1. Add python-type-stubs as a git submodule under the directory stubs:
cd proj
# Assuming you have GitHub SSH authentication set up.
git submodule add git@github.com:microsoft/python-type-stubs stubs
  1. Point to stubs
  • Using pyrproject.toml
[tool.pyright]
stubPath = "./stubs/stubs"
  • If not pyporject.toml, must have pyrightconfig.json in root of workspace
{
  "stubPath": "./stubs/stubs"
}
  1. To update: git submodule update

About

Don't let my boss see how much time I spend on this (it didn't make me a better dev)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages