News for hackers. Stuff that matters.
Re:Vim 101: How to Start Using the Text Editor for Developers by wolfhumble on Thursday October 24, 2019 @05:58AM (#21343024)
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! :-)

Re:Vim 101: How to Start Using the Text Editor for Developers by zwolbers on Thursday October 24, 2019 @01:21PM (#21346850)
Personally, 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-...

[1] https://wiki.archlinux.org/index.php/Readline#Editing_mode

Re:Vim 101: How to Start Using the Text Editor for Developers by itomato on Thursday October 24, 2019 @10:08AM (#21344808)
They 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-...

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)

Re:Vim 101: How to Start Using the Text Editor for Developers by lsiebert on Thursday October 24, 2019 @06:03AM (#21343046)
I use vi key bindings in bash and in tmux for that matter.
Re:Vim 101: How to Start Using the Text Editor for Developers by intarga on Thursday October 24, 2019 @06:49AM (#21343290)
“set -o vi” will give you vim bindings in bash
Re:Vim 101: How to Start Using the Text Editor for Developers by wolfhumble on Thursday October 24, 2019 @08:01AM (#21343723)
Yes, 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! :-)
Re:Vim 101: How to Start Using the Text Editor for Developers by Antoninus on Thursday October 24, 2019 @08:01AM (#21343724)
If you don't have fkeys bound `$ vimtutor` works too.

*I have never used them on osx and use a 50% keyboard.

Re:Vim 101: How to Start Using the Text Editor for Developers by toastal on Thursday October 24, 2019 @08:15AM (#21343832)
For fish run (or store in config.fish) `fish_vi_key_bindings`