2,082 questions
1
vote
1
answer
142
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
56
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
1
answer
75
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 ...
-1
votes
3
answers
572
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 ...
0
votes
1
answer
69
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 ...
3
votes
3
answers
803
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" ...
0
votes
1
answer
80
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 ...
0
votes
0
answers
225
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 ...
0
votes
3
answers
347
views
How to remove characters from a string in a file starting from a given substring until the next n number of characters in Linux?
I have a file that contains a single line with usernames followed by their other information.
For instance the file contains:
Clara01{25 characters of info}Betty29{25 characters of info}Edith34{25 ...
0
votes
1
answer
198
views
Close the creation of a new .gitignore file in Git Bash
I am trying to upload a Unity project to GitHub and I want to create a new .gitignore file. The instructions I am following suggest to create it using the vi .gitignore command, and to close the ...
0
votes
0
answers
73
views
vi copy and yank mixing up
In the past, copying the contents of files by highlighting the contents are not mixing up with yank/delete lines in VI. In other words, after copying, I still can yank/delete those unwanted lines ...
0
votes
1
answer
60
views
Substitution in Vim using the capture sequence
I have the following lines in my text file:
.abc(),
.def(),
.ghi(),
.jkl(),
and I'd like to transform them into this:
.abc(abc),
.def(def),
.ghi(ghi),
.jkl(jkl),
I've tried :%s/\.\(\w\+\)(\),/.\1(\1)...
0
votes
0
answers
28
views
Why is Vi is removing my quotations on save?
I am trying to set up my _auth for npm.
I run npm config edit which pulls up the Vi editor. I update the token to include quotes around it
_auth="mytokenhere"
but then after saving and ...
0
votes
1
answer
125
views
Insert block of color into text file
The following line of code appears in a python source file. It appears exactly like this when the file is opened up in VS Code and in vi (as well as this text edit block). When I cat the file, the ...
0
votes
0
answers
95
views
vim cannot quit paste mode
I ssh to my ubuntu server from mac, and type vi command. I paste some text, and then every shortcut is invalid. esc becomes ^[, command + c not work, and I have to terminate my session. What happened, ...
0
votes
0
answers
623
views
how to tell emacs to actually use the ctags file I created
Not finding what i'm looking for.
Want to enable/start using Ctags with emacs & Vim (setting this up for a team, some use vi some use emacs)
I can: Run "ctags -e -f ./.ctags ...
0
votes
1
answer
71
views
how to shift (indent) yanked lines in vi
I already know many ways to shift (indent - and autoindent) lines in vi, but I was wondering if it is possible to mark/yank a block of lines and indent them.
I already tried the obvious (esc ma y'a &...
1
vote
1
answer
115
views
How to use 'vi' navigation commands within a shell script
I’m trying to use ex file <<EOF vi commands to go to end of a file, go up 100 lines, and delete from that position to end of file.
How can I use the G command to go to end of file within a shell ...
-2
votes
1
answer
866
views
How do I kill a process from c with fork() process id?
I am building a feature, where I can open and close files in vi editor. I am using execlp() system call in C for opening a file in a new terminal window in a new child process. Here is how it looks:
...
1
vote
2
answers
379
views
VIM Auto Wrapping
I cannot seem to get autowrap to work.
I've tried ":set fo ?" and the result is " formatoptions=tcq "
I just spent 30 hours in google and other sites, and 2 hours here trying to ...
0
votes
1
answer
94
views
vi: How to change inside 1) the set mark and 2) the current cursor
What is the shortest way that one can 1) set a mark (m<some_char>), 2) move the cursor to arbitrary position, and change between 1) and 2)?
Is there an equivalent ciw, ci', etc. for the above?
(...
0
votes
0
answers
72
views
Can’t open a file whose directory’s name starting with #
I am using gvim on Windows10.
I use gvim as a default text editor on my PC.
When I double click and open a .txt file which is in a directory starting with “#”
For example:
C:first/second/#third/text....
1
vote
3
answers
1k
views
Replace a substring in the first column using vi
I have a huge file that has multiple columns as shown below:
J02-31 23.2 ...
J30-09 -45.4 ...
J05+30 56.1 ...
J00-20 -78.2 ...
J11-54 232.0 ...
... ... ...
I would like to replace - ...
0
votes
1
answer
923
views
Linux - how to turn off space highlighting
I am working on a shell script but noticed that space character is unnecessarily highlighting which is very annoying.
Tried to turn it off by :syntax off but that removes highlighting for all. Please ...
-2
votes
2
answers
57
views
How to replace multine values to empty string in linux? [closed]
I wanted to change this value
{
"data":"correctValue",
"attributes": [
{
"otherValue": "incorrectValue"
}
]
}
to
{
"data":...