Giter Site home page Giter Site logo

fisher's People

Contributors

ainmosni avatar aquatix avatar bonds avatar carlfriedrich avatar detailyang avatar externl avatar franciscolourenco avatar gastove avatar ikngtty avatar jameschensmith avatar jethrokuan avatar jorgebucaran avatar laughedelic avatar markcial avatar mattmc3 avatar neersighted avatar patrickf1 avatar peey avatar pickfire avatar razvanazamfirei avatar rholak avatar rodrigobdz avatar sanyer avatar scrumplex avatar sijad avatar sotayamashita avatar stefanmaric avatar sullimander avatar thernstig avatar zubb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fisher's Issues

Retrieve record information from orphan plugins

Currently, only plugins in the Index are being used when doing searches / queries, both remote or local.

You can install / uninstall anything with a .fish extension and URL or short URL like:

owner/repo       # default is github.com
gh:owner/repo  # github
bb:owner/repo  # bitbucket 
gl:owner/repo   # gitlab

But Fisherman can't retrieve record information (name, url, info, tags and tags) from plugins installed like this (for lack of a better name these are known as orphans). Since Fisherman can't retrieve any information they do not show on searches.

The next milestone should include the ability to generate this information from the Git repository.

`fisher uninstall` is happy to uninstall already-uninstalled plugins

If you install a plugin, then uninstall it, you can repeat the fisher uninstall pluginname command as many times as you like and it continues to "uninstall" it. I think this is because uninstalling leaves the plugin in the cache, and fisher uninstall is happy to "uninstall" anything in the cache.

kevin@Erebor ~> fisher install shark
Installing >> shark
Aye! 1 plugin/s installed in 1s
kevin@Erebor ~> fisher uninstall shark
Uninstalling >> shark
Aye! 1 plugin/s uninstalled in 0s
kevin@Erebor ~> fisher uninstall shark
Uninstalling >> shark
Aye! 1 plugin/s uninstalled in 0s

Errors during installation

~/D/Projects $ curl -L install.fisherman.sh | fish
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   188    0   188    0     0    431      0 --:--:-- --:--:-- --:--:--   432
100    88  100    88    0     0     89      0 --:--:-- --:--:-- --:--:--   259
Cloning into 'fisherman'...
remote: Counting objects: 523, done.
remote: Compressing objects: 100% (249/249), done.
remote: Total 523 (delta 112), reused 0 (delta 0), pack-reused 270
Receiving objects: 100% (523/523), 447.22 KiB | 260.00 KiB/s, done.
Resolving deltas: 100% (204/204), done.
Checking connectivity... done.
Adding configuration to ~/.config/fish/config.fish
Downloading the index for the first time...
fish: Could not expand string '"$$spinners"'
/Users/nek/Documents/Projects/fisherman/functions/wait.fish (line 68):             set spinners "$$spinners"
                                                                                                ^
in function 'wait',
    called on line 72 of file '/Users/nek/Documents/Projects/fisherman/functions/fisher_update.fish',
    with parameter list '--spin=pipe --log=/Users/nek/.config/fisherman/cache/.debug_log 
                curl --max-time 5 -sS https://raw.githubusercontent.com/fisherman/fisher-index/master/INDEX > /Users/nek/.config/fisherman/cache/.index.tmp
            '

in function 'fisher_update',
    called on standard input,
    with parameter list '--index'

fisher: Connection timeout. Try again.
Ahoy! Reset your shell and type 'fisher <command>'
read: Unknown option 'alias'
/Users/nek/Documents/Projects/fisherman/functions/fisher.fish (line 2): while read -la alias
                                                                        ^
in function 'fisher',
    called on standard input,
    with parameter list 'help -a'


       read − read ‐ read line of input into variables


read ‐ read line of input into variables
   Synopsis
       read [OPTIONS] [VARIABLES...]

read: Type 'help read' for related documentation

Available Commands:
  help       Show Help 
  install    Install Plugins 
  search     Search Plugins 
  uninstall  Uninstall Plugins 
  update     Update Fisherman or Plugins 

Other Documentation:

