12 votes

vim line wrap with indent

The solution to your question can be achieved setting two parameters in your vimrc: To break the lines with the same indentation: set breakindent And one space for indenting soft-wrapped lines: let &...
aturegano's user avatar
  • 461
12 votes

Splitting a single file into multiple windows on Vim

As has already been pointed out, you can use splits displaying the same buffer to get you most of the way there. :vsplit or :split As for displaying only a specific section of the file, one way of ...
Veen's user avatar
  • 121
10 votes

Change menu/ui language of vim to english

It works for me to simply add one line language en_US.utf8 at the top of .vimrc. Since en_US.utf8 is the output of you $ locale -a command, you should use language en_US.utf8 instead of ...
heyrict's user avatar
  • 101
9 votes
Accepted

Stop vim indenting new lines after comma in plain text files

That is caused by the enabled 'cindent' option. I tried fiddling with the 'cino' options, but apparently it is not affected by that (but I have little experience with those). I think you should ...
Ingo Karkat's user avatar
  • 23.1k
8 votes

Insert a new full-width buffer underneath two vertically split buffers

Or, to do it in a single command: :bot sp The long version of this is :botright split But I find that more confusing than the short version! I'll let you look at :help :botright for an explanation :-...
spookypeanut's user avatar
8 votes
Accepted

Configure gvim swap, undo, and backup files on windows

These files are backup and undo files. vim also creates swap files if it crashes while editing. From https://coderwall.com/p/sdhfug/vim-swap-backup-and-undo-files In powershell, create the following ...
Heath Borders's user avatar
7 votes
Accepted

Vim slow at rendering the buffer with LaTeX syntax highlighting

The problem is, vim's regular expression engine is really slow, and I guess latex is pretty demanding on regex. I was able to get vim a bit faster by doing: :syn clear texSectionFold :syn clear ...
Edd Barrett's user avatar
6 votes

Where does VIM (gvim/macvim) keep swap files for unsaved/unnamed buffers?

I work on Windows 10 and :recover didn't find a swap file. vim -r listed the swap file from the last edit session (also never saved) named _.swp. Recovering was possible with :recover _.
rolacher's user avatar
6 votes

Gvim 7.4: how to save the default font setting? Any improvements from gvim 7.3?

On Windows 10, I had to add this line to _vimrc in user home directory to make font setting persistent: (Default set to Consolas size 10). set guifont=Consolas:h10
Ravi G.'s user avatar
  • 61
6 votes
Accepted

Vim and Gvim - Change color for cursorline line numbers

This is controlled by the CursorLineNr highlight group. It's a recent (Vim 7.4) addition; the blueshift colorscheme does not have a definition for that. You can change it like that (after the :...
Ingo Karkat's user avatar
  • 23.1k
5 votes

Vim Script: Is it possible to refer to script-local variables in mappings?

I originally wanted to comment this, but I need 50 rep. Here's a small suggestion, and I hope its on target. its possible to use (within the script where the var is defined) exe "nnoremap <c-...
dabyly's user avatar
  • 51
5 votes

vim windows 10 set packpath option for native package manager

You should not include the pack component in your 'packpath' setting, since Vim will add that for you. What you want is simply: :set packpath+=$HOME/vimlocal Or, better yet, just use the existing ~/...
filbranden's user avatar
  • 1,551
4 votes

How do I find the encoding of the current buffer in vim?

I found that : https://vim.fandom.com/wiki/Reloading_a_file_using_a_different_encoding You can reload a file using a different encoding if Vim was not able to detect the correct encoding :e ++enc=<...
Pierre-Damien's user avatar
4 votes

Close all locations list or quick fix windows in vim

I map this to <F11>: nmap <F11> :windo lcl\|ccl<CR> Basically: In each window, run lcl (close location list) and ccl (close quickfix)
Mark K Cowan's user avatar
4 votes

Change menu/ui language of vim to english

I've used different settings: language messages English_United States set langmenu=en_US.UTF-8 This worked for me. I added this at the top of _vimrc. I have Windows 10 in Korean, and gVim 8.0.586
HoJin's user avatar
  • 41
