techwizrd / fishmarks Goto Github PK
View Code? Open in Web Editor NEWBookmark and jump to directories faster than a sailfish! Fishmarks is a clone of bashmarks for the Fish shell.
License: Apache License 2.0
Bookmark and jump to directories faster than a sailfish! Fishmarks is a clone of bashmarks for the Fish shell.
License: Apache License 2.0
Although it is possible to add bookmarks with invalid names as per Issue #10, there is no way to delete them. This leaves the user with no way to fix their situation other than manually editing the ~/.sdirs
file.
Operating System: Ubuntu 13.04 "Raring Ringtail"
Fish Shell: fish, version 2.0.0
(Compiled from Git version fish-shell/fish-shell@a62ebc9)
Fishmarks version: 5f4771d
Steps to Reproduce:
The terminal session below demonstrates how to reproduce the error.
[~]$ mkdir test
[~]$ cd test
[~/test]$ s test~dir
set: Invalid character “~” in variable name. Only alphanumerical characters and underscores are valid in a variable name.
/home/kunal/.fishmarks/marks.fish (line 157): set -x DIR_test~dir "$HOME/test"
^
in . (source) call of file “-”,
called on line 140 of file “/home/kunal/.fishmarks/marks.fish”,
in function “_update_completions”,
called on line 50 of file “/home/kunal/.fishmarks/marks.fish”,
in function “save_bookmark”,
called on line 1 of file “-”,
with parameter list “test~dir”
in function “s”,
called on standard input,
with parameter list “test~dir”
[~/test]$ d test~dir
set: Invalid character “~” in variable name. Only alphanumerical characters and underscores are valid in a variable name.
/home/kunal/Projects/fishmarks/marks.fish (line 143): set -x DIR_test~dir "$HOME/test"
^
in . (source) call of file “-”,
called on line 129 of file “/home/kunal/.fishmarks/marks.fish”,
in function “_valid_bookmark”,
called on line 92 of file “/home/kunal/.fishmarks/marks.fish”,
with parameter list “test~dir”
in function “delete_bookmark”,
called on line 1 of file “-”,
with parameter list “test~dir”
in function “d”,
called on standard input,
with parameter list “test~dir”
ERROR: bookmark 'test~dir' does not exist
When you relocate a folder, the location obviously can't be found. I am however also having trouble removing the bookmark, and I even attempted to overwrite it with no luck. In both cases I get an error message that looks like this: "sed: 1: "/Users/Schuyler/.sdirs": invalid command code S"
We are still relatively new in town, and just getting started, but we are more stable than the other options, namely OMF. I think some of these functions could be turned into a handful of Wahoo plugins or maybe some could be even make it to core. We are always accepting feature request and feedback. I would love if you could give Wahoo a look.
Regards 😄
While the current install mechanism as mentioned in the README is good for a quick and dirty install, creating a distribution package will generally require the scripts to be installed in system directories.
Fish does provide mechanisms for this!
I'd recommend the following source structure:
<function_name>.fish
for each included function. This can be installed to pkg-config --variable functionsdir fish
which points to /usr/share/fish/vendor_functions.d
fishmarks.fish
containing the aliases and the SDIR
check. This can be installed to pkg-config --variable confdir fish
(/usr/share/fish/vendor_conf.d
)This would clean up the installs and probably simplify the packaging process.
I am willing to provide a PR, if desired.
There isn't necessarily a need to restrict Fishmarks to only bashmarks functionality, bookmark names, error messages, and help text. There should be a flag like BASHMARK_COMPATIBLE
to make Fishmarks act exactly like Bashmarks. Unseting the flag should allow Fishmarks to provide less restrictions on bookmark names and more helpful error messages and help text.
For example, UNIX directories can have hyphens in their name, but currently hyphens are not allowed in bookmark names. Hyphens are not allowed because they cannot be used in bash environment variables and bashmarks saves all of it's directories as environment variables prefixed with DIR_
in the ~/.sdirs
file. This is only one of the many restrictions that could be lifted if Fishmarks did not have to keep strict compatibility with Bashmarks.
Fishmarks allows you to save bookmarks with names that contain invalid characters that cause Fishmarks to display an error on every you try to use Fishmarks afterwards. However, you cannot remove them unless you edit the ~/.sdirs
file because the Fish shell cannot set variables with invalid variables.
Operating System: Ubuntu 13.04 "Raring Ringtail"
Fish Shell: fish, version 2.0.0
(Compiled from Git version fish-shell/fish-shell@a62ebc9)
Fishmarks version: 5f4771d
Steps to Reproduce:
The terminal session below demonstrates how to reproduce the error.
[~]$ mkdir test
[~]$ cd test
[~/test]$ s test~dir
set: Invalid character “~” in variable name. Only alphanumerical characters and underscores are valid in a variable name.
/home/kunal/.fishmarks/marks.fish (line 157): set -x DIR_test~dir "$HOME/test"
^
in . (source) call of file “-”,
called on line 140 of file “/home/kunal/.fishmarks/marks.fish”,
in function “_update_completions”,
called on line 50 of file “/home/kunal/.fishmarks/marks.fish”,
in function “save_bookmark”,
called on line 1 of file “-”,
with parameter list “test~dir”
in function “s”,
called on standard input,
with parameter list “test~dir”
[~/test]$ l
set: Invalid character “~” in variable name. Only alphanumerical characters and underscores are valid in a variable name.
/home/kunal/.fishmarks/marks.fish (line 119): set -x DIR_test~dir "$HOME/test"
^
in . (source) call of file “-”,
called on line 103 of file “/home/kunal/.fishmarks/marks.fish”,
in function “list_bookmarks”,
called on line 1 of file “-”,
in function “l”,
called on standard input,
Currently, developing Fishmarks is tricky because there are no unit tests to ensure that Fishmarks is working properly as new features are added or issues are fixed. Since Fishmarks works with text and has to make sure text is in a very specific format to be parsed, unit tests are a necessary to make sure that things like bookmark names are parsed that same way in every function and changes to the parsing system do not impact Fishmarks robust handling of bookmark names or user input.
However, there does not seem to be a clear standard for testing in Fish unlike JUnit for Java, unittest for Python, and RSpec for Ruby. The two solutions I can think of are running and writing Fishmarks tests using using the testing functionality of purpose programming language like Python or writing a test harness framework and unit testing library for Fish.
As noted, this way is terrible for security. Let's not even list it as an option. The manual way is not difficult. Or find a more secure way of doing it "automatically".
And just take the current dir name? For example, s
without arguments in /var/app/meh
would save the meh
bookmark as a link to /var/app/meh
.
Hi, I am not sure whether this is a bug or a feature. I use GNU stow and git to manage my dotfiles on multiple ubuntu machines so fishmarks' .sdirs
file is always symlinked from my dotfiles git repo to the home directory. However, the .sdirs
symlink is sometimes no longer effective and fishmarks starts reading from a non-symlinked .sdirs=
file it created, causing me to always have to copy the new file into my dotfiles git repo, rename it, and symlink it again. This behaviour is highly annoying but I have no idea what are the conditions that cause it as it seems to appear randomly whenever I add a new bookmark.
using fish 2.1.1 from ppa
set: Invalid character '-' in variable name. Only alphanumerical characters and underscores are valid in a variable name.
/home/teddy/.dotfiles/pkg/marks/marks.fish (line 103): set -x DIR_-h "$HOME/.dotfiles/pkg/marks"
^
in . (source) call of file '-',
called on line 109 of file '/home/teddy/.dotfiles/pkg/marks/marks.fish',
in function 'list_bookmarks',
called on line 1 of file '-',
in function 'l',
called on standard input,
set - set - display and change environment variables.
set - display and change environment variables.
Synopsis
set [SCOPE_OPTIONS]
set [OPTIONS] VARIABLE_NAME VALUES...
set [OPTIONS] VARIABLE_NAME[INDICES]... VALUES...
set (-q | --query) [SCOPE_OPTIONS] VARIABLE_NAMES...
set (-e | --erase) [SCOPE_OPTIONS] VARIABLE_NAME
set (-e | --erase) [SCOPE_OPTIONS] VARIABLE_NAME[INDICES]...
set: Type 'help set' for related documentation
set: Invalid character '-' in variable name. Only alphanumerical characters and underscores are valid in a variable name.
/home/teddy/.dotfiles/pkg/marks/marks.fish (line 105): set -x DIR_-h "$HOME/.dotfiles/pkg"
^
in . (source) call of file '-',
called on line 109 of file '/home/teddy/.dotfiles/pkg/marks/marks.fish',
in function 'list_bookmarks',
called on line 1 of file '-',
in function 'l',
called on standard input,
set - set - display and change environment variables.
set - display and change environment variables.
Synopsis
set [SCOPE_OPTIONS]
set [OPTIONS] VARIABLE_NAME VALUES...
set [OPTIONS] VARIABLE_NAME[INDICES]... VALUES...
set (-q | --query) [SCOPE_OPTIONS] VARIABLE_NAMES...
set (-e | --erase) [SCOPE_OPTIONS] VARIABLE_NAME
set (-e | --erase) [SCOPE_OPTIONS] VARIABLE_NAME[INDICES]...
set: Type 'help set' for related documentation
ckan /home/user/Kod/ckan
godot /home/user/Programy/godot
pkg /home/user/.dotfiles/pkg
It would be great if the keybindings is configurable e.g. from g
to j
It would be really nice if Arch Linux users could install Fishmarks via AUR.
I've been using fishmarks for a long time. Recently, I noticed that deleting a bookmark errors out due to sed
. Here's how this looks like:
ankur@MauiCovenant ~/L/A/S/P/User> s st3user
ankur@MauiCovenant ~/L/A/S/P/User> l
st3user /Users/ankur/Library/Application Support/Sublime Text/Packages/User
ankur@MauiCovenant ~/L/A/S/P/User> d st3user
sed: illegal option -- -
usage: sed script [-Ealnru] [-i extension] [file ...]
sed [-Ealnu] [-i extension] [-e script] ... [-f script_file] ... [file ...]
I notice that the error is due to this line in fishmarks/marks.fish
's delete_bookmark
function:
sed --follow-symlinks -i='' "/DIR_$argv[1]=/d" $SDIRS
The error exists if I reorder the --follow-symlinks
option:
sed -i='' --follow-symlinks "/DIR_$argv[1]=/d" $SDIRS
But, error disappears when I change the above line to
sed -i --follow-symlinks "/DIR_$argv[1]=/d" $SDIRS
I see that -i=''
was added in #1. I don't know if -i=''
is still needed. I did a test on MacOS and it seems that a fishmark associated with a relocated folder can still be deleted with only -i --follow-symlinks
without needing =''
. Let me know what you think. Thanks!
It would be good to package Fishmarks for Red Hat-based systems like Red Hat and CentOS. It would also be useful to provide packages for Fedora as well.
It would be much easier to install fishmarks on Ubuntu-based systems if there was a PPA on Launchpad with Debian packages for fishmarks that are in sync with the Git repository. It would be even better if the repository included stable releases, nightly releases, packages tracking the Git repository for the fish shell.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.