News for hackers. Stuff that matters.
Re:Quick tip for developers who use OS X by bilalq on Monday January 13, 2014 @02:46PM (#7052815)
I use these settings in my .inputrc. The get me a few more commands and even the ability to escape using jj.

    set completion-ignore-case On
    set bell-style none
    set editing-mode vi

    $if mode=vi
      set keymap vi-command
      "gg": beginning-of-history
      "G": end-of-history
      set keymap vi-insert
      "jj": vi-movement-mode
      "\C-p": history-search-backward
Re:Quick tip for developers who use OS X by awolf on Monday January 13, 2014 @04:14PM (#7053323)
>set completion-ignore-case On

Thanks. Keeping track of whether certain directories were capitalized or not has been unnecessarily occupying my mental bandwidth for years.

Re:Quick tip for developers who use OS X by mkdir on Monday January 13, 2014 @05:40PM (#7054066)
Is there a functional difference between putting...

    set editing-mode vi
... in one's inputrc and...

    set -o vi
... in one's .bashrc?

I realize that .inputrc is the config file for Readline, and .bashrc is essentially a start-up file for Bash. But is it ever necessary to use both snippets?

Re:Quick tip for developers who use OS X by terminus on Monday January 13, 2014 @06:35PM (#7054375)
I would imagine that .inputrc would serve as a superset in that all programs (for instance gdb) whiich use readline would now default to vi mode.
Re:Quick tip for developers who use OS X by jknupp on Monday January 13, 2014 @08:56PM (#7054901)
This is the most useful thing I've heard this (short) year. I've always been looking for a way to make readline globally default to vi mode. Thanks for that.
Re:Quick tip for developers who use OS X by bilalq on Monday January 13, 2014 @07:07PM (#7054505)
Indeed. It also works in things like irb, for example.
Re:Quick tip for developers who use OS X by b-ryan on Monday January 13, 2014 @03:06PM (#7052945)
Thanks for this. I switched my input mode to VI and was greatly missing using Ctrl-L to clear the screen when in input mode. I hadn't known about the inputrc before. Adding this line below your "\C-p" line fixed that for me:

    "\C-l": clear-screen
Re:Quick tip for developers who use OS X by yawboakye on Monday January 13, 2014 @07:02PM (#7054490)
Signs you have to revert to Emacs mode. Unless it's an assemblage, it's always a smell if you replace a unit of a body with that of a "competitor."
Re:Quick tip for developers who use OS X by bilalq on Monday January 13, 2014 @05:14PM (#7053881)
Oh wow, I didn't even think about that. I've been making do with Cmd+K on OSX and aliasing c to clear to get around the problem.
Re:Quick tip for developers who use OS X by tambourine_man on Monday January 13, 2014 @06:15PM (#7054264)
Command-K also does the trick
Re:Quick tip for developers who use OS X by bilalq on Thursday January 16, 2014 @12:05PM (#7070645)
Command-K won't play nicely with tmux panes though.
Re:Quick tip for developers who use OS X by joshweinstein on Tuesday January 14, 2014 @12:31AM (#7055556)
I've been wanting to use 'jj' to enter normal mode on the command line for some time. This solution actually didn't work for me, but adding the following to my .zshrc did:

  bindkey -M viins 'jj' vi-cmd-mode
Re:Quick tip for developers who use OS X by bilalq on Thursday January 16, 2014 @12:04PM (#7070627)
That is because zsh does not make use of readline. I ran into this issue myself recently, since I use bash on my personal machines and zsh on my work ones.
Re:Quick tip for developers who use OS X by danielrm26 on Saturday January 18, 2014 @10:42AM (#7081198)
Super off-topic, but I bet you'd be far happier if you used only one.
Re:Quick tip for developers who use OS X by troyk on Monday January 13, 2014 @06:02PM (#7054205)
Very cool, does anyone know a way to set a visual indicator (diff cursor?) when in edit mode?
Re:Quick tip for developers who use OS X by yawboakye on Monday January 13, 2014 @06:48PM (#7054431)
> set completion-ignore-case

works well with "\t": menu-complete

But I had to delete this entry. I need the case to differentiate between which path I really wanted :(