dumb-jump
                                
                                
                                
                                    dumb-jump copied to clipboard
                            
                            
                            
                        Paths too long in the tooltip
I just heard about dumb-jump and started using it in a Python project I'm working on. So far so good, except for one thing.
I work with a virtualenv in ~/.virtualenv, so I added +/home/schnouki/.virtualenv/envname/lib/python3.6/site-packages to my .dumbjump file.
As a result, when using dubm-jump-go, the first line can sometimes be extremely long, such as home/schnouki/.virtualenv/envname/lib/python3.6/site-packages/django_extensions/management/modelviz.py...
As I'm typically working with my emacs in full-screen with several windows, if I'm using dumb-jump in the right-most window and I have such a result, the line is so long that it is cut somewhere in the middle of the path. Which makes the tooltip quite unusable.
IMO it would make sense to have an option in .dumpjump to shorten some paths. For example my virtualenv path could be shortened to [venv], displaying a path such as [venv]/django_extensions/management/modelviz.py. Which would be much better 😃
What do you think? Is it a good idea? Would you care to implement it, or merge it if I implemented it myself?
Thanks for the report. So just to confirm you're talking about using dumb-jump-quick-look, right? I assume so based on your usage of "tooltip" and not popup.
I guess it should be used for all choices in dumb-jump-prompt-user-for-choice then? Should the same apply for the project itself?
What would be the syntax for defining a shorthand path identifier? Maybe something like:
venv=/home/schnouki/.virtualenv/envname/lib/python3.6/site-packages
usrinc=/usr/local/include
sysinc=/usr/include
Or:
alias venv /home/schnouki/.virtualenv/envname/lib/python3.6/site-packages
alias usrinc /usr/local/include
alias sysinc /usr/include
                                    
                                    
                                    
                                
Maybe I am underthinking this and please correct me if I am wrong, but it seems like this is pretty easy to solve without changing dumb-jump
Instead of adding +/home/schnouki/.virtualenv/envname/lib/python3.6/site-packages to your .dumb-jump just add +/tmp/venv and do a:
ln -s /tmp/venv /home/schnouki/.virtualenv/envname/lib/python3.6/site-packages in your terminal. Obviously /tmp/venv can be anything in this example.
Edit:
Obviously /tmp is a bad example since it probably won't stick around after a reboot, but if instead of /tmp you just used your project root then 1) project root path will be excluded from the tooltip 2) you might not even need to update your .dumpjump file
I was thinking about dumb-jump-go. Sorry if I was unclear; I was using the word "tooltip" as the first argument for dump-jump-go is called use-tooltip. But yeah it uses a popup, and I meant popup indeed :)
I thought about the symlink solution but I don't quite like it: it I create such a symlink in my project, I'll have to add some exclusion rules in my linter config and unit test launcher (flake8 and pytest) so that they ignore the symlink. Which is annoying considering that these files are in git (and used by other people in the team), while my .dumbjump is not (added to .git/info/exclude).
The syntax venv=... looks really nice to me; maybe I'll try to implement that in the next few days if I have some time :)
Thanks!
@Schnouki Thanks for the details. Have you considered using ivy or helm instead of the default popup? See dumb-jump-selector in the README. I think it would handle long paths way better.