Questions tagged [vim]
vim (Vi IMproved) is a text editor supporting different editing modes.
1,822
questions
0
votes
1
answer
53
views
YANKING in Vim and Bash - are they opposite?
I have a very short question that I couldn't really find anywhere else upon googling, though to me this feels like a very natural question to ask, so maybe it's just I'm missing out on something.
So ...
2
votes
1
answer
58
views
Why does sudo change HOME directory to /root on some Linux distros but not others?
In troubleshooting vi, I noticed on my Ubuntu installation running the command sudo env | grep HOME returns the home directory of the user that runs the command (/home/USER). But I noticed on my Linux ...
0
votes
1
answer
40
views
Vim color problem
I've a strange problem with vim editor:
if i write a simple text, all is normal, white text
If i add shebang, save and exit...reopen and ..color change after first line!
:(( Can you help me?!
Thanks ...
0
votes
1
answer
31
views
Vim: Is it possible to open multiple files and jump to specific lines?
Regularly, one may open one file "foobar" and jump directly to line M as such:
vim +M foobar
Now, I have a whole list of files "foobar1", "foobar2", ..., "foobarN&...
3
votes
1
answer
82
views
How to use neovim configuration systemwide
I am trying to make sure that my neovim configuration gets used for all users. Basically I want my neovim configuration at ~/.config/nvim to be used on using the nvim command with sudo. Hence I copied ...
0
votes
0
answers
23
views
Vim show all buffers at top of view, hot keys to move to different buffers?
I have recently realized I have been using tabs instead of buffers for editing multiple files. This appears to be a common mistake for a lot of people.
I want to shift to using buffers for opening ...
0
votes
0
answers
37
views
How is ex implemented in vim?
Now I am reading a book on sed and awk and to learn the history needed to use ed and ex commands.
I thought for a vim user on Arch Linux, there is no need to install other packages but I found that ex ...
1
vote
0
answers
80
views
Cannot Edit KVM Machine's XML; Failed to validate against schema
When trying to save XML changes in Vim this error occurs:
error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng
Extra element ...
1
vote
0
answers
32
views
remove mapping "No mapping found" in vim
I have written a shell script and which generates a custom vimrc file.
gen-config.sh
#!/bin/bash
# Variables
file="groff_ms_macro"
backspace="indent,eol,word"
# Set Delimeters ...
2
votes
0
answers
34
views
In vim, is there a way to map the umlaut letters to the normal ones for jumping?
The result I wish for:
When I type f a, the cursor jumps to the next a or ä, so basically an ä is mapped to an a (but only for the purpose of jumping).
This could be applied to many cases, for example ...
0
votes
1
answer
27
views
Neovim open file with search pattern not escaped?
I'm trying to run the command:
nvim "./some-file" '+/Text (with/slash)'
But I get the following error:
Error detected while processing command line:
E486: Pattern not found: Text (with
And ...
0
votes
1
answer
43
views
How can I prevent vim from trying to connect to an X server?
I'm starting vim in a bash session, within an SSH session. This session has X forwarding enabled, for reasons, but - I want vim to not try to connect to the X server (see this question).
Other ...
0
votes
1
answer
54
views
What should be the appropriate response to error message on Vi
what do you do when you get a" "tests/1-my_list.txt" E212: Can't open file for writing" error message
0
votes
1
answer
101
views
vim very slow over SSH connection
I have a non-stellar SSH connection to some machine; the echo time is... I don't know, 0.2 seconds or so.
Anyway, when I start vim, say with no input file, I experience a long delay, of about 3 to 4 ...
0
votes
1
answer
11
views
Vim autocomplete line inside tmux split
Using vim inside tmux, I would like to bring up the autocomplete line suggestions (normally done via C-x C-l).
I however have the following .tmux config which uses C-l as a navigation key between ...
1
vote
1
answer
225
views
Vim: Warning: Input is not from a terminal
I am not an advanced linux user and I have a hard time wrapping my head around some new concepts.
I recently read about xargs command and wanted to test some examples. One of them confused me like ...
2
votes
0
answers
171
views
Weird garbage (ansi escape characters?) in terminal when running VIM command
I have a script, that when run sometimes/often outputs an "unescaped" ANSI escape sequence when encountering this line:
vim -X -u NONE -c "helptags ~/.vim/plugged/vim-fugitive/doc" ...
-1
votes
0
answers
24
views
How do you customize VIM on Ubuntu?
I am getting used to VIM on Ubuntu 18.04 but would like to make use of plugins to get to the next level. So far, I have tried to install YouCompleteMe using Vundle but for some reason, I keep getting ...
0
votes
1
answer
65
views
How to use vim in textarea in 2023? ItsAllText like
I remember how it was simple to edit textarea back in the dayZ with itsalltex browser addon, now I searched quite an hour which addon can replace this well known utility.
I found ghostext (recommended ...
0
votes
1
answer
53
views
Use sed, awk, or vim to delete everything in a line that starts with + except for the +
I have a fastq file where I must delete everything in certain lines except for the first character. Here is an example:
@A202BNABXX:2:1:4523:2219/1
...
0
votes
0
answers
19
views
How to use Fixed family bitmap fonts in fbterm
I work in a text terminal a lot on my Debian 12 box, and I like the bitmap font family it uses, which IIRC is called Fixed. I use vim for pretty much everything, and it works well in this environment.
...
1
vote
4
answers
88
views
Stuck with regex syntax
I was doing a basic shell script and got a datafile that I need to edit a bit to work with it. The thing is it has multiple lines repeated and even words, so I wanted to fast-edit with vim's ...
1
vote
0
answers
74
views
WSL2 Ubuntu won't let me grep recursively?
I can't seem to recursively search with grep for some reason in WSL2.
me@SOMEHOST:~$ grep -r -e "DATASTORE_BAKs" --exclude=SOMEHOST-2\.viminfo *
grep: SOMEHOST-2.viminfo: invalid context ...
0
votes
0
answers
81
views
+python is not enabled in vim in termux
To use autocompletion of python, I have to install +python enabled in vim.
sudo apt install vim-nox perfectly works on debian based linux, but vim-nox package is not found in the termux repo.
How can ...
2
votes
1
answer
59
views
Unexpected `^[[I` shows up when running vim script from command line
In a shell script, if I source even a trivial vim script this way
$ cat ascript
:q
$ cat test
vim -S ascript -N -u NONE
read
This is what I get when I run it:
$ bash test
^[[I
The ^[[I output is ...
1
vote
1
answer
83
views
How does the zsh which builtin work?
My question is actually two-fold; I have a user defined function for TeX processing, called texsed, which is as following:
function texsed () {
sed -i -f $S/tex_rule.sed $1 && pdflatex $2 $...
0
votes
1
answer
788
views
Enable plugins in VIM. E492: Not an editor command: PlugInstall
I've been following this video tutorial, to install some VIM plugins in order to change the text colors in my VIM editor, especially to make comments brighter color.
I've created .vimrc file. It looks ...
0
votes
0
answers
40
views
Mapping colors in KDE Konsole to elements of Vim formatting
I seem to be struggling with this for quite a while, and always it is trial and error.
I need to know the mapping between different elements of formatting in Vim (for instance, the font color of the ...
0
votes
0
answers
30
views
Vim - Green highlight when moving cursor position
When moving the cursor, there is a green highlight which follows the path of where ever I move to.
How do I get rid of it?
0
votes
1
answer
38
views
Why I had to change my tmux vim regexp recognition?
As many people, I have several lines of tmux config copied from somewhere else. One of them is the "detect if is VIM window" one. No matter ho much I find, I always find the same set of ...
0
votes
2
answers
35
views
Paste with VIM through regular-expression replace
I'm using VIM's y command to copy some code (multiline), and want to paste it with p-command in some other place in the file.
However, I want to paste the copied code quickly after doing some changes ...
0
votes
0
answers
15
views
vim not properly sequencing key strokes
I am having an issue with vim after installing a new system (I mention that because it may be an issue specific to a recent update in vim, said new system is Ubuntu 22.04). Key strokes are not ...
0
votes
0
answers
14
views
How to disable wrong indentation in VIM? [duplicate]
I would like to disable "too smart" autoindent in vim 8.2 (e.g. in new Ubuntu or Raspbian) while keeping other defaults, e.g. syntax highlighting configured.
For example this yaml file:
test:...
1
vote
0
answers
37
views
What exactly does the command 'make reconfig' do when build Vim?
I try to build VIM but I have a few question about make command and its options (now on Ubuntu 22.04).
For building VIM I follow the official documentation, first download the source files from its ...
2
votes
0
answers
31
views
Screen issue when using vim
When I launch vim in a window of gnu screen, it shows the file as if I had inserted two 'z's at the initial cursor position, but the file is in fact correct and these 'z's just get over written the ...
16
votes
2
answers
3k
views
How do interactive CLIs work?
How do command-line applications like Vim work? Specifically, how do they take control of the terminal in the manner they do? Also, for future reference, is there a specific term for applications that ...
1
vote
1
answer
43
views
Vim: is there a way to quickly start in insert mode at a certain line number after erasing that line?
I personally prefer nano over vim because vim just works so much differently than a standard text editor...it can really be stressful if you don't understand how to use it efficiently.
However, today ...
0
votes
1
answer
30
views
Why do some applications started using bash "bind -x" hang the terminal?
I have these bindings in .bashrc:
bind -x '"\C-f":"vim -c MRU"'
bind -x '"\C-g":"lazygit"'
and after starting vim using Ctrl-F and exiting it, it leaves the ...
0
votes
0
answers
158
views
How to make (neo)vim replace a selection with the clipboard?
Let's say I have "some example" text
If I want to change the text inside quotes, and because I have set clipboard=unnamed¹ in my configuration, I have to "qci" then ⌘V. "q is ...
0
votes
1
answer
36
views
Copying "fancy" spaces with the mouse from Vim
I have the following setting in my .vimrc:
set listchars+=space:·
for formatting purposes (spaces vs tabs, extra spaces, etc) and thanks to a proper color scheme, these dots do not disturb much. So ...
0
votes
0
answers
123
views
how to copy from ssh linux to windows clipboard in vim
I'm very new to vim and linux, and I'm using windows to ssh to my schools linux server through terminal. But I don't know how to copy from vim in linux to my windows' clipboard.
I tried "+y, but ...
0
votes
0
answers
56
views
nvim colorschemes doesn't work as expected with urxvt terminal
hello my terminal (urxvt) is working well, but it has one problem with vim's colorschemes.
it displays a weired colors, not like other terminal (xfce4-terminal).
i look for the problem and i found ...
0
votes
0
answers
63
views
vim: shift+insert works for external keyboard but not laptop keyboard
I'm very new to linux and vim, my laptop computer is windows and I'm using ssh to access my school's unbuntu linux in the terminal. The funny thing is, when I use shift+insert through external ...
1
vote
0
answers
79
views
How to perform substitution with vim in the current command-line command?
I use vim on the command line. I want to use the substitution command to search for and replace characters in the command line I’m currently working on in the CLI.
Here’s merely one example, say I ...
0
votes
1
answer
391
views
Configuring vim installed via NixOS's home-manager
I'm just getting started with NixOS, and I'm trying to us home-manager to declaratively control which packages I have installed and deploy their configurations to my home directory.
I told home-...
1
vote
1
answer
172
views
How do I search for a string and then insert a newline at the beginning, for all lines in file?
I want to search an entire file for the string --- when it appears at the beginning of a line. I then want to insert a newline before each instance of that string.
In my .vimrc file, I added this ...
-1
votes
1
answer
91
views
Insert text at same time on different line but with different columns in Vim
Lets say I have this line:
gonna give you up
gonna let you down
gonna run around and desert you
If I want to insert some text at the same time on different line and on the same columns, such like ...
8
votes
2
answers
1k
views
Difference between sudo -e and sudo vim?
Is there a key difference between sudo -e and sudo vim. I have set up the sudoers file so that vim is my default editor. Is there a key difference between the two?
Plus, should I switch from vim to ...
1
vote
0
answers
65
views
tmux send-keys to vim has no effect when used with swap-pane
I have a tmux window with 2 panes (pane-ids: 0 and 1). In the pane 0 there is vim launched. I want to fire a combination of two commands from tmux command-prompt:
:send-keys -t 0 "iabc" ; ...
0
votes
0
answers
147
views
no vim color syntax in xfce
Colors are not showing in vim syntax highlighting under xfce (xfce4-terminal and xterm, connecting with X2Go). But showing fine if using ssh terminal to the same node.
In xfc4-terminal
if starting ...