Greg Reagle | 15 Apr 21:59 2015

patch: Enable editing of command with $EDITOR

This is my first time trying to contribute to fish, so please forgive any mistakes I make.  The patch is
included as an attachment and Sanne Wouda <sanne.wouda@...>
wrote this function which I changed a little.
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Sanne Wouda | 15 Apr 17:09 2015
Picon

Re: Edit command line in $EDITOR?

It is possible to implement this with a fish function.

function edit_commandline
  set -l tmp (mktemp /tmp/fish-fc.XXXXXX)
  commandline > $tmp
  eval $EDITOR $tmp
  cat $tmp | read -l cmd
  commandline -r "$cmd"
  rm $tmp
end

Of course, if you do this properly, you'd have to check whether mktemp failed, or whether EDITOR is set and executable.

To bind this to, for example, Ctrl-x, do
$ bind \cx edit_commandline



On Wed, 15 Apr 2015 at 16:32 Wai Yan Pong <wypong00-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Yes, I missed that feature too. Hopefully developers of fish will consider adding that.
That seems more adhere to the linux philiosophy---better leave it to the editor instead of the shell to do the editing.

On Tue, Apr 7, 2015 at 12:38 AM, Gareth Skinner <g <at> sknr.org> wrote:
Hi fish-users,

In bash, you can hit Ctrl-x-e to open your current command line in $EDITOR, make your modifications, and the shell runs your command when you exit. It also exists in zsh: http://stackoverflow.com/questions/890620/unable-to-have-bash-like-c-x-e-in-zsh

I've been playing around with fish and sorely miss this feature. I can't find it in fish -- does it exist?

Thanks,
Gareth

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Fish-users mailing list
Fish-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/fish-users


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF_______________________________________________
Fish-users mailing list
Fish-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/fish-users
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Gareth Skinner | 7 Apr 09:38 2015

Edit command line in $EDITOR?

Hi fish-users,

In bash, you can hit Ctrl-x-e to open your current command line in $EDITOR, make your modifications, and the shell runs your command when you exit. It also exists in zsh: http://stackoverflow.com/questions/890620/unable-to-have-bash-like-c-x-e-in-zsh

I've been playing around with fish and sorely miss this feature. I can't find it in fish -- does it exist?

Thanks,
Gareth
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Stéphane Wirtel | 7 Apr 17:47 2015
Picon

local config in function of the current directory?

Hi all,

I think it’s already asked in the past (not sure, I haven’t checked 
the archives) but I wanted to know If I can have a .fishrc file in a 
directory with some directives for a specific configuration.

Example, in python, there is the PYTHONPATH env and I would like to 
override it when I enter in a specific directory (project). I think 
it’s possible if we override the “cd” command because there is the 
virtualfish package (for virtualenv).

So, If you have an idea, could you give me the link to the solution ?

Thank you so much,

Stephane

--
Stéphane Wirtel - http://wirtel.be -  <at> matrixise

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Fish-users mailing list
Fish-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users
jean-marie winters | 6 Apr 21:03 2015
Picon

Autocompletion for options without-


I'm trying to write an autocompletion for beets ( https://github.com/sampsyo/beets).
It's got a lot of options like:  help, play, import, modify ... All these options do have secondary options that start with a - .
Problems is the first major options do not start with - or -- so no short, long or old options for the complete command.
So the question is...
Is there anyway that this can still be accomplished or is it a lost cause to start with?
Grtz
Jm

Sent using CloudMagic

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
John Chludzinski | 5 Apr 01:54 2015
Picon

What's the Fish analog to a backtick?

I tried:

$set cur_db_dstamp `stat -c "%y" $cur_db | tr '.' ' ' | tr -d ':-' | awk '{print$1"-"$2}'`

and got:

awk: cmd. line:1: {print$1"-"$2}`
awk: cmd. line:1:               ^ invalid char '`' in expression


Then tried:

$  set cur_db_dstamp stat -c "%y" $cur_db | tr '.' ' ' | tr -d ':-' | awk '{print$1"-"$2}'

and got:

