2,079 questions
1
vote
1
answer
226
views
How to change cursor shape depending on Insert or Normal mode when using `set -o vi` in `tmux`? [closed]
I would like to use set -o vi in my terminal.
However, I find myself getting confused on whether I am in insert mode or normal mode, since the cursor does not switch between a vertical line (insert) ...
0
votes
1
answer
76
views
Find and Replace using wildcard in VIM or VI [closed]
I have a file with numbered host names. I want to change the name while preserving the numbers.
CHANGE THIS:
server1.domain.com
server2.domain.com
server3.domain.com
server4.domain.com
server1....
0
votes
1
answer
64
views
Shortcut to go to the start of the previous line? (opposite of enter / return) [closed]
I certainly am not searching for this answer properly. It should be obvious.
Basically, enter goes to the start of the next line.
I want the opposite of enter. I want to go to the start of the ...
2
votes
2
answers
102
views
How to remove first 3 characters of a visual-line block selection?
So I'm using a language where adding -- to the beginning of a line will comment the line.
To comment a block of code that I have selected using visual-line, I do this:
map <F2> <C-v>0<S-...
-2
votes
1
answer
77
views
vim group and substitute [closed]
I have a csv file that contains 3 sets of ids. I want to use Vim to substitute the appropriate id into the appropriate places, e.g.
A | B | C |
1| 1 | 2 | 3 |
2|33 |11 | 31|
How i can to replace ...
0
votes
1
answer
271
views
How can vi write a file without permissions?
I created a file using touch test, then changed the file permission using chmod 000 test, then did vi test, wrote random characters, I was successfully able to save the file using :wq!. I'm the owner ...
-1
votes
3
answers
615
views
VI search and replace for symbol with digits on either side
I have a large data set that has some values written in -1.00000e-00 notation and others written as -1.00000-00. I would like to replace all of the -00 notation with e-00. I cannot find/replace all of ...
-2
votes
1
answer
84
views
VIM: Avoid a search result is shown at the first or last line of the screen?
If I search forward or backwards (via / and ?) in VIM it will show results at the last line of the screen (when searched forward) or first line of the screen (when searched backwards).
The problem is ...
0
votes
1
answer
91
views
gg in sourced file goes to line 2 in vim
I'm experimenting with running a sequence of commands on a csv file; doing some replacements, changing some stuff. I open the file in vim and use so! filewithcommands. But gg will never go to the top ...
0
votes
1
answer
75
views
How can I copy and paste variable in tcl into vi-editor using middle mousewheel click?
[proc_selProc.tcl]
proc selProc {str offset count} {
return [string range $str $offset [expr {$offset + $count -1}]]
}
set myVar Hello
selection handle -selection . [list selproc $myVar]
selection ...
3
votes
3
answers
904
views
Vim - How to Select a Text In Between Double Quotes That Has Double Quotes Within It
If I have the text:
var x = "Hello my name is Jim and I like ice-cream"
It'd be pretty straight forward to use v+i+".
But if my text is:
var x = "Hello my name is "Jim" ...
1
vote
0
answers
230
views
How can I prevent git bash vi from crashing while rewording commit message with interactive rebase?
I am getting the below error message while attempting to reword a commit in git bash using vi/vim. I have tried on IntelliJ terminal and Git Bash terminal itself with the same result.
hint: Waiting ...
0
votes
1
answer
85
views
AWS Linux 2 Mate Desktop Vi Pasting Issues
Recently there has been issues pasting into Vi from the system clipboard.
When the text is pasted, it inserts the pasted text before the existing text on the line, rather that after the cursor ...
1
vote
1
answer
243
views
How can I remap <CapsLock> to <Escape> in the fish shell?
I've just installed fish shell in my archlinux. Because I use vi-mode in fish, I want to remap my <CapsLock> to <Escape>. How can I archieve it by adding something into my ~/.config/config....
0
votes
0
answers
229
views
Syncing open file changes with Visual Studio Code and Vim
I am looking to auto-sync the file changes for an open file on Visual Studio Code and the same file open externally with Vim. (i.e.: When the file is changed in Vim, I'd like for it to immediately ...