Community Digest

Top new questions this week:

Folding example from Learn Vimscript the Hard Way not working?

I'm reading Learn Vimscript the Hard Way - Chapter 18, which is also about folds. I'm surprised to see that copying the sample code " Vimscript file settings ---------------------- {{{ augroup ...

vimrc vimscript folding  
asked by Enrico 3 votes
answered by Enrico 2 votes

How to display a list of all folds?

How can I show a list of all folds? e.g., maybe a list something like: 1-3 12-18 13-16 where <start-line>-<end-line> are the starting and ending lines of the fold. Is there a command-line ...

command-line folding command  
asked by Rob Bednark 2 votes
answered by D. Ben Knoble 1 vote

Single page version of docs

I would like to read the Vim user guide and reference docs and man pages on my Kindle Paperwhite. Does anyone know of a single page web readable version of the docs? Or even a PDF? Https:// is ...

asked by xdhmoore 1 vote
answered by D. Ben Knoble 1 vote

How to remove spaces between parenthesis?

I have a text that looks like this " original call minpac#add('morhetz / gruvbox') " desired call minpac#add('morhetz/gruvbox') How can I limit vim pattern search within parentheses? I ...

asked by Avi Mehenwal 1 vote
answered by Maxim Kim 1 vote

In vim8.2, is there any difference between using :term vs :shell?

In vim 8.2, is there any difference between using :terminal versus :shell to run commands on shell? Or are they identical? I would like to know if there are any specific use-cases for using :shell vs :...

terminal shell  
asked by Avi Mehenwal 1 vote
answered by Quasímodo 2 votes

How can I delete whitespace backwards until end of previous word?

I want to delete whitespace backwards until end of previous word. Say, I have the cursor on the character "d" in the word "dog": horse cat dog If I press Ctrl-W (Insert ...

normal insert  
asked by Shuzheng 1 vote
answered by Andy Stewart 3 votes

How to trigger rhs of a map?

Let's say I have a function like this: function! Foo() echom 'foo' endfunction And a map like this: nmap gf :<C-U>call Foo()<CR>0v$ When I type gf I see foo echoed and the current line ...

key-bindings vimscript  
asked by Andy Stewart 1 vote
answered by user938271 0 votes

Greatest hits from previous weeks:

What is the difference between the vim plugin managers?

I have been looking at the different package managers for vim and the one I decided to use vim-plug but I have seen others like pathogen and vundle and I honestly don't know what the difference is. ...

asked by ZucchiniZe 235 votes
answered by gjg 167 votes

How do I open and close NERDTree (toggle NERDTree view) using a single keystroke?

Sometimes during my workflow, I might want to open/search for a file on the go. I'd like to map a single key (say F6) to open and close NERDTree (ie. I want to toggle NERDTree view). Also, I'd like ...

asked by evil_potato 29 votes
answered by Atropo 33 votes

How to indent as spaces instead of tab?

I am coding some html templates in JADE files. I want to auto indent code with spaces instead of tab. I tried shiftwidth=2, tabstop=2, but no matter what, it's still indents using tabs instead of ...

indentation whitespace  
asked by John 31 votes
answered by EvergreenTree 32 votes

How to show only matching lines?

Is there a way to hide all lines that did not match, while going through the list of result lines? In a long file, I would like to search for a pattern that will match roughly 200 lines or so. The ...

asked by Volker Siegel 40 votes
answered by Zach Ingbretsen 44 votes

How can I set up a ruler at a specific column?

When coding in different languages, I tend to need to restrict my lines to a specific length (usually 79 or 80 characters). I've seen this done in other editors through the use of a ruler (solid line ...

alignment colorcolumn  
asked by Kevin Brown 63 votes
answered by Kevin Brown 83 votes

How to find and replace in Vim without having to type the original word?

I'd like to optimize my "find and replace" workflow in Vim. It's something I do often, as I'm sure most of you do too. Usually something along the lines of -- copy a block and change the name of a ...

search substitute  
asked by Joel 67 votes
answered by James 93 votes

How can I rename the file I'm editing?

Is it possible to rename the file I'm editing from within Vim? Currently what I do is exit Vim, rename the file and open from Vim again.

save file-operations  
asked by thameera 50 votes
answered by OrangeTux 50 votes

Can you answer these questions?

vimscript - copy a file from one path to another

How do I rewrite this line of code call system("cp /tmp/foo.txt /tmp/bar.txt") into a vim command which is more portable and OS-independent? I've been looking around but checking for "...

vimscript filesystem  
asked by ColinKennedy 1 vote

Different word boundaries in command mode

I very commonly use CTRL-W to adjust a previous path in the command line, like I'll bring up the directory of the current file or perhaps a previous :e ... command from history that's close, and use ...

command-line autocmd  
asked by scanny 1 vote
answered by perelo 0 votes
You're receiving this message because you subscribed to the Vi and Vim community digest.
Unsubscribe from this community digest       Edit email settings       Leave feedback       Privacy
Stack Overflow

Stack Overflow, 110 William Street, 28th floor, New York, NY 10038