Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/tokisuno/stackmap.nvim
- Owner: tokisuno
- License: mit
- Created: 2024-07-17T13:38:13.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-19T13:11:18.000Z (6 months ago)
- Last Synced: 2024-11-10T23:35:00.268Z (2 months ago)
- Language: Lua
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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