GithubHelp home page GithubHelp logo

laughedelic / pisces Goto Github PK

View Code? Open in Web Editor NEW
278.0 6.0 12.0 51 KB

♓️ Fish shell plugin that helps you to work with paired symbols in the command line

License: Other

Shell 100.00%
fish keybindings paired-symbols fish-shell oh-my-fish oh-my-fish-plugin plugin fishshell fish-plugin fish-plugins

pisces's People

Contributors

9999years avatar laughedelic avatar nickeb96 avatar sjuxax avatar terlar 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

pisces's Issues

Copy paste

Copy pasting creates undesired behavior.

Pasting the following into my terminal:
echo -e "\e[1;31mSome red message\e[0m"

Will result in:
echo -e "\e[1;31mSome red message\e[0m""]]"

At first I thought it might be my terminal, but the behavior exists whether I use terminator, xterm, or the default terminal for Xubuntu 16.04.

Conflict with fzf

This plugin unconditionally overwrites the \t bind. Making this configurable would allow it to be used at the same time as https://github.com/fisherman/fzf.

Alternatively, the current binding of \t could be preserved and called within pices' wrapping bind.

Can't create backward-kill-path-component keybind

I created a $OMF_CONFIG/key_bindings.fish file where I placed 2 keybinds:

bind \b backward-kill-path-component # ctrl+backspace
bind \e\[3\;5~ kill-word             # ctrl+delete

ctrl+delete works fine while ctrl+backspace doesnt at all. Before using pisces i had these keybinds in ~/.config/fish/config.fish as:

function fish_user_key_bindings
	bind \b backward-kill-path-component # ctrl+backspace
	bind \e\[3\;5~ kill-word             # ctrl+delete
end

The above worked for both binds.

Completion function file name wrong

fish lazy loading of functions needs a function file name matching the function name. pisces tab override completion function is called _pisces_complete and mapped as such in user keybindings, but the containing file is _pisces_tab.fish, which will make the mapping spew errors on every fish session but the initial one.

Not working with Fisher 4

I've recently installed this plugin via Fisher. After many shell reloads and reinstalls I came to the conclusion that it was not working. On the other hand, when installed through omf I've have had no problem at all.
I haven't altered fisher's default configuration, and it has worked for all the other plugins I've used.
I'm using Arch Linux and Kitty as terminal emulator.
Congrats on this great plugin, anyway. I find it really useful and comfortable.

Inserts pairs in middle of command-line

Frequently, I'll type a command and then want to go back and quote or parenthesize one of the arguments, e.g.

ls some directory

to

ls "some directory"

but Pisces will change that to

ls ""some directory""

which is not what I want.

Let's add a variable to disable autoinsertion unless the cursor is at the end of the line. I'll try to have a PR in by the end of the day.

Performance Issue

I've noticed that with Pisces installed in my (fairly minimally configured) fish shell, I get keypress performance issues.

Specifically, if I type a string with a couple of Pisces pairs, such as echo "()foobar[]()foobar[]()foobar[]()foobar[]", then try to delete some characters (by holding down delete), my shell lags considerably. It usually takes a few hundred ms after I let of the backspace key before it stops deleting. If I uninstall Pisces, then backspacing is instant, no matter what string I am backspacing and for how long.

I am using iTerm 2, if that matters.

For me, the performance issue means that Pisces is not worth using. Is there anyway this could be fixed? I looked at the backspace function and it seems pretty minimal, so I'm not sure how it could be improved.

Also, thanks so much for developing this plugin - I don't mean to complain. I just want to let you know about the performance issues in case you didn't already.

Error when starting a new shell

~/.config/fish/conf.d/pisces_key_bindings.fish (line 2): switch: Expected exactly one argument, got 0                                                                                                                                         switch $fish_key_bindings                                                                                                     
           ^                                                                                                              
from sourcing file ~/.config/fish/conf.d/pisces_key_bindings.fish                                                              
              called on line 250 of file /usr/share/fish/config.fish                                                                                                                                                                                from sourcing file /usr/share/fish/config.fish                                                                                 
               called during startup              

Unexpected behavior with `set -a var "string"`

Expected behavior in an interactive session:

> set cmd one two
> set -a cmd "three"
> set --show cmd
$cmd: set in global scope, unexported, with 3 elements
$cmd[1]: |one|
$cmd[2]: |two|
$cmd[3]: |three|

Observed behavior in an interactive session with pisces installed:

> set cmd one two
> set -a cmd "three"
> set --show cmd
$cmd: set in global scope, unexported, with 2 elements
$cmd[1]: |set -a cmd |
$cmd[2]: |three|

The command input was set -a cmd "three[enter]. When the closing" is also typed as in set -a cmd "three"[enter] the output is:

$cmd: set in global scope, unexported, with 2 elements
$cmd[1]: |set -a cmd "three"|
$cmd[2]: |three|

However when the complete line set -a cmd "three" is pasted in it works correctly.

I can reproduce this consistently on my system with fish version 3.7.1 in a fresh config directory with only jorgebucaran/fisher and laughedelic/pisces installed.

No autocompletion inside autoclosed pairs

Not sure if there is much pisces can do about it, but fish completion breaks inside autocompleted pairs, probably because the closing symbol is then added to the tokens parsed for completion. Without pisces

echo "$<tab>

will complete variable names, but with it

echo "$<tab>"

will offer no completions.

Error on deleting character after '-'

When I input -abc in my shell and erase a few characters,

string sub: Unknown option '-ab'                                                            
~/.config/fish/functions/_pisces_backspace.fish (line 2):                                        
in command substitution                                                                          
        called on line 7 of file ~/.config/fish/functions/_pisces_backspace.fish                 
                                                                                                 
in function '_pisces_backspace'                                                                  
        called on standard input                                                                 
                                                                                                 
                                                                                                 
       string - manipulate strings                                                               
                                                                                                 
       string  escape  [(-n  |  --no-quoted)]  [--style=xxx]  [STRING...]  string join [(-q |    
       --quiet)] SEP [STRING...]  string join0 [(-q | --quiet)]  [STRING...]   string  length    
       [(-q  | --quiet)] [STRING...]  string lower [(-q | --quiet)] [STRING...]  string match    
       [(-a | --all)] [(-e | --entire)] [(-i | --ignore-case)] [(-r | --regex)]                  
          [(-n | --index)] [(-q | --quiet)] [(-v | --invert)] PATTERN [STRING...]                
                                                                                                 
string: Type 'help string' for related documentation                                             
                                                                                                 
[: Missing argument at index 2                                                                   
[: Missing argument at index 2                                                                   
[: Missing argument at index 2                                                                   
[: Missing argument at index 2                                                                   
[: Missing argument at index 2                                                                   

occurs.

Asciicast:
asciicast

Wrap selection (aka regions)

What happens currently:
pisces selection

What should happen is the selection (grey) being wrapped with quotes.

Thank you for the great package!

Error when opening a new shell

I get these errors when starting a new shell, only on macosx :

~/.config/fish/conf.d/pisces_key_bindings.fish (line 2): switch: Expected exactly one argument, got 0

switch $fish_key_bindings
       ^
from sourcing file ~/.config/fish/conf.d/pisces_key_bindings.fish
	called on line 305 of file /usr/local/Cellar/fish/3.0.2/share/fish/config.fish

from sourcing file /usr/local/Cellar/fish/3.0.2/share/fish/config.fish
	called during startup

My dotfiles for fish are here :
https://github.com/HerveMARTIN/dotfiles/tree/master/shells/fish

I use these dotfiles on both macosx and manjaro, and these errors occurs only on macosx...

2.7?

The README says:

This plugin works best with fish v2.6, because it has a feature called bracketed (a.k.a safe) paste which solves the problem with pasting strings containing paired symbols (they get autoclosed), see #6 for details.

I am now on Fish 2.7. Will this plugin work in 2.7?

Tab Completion

This command broke circular tab completion

bind -M $_pisces_bind_mode \t _pisces_complete

See this example,
(first command pressing lot of TAB)
(second command pressiong lot of SHIFT-TAB)
https://asciinema.org/a/bShqIYrla3TCMwILAyAZShYRs

As we can see the first completion doesn't return to the beginning

Not working when fish_vi_key_bindings is set

I've just installed the plugin using Fisher 4.1.0 and it simply doesn't work if fish_vi_key_bindings is set. It works perfectly when the default bindings are set, though. Is there any workaround?

Detect when matching character already exists

Sometimes Ill autocomplete (word by word) a command such as
git commit -m "Refactor the ...
then I'll complete the message and type the closing "
Problem is the plugin will create a matching " because it doesnt detect that the earlier " is still open
Can this be fixed?

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.