12 ms·
Moving efficiently in the CLI
- pcmaffey 9y agoMy dream command is [somekey] + up that scrolls through history sorted by frequency of use.
- rossjudson 9y agoI've used this for years: https://github.com/dvorka/hstr https://github.com/dvorka/hstr
- rpdillon 9y agoNot what you asked for, but assuming you use the commands frequently, they'll tend to stay cached, and C-r can access them quickly if they have a unique substring you can remember.
- itomato 9y agoset -o vi Vi keys in the editor, Emacs on the CLI? This has never made any sense to me. https://popcon.debian.org/main/editors/by_inst https://popcon.debian.org/main/editors/by_inst
- mpblampo 9y agoThank you for this! I had no idea this existed. It is perfect for vim users. Very happy that I can now jump around to my heart's content without learning a new set of keyboard shortcuts.
- funkymike 9y agoEven better is to create a .inputrc configuration file. This is used by readline so it will affect your shell and some other utilities. You can do even more in there too. For example I use this: set editing-mode vi # Up and down arrows keys search history based on what is already typed. "\e[A": history-search-backward "\e[B": history-search-forward
- deleted 9y ago[deleted]
- ggm 9y agoIts a historical artifact of how in-line edit emerged as a thing for most people. MIT had huge influence in the development of window systems (X10/X11) and adopted emacs string edit mode in most type in boxes. Bash came from a community which had a strong emacs usage. So, the default in both the window system and in the bash shell, was emacs, even if you use ed/ex/vi Because most people used awk/grep/sed/ed/ex/vi the regex format tended that way. But enough people used tcsh or bash in emacs by default, that shell and omnibox (when browsers eventuated) edit defaulted to emacs. Thats my theory: accidental happenstance and defaults.
- deleted 9y ago[deleted]
- SmirkingRevenge 9y agoAnd if I'm not mistaken, during that time, the ctrl key was typically where caps lock is today (maybe just on certain machines?) - and that is what influenced the frequent use of ctrl for key shortcuts in libraries lile readline.
- ggm 9y agomay well be. not that escape is so far away from a pinkie, for the modal people (like me)
- SmirkingRevenge 9y agoIt pretty far away, compared to capslock. Especially on modern laptops.. lile touch bar macs that actually remove the the entirely
- ggm 9y agoHateful. Annoying. Thank goodness for kbd remapping
- hoosieree 9y agoClose: https://en.wikipedia.org/wiki/Space-cadet_keyboard#/media/File:Space-cadet.jpg https://en.wikipedia.org/wiki/Space-cadet_keyboard#/media/Fi...
- okket 9y agoI am a fan of vi/vim, esp. as a remote shell editor. But the vi support in readline CLIs is overkill IMHO. I don't see the need for the 'extra power' of vi there, esp. the modes. A few well known keyboard short cuts are just fine for a CLI. This also works the other way around: A few EMACS based shortcuts are the better 'lowest common denominator' than to force vi modes on everyone. Many are not willing to go down the vi/vim path, for various reasons.
- jethro_tell 9y agoHOW DO YOU EXIT THIS SHELL??
- imiric 9y agoI disagree, and find the vi mode (and extended Vim bindings) very useful in the shell. Consider a long cURL command split over several lines. If every option is on a separate line, removing one is a `dd` keystroke away. Adding a new option is also very efficient. Extended Vim bindings will also allow you to delete everything within brackets/delimiters (e.g. `di"`) or delete everything up until a character, etc. These are all simple keystrokes that translate well to the shell. You could also open the command in your $EDITOR anyway (bound to `V` for me), but I reserve that for really long and unwieldy commands.
- mooreds 9y agoI came here to post that, glad you beat me to it. Reaching for that control key? Ouch. Though I guess when you use vi keybindings, you are occasionally reaching for the escape key. But, there is something to be said for meeting people where they are. If folks know the emacs keybindings, let them 'control' away!
- Lio 9y agoAs a dyed in the wool Vi user. I still want ctrl where I can reach it easily. Ctrl-[ for escape and when in Insert mode, ctrl-h backspace; ctrl-w delete word; ctrl-u delete line; Ctrl-m return; ctrl-i tab, etc.
- mooreds 9y agodifferent strokes for different folks. I did not know about those insert mode keystrokes. Thanks!
- Lio 9y agoYeah, I have some problems with RSI in my right wrist (stop sniggering at the back). I think it's mostly down to the way I twist to reach backspace rather than move my whole hand from the home row. Ctrl-h, Ctrl-w and Ctrl-m really help with that. The only problem I have is that I don't know how to remap Ctr-m to return in X windows applications. I use Karabiner on a macOS and Gnome Tweak tool on Linux for the others. It's somewhat frustrating to have different shortcuts in the terminal, where I spend most of my time and the browser where I spend most of the rest. Edit: (If anyone can suggest a good way of mapping ctrl-m to return in Linux browsers I'd really appreciate it.)
- SmirkingRevenge 9y agoIm a broken record in this thread right now... for goodness sake, remap capslock to ctrl!!
- wyclif 9y ago
- zeveb 9y agoemacs Why not just use emacs everywhere? I suppose if you use spacemacs (which has vim keybindings) then you might want to 'set -o vi' on the command line. Emacs has Org-mode & Magit, each of which should be reason enough to switch. Then there're notmuch, gnus, slack-mode, eww … Seriously, emacs really is a more powerful environment[0]. Modern vim tries to be as flexible as emacs, but the language isn't as nice. E.g. Damian Conway's[1] simple example: function! ToggleSyntax() if exists("g:syntax_on") syntax off else syntax enable endif endfunction nmap <silent> ;s :call ToggleSyntax()<CR> would be: (defun toggle-syntax () (syntax (not syntax)) (global-set-key (kbd "M-C-s") toggle-syntax) in a hypothetical elisp for a vim-like editor[2]. In his article he refers to vimscript a more humane than elisp, but I think this simple example shows he's wrong. His next example is a command to capitalise a line, centre it, then move down: function! CapitalizeCenterAndMoveDown() s/\<./\u&/g "Built-in substitution capitalizes each word center "Built-in center command centers entire line +1 "Built-in relative motion (+1 line down) endfunction nmap <silent> \C :call CapitalizeCenterAndMoveDown()<CR> I think this is a lot clearer: (defun capitalize-centre-and-move-down () (interactive) (upcase-region (line-beginning-position) (line-end-position)) (center-region (line-beginning-position) (line-end-position)) (forward-line)) [0] https://sites.google.com/site/steveyegge2/effective-emacs https://sites.google.com/site/steveyegge2/effective-emacs [1] https://www.ibm.com/developerworks/library/l-vim-script-1/index.html https://www.ibm.com/developerworks/library/l-vim-script-1/in... [2] For the real emacs, it's just font-lock-mode.
- 0x445442 9y agoI've used Emacs off and on for years now. But I can never get to that place where I get totally emersed because of the clunky terminal/shell story. I've tried eshell but what always gets me is having to C-c while in the terminal or eshell to get back to a different buffer. I prefer M-x and fuzzy function entry to key bindings and when I'm in a terminal buffer or eshell I always go for M-x which won't work. Any tips would be appreciated as I really like everything else about Emacs.
- sedachv 9y ago
- alan5 9y agoIf you modify your .inputrc with the following this should propagate to all of readline as well (e.g. python): set editing-mode vi
- CDRdude 9y agoWhat shell does that work in? On a mac, I have that set in my .inputrc and it does not propagate to python.
- zeptomu 9y agoBash. Actually it depends if the program uses libreadline - which should be the case for Python's REPL? You may try `rlwrap` which wraps programs without readline support.
- deleted 9y ago[deleted]
- foobarrio 9y agoThis is actually my preferred config. The reason being emacs shell buffers. I can interact with any shell tool using the full text editing features of emacs. I've had to interact with many Oracle databases via sqlplus. "sqlplus" is not a fun tool to use on the shell. However in emacs it is perfectly fine and works as well as the command line interfaces from PostGRE or MySQL. The inline shell also allows automatic history, block selecting and line truncate/wrapping controls across all tools. However for pure text editing, it's always vim for me. I've even found myself launching emacs+shell within tmux in one pane and vim in another.
- mulmen 9y agoSorry, unrelated nitpick but the name is PostgreSQL or Postgres. Postgres started in 1986 as a followup to Ingres and the name was meant to mean after-Ingres. The query language was later replaced with SQL and the name changed again to a portmanteau of Postgres SQL It's never PostGRE. https://www.postgresql.org/about/history/ https://www.postgresql.org/about/history/
- totierne2 9y agoHave you tried sqlcl from Oracle? 20 meg download (requires java). Up down left right work. Use sql hr@ instead of sqlplus hr @ (I am one of the developers.) . I should try it from within Emacs.
- debugxyz 9y agoNot enough people know about this config, bash/zsh compatible.
- zeptomu 9y agoAfter years of using Vim and Bash this was a relief that I learned way too late. For the lazy ones $ cat >~/.inputrc set editing-mode vi set keymap vi $if mode=vi set keymap vi-insert "jj": vi-movement-mode $endif Obviously you want to change vi-movement-mode to your favorite ESC style. E.g. searching through your last git commands becomes 'jj/git' then (you have to go to movement mode first, as insert mode is the default in the shell - which makes kind of sense).
- DavideNL 9y agoOne thing that annoys me on macOS is that "set -o vi" stops tab completion from working when logging in as root. $ sudo -i $ cd /va<tab> #results in "cd /var" $ set -o vi $ cd /va<tab> #results in: "cd /va "
- gumby 9y agoThey are simply basic Emacs keystrokes. They also work in Mac text fields. Exception: ^U and ^W are old unix "cooked" io keystrokes but the relevant Emacs ones also work (e.g. meta-delete instead of ^W).
- ubernostrum 9y agoThey're readline keybindings. Anything which uses readline will support them.
- gumby 9y agoI am well aware of this as Brian Fox wrote readline at my suggestion and we were both by then Emacs users of many many years. However the mac text widget doesn't use readline. edit:s/than/then/
- frou_dh 9y agoThose too can be hooked up throughout the Mac using the DefaultKeyBinding.dict mechanism "^u" = "deleteToBeginningOfLine:"; "^w" = "deleteWordBackward:";
- nextos 9y agoThose shortcuts are a subset of those offered by GNU Readline, which is e.g. used by Bash and emulated by Zsh. Readline can offer Emacs-like (by default) or Vi-like keybindings: https://en.wikipedia.org/wiki/GNU_Readline https://en.wikipedia.org/wiki/GNU_Readline
- acomjean 9y agoI use cntr -a cntrl e all the time. I use the default mac terminal. I was excited because I'm always forward and backing up in previous commands. But alas... Alt F and Alt B just print characters (ĺ). I tried to see if there was a configuration I could set, but to no avail. Maybe I need a better terminal.
- bobwaycott 9y agoiTerm handles Alt+f/b correctly.
- 32bitkid 9y agoTry: `esc F` and `esc B` instead of alt.
- base698 9y agoSet option to meta in your terminal preferences.
- em500 9y agoThe configuration is in Terminal Preferences -> Keyboard -> Use Option as Meta key
- acomjean 9y agoThat works. Thanks! though you have to set it for each terminal type. (I use 3 colors...). It was a little annoying but done.
- Lxr 9y agoHighly, highly recommend iTerm2, it’s a great piece of software and there’s really no reason to use the default terminal over it.
- rthille 9y agoThis would be a reason why: https://danluu.com/images/term-latency/idle-terminal-latency.svg https://danluu.com/images/term-latency/idle-terminal-latency...
- fiveFeet 9y agoThe diagram is awesome! It helps in remembering these shortcuts better.
- TheGrassyKnoll 9y agoYes VERY nice diagram.
- conradk 9y agoI use i3wm and always feel left out of these kinds of tips, because i3wm uses Alt for all kinds of Window Management stuff. If I do Alt-F, my shell goes fullscreen, because i3wm is setup to do that. Any tips for i3wm users that have these kinds of keybind conflicts ?
- awll 9y agoWhy don’t you use the windows key(Mod4) for i3?
- racingmars 9y agoI'm not sure if it's an option in your setup, but this is why I use the "Windows" key on my keyboard as my i3 modifier. The Alt key then remains available for applications.
- procparam 9y agoI use the windows key for the i3 modifier, and leave alt alone. If your keyboard doesn't have a windows key, you can probably map left-alt to mod and leave right-alt alone. Or vice versa. Basically, find a redundant key to use as your wm mod key.
- dijit 9y agoI remapped my modifier to the <Super> (Mod4) key a long time ago. Although I also admit to not using the alt variants of this. Alt is a common modifier for navigation though, things like qutebrowser use it to navigate tabs and such. It's worthwhile to switch and the "Windows" key hasn't conflicted with anything for me. In my opinion it's a saner default than the current.
- herewulf 9y agoI don't use i3wm but I use XMonad. I set my (window manager) meta key to the "windows key". You can probably do the same thing. I can't live without alt-. in the shell!
- sevanteri 9y agoI use Super instead of Alt. When I changed to i3 I instantly knew that alt would conflict with everything in terminals.
- the_cat_kittles 9y agooh my god. i cant be the only one here who had no idea these existed. thank you
- deleted 9y ago[deleted]
- herewulf 9y agoI use most of these on a regular computer but this is very helpful for something like Termux. My smartphone doesn't even have arrow keys! The diagram is very helpful.
- zython 9y agoIf anyone else likes linux tools explained visually heres one for htop: https://codeahoy.com/2017/01/20/hhtop-explained-visually/ https://codeahoy.com/2017/01/20/hhtop-explained-visually/
- wwarner 9y agoAll those, and ctl-r <chars><ret> for searching history.
- wwarner 9y agoAlso -- ctl-r <chars> ctl-r ctl-r ret To match two commands containing <chars>
- Exuma 9y agoHere's a few more that the diagram is missing, along with a function I created that inserts these commands (in dark gray so it's not intrusive) every time I start ZSH shell, like flash cards. Keep in mind, most of these work anywhere in OS X, not just in the terminal. Put this in your .bashrc or .zshrc # MOTD function echo_color() { local color="$1" printf "${color}$2\033[0m\n" } echo_color "\033[0;90m" "c-f Move forward" echo_color "\033[0;90m" "c-b Move backward" echo_color "\033[0;90m" "c-p Move up" echo_color "\033[0;90m" "c-n Move down" echo_color "\033[0;90m" "c-a Jump to beginning of line" echo_color "\033[0;90m" "c-e Jump to end of line" echo_color "\033[0;90m" "c-d Delete forward" echo_color "\033[0;90m" "c-h Delete backward" echo_color "\033[0;90m" "c-k Delete forward to end of line" echo_color "\033[0;90m" "c-u Delete entire line"
- pbhjpbhj 9y agoCtrl+W Delete word (and following spaces). [works in BASH at least]
- b5 9y agoKeep in mind, most of these work anywhere in OS X, not just in the terminal. That's one of my absolute favourite things about Mac OS -- because Cmd exists, and takes over what Ctrl is used for on Windows and Linux, I can use these Ctrl commands and they work as I expect. I wonder if it's possible to get Linux to work the way the Mac does in this regard? Allocate a Meta key to do what Ctrl does move of the time, so that these Ctrl commands became available again? I'd really find it easier to use Linux if that was possible.
- emidln 9y agoGnome/GTK and KDE both have keybinding themes that can be set to emacs. You can do it for GNOME/GTK from gnome-tweak tool. Otherwise you can use gsettings or edit the config directly. Just google "emacs gnome keybindings".
- bmn__ 9y agoYes, that works out of the box with every KDE application. I recommend Super as modifier key rather than Meta because most keyboards on the market have a physical Super key or two. https://encrypted.google.com/search?tbm=isch&q=kde+rebind+keys+dialog https://encrypted.google.com/search?tbm=isch&q=kde+rebind+ke...
- octref 9y agoThanks for sharing! I've been using C-A/E a lot, but not really Alt-B/F. Wondering if there is a way to swap Alt-B/F to Ctrl-B/F? Moving between words seems much useful than going one char forward/backward, and arrow keys get those covered.
- Yhippa 9y agoI moved to a 60% keyboard the past year and I wish I'd taken the time to research this. This is a lifesaver.
- ersing 9y agowe need this because first apple and later others ditched the navigation keys from keyboard. good old days with home, end , page up/down delete keys etc. nowadays they fuck with function keys first they replaced it with screen dim and sound now the touchbar , future is not bright!
- JadeNB 9y ago> they replaced it with screen dim and sound now the touchbar , future is not bright! Well, sure; that's because you've used the screen dimmer.
- wu_tang_chris 9y agolol no. > set -o vi
- YTGRK 9y agohttps://youtu.be/I2l8xkjTUh4 https://youtu.be/I2l8xkjTUh4
- inetknght 9y agoThis is handy. But it would be far more handy to show _exactly_ where the cursor goes. Moving left-ward puts the cursor at the beginning of the word. Moving right-ward puts the cursor one-past-the-end of the word, not at the last letter as is depicted in the diagram. Anyway, it's far more intuitive to use arrow keys with modifiers: * control + left-arrow = alt + b * control + right-arrow = alt + f * alt + backspace = control + w I get super upset (pet peeve) when programs don't support word navigation like this. What I would like would be for someone to build a web app which allows you to select what modifiers you want for each of the shortcuts, and then has a button which would generate configuration files for various programs (vim, emacs, tmux, gnome-terminal, etc) that you can download or copy/paste. That would be grand.
- devereaux 9y agoIn my inputrc, for the alt-backspace example: ### Line cuts will be remapped to cmd-remove in OSX, shift-remove in Linux ## OSX: Remap with ControllerMate Cmd+Delete to Ctrl-k "\e[3;2~": kill-line ## OSX: Remap with Controllermate Cmd+Backspace to Ctrl-u "\e[9;2~": backward-kill-line ### Word cuts will be remapped to opt-remove in OSX, alt-remove in Linux ## OSX: Remap Alt+Delete with ControllerMate to Ctrl-w "\e[3;3~": kill-word ## OSX: Remap Alt+Backspace with ControllerMate to Esc-d "\e[9;3~": backward-kill-word
- brucephillips 9y agoArrow keys are slower than letters, since you have to move your hand.
- inetknght 9y agoNot all keyboards are laid out the same.
- brucephillips 9y agoThere's no value in nitpicking. 99% of keyboards are standard qwerty.
- aequitas 9y agoI recently discovered that macOS has native support for these Emacs key bindings (https://jblevins.org/log/kbd https://jblevins.org/log/kbd) on it's textfields. This includes things like text editors, browser address bars, input fields and of course all terminal emulators. I still prefer Vim as my editor, but learned these key combo's because they are just so portable.
- eanzenberg 9y agoThis is why I use mac, the emacs keybindings I've learned and used for over 20 years.
- bocklund 9y agoExcept option as meta (terminal excepted). I just want to M-f and M-b through words and I cannot.
- callalex 9y agoGood news! If you add these shortcuts to the override file in your home directory it will override the alt-special-character behavior.
- why-el 9y agoSome of these actually work in a surprising number of places, for instance in the URL bar of both Safari and Chrome (assuming OSX). In fact I am so used to them that when they are missing they are the first reminder I am not in my preferred platform (or running a program that does not respect them).
- sigjuice 9y agoIf you like to use the mouse: In Terminal.app on macOS, alt + mouse click will move your cursor anywhere. I am not sure how exactly this works. It also seems to work while I am inside Terminal.app and logged on to a remote Linux system. Also, simply clicking works while running a shell in Emacs using M-x shell
- vladsanchez 9y agoChris Pizzi taught me all these little tricks while we worked at Ezyield.com. Thanks Chris!
- erikcw 9y agoMy favorite recent find in iPython is “alt-9-backspace” which deletes 9 “words” back. In my case clearing a uuid string in a Django ORM query: MyModel.objects.filter(UUID=‘123e4567-e89b-12d3-a456-426655440000‘)
- Symbiote 9y agoAlt+<number>, command is Emacs / readline etc for "Repeat this command number times". The number doesn't have to be a single digit, so Alt-3, Alt-6, Backspace, or Alt-3, Alt-6, Ctrl-H also work (delete 36 characters.) (Your command would normally be described is Alt-9, Alt-Backspace; or M-9 M-Backspace; to show the Alt/"Meta" key is held for both strokes.)
- petercooper 9y agoAs lovely as this diagram is, are there any explanations as to why these are the characters used? I know a few of them but don't see any overall pattern. Is there a logic to it, or do you just have to memorize it? Update: Never mind. Turns out alt+most keys on macOS just types special characters, making the ones I didn't know useless to me anyway :-D
- falcolas 9y agoTo your original question: They're emacs bindings. Back and Forward, Word, and such. Not all make perfect sense, but there are mnemonics. For the update - this is a problem with the built-in terminal. You can use iTerm and get the expected (within a terminal) key bindings, or remap the option binding within its preferences panel.
- ken 9y agoFrom Emacs: F/B are forward/back, D=delete, K=kill. E=end, and A was probably used because S was already Search. W=word, maybe? Not sure how U came about here (it's something different in Emacs). BTW, if you're using Terminal.app, you have to explicitly enable "Use Option as Meta key" in the preferences.
- hoosieree 9y ago^H comes from ASCII.
- kreetx 9y agoMany if not most are from emacs. As to why I have no clue, but could be for historic reasons, i.e no overarching logic. Bash also has a vim mode which makes sense to use for vim users. This connection with the editor really helps a lot.
- Kiro 9y agoI want a shortcut that moves from current location to 50% of the remainder.
- craftyguy 9y agoOhh, this would be interesting, assuming the jump would diminish by 50% each time the shortcut was hit!
- mattalbie 9y agoI'll just be over here, using acme.
- c256 9y agoHi! Where did you find a good 3-button mouse these days? Are you still living off a hoard collected from back when?
- ConSeannery 9y agoset -o vi
- blunte 9y agoI believe these work because of readline, and the standard text controls in MacOS use readline... Learning keyboard shortcuts is very beneficial, at least in cases where you often do the same things. CMD or Ctrl L is one of my favorites (jump to address text box in most browsers). It's a bit like coffee^h^h code (wow, autocorrect) optimization; a few improvements in a few places can save an immense amount of work or time.
- c256 9y agoThe standard text boxes on macOS don’t use readline, they use NSText*, which happens to implement similar things to the defaults for readline (because they were created by people who used Emacs a lot, and readline defaults to Emacs style). This is really only important because readline customizations won’t affect macOS text boxes — but it will affect readline programs on macOS, including bash.
- craigsmansion 9y agoTo memorise moving around the cli: C-f -> f for forward C-b -> b for backward C-p -> p for previous C-n -> n for next C-a -> a for Anfang C-e -> e for Ende C-k -> k for kill forward C-u -> just memorise this one. It's the one you use when you suspect you've mistyped a password in ssh or login shell. Alt/meta sometimes does what Ctrl does, but bigger. BONUS TIP: In GNU screen, you can use C-a-a for C-a to jump to the beginning of the line. Now you no longer have a reason to passionately hate the default C-a meta-binding for screen. You're welcome.
- paws 9y agoRandom tidbit: back when Mac OS X first mapped these bindings to Cocoa, it became possible to use them for evil -- to exploit OS X to grant access it wasn't supposed to. [1] For example if you had a screensaver with a password prompt, you could type some characters, then: 1. ctrl-a 2. ctrl-k 3. ctrl-y ...repeat steps 1-3 several times and hit enter. The screensaver would crash to desktop, or on the logon prompt, you'd crash to the console mode available by entering >console as a username. I think these were largely patched by 10.3.0.[2] [1] https://www.cnet.com/news/mac-os-x-screensaver-security-crashing-screen-effects/ https://www.cnet.com/news/mac-os-x-screensaver-security-cras... [2] https://apple.slashdot.org/story/03/07/05/187203/screensaver-bug-in-mac-os-x https://apple.slashdot.org/story/03/07/05/187203/screensaver...
- kakarot 9y agoThe terminal might be the most ubiquitous piece of software between *nix flavors, if there's a single application you should probably learn the defaults for, it's gonna be that one. Last thing you want to do is look like an idiot trying to fix your friend's computer because you can't even remember how to get around in their default bash shell. This gives me an interesting idea, though... Are there any "portable shell" applications that painlessly provide a mechanism for storing your preferred shell, necessary dependencies and configuration files on a thumb drive that's as easy to use as `/mnt/shelldrive/zsh`?
- yla92 9y agoHere's a gist I made awhile ago for moving around and other useful shortcuts and tools. https://gist.github.com/yelinaung/849c78c40784c56e05f5a04dded9082d https://gist.github.com/yelinaung/849c78c40784c56e05f5a04dde...
- mrtweetyhack 9y agoIt's too bad there are no keys that signify moving forward and backward.
- foobarian 9y agoMy favorite X-windows customization for improving the CLI experience (though it helps with all editing) is cranking up the key repeat rate to a lot higher than is possible in GUI control panels (and lowering the repeat delay): xset r rate 160 80 I haven't found how to do this in OSX yet, but there is probably a way.
- alsetmusic 9y ago> I haven't found how to do this in OSX yet, but there is probably a way. defaults write -g KeyRepeat -int 0.02 https://github.com/herrbischoff/awesome-macos-command-line https://github.com/herrbischoff/awesome-macos-command-line
- foobarian 9y agoI never got that to work somehow. I'm sure I have the wrong OSX version.
- mattacular 9y ago$ set -o vi
- alant 9y agoI always wanted these! I’ve been using cmd/alt and arrow keys by accident many times but no luck. Thank you!
- dbdr 9y agoI sometimes wish to "delete forward/backward until character X" (where X might be one of the quotes, a dash, period, etc). I know about Ctrl-W, but that will use a fixed definition of what a word is, while what I need will depend on the context. Is this possible in readline's emacs mode, or is it time to bite the bullet and learn vi?
- chadcmulligan 9y agod/X in vi - you'll never go back
- niark 9y agoFor Mac (iTerm) users, thanks to this thread https://stackoverflow.com/a/29403520/5233291 https://stackoverflow.com/a/29403520/5233291 you can easily configure - alt+arrow to jump words, - cmd+arrow to jump to start/end of line, - cmd+z/cmd+shift+z for undo/redo, - alt+delete to delete word Just discovered it, it's amazing
- qplex 9y agoWhat about the arrow keys? Home/End? Delete? Backspace? Seems pretty silly to key CTRL-something when there are dedicated buttons for the functions already.
- fbcpck 9y agoIn macOS, you can use Karabiner Elements[1] and enable a set of complex modification rules[2] to remap these to a more intuitive key combinations. [1] https://github.com/tekezo/Karabiner-Elements https://github.com/tekezo/Karabiner-Elements [2] https://pqrs.org/osx/karabiner/complex_modifications/#terminal_navi https://pqrs.org/osx/karabiner/complex_modifications/#termin...
- fulafel 9y agoIn the OS X Terminal, is there yet a way to simultaneously get a working alt key and the ability to type characters like []\/ when using an European KB layout?
- xuxiaodong 9y agoMore command line tips: https://talk.linuxtoy.org/cli-tips/#2 https://talk.linuxtoy.org/cli-tips/#2
- Symbiote 9y agoThis is covered within the first 2-3 minutes of the Emacs tutorial, along with some other shortcuts for moving around. Run "emacs" and then press C-h t (Control-H then T) to start the tutorial. Or you can read it [1], but the tutorial is interactive, so open it in Emacs if you have it. [1] http://www.cs.put.poznan.pl/anstroinski/data/uploads/sop1/materials/tutorial.txt http://www.cs.put.poznan.pl/anstroinski/data/uploads/sop1/ma...
- ktaylor 9y agoset -o vi