Comments (11)
Here's a better suggestion, don't read any files or config. Just have a "bookmark" directory ( can be configured via env var or whatever). And inside the bookmark directory, "bookmarks" will be added via symlinks.
And then pressing b or something would open up the bookmark dir and you can follow any of the symlinks in there. This is a much superior system than rolling some incompatible config file because this way bookmarks can be synced across applications quite easily.
from fuf.
I'd be fine with there being bookmarks but under a few conditions, as I dont really use these myself:
- read any bookmarks from a file (bookmarks in ~/.config/fuf maybe?) on startup
- suggest bookmarks in the 'goto' prompt of
g
- do not populate anything on missing or empty bookmarks file
really only thing that has to be worked out, unless you have better ideas against what I just listed, is the format of the file and representation of the list containing this info. personally I'd go with something simple like this:
home /home/cat
wallpapers /home/cat/img/wp
where home
and wallpapers
would be the names shown in the 'goto' prompt and the part after it being the location fuf would chdir to on select. as for how these would be represented for fuf, nothing super amazing comes to mind, possible a 2d array with names and location entries, or a simple structure containing these in an array.
exact implementation aside the core point is just reading in some bookmark file during init()
and referring to the obtained information how to populate the 'goto' prompt and where to go on select.
from fuf.
I was thinking of making the format of the file something like this:
gd /home/eastapolo/documents
gp /home/eastapolo/pictures
However, I think what you suggested makes more sense because I was just gonna put a letter in the goto prompt, for instance 'd' for documents but that is really vague. I'll work on using custom labels instead in the goto prompt. Maybe this format is better:
gd docs /home/eastapolo/documents
I'm experimenting with ideas atm, but another option is just putting the folder name in the goto prompt if I were to use my first format that doesn't have a label. I think I'll end up going with what you mentioned unless you have any other suggestions.
from fuf.
gd /home/eastapolo/documents
gp /home/eastapolo/pictures
ah yeah the keybinds themselves too, forgot about that part. would make sense with just that format as well, aside from lack of easily readable thing to put in prompt (paths can get quite long and the prompt only goes horizontally)
gd docs /home/eastapolo/documents
this makes the most sense imo, though for ease of implementation it might be more straight forward like this:
d docs /home/eastapolo/documents
as a side note, the ch_prompt
thats used is only made for single char keybinds anyways, defining them as gd
might make it unclear only one char is ever going to work with the curent codebase.
if you'd read these into a struct with a char key
, char[256] name
and char[PATH_MAX] path
, or something along those lines. and then construct an aray of all these bookmark items during init, that'd work out decently I think.
from fuf.
sticking with the keybind label path
format of the bookmark file would also allow you to easily stick with the existing ch_prompt
format of the key and short explanation, which could be the key and label, as illustrated in this professional mockup
from fuf.
that'd work, and would just be a simple listing all links in that dir if configured and showing them there. then changing to those on select.
where would a 'sane' ish default be for this if not set? ~/.bookmarks
or something like ~/.config/fuf/bookmarks
?
from fuf.
Probably ~/.config/fuf/bookmarks
, ~/.bookmarks
might be used by something else.
Adding bookmarks should also be very simple, B or something would just create a symlink of what's currently hovered under $bookmark_dir/$name
.
would just be a simple listing all links in that dir if configured and showing them there. then changing to those on select
Don't think even that's needed. Just changing the cwd (of fuf) to $bookmark_dir
should also work.
from fuf.
Btw nnn uses a similar bookmark system (was suggested by me) if you want to take a look on how it'd work in practice.
from fuf.
Don't think even that's needed. Just changing the cwd (of fuf) to $bookmark_dir should also work.
I guess, but I'd personally prefer it into the goto menu as its more vim.. ish. or maybe do it through m
and '
. more than just going to the bookmarks dir at any rate. nnn seems to use its completion capabilities on prompts, which I cannot be dicked to add as I only ever open fuf where I need to be anyway.
going of what I feel like at the moment it'd probably be implemented as follows:
- store symlinks of these 'bookmarks' in
~/.config/fuf/marks
- created by
m
plus any other key, similar to vim. eg.m
+a
- stored as a symlink named
key
. eg~/.config/fuf/marks/a
from last time '
would list all these in a similar way to the shoddy picture on the goto: prompt- pressing any of the keys would goto the mark location in question
- add special non existant mark
-
to goto previous location before going to mark now that absolute path changing is a thing
from fuf.
almost started working on this but then realized once again this doesnt overlap with any of my personal usecases. all I do is type fuf /where/I/want/to/be and browser around a bit. this coupled with history in my shell solves all my 'bookmark' needs.
sure its an alright feature but I just dont care enough personally to be motivated to implement this as I never keep it open. I rather use it as a quick tool similar to less or tree or something while doing all main things in my shell
from fuf.
I probably won't implement this because I've moved on to something else, but the suggestion similar to nnn sounds good to me and better than what I was thinking of.
from fuf.
Related Issues (20)
- optimization causes segfaults in color parsing HOT 1
- commandline arguments HOT 2
- corruption of ui and segfaults while scrolling rapidly HOT 5
- open_file() issues with different open scripts
- expand/improve default scripts HOT 1
- better loading canceling HOT 1
- handle current directory getting deleted
- resizing while loading segfaults
- dont uselessly refresh at top/bottom of filelist HOT 1
- fix open_with
- crashes on empty directory refreshes
- show uid/gid even when unresolvable
- previews dont always get started HOT 3
- add shell completion HOT 1
- prompt drawing issues after resize
- large directories dont always start loading HOT 4
- Define environment variables HOT 1
- freezing of ui
- double preview render
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fuf.