Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make it configurable #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

make it configurable #11

wants to merge 2 commits into from

Conversation

quantonganh
Copy link
Owner

#9

@quantonganh quantonganh mentioned this pull request Jul 12, 2024
@quantonganh quantonganh force-pushed the 9-configurable branch 2 times, most recently from 0446004 to a93aa96 Compare July 12, 2024 04:24
@markstos
Copy link
Contributor

This direction looks great! Here's some feedback.

  • One reason I'm interested in this personally is that I don't have ripgrep installed. I like ack. It would be nice if the script itself used grep instead, which is pre-installed everywhere. Modern grep has a flag for PCRE regex support, should it should be able to do what ripgrep is doing.

  • I tried to create my own config file and swap out rg with ack, but launching the fzf action failed with this error:

⚠️  Process "--percent" in domain "local" didn't exit cleanly
Exited with code 1.

I'm not sure I did something wrong when changing the action syntax or if there's a bug here, but it seems like there may be room for some more error checking so --percent doesn't end up getting treated like a process name.

Here's the action I tried:

  fzf:
    command: |
      helix-fzf.sh \$(ack . | fzf --delimiter : --preview 'bat --style=full --color=always --highlight-line {2} {1}' --preview-window '~3,+{2}+3/2' | awk '{ print \$1 }' | cut -d: -f1,2,3)

@markstos
Copy link
Contributor

The same concept could be done with other terminals, like foot, and a tiling window manager with a CLI API, like Sway, once Helix supports placeholders for the current file name and line number in command mode.

With those, a swaymsg CLI command could sent to split horizontally, then a command like foot lazygit -- path/to/current/file.txt.

This would also not require having a status bar design that displays the current file and line number just so this utility could parse it.

The config file format would equally interesting for any other project like that wishes to create an IDE with a terminal text editor and a tiling window manager.

It looks like these features of Helix may be merged soon. Here's a PR to track:

helix-editor/helix#11164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants