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

feat(telescope): magic command #11

Merged
merged 9 commits into from
Apr 5, 2023
Merged

Conversation

fedemengo
Copy link
Owner

@fedemengo fedemengo commented Feb 23, 2023

This adds a new telescope command that

  • <S-tab> moves one directory up
  • <tab> moves inside the directory of the file entry selected
  • <C-e> to move inside only one dir wrt the file entry selected
  • <C-h> toggle hidden files
  • S to decrease the depth of the finder command (only in normal mode)
  • D to increase the depth of the finder command (only in normal mode)

So

/home/user/some/folder
S-tab
/home/user/some

/home/user/ :entry some/folder/myfile.data
tab
/home/user/some/folder

/home/user/ :entry some/folder/myfile.data
C-e
/home/user/some
1s83r17b05ra1.mp4

fnl/init.fnl Outdated Show resolved Hide resolved
@fedemengo fedemengo force-pushed the test/telescope-ff-with-cd branch 4 times, most recently from 2f87af2 to 135ad19 Compare February 24, 2023 12:56
fnl/mods/tools/telescope.fnl Show resolved Hide resolved
fnl/init.fnl Show resolved Hide resolved
@fedemengo fedemengo self-assigned this Feb 24, 2023
@fedemengo fedemengo force-pushed the test/telescope-ff-with-cd branch 2 times, most recently from 4a6b354 to 66ced54 Compare February 24, 2023 21:32
@fedemengo
Copy link
Owner Author

Looks good if it didn't break Live Grep it might be something with the picker previewer, to investigate

@fedemengo
Copy link
Owner Author

Actually it breaks all pickers

@fedemengo fedemengo force-pushed the test/telescope-ff-with-cd branch from 4b3242b to 11708a4 Compare March 30, 2023 18:22
@@ -191,7 +191,7 @@

(var magic
(fn [_opts]
(var opts (or _opts {}))
(var opts (deep-copy (or _opts {})))
Copy link
Owner Author

@fedemengo fedemengo Mar 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good if it didn't break Live Grep it might be something with the picker previewer, to investigate

Actually it breaks all pickers

This was causing _opts passed as input, which was causing ivy_config to be modified (lua uses references for all vars). This was adding additional fields breaking the preview

Screenshot 2023-03-31 at 01 07 42

Debugged by logging opts passed to live_grep/find_files before and after using the magic command

@fedemengo fedemengo force-pushed the test/telescope-ff-with-cd branch from b514510 to 2c3e239 Compare March 30, 2023 23:13
@fedemengo fedemengo changed the title WIP - telescope magic command telescope magic command Mar 30, 2023
@fedemengo fedemengo marked this pull request as ready for review March 30, 2023 23:16
@fedemengo fedemengo force-pushed the test/telescope-ff-with-cd branch 2 times, most recently from 387cd7d to 18f4687 Compare March 31, 2023 09:19
@fedemengo fedemengo force-pushed the test/telescope-ff-with-cd branch 5 times, most recently from 1caea80 to 35c26e0 Compare April 1, 2023 11:48
@fedemengo fedemengo force-pushed the test/telescope-ff-with-cd branch 2 times, most recently from 7e3e03c to dae2928 Compare April 1, 2023 14:23
@fedemengo fedemengo force-pushed the test/telescope-ff-with-cd branch from dae2928 to 80fb7a2 Compare April 1, 2023 21:26
@fedemengo fedemengo force-pushed the test/telescope-ff-with-cd branch from 80fb7a2 to 276ba67 Compare April 5, 2023 07:30
@fedemengo fedemengo changed the title telescope magic command feat(telescope): magic command Apr 5, 2023
@fedemengo fedemengo merged commit ecaaf74 into main Apr 5, 2023
@fedemengo fedemengo deleted the test/telescope-ff-with-cd branch April 20, 2023 19:20
@phortonssf
Copy link

Does this work still for telescope?

@fedemengo
Copy link
Owner Author

@phortonssf it does, I'm still using it heavily

(var magic (fn [_opts]

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