Questions tagged [vim]
vim (Vi IMproved) is a text editor supporting different editing modes.
1,768
questions
0
votes
0
answers
17
views
In vim when same buffer is open in multiple windows how to make buffer-list to show all instances of the buffer
Using Kubuntu 20.04, vim 8.1, in terminal Konsole some subwindows with bash, in one of these vim.
In vim many windows, and one buffer is open in three windows.
Until a few days ago, the buffer-list ...
1
vote
0
answers
44
views
File changed whilst editing with vi
I'm using an Ubuntu 20.0.4 machine and connecting via SSH to run vi. On more than one occasion, I've had a message when saving the file telling me that the file's contents had changed since I started ...
1
vote
0
answers
24
views
How can read the content of the active window?
I am trying to create a bash script that selects the content of the active window, copies the content to the clipboard, and saves the content to a file. This file then gets read by some text editor, ...
1
vote
1
answer
9
views
How to get help on vim's `complete` variable, not vim's `complete' function?
In vim, there is both a function and a variable called complete.
If you do help complete, you get the function's help.
How do you get the help for the variable?
2
votes
1
answer
41
views
Disable vim from auto indenting my comment lines, but continue to autoindent everything else [duplicate]
I want vim to stop auto indenting any time I add a # to the beginning of a link after its white space.
Here is an example of the problem:
Original text:
dog
cat
moose
If I add a # comment ...
0
votes
0
answers
8
views
Copy paste text contained tabs from local to remote server in Tmux [duplicate]
I'm having an issue with copying and pasting.
When I copy a selected multiple-line text which contains tabs in my host, the pasted text in the server has the wrong format.
For instance, I have a ...
2
votes
1
answer
43
views
VIM shows ^@ every other character and ^M^@ at the end of line
Sorry if it's answered somewhere, I have no idea how to look for it. I received a series of reports from a bank that I'm supposed to process and they seem to be... badly encoded?
First two lines in ...
3
votes
1
answer
386
views
Why RHEL has two vim installed by default?
I'm on a RHEL 8.3 system. I found that the built-in vim and vi are all vim. They have the same version, but compiled differently. Below is my testing:
[root@192 ~]# which vim
/usr/bin/vim
[root@192 ~]#...
-3
votes
1
answer
61
views
How to copy text from text editor to tty command line
Using debian 11 GNU/linux bullseye without mouse, only keyboard.
The problem:
I have a file with a password, very long and complicated.
I need to copy it and paste when I login via ssh.
I tried to ...
0
votes
0
answers
9
views
"+ (clipboard) register not working from visual mode VIM on Cinnamon Mint
This one is a bit bizarre. Here's my OS:
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=20.3
DISTRIB_CODENAME=una
DISTRIB_DESCRIPTION="Linux Mint 20.3 Una"
NAME="Linux Mint"
VERSION="20....
1
vote
0
answers
32
views
How to make Vim interpret CR characters as in terminal (overwrite the current line)
A bit of context: I use a progress bar (in particular tqdm) to monitor the progress of my script which is executing on a remote machine, accessed through ssh. As long I have the ability to access the ...
0
votes
1
answer
22
views
vim scrolling with cursor, only bottom line moves until certain amount lines scrolled (in gnu screen)
Vim issue, note this happens only when i open gnu screen, on ubuntu, when shelled from a Mac, and only in the top pane of the screen (bottom pane works fine). It does not happen on the mac when i ...
0
votes
1
answer
52
views
`jj` vim keybinding for zsh terminal
I have recently set vim key binding to my zsh terminal on OSX, as described in here.
However, the deault keybindings doesn't have the mapping from jj to insert mode -> normal mode transition.
Howe ...
1
vote
1
answer
37
views
How can I set my default shell to start up vim terminal?
After causing an infinite recursion by putting
vim -c ':term ++curwin'
in my ~/.bashrc, I wonder if there's a way to do it that actually works.
I know for tmux there's this solution:
How can I set my ...
1
vote
1
answer
35
views
Repeat a sequence of edits in vim
I have this text:
gradient
continuité
direction
and I would like this one:
\donnee{gradient}
\donnee{continuité}
\donnee{direction}
In visual mode, I can prepare the sequence \donnee{ ESC
then going ...
0
votes
2
answers
19
views
How do I preserve vimcat colors in a pipe?
For example, this will preserve ls's coloring / syntax highlighting:
ls -la --color=always | egrep --color=always -i "(foobar|$)"
But this will not (so I know it's not a grep issue):
vimcat ...
0
votes
0
answers
21
views
How can I get Vim to give me different tab settings for crontab?
I would like to be able to keep the temporal expressions in my crontab neatly organized in columns, with a key above every 5 or so entries, like so:
#m h dom mon dow command
30 6 * * * /...
0
votes
1
answer
18
views
How to use Vim-like registers across programs
I'd like to be able to dd j dd in Vim, then p "2p in a text box on
another program.
The ideal solution would allow Vim yank and put bindings across the OS.
I'm using Arch Linux with DWM as my ...
0
votes
2
answers
43
views
How can I make the vimdiff command use the same Vim version as the vi and vim commands?
I've never worried about vimdiff on my own computer, where I have archlinux installed, so everything is up-to-date, generally speaking; I generally just used it, and I'm fine with it. After all, :...
0
votes
1
answer
25
views
vim: how to call a script from a line mode?
A simple question.
I want to make some vim commands but only for selected lines
using shift+v.
Manually is possible: I press shift+v and I select the lines I want to modify, then I press : and
in the &...
1
vote
0
answers
25
views
How can I :vs between two tabs in vim
I know how to open up separate tabes (:tabe ../otherfile)
I know how to compare two files (:vs ../otherfile)
Lets say I have two tabs already open, is there a way to compare the two active tabs the ...
-1
votes
4
answers
83
views
Easy way to output a file and change the implicit newlines ($) in the file into literal (\n)
I have a file with a number of invisible Newlines. In Vim it's shown as $ (can be seen with :set list). I had a hard time to convert them to an output which is represented as a one line string with ...
2
votes
2
answers
143
views
Change the default comments in GIT's COMMIT_EDITMSG after typing "git commit"
Sometimes when I'm at work, I want to commit and push changes to my own projects on GitHub. So I do a lot of git config user.email to make sure that I don't commit with my email at the company and ...
0
votes
1
answer
69
views
calling vim with mpiexec says "Warning: Output is not to a terminal / Warning: Input is not from a terminal"
My question is a bit technical.
For specific reason, I need to call vim after mpiexec.
Example :
mpiexec -n 1 vim mytext.txt
But this gives the following warning message:
Vim: Warning: Output is not ...
1
vote
0
answers
57
views
Ubuntu: vim gruvbox looks like completely different in tmux
I am a beginner of using tmux and am trying to get vim and tmux working together properly. I am using Ubuntu 20.04 LTS, vim 8.1.3741, tmux 3.0a.
All was well until I entered vim inside of a tmux ...
1
vote
1
answer
22
views
Neovim(vim), resizes my splits after closing Nerdtree
I have some issue. I opened some files in vertical split, and resized it to work with it more comfortable. But when I'm opening and closing nerdtree, all my panes resized by default.
Here is I'm ...
0
votes
0
answers
24
views
Vim Spell, how to Not check spelling inside comments
I use Vim Spell to check many LaTeX files, which get identified as ft=plaintex. They are mostly regular text words, without markup syntax. In many cases I have entire paragraphs without syntax. ...
1
vote
0
answers
17
views
Vim goes to background when rearranging window layout
The GIF below shows what I'm observing. If I do the following
I send Vim to background with Ctrl-Z only once,
come back to it via fgEnter,
then open another terminal, causing the original one to ...
1
vote
0
answers
40
views
Invalid characters replace using VIM
In my file due to some reasons some invalid characters are coming making it very huge file. Sample below of one line. I am not sure where these characters are coming from(I am using google drive ...
0
votes
1
answer
46
views
How can I know which are my most used aliases?
I would like to know which aliases I use most often, in both zsh and vim, so I can rename them to have more or fewer letters depending on the use. And also to remove aliases I never use, because I ...
0
votes
0
answers
62
views
Checkers problem with syntastic vim plugin
I have carefully read the documentation, tried everything, but unfortunately I have not succeeded.
I tried to enable Ansible and Python checkers, but something does not work.
The strange thing is that ...
1
vote
0
answers
22
views
Color filenames according to $LS_COLORS in vim
I'm writing a simple vim syntax file for random note takings for work.
I would like to color filenames according to $LS_COLORS. I can prefix a filename in the notes file with something random, like '·'...
0
votes
0
answers
21
views
How to use Ctrl (or other modifier) as insert mode pass through?
In vim, when I'm insert mode, I can use Ctrl+O to drop into normal mode for the one command. So for example if I'm editing the middle of a paragraph, I can do Ctrl+O D to delete until the end of the ...
1
vote
1
answer
51
views
Match all strings containing a string followed by a dot followed by exactly two letters in Vim?
For example, we have a file with all kind of domain names about 800 lines.
we would like to using vim to quickly find all the domain names that start www.example.**
where ** is 2 letters for any kind.
...
-1
votes
3
answers
171
views
How can we delete all numbers and . (dot) in all lines within a file using vim?
How can we delete all numbers and . (dot) in all lines within a file using vim ?
For example, we have a file has the following.
afsdfsd 0.98096764
afsdfd 0.98196765
0.98096764
afsadfsd 0.98096764
...
2
votes
2
answers
66
views
xterm loss of focus signals vim to exit input mode?
I've been using xterm on a KDE desktop for many years, on one Debian/Ubuntu/Arbian release after another. I use the focus-follows-mouse desktop setting, and ":set mouse=a" in .vimrc. ...
0
votes
4
answers
86
views
Is it possible to move a string which starts with # after another string to the preceding line?
I have a script file that looks like this:
auditctl -a always,exit -F arch=b64 -S openat -F auid=1000 <TAB> #description of command....
auditctl -a .... ...
1
vote
0
answers
38
views
VIM run hardcopy commands on file ALREADY OPENED by another VIM
I adopted printing solution from https://unix.stackexchange.com/a/20448/9689 :
vim -c 'hardcopy > /path/to/saved.ps' -c 'quit' /path/to/file
Problem is, when I have this file opened in VIM and I ...
1
vote
1
answer
18
views
Block edit only lets me insert not delete
I would like to delete some spaces across a block of text. I am able to insert spaces or characters, but seem unable to delete.
Steps that I try:
Control + V to enter block mode
Press up or down key ...
0
votes
0
answers
28
views
Arrow keys and backspace not operational on remote Vim
I've seen similar posts/articles about this but none of the solutions have been able to resolve my issue.
When I SSH into any remote machine (primarily CentOS and Debian) and try to edit a file using ...
0
votes
0
answers
49
views
Segmentation fault in vim and vifm
What does this error mean?
Vim: Caught deadly signal SEGV
Vim: Finished.
Segmentation fault (core dumped)
Vim: Caught deadly signal SEGV
Vim: Finished.
I get it randomly when I close vifm or vim in ...
0
votes
0
answers
28
views
Terminal Emulator Blinking Words in VIM
I am starting to write LaTeX documents in VIM and here is my code:
\documentclass{article}
\begin{document}
\frac{2x}{2} *
\end{document}
For some reason, the following characters are blinking in ...
0
votes
1
answer
41
views
Switching between editor and terminal window intermittently fails in vim
Maybe I'm just using vim :term feature the wrong way but the ctr+w-ctr+w command does not always work on my Ubuntu set up when I try to switch between the terminal and the editor. I can't figure out ...
1
vote
1
answer
152
views
How to persist the contents of the X11 (copy) clipboard on closing e.g. Vim to paste its contents later?
If I copy to X11 (copy) clipboard in Vim using "+y, I can only paste contents as long as Vim is open. The reason is as follows:
From Ubuntu Wiki: ClipboardPersistence:
The problem happens ...
0
votes
0
answers
75
views
Ctrl-D doesn't close the terminal inside VIM after piping the output of cat to clipboard (needs :q)
It's a very specific problem, so I'll try to provide everything that I think might be relevant.
I have these two aliases in my ~/.zshrc for copying and pasting the output of commands:
$ grep xclip ~/....
1
vote
1
answer
37
views
Make vim highlight shell scripts at first try
I create a lot of shell scripts with VIM. But since they don't have an extension, VIM doesn't highlight the syntax at first try.
So I have to write #!/bin/bash and exit VIM and open it again to have ...
0
votes
0
answers
469
views
How to remap CapsLock to Esc in Vim, installed on Ubuntu (console only, no Desktop Environment)?
The goal is to remap CapsLock to Esc in Vim, installed on Ubuntu (console only, no Desktop Environment).
This Ubuntu system is installed on Virtual Private Server.
I'm logging to this server using ...
0
votes
1
answer
58
views
Does my vim not use the config in the home directory when used with sudo?
I tried to manipulate a file with sudo but NERDTree was obviously not loadable. I am new to vi(m) so I don't have many other plugins which I would have had the chance to see if vim missed to load them....
0
votes
0
answers
51
views
How to find a file in current working directory without opening the file in vim
When there is a unit test error in the Java project it shows me the class name. Since it is java class name and the file name is the same I can just append .java. So right now I can add the current ...
2
votes
1
answer
188
views
How to disable Ctrl+S in terminal applications started from file manager or via shortcut?
I've successfully disabled Ctrl+S in terminal using instructions here.
However, if I launch a terminal programs (namely terminal vim) from "outside the terminal", Ctrl+S still freezes the ...