Use 'fisher help -g' to list guides and other documentation.
See 'fisher help <command or concept>' to access a man page.
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
➜ fisherman git:(master) 

updates available notification

To enhance user experience, it would be nice to have a message that notifies when fisherman updates are available, a la bower.

This could be displayed after an install.
It should be silenced if some --quiet option is enabled, to respet rule of silence.

Fisher install doest not persist plugin

When I install a new fisher plugin like:

fisher install https://github.com/jonatas/rd-fish

It works only in the same tab I am. If I open a new fish session. It does not load the plugin.

I missed something on my repo to load it in every fish session?

$ fish -v # => fish, version 2.2.0
$ fisher -v # => fisher version 0.4.0

`fisher --list` with no installed plugins exits with an error

If nothing has been installed, fisher --list exits with an error and no output. It should instead tell me that there's nothing installed on stderr and exit cleanly. Maybe exiting with code 1 is reasonable, but IIRC it exited with code 127 which is weird (I can't verify since I've already installed something now).

Shorter fisher-search output?

Imo it'd be much cooler if the search output took a single line per package in format pkgname description. Ideally, table-aligned. I'd love to see smth like fisher info <pkg> to see more information about a particular package (such as author, last update time, deps, whatever).

$ fisher search

fishtape      test tool
shark         chart tool
scaffold      create plugin generator boilerplate fish fisherman
get           stty read line ui cli key character
submit        fisherman contrib index plugin
bobthefish    theme powerline awesome

Prepend a`*` to plugin with fisher -l

Quoting @kballard

I think it makes sense to position fisher --list as a plumbing command suitable for use by scripts, so maybe it could do something like list all enabled plugins first with a * prefix (to mean installed) and then all disabled plugins with a space prefix (so it lines up with installed ones), e.g.

fisher --list
*shark
 scaffold

Add plumbing function to update the index.

This would be used instead of fisher update --index by those that need to cause the index to be updated for some reason. For example, make, during install, downloads the index for the first time. In this ocassion, using fisher --update will schedule the index update as a job in order to show a progress indicator which is not shown by make anyway and causes the install to fail in < fish 2.2.0.

Related: #48

*.config.fish files in $fish_function_path cause fish to believe a function named *.config.fish exists

In config.fish, fisherman currently sources everything in $fisher_config/functions that is named *.config.fish.

Only because $fisher_config/functions is in $fish_function_path, this causes an issue:

  • fish will complete *.config (e.g. "banana.config" if you have a file called "banana.config.fish")
  • fish will mark it as a valid command via syntax highlighting, and only fail once it is executed

What you want to do is the same thing I proposed in fish-shell/fish-shell#2498: Make a new directory for these kinds of always-sourced non-autoloaded non-function files that is not in $fish_function_path.

install omf/z does not work

Hi,

maybe I missed something, I tryed fisher install omf/z and I could not use z.
Also, I added a z.fish file in conf.d/ folder, see my article for complete working instructions. I did not found documentation about conf.d/, I just read the code. Is that ok?

Better help for failed installs

If Fisherman fails to install a package it could offer better help adding something like:

Did you miss the `prefix-` or `theme-`?

In the case of oh-my-fish plugins, or even better, if it fails, then test with plugin- and if that fails too, test theme-.

Another thing, it should validate ohm-y-fish, o-hm-y-fsh or similar looking URLs to the correct address.

Plugins not working

For the moment fisherman is not executing my plugins.

I reinstalled it but the problem still persist.
Another thing is that I tried to uninstall some of the plugins to check if there is a particular one that is generating an error and brakes the initialization chain but it does not seem to be uninstalled:

❯ fisher --cache
/home/rif/.config/fisherman/cache/fasd
/home/rif/.config/fisherman/cache/fzf
/home/rif/.config/fisherman/cache/pure
/home/rif/.config/fisherman/cache/tmux

~
❯ fisher uninstall tmux
Uninstalling >> tmux
1 plugin/s uninstalled (0s)

~
❯ fisher --cache
/home/rif/.config/fisherman/cache/fasd
/home/rif/.config/fisherman/cache/fzf
/home/rif/.config/fisherman/cache/pure
/home/rif/.config/fisherman/cache/tmux

