Community Digest

Top new questions this week:

How do I get my signature with a date inserted in my changelog?

Whenever I make an update to the changelog of a Debian package, I have to update the signature with the correct date (well, it's not mandatory, but it's really nice to have). The signature looks like ...

macro date-and-time  
asked by Alexis Wilke 3 votes
answered by filbranden 4 votes

How can I quickly mark consecutive lines of the same indentation in Vim?

I often edit Python code that needs to be re-indented other otherwise manipulated through visual selection. Is there any way to visually select all lines of the same indentation in Vim? I know I ...

visual-mode nvim  
asked by Shuzheng 3 votes
answered by statox 5 votes

How to preview Markdown in a Vim buffer?

I'm aware of some of the Markdown plugins for Vim, but I want the functionality VS Code and Atom provide, namely being able to split the editor screen and render a live Markdown preview in an adjacent ...

vim-windows filetype-markdown previewing  
asked by Mr Blue 3 votes

Why does `:cdo print` not show full output?

:cdo print command (intended to print every line in the quickfix list), shows generic file information instead of line output for some quickfix entries. Why is this? The following example is taken ...

quickfix message  
asked by mxxk 2 votes
answered by Ingo Karkat 4 votes

How to open :Explore for a directory under the cursor?

I wonder how to open a file from a directory under the cursor. I have managed to do it for simple directories, but it requires they are one single word and are located in the current working ...

open explore  
asked by Stephane Rolland 2 votes
answered by D. Ben Knoble 4 votes

Tell vim to treat character as full width

I am wondering if it is possible to tell vim to treat an individial code point in the unicode plain. I am aware of the ambiwidth option, but it does not help with my current task because the relevant ...

options unicode font  
asked by Max Xiong 2 votes

add quotes around an element of a list with vim-sandwich

I have an array like this ["/api/static/1_lion.wav",/api/static/2_lion.wav], I want to add quotes around /api/static/2_lion.wav. I have vim-sandwich, and I have a vague feeling I should be able to do ...

plugin plugin-vim-sandwich  
asked by fbence 2 votes
answered by filbranden 2 votes

Greatest hits from previous weeks:

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 26 votes
answered by EvergreenTree 29 votes

How to automatically turn off "hlsearch" after I'm done searching?

I love the "hlsearch" setting, but after I'm done searching, I find it obnoxious. Especially if I search for something that has a lot of matches. I know that I can turn this off with :set nohlsearch ...

search highlight  
asked by James 25 votes
answered by James 28 votes

How to do :Sex but with a vertical split?

When viewing a file /tmp/vim_split_demo/test.txt, the parent directory can be opened in a horizontal split screen using the command :Sex, as shown in these screenshots: What command gives same ...

split filesystem multiple-files working-directory  
asked by user1717828 1 vote
answered by Mike Holt 10 votes

Close all split files, except the one currently focused?

Sometimes when I'm working on a file, I'll open up multiple files just to get an idea of the current flow of the code up to a point. However this sometimes leads to multiple files being open at a time ...

command-line split vim-windows  
asked by Dom 37 votes
answered by Matt Boehm 45 votes

How can I yank (copy) the single character on which the cursor rests?

I know many ways to copy things: yiw = yank in current word yaw = yank all word (includes a trailing space) yy = yank the current line 3yy = yank three lines starting at the current one yap = yank ...

cut-copy-paste  
asked by Christopher Bottoms 64 votes
answered by VanLaser 54 votes

What does :set background=dark do?

I didn't put color xxx in my .vimrc. So I see this when I first open my .vimrc. :color gives me default here. Then I type :color darcula. And it changes to this. :color gives me darcula here ...

colorscheme  
asked by Michael Ma 40 votes
answered by Rich 36 votes

How to get intelligent C++ auto-completion

Some editors (such as visual studio on windows) do C++ autocompletion which understand C++. For example, given: #include <vector> int main(void) { std::vector<int> v; v.i In visual ...

ide autocompletion filetype-c++  
asked by Chris Jefferson 35 votes
answered by akshay 30 votes

Can you answer these questions?

How to use the same set of cursor shapes for bash vi mode and vim?

I want to use block cursor for normal mode, bar cursor for insert mode in both vim and bash vi mode, a minimal setting can look like this: vimrc -------- let &t_SI = "\e[5 q" let &t_EI = ...

cursor  
asked by dedowsdi 1 vote
answered by Biggybi 0 votes

In Windows 10, WSL 2, Windows Terminal, bash and VIM, how to avoid the conflict of <c-v>?

With the newly released Windows 10 update 2004, we can run native Windows Subsystem for Linux (WSL) 2 and install Ubuntu 20.04 on it. Then we can run native bash inside the latest Windows Terminal. ...

neovim microsoft-windows visual-block  
asked by Kevin Wang 1 vote

losing random chars when pasting (insert mode + :set paste are set)

When pasting a huge text(10,000 lines, around 500KB) in vim (yes, I'm using insert mode + :set paste), I lose random characters every few lines. I thought it could be a plugin, so I tried starting ...

cut-copy-paste paste  
asked by J Placeholder 1 vote
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

<3