Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tokisuno/stackmap.nvim

learning neovim plugin development
https://github.com/tokisuno/stackmap.nvim

Last synced: 3 days ago
JSON representation

learning neovim plugin development

Awesome Lists containing this project

README

        

# stackmap.nvim
learning neovim plugin development

[last left off](https://youtu.be/n4Lp4cV8YR0?si=msuEhNsuB-Tbx0r0&t=5538)

## notes
* Files in `lua/` are to be run when they are called
* Files in `plugin/` are to be run on startup/runtime
* `require()` loads a file once and then puts it inside of an internal table
- If you run `:lua require('plugin.xyz') again, nvim checks to see if it's already in the table
- If the check is satisfied, nothing new happens
* `require()` loads a file once and saves the result of that thing
* lhs = left-hand side

## Mindmap
```lua
--[[

lua require('mapstack').push('debug_mode', 'n' {
})

...

lua require('mapstack').pop('debug_mode')

--]]
```
## Functions needed for plugin
* vim.keymap.set(...) -> create new keymaps
* vim.api.nvim_get_keymap(...) -> gets keymaps

## pairs() vs ipairs()
### pairs
* iterates over EVERY key in a table
* order not guaranteed
* used for string keys
### ipairs
* iterate over numeric keys
* order IS guaranteed