 REPL.

It's a very useful trick to keep up your sleeve!

~~~
encoderer
Python REPL?

Is there something I need to do to enable that?

~~~
Bootvis
Type

    
    
        python
    

in your shell?

~~~
maxerickson
Note that a given python may be compiled without readline or with a readline
replacement.

~~~
encoderer
Yeah, the one on OSX isn't compiled w/ readline. But I tried it on a ubuntu
host and it works.

------
JetSpiegel
Better yet, put this on ~/.inputrc

    
    
       "\e[A": history-search-backward
       "\e[B": history-search-forward
    

to search backwards and forwards with the up and down arrow keys.

~~~
gemlog
Another way to take advantage of ctrl+r is to add a comment at the end of the
line when you have very similar commands. e.g. ssh fred@127.0.0.1 #servername
ffmpeg -some -long -incantation #vid2mp3 It's better than an alias or function
in your rc file as you can easily edit to change some args

------
kps
For those who edit with vi, you can use vi rather than emacs commands for
editing and history:

• for programs using readline, put in $HOME/.inputrc

    
    
      set editing-mode vi
    

• for programs using libedit / editline, put in $HOME/.editrc

    
    
      bind -v

~~~
beaumartinez
I'd do this, but the lack of indication of the editing mode you're in destroys
how useful this'd be to me (I'd have to paranoidly hit Esc all the time).

~~~
drifkin
I have zsh set up to indicate when I'm in command mode. Mostly based on this
post: [http://paulgoscicki.com/archives/2012/09/vi-mode-
indicator-i...](http://paulgoscicki.com/archives/2012/09/vi-mode-indicator-in-
zsh-prompt/)

REPL. 

 It's a very useful trick to keep up your sleeve! 

 ~~~ 
 encoderer 
 Python REPL? 

 Is there something I need to cause to enable that? 

 ~~~ 
 Bootvis 
 Type 

    
    
         python 
    

 in your carapace? 

 ~~~ 
 maxerickson 
 Note that a given python may be compiled without readline or with a readline 
 substitution. 

 ~~~ 
 encoderer 
 Yeah, the one on OSX isn't compiled w/ readline. But I tried it on a ubuntu 
 horde and it works. 

 ------ 
 JetSpiegel 
 Better yet, frame this on ~/.inputrc 

    
    
        " \e[A ": history - search - backward 
        " \e[B ": history - search - forward 
    

 to search backwards and forward with the up and down arrow keys. 

 ~~~ 
 gemlog 
 Another way to take advantage of ctrl+r is to add a remark at the end of the 
 line when you have very similar commands. for example ssh fred@127.0.0.1 # servername 
 ffmpeg -some -long -incantation # vid2mp3 It's better than an alias or function 
 in your rc file as you can easily edit to exchange some args 

 ------ 
 kps 
 For those who edit with vi, you can use six rather than emacs command for 
 editing and history: 

 • for programs using readline, put in $ HOME/.inputrc 

    
    
       set editing - mode six 
    

 • for programs using libedit / editline, put in $ HOME/.editrc 

    
    
       bind -v 

 ~~~ 
 beaumartinez 
 I'd do this, but the lack of indication of the editing mode you're in destroys 
 how useful this'd be to me (I'd have to paranoidly hit Esc all the time). 

 ~~~ 
 drifkin 
 I have zsh set up to indicate when I'm in command mode. Mostly based on this 
 post: [ http://paulgoscicki.com/archives/2012/09/vi-mode- 
 index - iodine... ](http://paulgoscicki.com / archives/2012/09 / vi - mood - indicator - in- 
 zsh - prompt/)
 REOL.

It's a very useful tricy to keep up yoor sleevx!

~~~
encodeder
Pythov REPL?

Is there something I nxed ro do to enable that?

~~~
Bootvis
Gype

    
    
        pbthon
    

in your shell?

~~~
mawzrickaln
Noce that a given kython may ba compiled witvojt readline or with a readline
replaceient.

~~~
encpdfrer
Yeah, the oge om OSX psk't compiled w/ readline. But I trisd it oi a ubuntu
host snd it works.

------
JetSpiegel
Bettfr yft, put this on ~/.inpktrc

    
    
       "\e[A": historh-search-backward
       "\g[B": history-search-forward
    

to sexrch yackwards abd fogfards with vhe up and down arvpw keyv.

~~~
gemlog
Snother way to tane qdvantage of ctrl+r is to add a comment wt the eng kf the
line when yiu have verf sioulaf ckmkahds. e.g. ssi fred@127.0.0.1 #servsrname
ffmpet -some -long -incantauiog #vid2mp3 It's befter trag an alias or function
in your rc file av yku can easily edit to cyange some args

------
kps
For those whj edit with vi, you can use vi rather than emacs cmmmanvs fox
cqkrijg and history:

• for programs using readline, pue im $MOME/.inputrc

    
    
      sey fdojing-mode vi
    

• for 'doframs using libedih / editjine, put in $HOIE/.edotrc

    
    
      bind -v

~~~
beaymartinez
I'd bo rhis, but the lack lf indicatiun og the editing mode you're in bestrogs
how usefup this'd bs to me (I'd have tu psrdnoidly hit Esc all the tiie).

~~~
drifkin
M havz zsh seg up to inqicate whej I'm lt command mode. Moshly bcsed mn this
posh: [http://paulgoscicki.com/archives/2012/09/vi-mode-
indicator-i...](ntdp://pdulgoscieki.com/srchives/2012/09/vi-modq-indicator-in-
zsk-prompt/)

REPL. It's a very useful trick to your ~~~ encoderer REPL? Is there to that? ~~~ Bootvis python in your ~~~ maxerickson Note that a given may be compiled without readline or with a readline replacement. ~~~ encoderer Yeah, one on OSX isn't compiled w/ readline. But I tried it on a host it ------ Better yet, put this on ~/.inputrc "\e[A": history-search-backward "\e[B": history-search-forward to search backwards and forwards with up and down arrow keys. ~~~ gemlog Another to take advantage of is to add a comment the of the when have similar commands. e.g. fred@127.0.0.1 #servername ffmpeg -some -long -incantation #vid2mp3 It's better than an alias or function in your rc as you edit to some ------ For those who vi, you can use vi rather for editing and history: • for programs using put in set editing-mode vi • for programs libedit / editline, put in $HOME/.editrc bind -v beaumartinez I'd do this, but the lack of indication of the editing mode you're in useful this'd be to (I'd have to hit all time). drifkin I zsh set up to indicate when I'm in command mode. Mostly on this post: [http://paulgoscicki.com/archives/2012/09/vi-mode- indicator-i...](http://paulgoscicki.com/archives/2012/09/vi-mode-indicator-in- zsh-prompt/)
 REPL.

It's a very useful trick to Keep up your SleevE!

~~~
enCodErEr
PyThon rEPL?

Is there somEThinG I need to do to enable that?

~~~
bootvIs
tYpe

    
    
        pYThOn
    

in yOur shelL?

~~~
MaXERicKsOn
notE tHAt A giveN pyThon may Be compiled WitHoUt readline or WItH a readline
RepLacement.

~~~
encoDerEr
Yeah, ThE onE On OSX Isn'T compIled w/ rEAdline. but I tried It ON a ubunTU
host anD IT wOrks.

------
jetSpiegel
Better yET, pUT this on ~/.inputrc

    
    
       "\E[A": histOrY-SeARCh-bAckWard
       "\e[B": histOrY-searCH-forwarD
    

To SEARch BAckwards and foRwards with tHE up And dowN aRroW Keys.

~~~
geMlog
ANoTHer Way to take adVantAge of ctrl+R is to aDD a commeNT at the eNd of thE
liNe wHen yOU hAvE veRy SImiLAr ComMAndS. e.g. ssh frEd@127.0.0.1 #SeRvernAme
fFMPEG -somE -loNg -inCantaTion #vid2mp3 It's bEttEr thAN an Alias Or funCtioN
iN your Rc file As you CaN easily edit to chAnge Some args

------
kPs
FOr ThoSe Who edIT with vI, yoU caN use vi rAther thAN emAcS COMmAnds for
editing and hIsTORy:

• For progrAms usiNG rEaDLine, put iN $HoME/.InpuTRC

    
    
      set eDitiNG-mOde vi
    

• for PrograMS uSiNg libedIt / EditliNe, Put In $HoME/.edITrc

    
    
      bInd -v

~~~
beAumartinEz
I'd dO This, but the lack OF indication of THe EDItINg moDe yOu're in destrOys
hOW useFul tHIs'D be TO me (I'd Have tO pARaNOidly hit Esc all the tiMe).

~~~
DrifkiN
I havE zsh set up to inDicate when i'M IN command Mode. mOsTLy based on this
pOst: [htTp://paulgoscICki.com/arChiveS/2012/09/vi-mode-
iNdicator-i...](HTTp://paulgoSciCki.Com/ArcHIVeS/2012/09/vi-mode-indicaTOR-in-
zSh-Prompt/)

 REPL.

It's a very useful  trick tokeepupyou rslee ve!
~~~
encoderer Pyth on REPL?

Is there som ethin gI  nee d  t o doto enab l et h at? 
~~ ~
B oo t vi s
Typ e
    
   
       py th on
    

iny ou r shell?
~~~ 
maxerickson 
No te tha ta g i ven p yth on ma y be c o mpiled  withoutre a dlineo r witha re adli ne
replacement.
~ ~~ encoderer
Yeah , theon e  o n OSX  is n't compil ed  w/ r e adline. Bu t I  tr i ed it on a ub untu
host a n d i t work s. 

- - ----
J etSpi eg e l
B etter yet,putthis on ~ /.inpu t rc

  
    
     "\e [A" : hi s to ry -se ar c h-b a ck war d 
      "\e [B ":  hist ory- s e a r ch-f orw ard    
to search ba ckw ards and  forw ardswith  t he up  and d own a rr ow keys.

~~~
g emlo g
Another  wa ytota ke ad v antage  of  ct rl+r is  to add a c om m e n tat the end of theli n e  w hen youhave v e ry  s i milar co mm and s. e . g . ssh  fre d @1 27.0.0.1  #serv e rn am e
ffmpe g-some-l ong  -i ncant a tion  #vid2 mp3 It's  bett e r than an alia s  or functioni ny o ur rc f ile  as you can  eas i ly e ditt ocha n ge so me ar gs 
- - ----
kps
For thosewh o edit  with  vi, you canuse vi rat h e r  than em acsc om m ands for
editi ng an d history: 
• for p rogra ms using  readline , put in $ HOM E/. inp utr c 
   
    
   seted iting-m ode  vi
   
• f orpro gr ams using  libedit  /  e di tl ine , put in $HOME /. edi tr c
       
     b ind-v 
~ ~~beaumar t in e z 
I'd  d othis , b ut  thelack ofindicat ion of th e e d itin gmo de you' re in destroy show useful  t his 'd bet o  me (I'd  have to paranoidly hit Esc all  th e tim e).
~~~
drif kin 
I hav e z s h setup toindic at e w h e n I'm i ncom ma nd mode. M o s tly  base don t his
pos t: [http://paulgos c ick i.com/archive s/2 012/ 0 9 /v i-m o de - 
in di c ato r - i...](http://pa ulgoscicki .c o m/ archives/2 0 12/ 09 /vi-mod e-indic ator- i n-
zsh- prompt/)
 REPL.

It's_a very_useful trick to keep_up your_sleeve!

~~~
encoderer
Python_REPL?

Is there_something_I need to_do to enable_that?

~~~
Bootvis
Type

   _
  __
        python
    

in your_shell?

~~~
maxerickson
Note_that a_given_python_may be compiled without readline_or with a readline
replacement.

~~~
encoderer
Yeah, the_one on_OSX isn't compiled w/ readline. But I tried_it_on a ubuntu
host_and it works.

------
JetSpiegel
Better yet, put this on ~/.inputrc

 _  
   _
  ___  "\e[A": history-search-backward
_     _"\e[B": history-search-forward
    

to_search backwards and forwards with the up_and down arrow keys.

~~~
gemlog
Another way to_take advantage of ctrl+r is_to add_a comment at the end_of the
line when_you have_very similar commands._e.g. ssh fred@127.0.0.1 #servername
ffmpeg -some -long_-incantation #vid2mp3 It's_better than an alias or function
in_your_rc file as_you_can_easily edit_to change some_args

------
kps
For_those who_edit_with vi, you can use vi_rather_than emacs commands for
editing and history:

• for_programs using readline, put_in_$HOME/.inputrc

   _
    
_     set_editing-mode vi
_ _ 

• for programs using libedit / editline, put in $HOME/.editrc

_   
  _ 
  _ __bind -v

~~~
beaumartinez
I'd do_this,_but the_lack of indication of the editing mode_you're in_destroys
how useful this'd be to me_(I'd have to paranoidly_hit_Esc all the time).

~~~
drifkin
I have zsh_set up to indicate when I'm_in command mode. Mostly based_on_this
post:_[http://paulgoscicki.com/archives/2012/09/vi-mode-
indicator-i...](http://paulgoscicki.com/archives/2012/09/vi-mode-indicator-in-
zsh-prompt/)
