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

Add short option to dir section like fish shell #1265

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

Conversation

knorr3
Copy link

@knorr3 knorr3 commented Oct 17, 2022

Description

Fixes #897.

I dunno if the placement is right because I was confused by the repo truncate code above :-).
The code was copied by fish shell: https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/fishy.zsh-theme

Screenshot

  • Path:
    • /usr/local/opt/spaceship/sections
  • Path with standard TRUNC setting:
    • …/opt/spaceship/sections
  • Path with this pull request:
    Short path

@netlify
Copy link

netlify bot commented Oct 17, 2022

Deploy Preview for spaceship-prompt ready!

Name Link
🔨 Latest commit 863eea2
🔍 Latest deploy log https://app.netlify.com/sites/spaceship-prompt/deploys/634db25befb06a000b267936
😎 Deploy Preview https://deploy-preview-1265--spaceship-prompt.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@denysdovhan
Copy link
Member

Good job! Thanks for contributing!

Let me take a closer look when I will get some spare time.

@merikan
Copy link
Contributor

merikan commented Oct 22, 2022

@knorr3 I have been using your PR for a couple of days and it works great. Awesome, just what I needed 👍

Previously I used liquidprompt which has a nice implementation to show the path through different methods.

@denysdovhan denysdovhan added the improvement A PR that make small changes for improving UX, performance, readability, etc label Nov 2, 2022
Copy link
Member

@denysdovhan denysdovhan left a comment

Choose a reason for hiding this comment

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

I guess this will not work with git/hg repos. I would like to maintain git repo name in full instead of shortened.

Copy link
Member

@denysdovhan denysdovhan left a comment

Choose a reason for hiding this comment

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

Here's my review:

  • This is a cool and long-awaited feature. Thanks for contributing it!
  • This should be enabled by default, so no SPACESHIP_DIR_SHORT option
  • This should respect git/hg-root, so it is not truncated

Please, implement these suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement A PR that make small changes for improving UX, performance, readability, etc
Development

Successfully merging this pull request may close these issues.

Dir module: shorten path like fish shell
3 participants