Can you suggest some troubleshooting steps?

Thanks a lot,
-rif

Add --orphan option to `fisher` or `fisher search` to list packages installed with a custom url

ls $fisher_cache

The above is not terribly bad as a simple way to query the cache, but it would be nice if we could get a list of those packages that were installed using a custom URL. I think a memorable name could be --orphan.

➡️ This option would be essentially used to add completion to fisher update/uninstall.

Explanation: The current fisher search --select=cache displays all the packages that exist in the cache that Fisherman recognizes and skips those that were installed with a custom URL. The --orphan would show those packages too.

fisher install fails to load some themes in the same shell session

Fisherman does not use exec fish to force a shell reset to refresh plugins or prompts, instead, it sources the relevant files and updates the current shell session. Currently, however, prompts are not being sourced.

Fisherman should source all {<the_plugin_name>,fish_{,right_}prompt}.fish during fisher install to correctly enable plugins/prompts without a shell restart.


Note: While most prompts work fine, if a prompt (theme) fails to declare any global variables with a -g flag, the source mechanism will fail as those variables will be scoped to the parent function (the one who invokes source)

Related

Semi-Related

'fisher install' fails due to mktemp on Mac OS X

There's two uses of mktemp in fisherman, which work fine on Linux but fail on Mac OS X because mktemp requires the template argument (see e.g. stackoverflow).

I believe there's two easy solutions. One is to specify a prefix instead, the other is to see if mktemp failed:

mktemp -t fisher.XXXXXXXX
mktemp 2>/dev/null; or mktemp -t fisher

Either seems to work on Mac OS X (10.9 and 10.10), FreeBSD (9.3), Ubuntu (14.04), and Linux Mint (17.3).

`fisher --list` lists uninstalled plugins

After uninstalling a plugin, fisher --list continues to list the plugin. It may still be in the cache (though is there any point to caching uninstalled plugins?), and fisher --list is documented as reporting what's in the cache, but really that command is only useful if it lists the actual installed plugins.

Can't install using make

temp ) git clone https://github.com/fisherman/fisherman
Cloning into 'fisherman'...
remote: Counting objects: 94, done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 94 (delta 7), reused 0 (delta 0), pack-reused 72
Unpacking objects: 100% (94/94), done.
Checking connectivity... done.
temp ) cd fisherman
fisherman ) make
Reset your shell to apply changes
fisherman )

And then nothing happend after the shell restart.

I'm using fish with omf.

Fisherman should provide an official way for plugins to register keybindings

Fish currently invokes the user function fish_user_key_bindings whenever the fish_key_bindings variable changes (and prior to the first prompt being displayed). That's the official customization point for loading in your own keybindings. Anything set manually with bind will not survive the session, and will also get erased if the user changes the fish_key_bindings variable.

Unfortunately, this isn't very amenable to a plugin infrastructure, because multiple plugins that want to set keybindings would overwrite each other when setting this function (and would overwrite the user's own keybindings). You can see this in the OMF plugin oh-my-fish/plugin-bang-bang which simply provides its own fish_user_key_bindings function.

I think Fisherman can do better.

I think the right approach here is for Fisherman to define its own fish_user_key_bindings function. Since Fisherman puts itself in the fish_function_path prior to $XDG_CONFIG_HOME/fish/functions, Fisherman's version will override the user's. Fisherman can also alter the plugin structure to allow for a file named key_bindings.fish, which will get copied into a new folder $fisher_config/keybindings when the plugin is installed. Fisherman's fish_user_key_bindings can then source every file in this folder.

Furthermore, Fisherman's version of functions/fish_user_key_bindings.fish can explicitly check the remainder of the $fish_function_path list (everything after the fisherman path) and look for another file called fish_user_key_bindings.fish; if it finds one, it can source it, then use functions -c to copy the other fish_user_key_bindings to some other name. This way it can execute that function at the end of its own fish_user_key_bindings (so user keybindings will override plugin ones). This way users can still define their own fish_user_key_bindings functions and it will still be invoked as appropriate; the only real problem is if they modify the file, re-running fish_user_key_bindings won't reapply it. A possible workaround there is to actually search for the file inside the invocation of fish_user_key_bindings, but then you have to do weird things like rename Fisherman's version of the function, execute the file, check to make sure it actually defined its own fish_user_key_bindings function, execute the function, and then rename Fisherman's copy back to the normal name. This sounds doable, but I'm not sure if there's any potential issues there.

