Questions tagged [vi]
vi is a screen-oriented text editor originally created for the Unix operating system.
418 questions
2 votes
1 answer
89 views
Make `set -o vi` vim cursor reflect editing mode when in `read`
I have a script read.sh: read -ei "hello world" eval $REPLY Upon executing chmod +x read.sh and then running ./read.sh, I notice that pressing Esc followed by b or w jumps between the ...
8 votes
1 answer
331 views
bash or ksh 'vi' mode - How to jump to end of history (most recent command)?
I am a long time ksh user, and use bash under duress - both in 'vi' editing mode. One thing that has always niggled - after searching back through history for a command (.e.g <Esc>/needle), how ...
1 vote
3 answers
439 views
sudo vi fails with "Permission denied" after hardening RHEL
I recently hardened my RHEL system, and after that, sudo vi stopped working. When I try to run: sudo vi test.sh I get the following error: /bin/vi: line 23: /usr/libexec/vi: Permission denied /bin/vi: ...
0 votes
4 answers
123 views
editing files in batches from a huge amount of data
I ran into an issue: I have folders with usually 50-150 text files, which I need to modify. sed is not an option, since the changes cannot be automated (sometimes "ss" need to be changed, ...
0 votes
0 answers
40 views
how to use `vi`/`vim` in cli mode like `sed` [duplicate]
i need to replace some strings and due to some reason, vi or vim is my only options. but the problem is i need this to be done in a shell script, is it possible to use vi/vim in cli mode like sed? e.g....
1 vote
0 answers
102 views
Backspace on vim doesn't work after I create a ~/.vimrc file
I'm using vim on macOS, I did different tests. Backspace doesn't work in vim with my ~/.vimrc. I saw that when I remove my ~/.vimrc file everything is ok, but whatever I write in it (any writable ...
0 votes
1 answer
145 views
Bind C-h in tmux copy mode
I'm trying to bind C-h to move to the window on the left. Here is my tmux.conf set -g default-terminal "xterm-256color" bind -n S-down new-window bind -n C-l next bind -n C-h prev bind q ...
1 vote
0 answers
49 views
How to remap "vi-search-again" in .inputrc?
I use Colemak + Bash Vi mode, and have remapped h j k l to h n e i in .inputrc. The original N n keys for repeating search seem to be bound to the same command: $ # Run in command mode $ bind -p | ...
1 vote
2 answers
81 views
Disable $keyword$ expansion by RCS ci check in?
For better or worse, I am using rcs to track changes to HTML and JSON files exported from chatGPT. Some of these contain chats with embedded $keyword$'s. These get expanded on ci check in. How do I ...
0 votes
1 answer
273 views
yamlfix not using configuration + (neo)vim usage
I'm using yamlfix with ale in vim. I followed these steps because I wanted to remove the automatic "---" adding on top of the file every time I save my work (and some others default ...
0 votes
2 answers
617 views
Highlight for two strings simultaneously in vi or less editor?
https://stackoverflow.com/questions/41901319/how-to-search-for-multiple-strings-in-a-log-file-using-less-command-in-unix I found this. awk '/pattern1/ && /pattern2/ && /pattern3/' file....
0 votes
0 answers
158 views
Why am I unable to copy to clipboard from vi editor?
I use old servers so I've to use vi editor. Problem is that I need to copy logs frequently and it's totally painful to do so. I've to convert that to a file, do SCP then only be able to get the logs. ...
2 votes
0 answers
75 views
How do I get the man page for a sub command using vim?
For example, I get the manpage for a command using 'K': docker run +------------ cursor is on d # if I press 'ESC-SHIFT-K', I'll get a manpage for docker Now, if I want to get the manpage for docker ...
1 vote
1 answer
576 views
quick-swap TUI mode while using vi keybindings in GDB
In the default mode of gdb, pressing ctrl+x a turns on and off the UI, and ctrl+x 2 cycles through different split views. There are a number of similar useful shortcuts. I can turn on vi emulation ...
0 votes
1 answer
114 views
How to do a random search in vi editor?
By random, I mean neither from top, nor from middle, nor from bootom. The search should return randomly ordered results. eg: I am searching for "failed" in vi editor. I want randomly ordered ...