Skip to content

Commit a7f0c4d

Browse files
committed
feat: create initial, working version of the nvim-git-rebase-todo neovim plugin! 🔥🔥🔥
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
1 parent 517fd79 commit a7f0c4d

File tree

2 files changed

+494
-22
lines changed

2 files changed

+494
-22
lines changed

nvim-git-rebase-todo/README

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,38 @@ see also:
5555
- https://neovim.io/node-client/classes/Neovim.html
5656
- https://neovim.io/node-client/classes/NeovimClient.html
5757
- https://neovim.io/node-client/classes/Window.html
58-
- https://neovim.io/doc/user/api.html
58+
- ! https://neovim.io/doc/user/api.html
5959
- https://neovim.io/doc/user/windows.html#window
60+
- same as :help
61+
- :help events
62+
- :help nvim_open_win|nvim_win_close|nvim_win_get_cursor
63+
- :help BufEnter|BufLeave|CursorMoved|CursorMovedI
64+
- etc
65+
- ! https://github.com/neovim/node-client/tree/master/packages/neovim/src/api/Neovim.ts
66+
- Neovim
67+
- Buffer
68+
- Window
69+
- NerdTree's `ToggleTabTree` & following to what it leads (via simple file search)
70+
- https://github.com/preservim/nerdtree/blob/eed488b1cd1867bd25f19f90e10440c5cc7d6424/autoload/nerdtree/ui_glue.vim#L643
71+
72+
mixing these up was the most useful.
73+
74+
in general, i tried to read from the start of the API reference, but just couldn't focus - nothing seemed important.
75+
76+
then, found the nodejs REPL demo from node-client:
77+
- https://github.com/neovim/node-client/blob/e01ecaa6ba616738e6fc2b9d1b283f095a84899b/packages/neovim/scripts/nvim.js
78+
and started playing w/ stuff.
79+
80+
it took a long time to figure out how to properly link the (remote) plugin for nvim to detect.
81+
the package.json's "postinstall" script now has this.
82+
though, TODO: create a PR to upstream to clear this up. i wasted a good few hours on this.
83+
84+
& then bit by bit, continued trying to figure out how to write the plugin.
85+
i think after creating a new Buffer and then opening a new Window with it,
86+
i knew what's up, and switched from the REPL to the TS file.
87+
88+
there were many, many iterations of it. sadly didn't commit any of them,
89+
only the latest one now.. good fun anyhow!
90+
91+
really appreciate both the RPC capabilities, and the nvim-node-client.
92+
wouldn't have been able to do this in lua -- not in a single day for sure.

0 commit comments

Comments
 (0)