mrjones2014 / ctrlg

A command line context switcher, written in Rust :crab:
https://crates.io/crates/ctrlg
MIT License
30 stars 1 forks source link

[Feature]: Keybind to open selected directory in `$EDITOR` if defined #38

Closed mrjones2014 closed 2 years ago

mrjones2014 commented 2 years ago

Similar Issues

Description

There should be a separate key bind in the fuzzy finder like maybe ctrl + enter or something that, when used, opens the selected directory in $EDITOR (if $EDITOR is defined) in the active tmux pane only. So, both tmux panes would still get cd'd, but only current would open $EDITOR.

Use Case

Quickly opening a context to work on writing some code. cd to the directory in all panes, but have the current pane open Neovim to the directory, for example.

mrjones2014 commented 2 years ago

Most likely the way to do this is to prefix the selected directory with something and parse that something. Maybe output could look like one of the following:

edit:"path/to/dir"

in this example, multiline output, the first line is treated like an instruction

edit
path/to/dir
mrjones2014 commented 2 years ago

the delimiter between the instruction and the directory would need to be a character that can't be part of the directory name.