The tag has no usage guidance.

learn more… | top users | synonyms

1
vote
1answer
14 views

zsh vi mode: browse recent commands starting with

I've recently switched to vi-mode in my zsh and there is a feature from emacs-mode that I cannot find how to do in vi-mode. The feature is browsing history by lines starting by something I've already ...
1
vote
1answer
28 views

trigger vi mode key binding in normal mode only

I've created some custom key bindings for bash vi mode. They trigger while I'm in insert mode and I want them instead to trigger when I'm in normal mode. I'm using vi mode set -o vi in a terminal ...
0
votes
1answer
31 views

How to enable bash completion in vi mode on Synology DSM6

When I turned on vi mode in bash by setting set -o vi suddenly the tab completion was broken, and a literal tab was inserted. How can this be fixed?
2
votes
1answer
46 views

Pasting text in zsh in vi mode

I changed input mode in zsh to vi with set -o vi, but that created problems with pasting text. While trying to do cmd-v (MacOS) in the insert mode, zsh is pasting only a fraction of the clipboard ...
1
vote
0answers
10 views

Can I bind single keys in zsh when in vi normal mode? [duplicate]

I use urxvt with zsh and vi keys (bindkey -v). Is there a way to bind custom commands to single keys when in normal mode? For example, I'd like p to run xclip -o -sel clip and insert the result at the ...
1
vote
3answers
203 views

How to match two lines at once in vim

I have a file that contains records with tab separated format but in two lines, I want to arrange records in one line with tab separated values using vim editor pattern match. Ex. Abc PQR ...
16
votes
3answers
4k views

Vim - how to replace one new line \n with two \n's

In vim editor, I want to replace a newline character (\n) with two new line characters (\n\n) using vim command mode. Input file content: This is my first line. This is second line. Command that I ...
2
votes
1answer
16 views

Is it possible to use two characters (e.g. ^tm) in insert mode in zsh for a command binding?

in my current .zshrc file I have bindkey -M viins -s '^tm' '^[Iman ^[Ela ^[d$' and this doesn't work, however when I remove m from the shortcut and it is now only ^t the shortcut is working. I'd ...
1
vote
1answer
242 views

Setting backspace=2 in zsh with vi bindings

I just set my zsh to vi mode as I feel the word/WORD (w/b W/B) skip keybindings will help me work faster than plain ^a ^e in emacs binding mode. However, I'd like to set backspace=2 or set backspace=...
1
vote
0answers
59 views

Clear the terminal in “vi” mode? (equivalent of “ctrl+l” from “emacs” mode) [duplicate]

I am aware of Ctrl+L on bash terminal (using it on Ubuntu) which clears the screen by applying appropriate scrolling on bash terminal. After learning that the terminal is by default set to emacs mode ...
0
votes
1answer
24 views

vim color changing between | |

I'm editing some rst files. In the math section, the color changes between | |. Why is this so? How can I change my rst.vim file to not change color between | |? Thank you in advance.
1
vote
1answer
241 views

How to enable yank-nth-arg using vi mode on Bash?

Hey guys I'm trying to figure out how can I take my nth arg, from my last command, without using the !:nth. In a normal bash (emacs mode) I can do that using the follow shortcuts: <ESC>nth_arg &...
4
votes
1answer
105 views

How can I get back into “normal” edit-mode after pressing esc in zsh (vi mode)?

I'm using zsh in vi-mode. When I go to normal mode with ESC and then back into insert mode (for example using i, a or s), the line editor kind of "protects" the part of the line in front of the char, ...
1
vote
1answer
278 views

tcsh/vi-mode behavior difference between Solaris and Linux

We have both Solaris and Linux environments at work. We use tcsh as the standard shell for hundreds of users. My question is about vi-mode in tcsh: In Solaris, while I'm typing, I can backspace ...
2
votes
1answer
108 views

How to bind a key sequence to a widget in vi cmd mode zsh?

Let's say I want to bind R to redo in vicmd mode. This works. bindkey -a r redo If I change it to this, it does not work. bindkey -a rr redo I have tried different things with no success. Is ...
4
votes
1answer
364 views

How can I configure ZSH's vi mode to persist the state between commands?

I am aware how to set ZSH's default line editor to use vi-like keybindings... bindkeys -v ...and even to default each new prompt to be in command mode instead of insert mod by default... zle-line-...
20
votes
2answers
5k views

Is there any way to enable Ctrl+L to clear screen when 'set -o vi' is set?

When you press Ctrl+L in bash default mode the screen is cleared. But when I run set -o vi and press Ctrl+L the keystroke is printed (^L). Is there any way to keep this behavior?
4
votes
1answer
1k views

bind key sequence to Escape, zsh

How would I map jj to Esc in zsh? I'm trying to recreate a key-mapping that I have setup in vim, where I have jj mapped to ESC so that whenever I double-press j, it sends the an <Esc> to vim--...
4
votes
3answers
4k views

Running external commands in vim

It seems that if I run the following inside the vim: :w !wc -w I get the word count of the file. But I don't understand the syntax. How does this work and how would I specify that I want the ...
1
vote
1answer
415 views

Issues using sublime text to edit command line in VI mode

I am using the following to edit the current command line in Sublime Text 2 (using a working subl alias) .zshrc set -o vi EDITOR='subl'; export EDITOR bindkey -M vicmd v edit-command-line ...
13
votes
2answers
8k views

How to unset set -o vi?

I wanted to try vi mode in bash but now I would like to change it back to normal. How can I unset -o vi ?
5
votes
0answers
56 views

Change PS1 without hitting enter [duplicate]

Possible Duplicate: Change cursor shape (or color) to indicate vi mode in bash I am using vi-mode in a bash shell, and I would like to change the PS1 variable whenever I am in insert mode. ...
29
votes
2answers
9k views

How do I perform a reverse history search in ZSH's vi-mode?

I use vim for essentially all my editing needs, so I decided to once again try vi-mode for my shell (currently ZSH w/ oh-my-zsh on OS X), but I find myself trying (and failing) to use Ctrl-R ...