Community Digest

Top new questions this week:

What do I need in my ~/.vimrc to make neovim act like vim?

I'd like to be able to use Neovim with my usual Vim configuration by running nvim -u ~/.vimrc. However, Neovim seems to introduce a few changes to the default Vim key bindings, such as Y no longer ...

user avatar asked by cjs Score of 4
user avatar answered by Mass Score of 2

Regex to delete all leading blank lines

Is there a Vim regex to delete all leading blank lines in the file? text more text some more text Should become: text more text some more text

user avatar asked by Amarakon Score of 3
user avatar answered by Vivian De Smedt Score of 5

Use *-like command in normal mode to execute a find/replace

Background It's nice to be able to type * in normal mode and automatically have Vim search for the word under the cursor. Question Is there an analogous command for executing a find/replace? E.g. the ...

normal-mode replace find search-replace  
user avatar asked by Alex Roberts Score of 2
user avatar answered by Vivian De Smedt Score of 4

Open JIRA issues from inside Vim based on JIRA tag

I just learned about the gx command to open URLs from Vim. Is there a way to do the same thing based on the highlighting. For example, I have this match rule to hightlight JIRA issues: syn match ...

vimscript netrw  
user avatar asked by Stephen Rasku Score of 2
user avatar answered by D. Ben Knoble Score of 2

How can I store the number of regex matches in a variable?

In Vim Script, I want to check for the amount of matches from a regular expression (/\%^\n*) and store the amount of matches in a variable. I this possible?

vimscript regular-expression variables  
user avatar asked by Amarakon Score of 2

Comment out just-pasted text?

In vim, I would like to operate on the block of text I just pasted. How? For example, I select a block of text using shift-V, yank and then paste it somewhere. I would then like to comment that text ...

user avatar asked by Ana Score of 2
user avatar answered by romainl Score of 4

Disabling undodir and backupdir for specific paths

My email client creates files in /tmp and my password manager under /dev/shm when editing. The first is just unnecessary to store the undos for longer than the lifetime of the file, the latter is ...

undo-redo backup  
user avatar asked by fbence Score of 2
user avatar answered by Maxim Kim Score of 2

Greatest hits from previous weeks:

How can I get gVim on Windows to behave as on Linux?

I am a frequent user of the Vim editor on Linux and now I want to use it on Windows. I downloaded Vim for Windows, which happens to be gVim. Several features of Vim doesn't work in gVim 7.4 like ...

gvim microsoft-windows  
user avatar asked by SibiCoder Score of 15
user avatar answered by statox Score of 14

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  
user avatar asked by thameera Score of 67
user avatar answered by OrangeTux Score of 65

Installing Neovim 0.7 on Ubuntu?

I just moved from Mac to Ubuntu. I have set everything up but my lua keybindings are following the 0.7 configurations. When I install neovim on Ubuntu it gives me 0.6. I tried this: sudo add-apt-...

neovim linux-ubuntu  
user avatar asked by Vinn Score of 9
user avatar answered by D. Ben Knoble Score of 2

How to add indentation guides/lines

In Sublime Text 2, you get vertical guides where your indentation is, like this: but in vim I obviously don't: Is there a way to show lines like that in vim? By the way, my indentation is 2 spaces. ...

indentation alignment colorscheme  
user avatar asked by aharris88 Score of 63
user avatar answered by John O'M. Score of 53

How can I show relative line numbers?

A lot of vim commands can take a number referring to the number of lines that the command will act on. Is it possible to show the line numbers relative to the current line? Something like the ...

user avatar asked by Nick J Adams Score of 92
user avatar answered by Collin Peters Score of 114

How to save window, split, and buffer layout?

I have several tasks I am working on in one repository. I would like to create "workspaces" for working on them. One "workspace" or "buffer layout" would have all files I need to work on open in the ...

buffers persistent-state vim-windows sessions  
user avatar asked by Nebril Score of 74
user avatar answered by craigp Score of 69

How to add space on multiple lines when pressing spacebar (without extra configuration)?

I tried visual block, but visual block only allow to highlight or delete characters on multiple lines. Is there any function that allows to add space before the first character of multiple lines when ...

insert-mode visual-mode replace  
user avatar asked by ggrr Score of 18
user avatar answered by nobe4 Score of 26

Can you answer these questions?

Snippet lookahead trigger

Using UltiSnips, I'm wondering if it's possible to do some lookahead assertion when detecting the trigger. For example, this works: snippet "dv" "derivative" ir \dv{$1}{$2}$0 ...

regular-expression plugin-ultisnips  
user avatar asked by Alex867 Score of 1
user avatar answered by husB Score of 0

Is there a way to get the coordinates of the character that was clicked from a <LeftMouse> bind?

I'm trying to create a plugin that will, when the user clicks the mouse, switch focus to the window the user clicked in without changing the cursor position in that window. To do this, I intend to ...

user avatar asked by wallefan Score of 1
user avatar answered by wallefan Score of 0

Sort from current column from visual selection

I am trying to write a :sort wrapper that sorts from current column. command! -bang -range=% -nargs=* Sortc exe '<line1>,<line2>sort<bang> <args> /\%' .. virtcol('.') .. 'v/' ...

visual-mode command sort user-commands  
user avatar asked by balki Score of 1
user avatar answered by Matt Score of 0
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