function h; echo $history[1]; end

now you can do

sudo (h)


On Tue, May 28, 2013 at 7:06 PM, Yvon Thoraval <yvon.thora...@gmail.com>wrote:

> fine thanks it's $history[1] :
>
> $ cat ~/.config/fish/config.fish
> if status --is-interactive
>  blahblahblah
> end
>
> $ echo $history[1]
> cat ~/.config/fish/config.fish
>
> $
>
> then, i'd like to alias $history[1] to something shorter.
>
> for example h1
>
> the previous "echo $history[1]" giving :
>
> $ echo $h1
>
>
>
> 2013/5/28 Myrddin Emrys <myrd...@gmail.com>
>
>> I'm not at my computer, but you can use the history variable.
>>
>> $ my_command $history[0]
>>
>> I have not done this myself, so I can't remember if you should use
>> $history[1] instead. Not sure when the current command gets pushed into the
>> array.
>>
>>
>> On Tue, May 28, 2013 at 11:31 AM, Yvon Thoraval 
>> <yvon.thora...@gmail.com>wrote:
>>
>>> before switching to fish, from zsh, I've used a command like :
>>> $ my_command "!!"
>>>
>>> the "!!" being translated to last command line (as up key).
>>>
>>> is there a way to get last command line as argument of the current
>>> command line ?
>>>
>>> --
>>> Yvon@48.871651804,2.384858688
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Try New Relic Now & We'll Send You this Cool Shirt
>>> New Relic is the only SaaS-based application performance monitoring
>>> service
>>> that delivers powerful full stack analytics. Optimize and monitor your
>>> browser, app, & servers with just a few lines of code. Try New Relic
>>> and get this awesome Nerd Life shirt!
>>> http://p.sf.net/sfu/newrelic_d2d_may
>>> _______________________________________________
>>> Fish-users mailing list
>>> Fish-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/fish-users
>>>
>>>
>>
>
>
> --
> Yvon@48.871651804,2.384858688
>
>
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
> _______________________________________________
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
>
>
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to