I'm actually kind of surprised OMF doesn't already do something like this.

`fisher update --me` spews errors then loops at a spinner forever.

$ fisher update --me
Updating >> Fisherman
test: unexpected argument at index 2: '10 81184 stopped cat | grep -o .'
test: unexpected argument at index 2: '10 81184 stopped cat | grep -o .'
test: unexpected argument at index 2: '10 81184 stopped cat | grep -o .'
test: unexpected argument at index 2: '10 81184 stopped cat | grep -o .'
test: unexpected argument at index 2: '10 81184 stopped cat | grep -o .'
test: unexpected argument at index 2: '10 81184 stopped cat | grep -o .'

It's hard to paste a spinner here, so just imagine it's on the last line.

Merge the Enable/Disable logic and separate to function

The algorithm to enable/disable plugins is essentially the same. The only difference is enable copies/symlinks and disable removes, files from $fisher_config/{functions,confd,completions,man%}. Other than that, there is some specific logic to unload themes, but that's it.

The next milestone should address this by wrapping this logic and extracting all of that into a generic __fisher_plugin. Currently the API I am considering is:

__fisher_plugin --disable NAME PATH
__fisher_plugin --enable NAME PATH

Should fisher update also re-install prompts/themes?

The current behavior of fisher update is to install the plugin again.

This is simply by calling fisher install after the update. This makes sense for a plugin, but perhaps not for a prompt/theme. If you are using prompt X and then fisher update promptZ, Fisherman will update promptZ and also set your current prompt to promptZ.

I have no problem with this, but perhaps we could add an option to fisher update --no-install or similar.

@tuvistavie @colstrom @tobywf

fisher install succeeds when installing a plugin in a local path but displays an error

Due to wait(1) behavior of always returning 1 if there was output to stderr, git clone in fisher install writes to `$fisher_error_log:

warning: --depth is ignored in local clones; use file:// instead.

Fisherman#wait(1) treats it as an error and we get Repository not found. error even though the install was succesful.

A simple fix would clear out $fisher_error_log if git clone is succesful.

Symlink configuration

The install process breaks config.fish when it is a symlink.

$ ls -l ~/.config/fish/config.fish 
lrwxrwxrwx 1 daniel daniel 68 Jan  3 18:54 /home/daniel/.config/fish/config.fish -> /home/daniel/.homesick/repos/dot-files/home/.config/fish/config.fish
$ make
Adding configuration to ~/.config/fish/config.fish
Reset your shell to apply changes
$ ls -l ~/.config/fish/config.fish 
-rw-r--r-- 1 daniel daniel 512 Jan  3 19:18 /home/daniel/.config/fish/config.fish

The issue is in the last line of $(FISH_CONFIG) target in the Makefile, which replaces the current config.fish with a new one.

`fisher install shark scaffold reported wrong index

After running fisher search to see the available projects, I tried running fisher install shark scaffold and it reported the wrong indexes:

kevin@Erebor ~> fisher install shark scaffold
Installing (2 of 2) >> shark
Installing (3 of 2) >> scaffold
fisher: Repository not found: 'https://github.com/bucaran/fish-scaffold'
Aye! 1 plugin/s installed in 3s

fish-scaffold also doesn't seem to exist, but that's a different issue.

Add a code of conduct!

You probably don't want yet another file in your repo, but I promise this one is good for like 95% of everyone (the other 5% is busy looking at cat pictures).

I've used the contributor covenant in the past, it's pretty easy to read and understand (and translated into a few languages here). Pick the one you like though :)

make failes

