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

There is no way to cd to the directory of the current file #3519

Closed
cole-h opened this issue Aug 23, 2022 · 3 comments
Closed

There is no way to cd to the directory of the current file #3519

cole-h opened this issue Aug 23, 2022 · 3 comments
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements

Comments

@cole-h
Copy link
Contributor

cole-h commented Aug 23, 2022

Describe your feature request

I'd like to be able to to cd to the directory the current file is in.

@cole-h cole-h added the C-enhancement Category: Improvements label Aug 23, 2022
@kirawi kirawi added the A-helix-term Area: Helix term improvements label Aug 27, 2022
@cole-h cole-h changed the title :cd with no arguments should cd to the directory of the current file There is no way to cd to the directory of the current file Oct 6, 2022
@cole-h
Copy link
Contributor Author

cole-h commented Oct 6, 2022

The discussion in #3523 has somewhat changed this ticket. I've modified the title and body to reflect that.

@pascalkuthe
Copy link
Member

:cd <c-r>%<c-w> makes this very convenience. Can be bound as a keymap as a macro or when command expansoon lands so closing as duplicate of either those two

@pascalkuthe pascalkuthe closed this as not planned Won't fix, can't repro, duplicate, stale Apr 7, 2024
@cole-h
Copy link
Contributor Author

cole-h commented Aug 9, 2024

Now that #4709 has merged, here's a macro you can use to get this functionality!

[keys.normal.space]
"c" = "@:cd <C-r>%<C-w><ret>"

Pressing spacec will cd helix to the directory containing the current file!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-enhancement Category: Improvements
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants