Earlier quoted context omitted.
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
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
Quick tip for developers who use OS X
291–300 of 406 posts
Re: Quick tip for developers who use OS X
#292Earlier quoted context omitted.
And OS X doesn't steal Control for menu shortcuts. Control-V (literal) is not the same as Command-V (paste), Control-Z (suspend) is not the same as Command-Z (undo), and so on. X Window software used to get this right, too; Unix workstations generally had another modifier (e.g. Meta, diamond on Suns) since they knew better than to hijack keys people would type in a terminal. It's only the this-is-finally-the-year…
"X Window software" hasn't really changed very much in the last couple decades. I use distinct Control, Shift, Meta/Alt, and Hyper keys. The blame lies with "desktop environments", not X. X has plenty of its own problems without getting Gnome's problems heaped on top. Edit: > It's only the this-is-finally-the-year-of-Linux-on-the-desktop crowd slavishly imitating Microsoft's mistakes that screwed it up. Most…
And hey, as far as ‘really shitty reimplementations of Growl’ go, even Apple has one now.
Re: Quick tip for developers who use OS X
#293Bash, running in your terminal, understands both the Emacs and the Vi commands. By default is Emacs, so you can C-a (control-a) for beginning of line, C-p to go back in command line history, or C-r to search it. I prefer the Vi mode, though. Add to your .bashrc set -o vi Then you can press escape to go from input mode to normal mode; there k will take you to the previous line in command line history, j to the next li…
Re: Quick tip for developers who use OS X
#294Re: Quick tip for developers who use OS X
#295Two more (for Bash) - Ctrl-x, Ctrl-e will pop open your EDITOR so you can edit the command. Saving and closing the editor brings the command back in your terminal and automatically executes it. fc will bring up your EDITOR with the last typed command. (You can use fc -l to see a list of commands)
damn.. thats the real #yearslost for me. I should have focused on learning that instead of the wordback/forward commands.
Re: Quick tip for developers who use OS X
#296Bash, running in your terminal, understands both the Emacs and the Vi commands. By default is Emacs, so you can C-a (control-a) for beginning of line, C-p to go back in command line history, or C-r to search it. I prefer the Vi mode, though. Add to your .bashrc set -o vi Then you can press escape to go from input mode to normal mode; there k will take you to the previous line in command line history, j to the next li…
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
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
#297Earlier quoted context omitted.
Because crappy Macs have no Home/End keys (or they don't work as such).
On most macs, Fn + left/right arrow are home/end. Fn + up/down are pageup/pagedown.
Re: Quick tip for developers who use OS X
#298The first thing I do when setting up a new Mac is make the Caps Lock key into another Control key. System Preferences > Keyboard > Modifier Keys Saves lots of awkward pinky-bending.
Re: Quick tip for developers who use OS X
#299Earlier quoted context omitted.
Because crappy Macs have no Home/End keys (or they don't work as such).
ctrl-arrow (which breaks with Lion's Spaces default keys), or shift Home/End in Terminal. It's not that Macs are crappy, they just have different key bindings. I regularly work with Macs, Windows, and Linux for development and I've just learned to use the different key mappings. I don't think I'm quite as proficient in any one system because of that, though. For example, I have avoided learning the Emacs key bindings…
Yes, other systems have other key bindings, but why do common things like jumping to the begin/end of a line need a key combination? And why aren't the characters written onto the keys? Every time I have to type some code on a Mac I have to press all the keys in order to find { } [ ] etc. At leas I learned not to quit the terminal when I want to enter a @ by now. Whose brilliant idea was that?
Re: Quick tip for developers who use OS X
#300drag + drop files to terminal to get its location. I often do "cd " + dragon drop folder to get to that folder in terminal
There's a free app called Go2Shell that adds a button to finder to open the current directory in Terminal/iTerm. Also works great in conjunction with "open ."
This includes dragging a folder's proxy icon to the terminal app to open the current Finder window in a new terminal.
The proxy icon is the little icon in the top middle of the window, to the left of the name.