lotabout / skim

Fuzzy Finder in rust!
MIT License
5.07k stars 180 forks source link

shortening long filenames #397

Open bionicles opened 3 years ago

bionicles commented 3 years ago

I have some long filenames from synthetic data which put uuid in the filename (dumb but not my fault!)

ex Zula72_Ondricka197_907bd608-e768-4ce4-a5d8-4c7ba87bffa5.json

it takes up so much space it's hard to see the preview, is there a way to shorten the filenames in skim without renaming the files?

lotabout commented 3 years ago

@bionicles Skim knows nothing about the meaning of the content and there is no optimization for filename displays.

There are two possible solutions:

  1. Skim provides ways to scroll left/right, bind to Alt-h, Alt-l by default. So you are not sticked to the default view.
  2. With -d and --with-nth you could format what's shown on the screen. e.g.
    $ echo Zula72_Ondricka197_907bd608-e768-4ce4-a5d8-4c7ba87bffa5.json | sk -d '_' --with-nth ..-2
    > Zula72_Ondricka197_

    However this feature is designed to format structured texts(e.g. csv) and might not meet your need directly.