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

possible to edit the database #60

Closed
graysky2 opened this issue Jul 16, 2011 · 7 comments
Closed

possible to edit the database #60

graysky2 opened this issue Jul 16, 2011 · 7 comments

Comments

@graysky2
Copy link
Contributor

Is it possible to edit the database from which autojump pulls? For example, I have changed some of my dirstructure such that a number of my j commands are no longer relevant.

Is my only option to remove and start fresh? (i.e. rm -f ~/.local/share/autojump)?

@joelthelion
Copy link
Collaborator

Normally paths that don't exist anymore are not used in the ranking, so autojump should still work properly. They are still kept in the database in case they were on a removable drive, so that you will be able to use autojump with removable drives.

Is there any specific reason you want to remove these paths from the database?

@graysky2
Copy link
Contributor Author

@joel - My highest weighted path per jumpstat was /dev/shm which is where I do compiling, scratch files, etc. I recently switched it to /tmp/scratch and whenever I'd hit 'j' autojump would take me to the highest ranked path which I don't use anymore. I just nuked the ~/.local/share/autojump and rebuilt my db. Having the ability to remove a line from the history would be a cool feature.

@joelthelion
Copy link
Collaborator

I think you have a good point. I see two options here: either add an option to autojump to remove paths, which is easy but not very flexible; or switch to a text format for the autojump file. What do you think?

@graysky2
Copy link
Contributor Author

@joelthelion - agreed. I think the latter represents the most flexible and simplistic option moving forward. It's akin to the ~/.bash_history to me. Good idea.

@joelthelion
Copy link
Collaborator

I've implemented a new text format in a new branch (text_format). I haven't written the migration code yet, but you can already try it, it will simply create a new database file.

Comments welcome!

@joelthelion
Copy link
Collaborator

The code is now ready in the "text_format" branch, can you test it and tell me what you think?

@joelthelion
Copy link
Collaborator

I've merged the code into master. Been using it for a few days, and it works great. Please re-open if there is a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants