4 ms·
Nice introduction to Vim! Using bash/zsh extensively, and Vim a few times a day, I have been wondering if people treat bash/zsh and Vim as two different worlds
by wolfhumble 7y ago
Nice introduction to Vim!
Using bash/zsh extensively, and Vim a few times a day, I have been wondering if people treat bash/zsh and Vim as two different worlds when it comes to keybindings, or is it common to use Vi/m keybindings in bash/zsh/other shells? Would love to hear some input on this! :-)
- lsiebert 7y agoI use vi key bindings in bash and in tmux for that matter.
- intarga 7y ago“set -o vi” will give you vim bindings in bash
- wolfhumble 7y agoYes, and thanks! In this case I was actually trying to understand how people in general try to combine the two tools. Keeping them separate, or using one keybinding for both! :-)
- Antoninus 7y agoIf you don't have fkeys bound `$ vimtutor` works too. *I have never used them on osx and use a 50% keyboard.
- toastal 7y agoFor fish run (or store in config.fish) `fish_vi_key_bindings`
- itomato 7y agoThey are two different worlds. GNU readline enforces the keys you might identify with Emacs and other GNU components that make their way into your GNU/Linux distro bundle. https://www.gnu.org/software/bash/manual/html_node/Readline-vi-Mode.html https://www.gnu.org/software/bash/manual/html_node/Readline-... I've toyed with taking what suckless have done with their libs and implement some alternatives (people still gripe about missing CP/M (DOS) shortcuts)
- zwolbers 7y agoPersonally, I have vi mode enabled for anything that uses readline. Some of my friends, though, have been reluctant to use it since the prompt doesn't indicate which mode it's currently in. But... That changed with recent versions of readline, which introduced 'show-mode-in-prompt' [0]. It's somewhat limited - it only prints an indicator at the beginning of the last row of the prompt. You can, however, change what text is displayed. I use it to emit escape codes that change the shape of the cursor (similar to vim itself) [1]. [0] https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File-Syntax.html#index-show_002dmode_002din_002dprompt https://www.gnu.org/software/bash/manual/html_node/Readline-... [1] https://wiki.archlinux.org/index.php/Readline#Editing_mode https://wiki.archlinux.org/index.php/Readline#Editing_mode