https://github.com/azeirah/nvim-redux
NVim integration for redux using telescope and ripgrep
https://github.com/azeirah/nvim-redux
nvim nvim-plugin nvim-telescope nvim-treesitter redux
Last synced: 11 months ago
JSON representation
NVim integration for redux using telescope and ripgrep
- Host: GitHub
- URL: https://github.com/azeirah/nvim-redux
- Owner: Azeirah
- Created: 2022-02-13T18:52:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-23T22:39:23.000Z (over 4 years ago)
- Last Synced: 2025-04-10T04:56:29.240Z (over 1 year ago)
- Topics: nvim, nvim-plugin, nvim-telescope, nvim-treesitter, redux
- Language: Lua
- Homepage:
- Size: 620 KB
- Stars: 17
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# nvim-redux
Simplify navigation in redux projects with telescope.
Treesitter queries written intelligently to find redux-related code in your entire project in milliseconds.
- ✔️ List `dispatch(...)` calls in your entire project
- ✔️ List your reducer action definitions
- ✔️ Raw definitions in switch cases
- ✔️ redux-toolkit action definitions
## Dependencies
ripgrep needs to be available on your system.
`use 'nvim-telescope/telescope.nvim`
## Install
Note: this doesn't work on any stable release of neovim currently due to a bug in neovim's treesitter api.
The only way this plugin can work right now is by building neovim yourself. This is as of 13th of February 2022.
Confirmed to work with neovim 0.7.0 `NVIM v0.7.0-dev+1070-gf89f4b1e1`
`use 'Azeirah/nvim-redux'`
## Setup
No configuration or setup needed. All you have to do is configure your keybindings.
```vimscript
# lrd = locate, redux, dispatch
nmap lrd :lua require('nvim-redux').list_dispatch_calls()
# lra = locate, redux, action
nmap lra :lua require('nvim-redux').list_actions_in_switch_reducer()
```
## Functionality
### List dispatch calls in telescope

Searches your project for calls to `dispatch(...)`.
**nvim-redux.list_dispatch_calls**
### List redux action definitions in telescope

Finds all redux action definitions. Supports both raw action definitions as well as reducers defined in slices using react toolkit.
```javascript
// Find raw actions
switch (action.type) {
case 'this_is_an_action_that_will_be_found':
break;
}
// Reducer actions defined using redux-toolkit are also supported!
const someSlice = createSlice({
...
reducers: {
youCanFindMe: state => {...},
andMe(state) {...}
}
});
```
**nvim-redux.list_actions_in_switch_reducer**