vim (Vi IMproved) is a text editor supporting different editing modes.
2
votes
1answer
39 views
Copy grep output from vim editor
Assume you have some text file (e.g. a log file) and you open
it in a vim editor and hit the command
:g/aaa
It will output a result in which you can move with j and k keys
and when you move to the ...
1
vote
1answer
16 views
Prevent vim from starting in a shell if it is already running in background
When using vim inside my Bash-shell, I will sometimes use Ctrl-Z to leave vim and do other things in the shell. Later, I will then use the fg command to return to vim. However, it sometimes happens ...
0
votes
0answers
15 views
neovim indentation issues
is there a way to make neovim indent correctly? as you can see in the example screenshot, when I press o newline doesn't take indentation from line above.
other editors work correctly replicating ...
0
votes
0answers
30 views
Syntax highlighting error in syncolor.vim with VIM 8.0 on Ubuntu
I recently installed VIM 8.0 on my Ubuntu 14.04 machine. When I open vim, it outputs an error:
> vim ~/.vimrc
Error detected while processing /usr/local/share/vim/vim80/syntax/syncolor.vim:
line ...
0
votes
1answer
24 views
vim - highlight for loop iterator
how can I highlight the iterator of a for loop?
for example, in:
for (int iter=0; iter<test; iter++)
array[iter][5] = array2[iter] & (array[iter] < test2)
end
I want every instance of ...
1
vote
0answers
38 views
Vim opens in wrong terminal emulator
I am using Debian with LXDE.
I want to change lxterminal to uxterm, so I went Menu -> Preferences -> Default applications for LXSession, and set 'Terminal manager' to UXTerm. However, if I ...
9
votes
1answer
178 views
Is there an equivalent for vim's \zs in sed or perl?
In vim we can use the \zs atom to say "really begin the match right here":
:%s/funnyword\zs.*$/otherword/
Is there an equivalent for sed or even perl?
-1
votes
0answers
51 views
Vim with the c command [closed]
I'm stuck on the last exercise of the level 14 in Vim-Adventures. According to the following picture, could anyone be able to tell me what I have to do here? Which command do I have to use (c,y,a,d or ...
1
vote
1answer
49 views
Using double-click in a terminal window under Fedora 24 with vim to perform copy and paste
I am very used to using the double click of the mouse in a terminal to copy a word, such as a file name, then using the middle click of the mouse in a different terminal to paste.
However, this ...
8
votes
4answers
624 views
How to send the ESC signal to vim when my esc key doesn't work?
I'm having a problem with the Esc key when I want to return to the interactive mode from the insert mode. Is there exist another key used to release the insert mode.
1
vote
2answers
32 views
View what to delete before taking action
With Vim editor, before deleting lines or words, I'd like to view what I delete before committing a big mistake. Could anyone have an idea how could it possible to do that? Is there exist a command-...
5
votes
1answer
45 views
Replace each tab ONLY at the beginning of each line with spaces
So replacing all tabs in a file with spaces is not hard.
In vim for example, I can do %s/\t/ /gc
And if I want to replace the ones at the beginning of each line, not the one in the middle I can ...
0
votes
3answers
31 views
How to change Vim window moving key combinations?
I found this :help window-move-cursor, but I tried to call it from the command line and doesn't work.
Is there a way to change the key mapping for switch windows?
1
vote
1answer
36 views
Naturally scroll past end of last line in vim
I'm a bit of a vim novice, but I'm having difficulty finding resources to help me with this problem.
When I move my cursor to the bottom of my file, I want it to keep going past the final line, ...
0
votes
1answer
35 views
vim how to simulate press of canc/delete key with norm command?
With this line
:execute "normal! A;\<esc>D"
I do "normal" command wich permit to edit file without entering edit mode.
Then I add ; after line(A in edit mode) and the simulate ESC press key
...
2
votes
0answers
30 views
Disabling mouse in Vim disables indentation
I have Vim version 8.0.122 on FreeBSD 9.3 (installed with pkg). I have default global vimrc. I want to disable mouse support completely on my account, so I put
set mouse=
in my local .vimrc. It ...
0
votes
2answers
54 views
Can I remap ctrl-j and ctrl-k in vim?
I would like to remap ctrl + j to ctrl + d, and ctrl + k to ctrl + u for moving half a page down and up in normal mode. I have tried with
noremap <c-j> <c-d>
noremap <c-k> <c-u&...
0
votes
2answers
62 views
Disable viminfo completely
I'm trying to disable viminfo completely, I tried to add something in the ~/.vimrc,
I tried 3 different methods, none of them works
set viminfo='0,:0,<0,@0,f0,n~/.viminfo
set viminfo=
set viminfo=...
0
votes
1answer
30 views
How to know how many tabs are open in Vim?
I have a task where I have to take a look at 211 ruby files. I need to know how many tabs are open. Is there any way I can get some statusbar or something similar that can tell me how many tabs are ...
0
votes
0answers
10 views
Is there are significant performance boost from using --with-luajit instead of --with-lua?
Does building vim with --with-luajit make lua-related features that much more performant or is the speed boost negligible? Is there any real significant performance difference between --with-lua and -...
1
vote
1answer
23 views
Vim how to create .swp file manually?
Q: Vim creates .swp files for recovery. In case you fail to save, vim
will be able to recover (at least some of) the file.
How to create .swp files manually?
0
votes
0answers
29 views
How to stop any application to store text in PRIMARY buffer just because it has been selected?
I'm using the autocutsel trick in the .xinitrc :
autocutsel -fork &
autocutsel -selection PRIMARY -fork &
to synchronize PRIMARY and CLIPBOARD buffers so I can yank text in vim and paste it ...
-3
votes
2answers
36 views
Place a character in the middle of every word in VIM
I have a file wth multiple lines that look like
RUS.LEN.8 "0612" "1212" "0605" "0606" "0000" "2121" "0401" "1211" "0000" "0707" "0000" "0000" "1111" "0303" "0303" "0102" "0133" "0602" "0000" "0404" "...
8
votes
2answers
252 views
How to suspend VIM history?
When we edit a file, we usually do many UNDO in a row, say, 20 times. In VIM, that is usually performed by pressing u 20 times, and that makes VIM go "up" in the history stack 20 positions. If you ...
27
votes
4answers
2k views
Vim: what are all the possible swapfile extensions?
When you're editing a file in vim, it generates a swapfile with the same name as your current file, but with a .swp extension.
If .swp is already taken, then it generates one a .swo one. If that's ...
0
votes
0answers
34 views
vim-nox installs python2 support by default
I try to install vim with python3 support. After a quick research, I learnt that vim-nox installs by default the python3 support. Except that, in my case, I have python2 support.
The result of apt-get ...
-1
votes
1answer
25 views
Vim doesn't delete underlying lines in Visual Block Mode
In vim, by pressing Ctrl+V you can enter Visual block mode.
When I select multiple lines by moving around with h,j,k and l, and press delete using d or D, the text gets deleted, but the underlying ...
0
votes
0answers
11 views
Racket CLI repl interprets tabs in text sent via tmux as autocomplete
I'm using vim, tslime, and tmux to send scheme code to the racket repl (v6.7) via the command line. I'm running on Arch Linux.
When I do so, I commonly get the auto-completion warning:
"Display ...
0
votes
1answer
48 views
run editor command when leaving insert mode in vim
I want to run a :command in vim when I exit insert mode. Specifically I want to run :GoFmt to format my code when I exit insert mode. Currently it runs when I save the file but sometimes I want to ...
3
votes
2answers
62 views
How can I access a Vim process after closing its terminal on macOS?
This what I get when I run the ps command:
$ ps
PID TTY TIME CMD
14777 ttys000 0:00.25 -bash
19716 ttys000 0:00.15 vi templates/base.html
8240 ttys001 0:00.11 -bash
8284 ...
0
votes
0answers
26 views
How can I pipe coloured grep output into vim [duplicate]
So I am trying:
grep --color -irn '.' -e "start" and I'm getting my coloured search results with different colours for my files and my search terms. What I can't do is, whenever I pipe this output ...
1
vote
1answer
39 views
How to stay in zoom in tmux if select-pane command issued?
I'll explain what I mean. Suppose I've created a horizontal split and then zoomed the top pane.
Then when I'm pressing C-w-l bounded to select-pane -R (I'm using vim and TmuxNavigator plugin to '...
3
votes
1answer
69 views
How to get the file path of a buffer?
I know that the register % contains the full path of the current buffer. But how to get the full path of another buffer by its number?
Is there such a function/command in VIM?
I want to explain how ...
3
votes
1answer
76 views
Cannot enable TrueColor support in tmux via overriding terminfo
dist: Arch Linux.
I have an st build from AUR and tmux from official repo.
In st I meet a good TrueColor support that works with last Vim version via termguicolors option.
But when i tried to bring ...
4
votes
1answer
51 views
vim - How to escape filename containing single and double quotes mix?
Let's say i create a filename with this:
xb@dnxb:/tmp/test$ touch '"i'"'"'m noob.mp4"'
xb@dnxb:/tmp/test$ ls -1
"i'm noob.mp4"
xb@dnxb:/tmp/test$
Then vim . to go inside Netrw directory listing.
" ...
0
votes
1answer
34 views
filename with newline in vim's Netrw Directory Listing
Create a filename containing newline character:
$ touch $'a\nb'
When i do vim ., the filename split into multiline:
I can only select one line and press enter. Then it act as new file and show this ...
5
votes
1answer
62 views
Suppress recovery files when editing sensitive files in vi, nvi, and vim
I'm writing an application that maintains an encrypted database containing extremely sensitive information including cryptographic keys and passwords. The application is paranoid about using memlock, ...
2
votes
1answer
33 views
How to navigate back from text/binary file view in Vim's Netrw directory listing?
I use vim.gtk3 . to navigate current directory in Netrw Directory Listing view.
I know I can press x to act like xdg-open. I also know I can press - to navigate to parent directory.
But if I press ...
0
votes
1answer
92 views
vim cut&paste not working in Stretch / Debian 9
Upgraded here a few VM servers to Debian 9.
Now when in ssh, we cannot copy and paste between remote terminals. The cursor seems to be doing the movements, and marking the text, albeit in a funnier ...
0
votes
0answers
29 views
:Explore deletes current buffer, didn't use to
I used to be on ubuntu 14.04, where :Explore always worked fine, but I recently updated to 16.04 (vim version 7.4, patches 1-1689), and the behaviour of :Explore has changed. (unfortunately not sure ...
0
votes
1answer
42 views
Vim ignores “set hlsearch” in vimrc. Setting manually works fine
I may be wrong, but I seem to recall hlsearch being on by default.
Setting it explicitly in .vimrc has no effect, though running
:set hlsearch
within vim turns on highlighting as expected.
I've ...
2
votes
2answers
61 views
Vi replace the currently searched string
I know how I can search and replace a string, either globally or in a selected area.
But I have the habit to go over a word and then hit * to search for that word. This won't only search for the word ...
0
votes
2answers
95 views
Need to type special symbol in vi
I want to type ½ in vi mode but it is coming with extra character ½. I am pressing ALT+0189. I have searched a lot on the same but failed to get.
Please advise.
1
vote
2answers
44 views
Vim, put off indent in global config
My vim have a auto indent future for C files. I can run it and :set nocindent to change this behaviour. I don’t know what to add to the global configuration file. I’ve tested these lines without ...
0
votes
2answers
28 views
How can I use vim to remove first few characters of the selected lines using commands?
How can I remove the first few characters like remove ; from the selected lines using commands? I switched into the insert mode, but can't figure out how to do.
;extension=php_bz2.dll
;extension=...
2
votes
2answers
170 views
Set solarized scheme on LXTerminal
I installed the solarized theme for vim but it looks quite ugly.
The documentation says, that I should also enable the solarized theme in my terminal, which is the LXTerminal. Therefore I tried to ...
1
vote
1answer
50 views
vim inside screen : Indentation displayed incorrectly
When I used vim outside a unix screen to edit a file, vim displays the file correctly.
However , when I open the same file inside a unix screen, the indentation "seems" to become messy.
I say "seems" ...
1
vote
1answer
101 views
What vim theme is this?
I just ssh'd into a machine and I like the vim theme a lot. Does anyone know it's name? Here are a few screen shots:
1
vote
1answer
74 views
Editing and compiling files on a remote server with Vim
I am editing a bunch of files on a remote server. I can connect using SSH (public key or password). I use Vim as follows:
vim scp://user@server//path/to/file.cpp
I need to use Vim on my computer ...
1
vote
0answers
65 views
Unable to install vim on a RasPi (Raspbian GNU/Linux 7)
I am trying to install vim onto a RasPi (i.e., Raspbian GNU/Linux 7 (wheezy)), but while executing "sudo apt-get install vim" I am getting an error. I have tried searching for a solution, but I haven'...