$ echo $cur_db_dstamp
stat -c %y /var/lib/aide/aide.db.gz
jski <at> localhost /u/s/selinux$ stat -c "%y" $cur_db | tr '.' ' ' | tr -d ':-' | awk '{print$1"-"$2}'

What's the solution to this problem?

And yes, this is from a KSH/BASH script I'm translating.

---John


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Scott Steele | 4 Apr 00:34 2015
Picon

Retrieve next character in auto-suggestion

Is there a way to access the contents of the current greyed-out auto-suggestion? I've played with all of the options for the `commandline' builtin but can't figure out how to grab the current auto-suggestion.

My end goal for this is to be able to bind a key (likely ctrl-y) to complete one character of the auto-suggestion as if I were in Vim and the auto-suggestion were the line above my cursor. I often want to complete/use part of the auto-suggestion (esp in cases when hitting tab ends up triggering a different completion) but going to the end of the line completes it entirely and then I end up hitting ctrl-w a ton.

Thanks,
Scott

-----
This is a work of fiction. Names, characters, places, and incidents either are the product of the writer's imagination or are used fictitiously, and any resemblance to actual persons, living or dead, businesses, companies, events, or locales is entirely coïncidental.
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Brandon Weiss | 23 Mar 07:50 2015

Post-process output?

I just saw this terminal-emojify gem and it got me wondering if there might be a way to do this for all terminal output via a fish hook, but I couldn’t find much in the documentation. Is there a way for me to post-process all output?
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Elias Assmann | 26 Mar 10:54 2015
Picon

command substitution into one word

Hi Fishers,

In fish, command substitution returns a list when the command outputs 
multiple lines, like this:

 > function foo; echo $argv[1]; end
 > foo (echo a; echo b; echo c)
a

But what do you do when you need the output as one word?  (Where, in 
Other Shells, you might do ‘foo "$(echo a; echo b; echo c)"’.)

Here's the problem that leads me to ask this: I wanted to tell 
subversion to ignore all files present in my directory that are not 
already under version control.  This command gets me a list of those files:

 > alias svnlist "svn st | grep '\?' | tr -s ' ' | cut -d ' ' -f 2"

It outputs one file per line, which is just the format that the 
‘svn:ignore’ property expects.  But this

 > svn ps svn:ignore (svnlist) .

fails because the property value must be a single word.  On the other 
hand, this

 > svn ps svn:ignore (svnlist | tr '\n' ' ') .

as well as this

 > set tmp (svnlist); svn ps svn:ignore "$tmp" .

does not work because it puts all the files on one line.

In the present case you can use ‘svn propset’s --file option, either 
with standard input

 > svnlist | svn ps svn:ignore -F - .

or in combination with ‘psub’.  One of these workarounds is likely to 
work in many cases.  But still, is there a way to capture the exact 
output of a command?

	Elias

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Fish-users mailing list
Fish-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users
charlie | 25 Mar 04:42 2015
Picon

Dependency on lynx ?

Installing fish on raspbian and wasn't sure I had the write package so I view the package info, and it says Depends: (...) lynx | www-brower ?

Just curious, but why that dependency? 
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users
Osamu OKANO | 24 Mar 13:44 2015
Picon

Using subshells to expand multiple line arguments

Hi!

How do I do the following in fish?
$(docker-machine env local) 

When I run following in fish,
docker-machine env local
Outputs are
set -x DOCKER_TLS_VERIFY yes
set -x DOCKER_CERT_PATH /Users/osamu/.docker/machine/machines/local
set -x DOCKER_HOST tcp://192.168.99.100:2376

When I run following in fish,
eval (docker-machine env local) 
printenv|grep DOCKER
DOCKER_CERT_PATH=/Users/osamu/.boot2docker/certs/boot2docker-vm
DOCKER_TLS_VERIFY=yes:set:-x:DOCKER_CERT_PATH:/Users/osamu/.docker/machine/machines/local:set:-x:DOCKER_HOST:tcp://192.168.99.100:2376

A simpe but non-smart solution is copy and paste.
Is there any simple and smart solution?

Regards.

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Fish-users mailing list
Fish-users@...
https://lists.sourceforge.net/lists/listinfo/fish-users

Gmane