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 truncate style for path #279

Merged
merged 15 commits into from
Dec 23, 2020
Merged

Add truncate style for path #279

merged 15 commits into from
Dec 23, 2020

Conversation

jcs090218
Copy link
Member

@jcs090218 jcs090218 commented Dec 21, 2020

Hmmm... I have tried implements #276. I would say this is a frame so we can implement more styles in the future.

@JesusMtnez What do you think? 😕

(setq dashboard-path-style 'truncate-middle)
(setq dashboard-path-max-length 50)

@jcs090218
Copy link
Member Author

jcs090218 commented Dec 21, 2020

Okay, this turn out became a huge patch. This patch does the following.

Truncate long path

  • Introduce variable dashboard-path-style for truncate the long path - nil (below are related variables)
    • dashboard-path-shorten-string - "..."
    • dashboard-path-max-length - 70

Show base of the path in front (Inspired by VSCode)

  • Introduce variable dashboard-recentf-show-base and dashboard-projects-show-base for showing the base of the path. (below are related variables)
    • dashboard-recentf-item-format - "%s %s"
    • dashboard-projects-item-format - "%s %s"

By setting dashboard-projects-show-base to t, you get the following. If nil then it does nothing

Image 1

dashboard-widgets.el Show resolved Hide resolved
dashboard-widgets.el Outdated Show resolved Hide resolved
dashboard-widgets.el Show resolved Hide resolved
dashboard-widgets.el Outdated Show resolved Hide resolved
@jcs090218
Copy link
Member Author

jcs090218 commented Dec 21, 2020

For the newest version of this branch. It gives this result.

(setq dashboard-path-style 'truncate-end
      dashboard-path-max-length 60
      dashboard-projects-show-base 'align
      dashboard-recentf-show-base 'align
      dashboard-recentf-item-format "%s  %s"
      dashboard-projects-item-format "%s  %s")

Copy link
Contributor

@JesusMtnez JesusMtnez left a comment

Choose a reason for hiding this comment

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

Really nice job!! Thank you!!

@jcs090218 jcs090218 merged commit 7419914 into master Dec 23, 2020
@jcs090218 jcs090218 deleted the trunc branch December 23, 2020 08:52
@jcs090218
Copy link
Member Author

Thanks!

@ema2159
Copy link
Contributor

ema2159 commented Dec 25, 2020

Perfect! Great job man, I appreciate your effort.

@ema2159 ema2159 mentioned this pull request Dec 25, 2020
@ema2159
Copy link
Contributor

ema2159 commented Dec 25, 2020

It would be a good idea to add some documentation in the README though.

@jcs090218
Copy link
Member Author

Yeah, I'm still working on the style you mentioned in doom-midline! Documentation would be the next step after this! It is still WIP. ;)

@jcs090218 jcs090218 mentioned this pull request Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants