Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [vim]

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

0
votes
1answer
23 views

vim: How to insert output of shell command in-line?

Suppose I want to edit a new libvirt XML file: virsh dumpxml machine1 > machine2.xml Then I open the file with vim, vim machine2.xml and then I want to change the UUID. Now do this, I use :r !...
4
votes
2answers
394 views

Is possible to search in vim history?

On bash I press CTRL+R and typing vim bash return list of commands typed in past with vim string.Is possible to make something like this in vim history for commands starting with the : ?
0
votes
0answers
10 views

Vim freezes in insert mode when .vimrc contains set tags=tags;

I am using vim-gtk on Ubuntu 16.04 and use exuberant-ctags to generate a tags file in the root directory of my project. My instance of vim would randomly freeze in insert mode, usually after inserting ...
0
votes
2answers
95 views

Replace block of text with sed, awk, perl or vim

I am trying to replace every instance of a block of six rows with another block of six rows, just reducing the six rows block of two columns to a six rows block of only one column. Thank you to your ...
-1
votes
0answers
15 views

How to layout this bar with vimscript?

I'm trying writing a vim completion script, but I don't know how to layout this bar with vimscript. How to trigger this bar when in i mode(Can I make it with vimscript)? And how to customize the ...
0
votes
3answers
41 views

are there side-effects to remapping/aliasing less to vim?

I added the following to .bashrc to remap less to vim alias vsi='vim -R -c ":map Q :q!<enter>" -' # Vim Standard Input [readonly] alias less='vsi' the reason is that I don't want to maintain ...
1
vote
1answer
37 views

Can't install Vim on Debian 9

Sorry buy it's in spanish: ~# apt install vim Leyendo lista de paquetes... Hecho Creando árbol de dependencias Leyendo la información de estado... Hecho El paquete vim no está disponible, pero ...
8
votes
1answer
361 views

Why don't I see the difference between two different files in insert mode in vim?

Let's create two files: $ echo -n 'test' > test.txt $ wc test.txt 0 1 4 test.txt The file test.txt doesn't contain the trailing newline. $ echo 'test' > test_n.txt $ wc test_n.txt 1 1 5 ...
1
vote
1answer
24 views

Vim - How do I paste a inner-word to line above?

I always use the following commands to yank an inner word and then paste it in the line above: yiw -> O -> Esc -> p Obviously P by itself (without using O to insert a line above) doesn't ...
0
votes
0answers
59 views

failed to execute child process xterm (no such file or directory)

When I right click on a file and select vim from upcoming tabs I get this error. Some files of vim should missing. In addition I'm able run vim from bash but can't run from desktop. Debian 9.8 ...
0
votes
0answers
22 views

Open VIM with zle key binding

I would like to setup a bindkey to launch a fuzzy search across projects, home directories, files etc... and launch some command depending of the choosen file type. If the file is a regular file, I ...
0
votes
1answer
45 views

cat shows file contents, gedit and vim show blank file

I was planning on building a current logging device with an Arduino, and tried starting off with the basic SD-card write example from the Arduino IDE sketchbook. The Serial console showed no errors, ...
22
votes
4answers
2k views

How vim overwrites readonly mode? [duplicate]

Quite often we see that the file we are trying to save in vim after edit is reported to be read-only. The way around this is to add !wq, i am trying to figure out what internally goes that allows the ...
0
votes
0answers
20 views

No change while editing interfaces

I have old Debian Squeeze blackbox device connected via serial terminal. Trying to configure network by editing interfaces: vim /etc/network/interfaces When I finish and do save no problems was ...
0
votes
1answer
70 views

How can I set the default editor as nano on my Mac?

I have vim as default editor on my Mac and every time I run commands on Mac terminal, it automatically opens "vim". How can I set up "nano" instead and make sure the terminal will open "nano" every ...
1
vote
1answer
31 views

Vim - opening man pages

I'm aware that exists a shortcut to open manpage of current function (the function cursor is on), but I can't recall how to do that.
0
votes
0answers
24 views

Best way to get rid import error in `vim-latexsuite`

I'm running Arch Linux and I have the vim-latexsuite package installed. A while ago I noticed started getting an error whenever I opened a .tex file: Traceback (most recent call last): File "<...
0
votes
1answer
19 views

How to split a window with terminal below in vim with predefined size

What I want is something like: :below 10sp Then open the terminal: :terminal ++curwin This two commands do exactly what I want but I don't know if it is the best way.
1
vote
1answer
41 views

How to open multiple man pages in split in vim?

From View man pages in Vim, I learnt how to open man pages in vim by adding the following lines to ~/.vimrc: " Enable viewing man page in vim by ":Man ..." runtime ftplugin/man.vim " Set keyword 'K' ...
0
votes
1answer
152 views

Privilege escalation with sudo vim

I have the following problem: I configured sudo with permissions for everything except for a few commands, remove, reboot, shutdown, block from sudo to shell, preventing a user from elevating the ...
1
vote
4answers
74 views

prevent vim from replacing % with file name

I am messing around with .vimrc and I had this idea to have function like follow: function Fill_line () execute "! printf '=%.0s' {1..10}" endfunction my output is: Hello =test.cpp.0s I ...
2
votes
1answer
61 views

Validate `~/.vimrc`

I want to validate that my ~/.vimrc file is correct, basically just by launching vim and immediately running quit. I can almost do this with vim -c quit, except that I have to press the enter key. For ...
1
vote
1answer
30 views

Remove multi line comments in vim

I want to remove a multi line comment in vim: /** * Factory for creating [MainViewModel] * * @param arg the repository to pass to [MainViewModel] */ I tried %s,/\*.*\*/,,gc but it doesn't work ...
0
votes
1answer
59 views

Close the file in vim without closing the file explorer

I am browsing the files in vim file explorer by entering vim dirname. Then I am opening the file, saving and closing it by entering :wq. Now the file explorer window disappears. How to prevent this ...
0
votes
0answers
35 views

How can I get neovim to load my init.vim file when in sudo mode?

I'm having an issue with neovim on a Raspberry Pi coding with Python. I have installed it by sudo apt-get install neovim, and it works using just the nvim in commandline. For some reason I can create ...
1
vote
1answer
34 views

How to get clipboard as input file name to Vim on bash?

I install xclip to access system clipboard, my setting and some operations as below: ➜ ~ cat .zshrc | grep xclip alias c="xclip -selection c" alias v="xclip -selection c -o" ➜ ~ which dict | c ➜ ~ ...
2
votes
0answers
150 views

How to edit a 100GB file in Linux?

I have a file that has several times my RAM capacity and I need to edit it, search for some expressions, etc. I've tried Vim (with LargeFiles plugin and CTRL + C trick), joe, shed all without luck. ...
1
vote
2answers
65 views

Why updates overwrites Vim that built from source?

I build Vim from source, and install it with checkinstall. Soon after Software&Updates warned there is an update for Vim. But after the installation, Vim path is altered and another build take its ...
0
votes
0answers
46 views

Output in terminal after quitting program

I'm using Kubuntu with i3, and I've recently migrated from Manjaro because things. My terminal emulator is urxvt but, when I use programs such as vim, less or nano in the terminal remains the part of ...
1
vote
3answers
65 views

Nailing down vim regex substitution

I started using Vimwiki to document weekly progress on my projects last year. As the year rolled on, the format of my list of links to weekly wikis changed a bit. At the end of the year I decided to ...
2
votes
0answers
43 views

Vim editor universal config for copy/paste on multiplatform environment does it exists? [closed]

I spend a lot of time to get comfortable working with Vim, and I am there right now, except one thing. Also it look like Vim has advantages in many cases working on embedded programming or kernel ...
1
vote
0answers
38 views

Need to edit a single file in a tar.gz using Python [closed]

Vim provides the ability to edit a single file in a tar.gz without unarchiving. ( i.e. vim some_archive.tar.gz ) How could I script the same type of operation using Python?
0
votes
2answers
86 views

How to make Readline in vi mode to read .vimrc?

When using Readline's vi mode in Bash, I can use command v from normal mode, to open the current command line in Vim for editing. However, in this case, Vim does not read my ~/.vimrc file, so none of ...
0
votes
0answers
67 views

how to setup vim plugin YouCompleteMe for python?

the autocomplete works for class. as shown in he screenshot but it does not for class.subclass. also it does not work for : var = class() so var. will not trigger the autocomplete.
0
votes
0answers
43 views

Neovim key mapping on Linux Mint

I recently started using Linux Mint (19, Cinnamon). I'm editing ~/.config/nvim/init.vim but some settings do not work. I want to move between windows I split. Here is what I have. " Work noremap <...
0
votes
1answer
39 views

Can't get plugin for Vim to work with Vundle. What am I doing wrong?

I am trying to install this plugin here for my Vim on my Centos 7 laptop. The instructions I followed to install the plugin manage Vundle are from the Github Vundle page here and then proceeded to ...
-1
votes
3answers
54 views

How can I replace ~60 print entries in 5 different files using vim or sed?

Fabfile (directory) containing Python files: print "DEBUG fab_helper DRYRUN: True"+var print "DEBUG fab_helper DRYRUN: True" #print "DEBUG cfn_stackname: "+cfn_stackname To: LOGGER.DEBUG("DEBUG ...
7
votes
4answers
696 views

Viewing man pages in vim

I wrote a function in bash to see manpages in vim viman () { man "$@" | vim -R +":set ft=man" - ; } This works fine, the only problem occurs if I pass a manpage to it which doesn't exist. It prints ...
-1
votes
1answer
19 views

vim: Execute command for FileGroup

I try to open NERDtree whenever I open a Golang file: au FileType go exe 'NERDTree' However, when I open a Go file from another directory it still displays the current directory. I can pass the ...
2
votes
1answer
56 views

How to prevent Vim from translating C-j into C-m when started by the zle widget `edit-command-line`?

I have the following code in my ~/.zshrc: autoload -Uz edit-command-line zle -N edit-command-line bindkey '^X^E' edit-command-line It binds the edit-command-line zle widget to the keysequence C-x C-...
1
vote
1answer
33 views

Question about Vi/Vim buffer

i just started using Vi/Vim editor and while i m checking the list of active buffers for the buffer i m using i get this line: 1 %a + "buffername" line 16 What does %a + ...
0
votes
3answers
58 views

How to use Unicode hex escape in :s/// replacement string in Vim?

I want to use a hexadecimal Unicode escape in the replacement string of a substitution command, i.e., with the example character U+20AC: :s#something#\x{20AC}#g The above example doesn't work, ...
0
votes
1answer
94 views

Change vim cursor in Terminator

I am using Terminator in Ubuntu as well as vim. My question is whether there is a possibility to use an underscore cursor in insert mode and a block cursor in normal mode. I read on http://vim....
1
vote
1answer
78 views

Should I learn to memorize these keys for Vim for moving - h,l,k,j? [closed]

For VIM in command mode, the keys h,l,k, and j are used to move the cursor but I see no point in memorizing these at the moment because when going into insert mode, I use the arrow keys to move the ...
0
votes
1answer
40 views

Unix Function func_name ### {{{ purpose of #and {

Function func_name ### {{{1 { Function defined Return statement } ### }}}1 I’m not sure on the purpose of these curly brackets and ###
3
votes
2answers
131 views

Why my simple script vim don't work for tab character?

This is my simple script of vim #!/usr/bin/vim %norm f^ID %norm $i, %!awk '{ for (i=1;i<=NF;i++ ) printf $i " " }' The first line delete all after the tab(^I) the second add a "," after every ...
1
vote
1answer
61 views

man pages no longer rendering - lots of “permission denied” errors related to pager / vimpager

For reasons I can't determine, within the last two days the "man" command stopped working on my linux server (Ubuntu 18.04). When attempting to run man <anything> I end up at a blank instance ...
0
votes
1answer
179 views

Grepping lines which have range of number

I have few lines in my text file as below. I want to grep all the lines which have patterns like :100, :101 and :102 up to :199 . How to get those lines instead of searching like this. :100\|:101\|:...
2
votes
1answer
91 views

Unable to copy from VIM to clipboard using "+y command

I am unable to copy strings from vim paste them somewhere else, for example in the terminal, using "+y. I run Ubuntu on my laptop, the vim version is vim-gtk, it has xterm_clipboard and clipboard ...
0
votes
1answer
189 views

Why is vim frozen?

I have two different machines (home and work) running Ubuntu 18.04. Last night vim froze at home. I was in insert mode and typing and went to save (esc :w) and nothing happened. The status bar still ...