Smart Neovim launcher for yyx990803/launch-editor
1# `launch-editor-nvim`
2
3something you can set as `$LAUNCH_EDITOR` for
4[`launch-editor`](https://github.com/yyx990803/launch-editor) to open a file in
5an existing `nvim` process
6
7uses artificial intelligence to choose the best neovim process to open the file
8in, based on the current working directory of neovim and the path of the file to
9open
10
11based on
12<https://theosteiner.de/open-neovim-from-your-browser-integrating-nvim-with-sveltes-inspector>
13and some discussion in the comment section under that blog post. thanks
14everyone!
15
16## installation
17
18```sh
19cargo install --locked launch-editor-nvim
20```
21
22then just set `$LAUNCH_EDITOR` (e.g., in `~/.zshenv`):
23
24```zsh
25export LAUNCH_EDITOR=launch-editor-nvim
26```
27
28## platform support
29
30| platform | tested | should work |
31| :------------: | :----: | :---------: |
32| macOS | yeah | yeah |
33| any other unix | no | yeah |
34| windows | no | no |
35
36## frequently asked questions
37
38### why did you write in rust what should really be a shell script
39
40because its fun and also i wanted to be able to `cargo install` it anywhere
41
42### how does the artificial intelligence decide which neovim process to target?
43
441. the current working directory of the neovim process must be an ancestor of
45 the file to open
462. the process with the closest ancestor "wins"
47
48### does it really use artificial intelligence?
49
50it makes use of somewhat arbitrary heuristics to take a decision for you. it
51also helps you be more productive, so it's like a sort of "copilot" i guess. it
52also involves a lot of `if` statements, enough to be called an ai-enabled app
53
54### this isn't artificial intelligence
55
56this isn't a question
57
58## infrequently asked questions
59
60### should i play outer wilds
61
62no, you _MUST_ (see [RFC 2119](https://www.rfc-editor.org/info/rfc2119))