mdziardziel@PC-076 ~/g/fisherman> make
Adding configuration to ~/.config/fish/config.fish
Downloading the index for the first time...
fish: Could not expand string “"$$spinners"”
/home/mdziardziel/git/fisherman/functions/wait.fish (line 68): set spinners "$$spinners"
^
in function “wait”,
called on line 72 of file “/home/mdziardziel/git/fisherman/functions/fisher_update.fish”,
with parameter list “--spin=pipe --log=/home/mdziardziel/.config/fisherman/cache/.debug_log
curl --max-time 5 -sS https://raw.githubusercontent.com/fisherman/fisher-index/master/INDEX > /home/mdziardziel/.config/fisherman/cache/.index.tmp

in function “fisher_update”,
called on standard input,
with parameter list “--index”

fisher: Connection timeout. Try again.
Ahoy! Reset your shell and type 'fisher '
read: Unknown option “alias”
/home/mdziardziel/git/fisherman/functions/fisher.fish (line 2): while read -la alias
^
in function “fisher”,
called on standard input,
with parameter list “help -a”

   read - read - read line of input into variables

`make` overzealously "fixes" my `config.fish`, rendering it syntactically invalid.

Looks like something in the awk script is truncating a portion of my config.fish when fisherman installs.

Steps to reproduce:

  1. Clone fisherman repo.
  2. Run make.
  3. Weep as the world implodes.
  4. File bug report.

Before:

set --query fish_greeting
and set --erase fish_greeting

if isatty
    if test -d ~/.config/fish/environment.d
        set environment_configs (find ~/.config/fish/environment.d -type f -name \*.fish)
        for config in $environment_configs
            source $config
        end
    end
    if test -d ~/.config/fish/functions.d
        set function_paths (find $HOME/.config/fish/functions.d -type d -mindepth 1 | grep --invert-match --extended-regexp "$HOME/.config/fish/functions.d(.*/\.)+")
        for path in $function_paths
            contains $path $fish_function_path
            or set fish_function_path $fish_function_path $path
            if which -s fasd
                function -e fish_preexec __fasd
                    fasd --proc (fasd --sanitize "$argv") > /dev/null 2>& 1
                end

                function j
                    cd (fasd -d -e 'printf %s' "$argv")
                end
            end
        end
    end
end

# OPAM configuration
#. /Users/colstrom/.opam/opam-init/init.fish > /dev/null 2> /dev/null or true

After:

set fisher_home ~/src/github.com/fisherman/fisherman
set fisher_config ~/.config/fisherman
source $fisher_home/config.fish
set --query fish_greeting
and set --erase fish_greeting

if isatty
    if test -d ~/.config/fish/environment.d
        set environment_configs (find ~/.config/fish/environment.d -type f -name \*.fish)
        for config in $environment_configs
            source $config
        end
    end
    if test -d ~/.config/fish/functions.d
        set function_paths (find $HOME/.config/fish/functions.d -type d -mindepth 1 | grep --invert-match --extended-regexp "$HOME/.config/fish/functions.d(.*/\.)+")
        for path in $function_paths
            contains $path $fish_function_path
            or set fish_function_path $fish_function_path $path
            if which -s fasd
                function -e fish_preexec __fasd
                    fasd --proc (fasd --sanitize "$argv") > /dev/null 2>& 1
                end

                function j
                    cd (fasd -d -e 'printf %s' "$argv")
            end
end

# OPAM configuration
#. /Users/colstrom/.opam/opam-init/init.fish > /dev/null 2> /dev/null or true

fisher uninstall fails to unload prompt correctly

The following:

fisher uninstall my_theme

Correctly removes the prompt files from $fisher_config/functions, but does not correctly unload the theme.

Fisherman should completely unload the theme and return to fish default's theme.

find: illegal option -- m

When $fisher_cache is empty the find -L $fisher_cache/* -maxdepth 0 -type d yields an error as it expands to nothing.

Update the index only once per session

Keeping the index up to date all the time is a feature, but updating the index multiple times in the same session is unncessary.

This can be fixed moving the index update logic to __fisher_update_index as well as most of the search command logic to smaller functions. This way, other commands can use these functions as plumbing commands for search without triggering an index update everytime.

This will improve in-session performance somewhat, which is also good.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.