Questions tagged [vim]

vim (Vi IMproved) is a text editor supporting different editing modes.

Filter by
Sorted by
Tagged with
2
votes
1answer
25 views

How to search current word in elvis editor?

How to search current word in elvis editor? just like * and # in vim. In slackware vi is elvis.
0
votes
1answer
34 views

Script to remove all modules in pom.xml except the one with the highest number

Question I have a huge pom.xml from a Talend DI/ESB project, where it was possible to have multiple lines for the same module with different Talend specific versions (don't even ask for that :-( ) ...
2
votes
1answer
70 views

Make GNOME Terminal send correct numeric keypad keycodes to vim

I use the vim-mark plugin, which allows me to make multiple highlights of different colours. It has some default key maps that uses the numeric keypad (<k1> ... <k9> and <C-k1> ... &...
0
votes
0answers
30 views

Bashrc not loading when running manpager

I have found issues with using the MANPAGER variable in bash in order to set vim to be my manpager. Initially I set my manpager using the method shown in :help manpager by doing: export MANPAGER="...
1
vote
1answer
408 views

Disabling vim visual mode in /etc/vim/vimrc does not work

I found plenty of questions regarding disabling visual mode in vim but none that tackles my particular problem: I added set mouse-=a to my /etc/vim/vimrc file to disable visual mode for good. Thing ...
2
votes
1answer
29 views

How to source a file that has set of vim search and replace commands in vim interactively?

I have a file (FileA) opened in Vim to edit. I have one another file (FileCommands) that has some set of vim search and replace commands. I am looking to load that FileCommands file, to do that ...
0
votes
3answers
144 views

How to open vim inside a bash script?

Hey how can I open vim inside a script? I need to grade coding assignments and wrote a script to open code and note files, but vim does not open. The script is essentially a fancier version of this: ...
0
votes
1answer
301 views

How to run aliases commands in inside the vim editor? [closed]

In .bashrc file set alias alias l='ls -l' Inside Vim: :! l [No write since last change] /bin/bash: l: command not found shell returned 127
0
votes
1answer
30 views

Tmux: create pane if I'm not in edge

I want to create some same function like Nick Nisi's window management in vim (if I'm in the edge, create a new window(in vim)/pane, otherwise just move). I don't know how to check, if I'm in the ...
0
votes
0answers
69 views

vim color is not showing on urxvt

I set vim color colorscheme solarized8_dark_low set t_Co=256 but vim showing bgcolor of urxvt when I open vim on urxvt.vim and urxvt side by side
0
votes
1answer
41 views

Changing a specific character in a line

Input Every line is separated into 8 parts by semicolons Every part can include words,numbers,space etc. Output I am trying to replace the space in the 6th part with a semicolon, thus separating ...
13
votes
1answer
2k views

How to make a continuous vertical line in vim?

I want to make a table in vim. Making a horizontal line is easy ______________________________ For the vertical I use this yes "|" | head -10 But the result is bad | | | | | | | | | I want ...
1
vote
1answer
60 views

Can you run vim (or another editor) in two shells at once on a single file, in a coordinated way?

I am interested in having a single file open with vim in two shells at once. The use case I have in mind is two windows of gnu screen running on a tty. The catch is that I would like the instances of ...
0
votes
0answers
27 views

How do I vimdiff a current version of a file to a previous version in CVS?

At the moment, I am able to use the command cvsvimdiff filename to compare my local modified file to the version found in the repo in a nice splitscreen view that highlights all the difference that ...
-4
votes
1answer
38 views

Search for lines that do not have certain characters in a row

I have a news article which I need to edit up a bit. Basically, I need to search for all lines that do not contain characters t and h 2 or more times in a row and replace 4 letter words with character ...
1
vote
0answers
65 views

How to enable text color in vim? [duplicate]

I have a file that I report to daily using shell script. There are also colored texts in this report. Normally, when the file is executed, color text is displayed, but when the result is saved to a ...
6
votes
2answers
244 views

SSHFS/SFTP : Vim hangs when trying to edit file over sshfs and can't upload file over MTU size over sftp

My university provides an ssh access to the students university accounts, and I just set up an sshfs to access some folders on my remote account. I am running pop_os on my local machine and using ...
1
vote
1answer
75 views

How can I change multiple filenames simultaneously in Vim?

I have a season of a show downloaded and every episode filename ends with information about the video ([1080p], [Dual Audio], etc). I would like to use Ctrl-V to simply rename all of the files at once,...
1
vote
1answer
43 views

How do I yank, delete, and paste a group of lines without moving the cursor?

Let's say I'm on line 25, and I want to grab lines 15-17, delete them, and paste them on my current line. Can I do that in a single command? I'm aware of things like this (and other similar combos): ...
3
votes
1answer
604 views

Vim freezes after Ctrl-S [duplicate]

I have been using neovim for a long time and I have been using Ctrl + s to save and Ctrl + q to quit. nmap <c-s> :w<CR> imap <c-s> <Esc>:w<CR>a nmap <c-q> :q<...
0
votes
2answers
173 views

vim - replace multiple words with yanked text, multiple times

In the text below, if I want to replace book1 and book2 with pen I could yark pen and go to the beginning of the 2 and 3 lines and hit . (dot) to replace the words. pen; book1; book2; book3; but, ...
0
votes
2answers
46 views

Search and Modify strings with Vim

I wish to find lines containing a digit string only and modify each match by putting it in between a pair of square brackets ([..]) in Vim. e.g. Original text 10001 hostname1 hostname2 10002 ...
2
votes
2answers
62 views

vi - finding a pattern in lines and add “;” at the end of those lines

I want to add ; in the end of lines in a txt file containing ddl for multiple tables. For example : LOCATION: 'hdfs://HDP**/apps/hive/warehouse/bps_uat.db/maaa' As per above, I need to add ; in ...
0
votes
0answers
42 views

Auto-completing bash command options in vim

When I am writing shell scripts inside of vim, I often myself looking at manpages for the command options the script will use. Is there any way to retrieve the auto-complete wordlist for a command ...
0
votes
1answer
94 views

Unicode Tables in Vim

I have been toying around with i3 and like many others ran into a few snags working with Unicode characters. The majority of them resolved by installing fonts or pointing config files to the installed ...
1
vote
1answer
41 views

How to prevent the name of a man page from being truncated when using Vim as a man pager?

Consider this shell command: $ MANPAGER='vim -Nu NONE -R -' man git-credential-cache It makes man(1) display the man page of git-credential-cache(1) in Vim. However, the name of the man page – as ...
0
votes
0answers
25 views

Syntax highlighting shows a yellow bar on Ubuntu shell in Windows 10

Good afternoon, I just started using the Ubuntu shell from Windows 10, and I copied my Mac .vimrc file. Everything seemed normal until these yellow bars started showing up at the end of some lines. ...
3
votes
1answer
136 views

Why can't I use tab for autocompletion in neovim over SSH?

When used locally on arch I can easily use tab for auto completion in vim when e.g. filling in a path with deoplete. If I SSH to this computer from my laptop then tab still works for completion. But ...
1
vote
0answers
92 views

Opacity for colours set within vim

I use a transparent terminal background on URxvt, which I set within my Xresources file: URxvt.background: [85]#2f2f2f In vim I have line numbers on the left hand side with a different background ...
1
vote
1answer
33 views

Vim - how to replace a space after dot with a newline?

I've pasted some text from the Web into Vim editor and for some reason each paragraph is treated as a single line: PROD $ egrep -i 'system' text Hurricane Dorian is a strong tropical cyclone ...
1
vote
2answers
263 views

How to convert a vim tab into a vertical split?

I have used VS Code and liked the way we can drag-drop the window to the right to create a vertical split. Sometimes I open many files with vim (vim -p *py). When going through the tabs, I feel like ...
0
votes
1answer
22 views

stop gvim from printing the filename onto console

In my unix environment when I use gvim to open a file it immediately print the file name onto console. Can someone help me on how to stop gvim from doing this? $ gvim ~/.cshrc.local "~/.cshrc.local" ...
0
votes
1answer
32 views

Compile in a single log all .log that shows Error message

I have many generated logs in /var/opt/log_loc1,/var/opt/log_loc2, /var/opt/log_loc3 from different cron jobs. Instead of looking in each log, is there a way to schedule a cron job that populates the ...
0
votes
0answers
78 views

vim doesn't terminate when terminal is forcefully closed

steps to replicate: [Windows PC] SSH to machine as user using putty/cmder (centos 7 VM) [Linux VM] vim def.txt (as a user) [Windows PC] kill the terminal program (putty/cmder) using task manager [...
0
votes
0answers
151 views

iTerm2 screen buffer not getting clear

I'm using bash as my shell and iTerm2 build 3.3.1 as my terminal emulator on Mac OS X 10.14.6 Whenever I use a type a long command, iTerm window overwrites my current line with the new symbols even ...
2
votes
0answers
31 views

How to enable “on-the-fly” autocompletion with vim-supertab?

Using the "supertab" plugin for autocompletion in vim, how can I make it so that hitting TAB is not required for the selection menu to pop up? I.e. what I want is the menu to be always present and to ...
1
vote
1answer
28 views

Using set paste disables imap jk <Esc>

I use the following line in ~/.vimrc to allow me to press jk instead of Esc. :imap jk <Esc> It works fine until I add a :set paste: " Pressing jk is same as pressing Esc :imap jk <Esc> ...
0
votes
0answers
55 views

vim-tmux-navigator to use tmux prefix instead of C-[hjkl]

I have installed vim-tmux-navigator (https://github.com/christoomey/vim-tmux-navigator) on the tmux and the vim side and I can navigate between vim panes and tmux windows using Ctrl-[hjkl] BUT: This ...
0
votes
3answers
187 views

How do add complex text using vim/sed/awk

following older posts (How do I use vim on the command line to add text to the middle of a file? & How to insert the content of a file into another file before a pattern (marker)?), I have a more ...
0
votes
0answers
36 views

Different color vim vs less in tmux

Both vim and less run inside tmux but they appear to have different white color, I really want to have less's white color in vim. In tmux I have terminal settings (st terminal): set -g default-...
0
votes
0answers
105 views

.nfsXXX files after using vim [duplicate]

I was trying to use vim on my university server trought SSH connection.. I created file, but i forgot to save it(I accideltaly paused the job with Ctrl+Z).. When I tried to delete the file it showed ...
1
vote
1answer
30 views

Vim autoindent stops indenting multiline array in bash after 20 lines

Given this code: #!/bin/bash _DATABASES=( "secretX" "secretmin" "secretcopyijui" "secretcroma" "secretdemo" "secretdicopy" "secretflashcolo" ...
0
votes
0answers
88 views

Is it possible to display curly error underlines in terminal vim?

I want to underline errors in vim like in this example gif from the ALE github page. Though as of yet I have only been able to get gVim to display curly underlines. Is it possible to get curly ...
6
votes
3answers
1k views

'dos2unix' is unable to convert a `typescript` file to Unix format

I recorded my current session using the script command, and all information was saved in a typescript file, but when I opened it using Vim there were a lot of ^Ms due to carriage returns. I tried to ...
1
vote
2answers
42 views

vim: open file under cursor in read-only (no swapfile)

so, we all know of gf, :find, etc, but is there a read-only equivalent, the :view to their :edit? i just want an easy shortcut to open system headers without creating a swapfile :find +set\ noma\ ro ...
7
votes
3answers
2k views

Quickest way to move a line in a text file before another line in a text file?

I have the line number 55 in a text file which I want to move just before line number 23 in the same text file. I know that you can move lines up by a certain number of lines 1, 2 but is it possible ...
0
votes
0answers
18 views

gvim key mappings under alt results in special characters

For some reason gVim (debian stretch + kde) started to map Alt+i to "é" and Alt + other characters are also tied to some special letters e.g. Atl+o="ï" and Alt+p="ð". The problem is that this key ...
0
votes
1answer
37 views

zsh crashing when editing .rs files only

As the title says, zsh crashes when writing to a rust .rs file using vim. It crashes whenever I save the file using :w. It never crashes when I edit another filetype (I've tried .c, .js, .py). I'm ...
1
vote
3answers
184 views

vi/vim, how can I write out the nth word of all lines to a new file

How can I write out the nth word of all lines to a new file? For example, I want the second word of all lines wrote out in new_file.txt: old_file.txt: pippo pluto paperino gigi lui marco piero ...
0
votes
0answers
28 views

vim pastes onto completely wrong location

This has not just once, but happened many times. I'm not sure what I'm doing wrong.. it tends to occur more frequently during remote control. I would set the mouse cursor at a certain position where I ...

1
2
3 4 5
32