4 votes

Splitting a single file into multiple windows on Vim

This is a actually pretty straightforward, and thankfully doesn't need any configuration. Once you open up your file, run :vsplit or the keyboard shortcut <C-w>v which does the same thing. ...
DJMcMayhem's user avatar
  • 1,052
4 votes

How do I make <Ctrl-a><Ctrl-c> copy and select all in vim?

I ultimately accomplished what I wanted to do by adding: map <C-a> ggVG map <C-c> "+y to my .vimrc file.
Al C's user avatar
  • 217
3 votes

How do I get Vim to automatically load .vimrc config from the current directory?

In vim version 8.1^ there is a autocmd-event named DirChanged that you can use to eval your project specific .vimrc. Here is more detail about when this event is triggered: DirChanged = Working ...
Vernon Grant's user avatar
3 votes

Better GUI for vim?

You can use VisualStudio Code and it has several plugins that add many of Vim's functionalities alongside with many goodies. It is a very good editor besides it is open and free and it has Windows, ...
Marco Santana's user avatar
3 votes

How to get vim to open multiple files into tabs at once

To open files in new tabs without replacing the arguments or tabs that are already open: :argadd *.c | tab all This was mentioned in a comment but I think deserves its own answer. Also, to search ...
Big McLargeHuge's user avatar
3 votes

Vim: How to synchronize NERDTree with current opened tab file path?

Check this cool plugin vim-nerdtree-sync
Nafaa Boutefer's user avatar
3 votes

Setting background color in gvim

I found below settings in .vimrc/.gvimrc are more easy and convenient for dark theme in gvim " Dark mode settings colors koehler highlight LineNr guifg=DarkGray highlight Search guibg='Purple' guifg=#...
Sriraj Hebbar's user avatar
3 votes

Copy/Paste in gvim broken after creating personal vimrc

Add the two lines below at the end of your _vimrc source $VIMRUNTIME/mswin.vim "This line is copied from C:\Program Files (x86)\Vim_vimrc (If delte this line, copy/paste is broken) behave ...
user927975's user avatar
3 votes

I want to replace multiple strings at a time using VIM Editor command

What you need is a regular expression which starts with 51 and its 3rd charactar can be any of 1,2 or 4. Then you want to replace the string that matches the regular expression this way: the first to ...
user556625's user avatar
  • 4,200
3 votes

Possible to make a backup of original file in vim?

You mean that you have already made some changes to the file in Vim you're about to :write, but want to backup the original file that's still on disk? You can launch an external shell command ...
Ingo Karkat's user avatar
  • 23.1k
3 votes

How to map ALT-return in .vimrc?

Due to the way that the keyboard input is handled internally, this unfortunately isn't generally possible today, even in GVIM. Some key combinations, like Ctrl + non-alphabetic cannot be mapped, and ...
Ingo Karkat's user avatar
  • 23.1k
2 votes

Is there a way to move a split page to a new tab in Vim?

Canonical Solution Suppose there are two buffers: :ls 1 #h "match_this_partially.md" line 1 2 %a "food/tacos.txt" line 1 You currently have food/tacos.txt open. You want to open ...
dylnmc's user avatar
  • 241
2 votes

gVim: How to open multiple files in its own tab at once?

You can open multiple files in single split window using gvim -O file1.c file2.c ... (split vertically) gvim -o file1.c file2.c ... (split horizontally) or in multiple tabs using gvim -p file1....
RGNR's user avatar
  • 21
2 votes

Better GUI for vim?

Vim is intended to be used without GUI. But if you are concerned about the menu bar and tool bar in gvim that looks out of place. You can disable it just insert "Remove Menubar and Toolbar set ...
user93's user avatar
  • 121
2 votes

How can I set gvim's window width to 80 columns of text, plus the ones needed to show the line number

I set the numberwidth to, say, 5 and then set the columns to 85 (80+5) That should be good for files from 0 lines to a million lines. Here is what you may have to put in (default) ~/.vimrc file set ...
isound's user avatar
  • 21

Only top scored, non community-wiki answers of a minimum length are eligible