Hot answers tagged

84 votes
Accepted

How to fold text in a JSON file?

Yes, it is possible. A minimal setup would be: :set filetype=json :syntax on :set foldmethod=syntax
user avatar
  • 4,228
54 votes

How can I change the font size in gVim?

If you want to simply change the font size in a running GVim instance, type: :set guifont=* A window should pop up letting you set font size as well as pick a new font if desired. You can then ask ...
user avatar
  • 641
53 votes
Accepted

Is there any way to change the popup menu color?

You can use the following highlight groups: Pmenu – normal item PmenuSel – selected item PmenuSbar – scrollbar PmenuThumb – thumb of the scrollbar For example to set a grey background: :highlight ...
user avatar
34 votes
Accepted

What additional features do gVim and/or MacVim offer compared to Vim inside a terminal emulator?

Some features that will only work with gVim: 24-bit color support out of the box (to get the same amount of colors in terminal vim, you have to try a little harder, see this and this). For true ...
33 votes
Accepted

Can I use a non-monospaced font in either Vim or gVim?

I found mlterm, which supports this. Aside from Emacs' built-in terminal (M-x term) this is the only terminal I've found that supports this (I've tried about 15-20 different ones). I've found that ...
user avatar
20 votes

how to install vim with python support for debian strech

It looks like I'm a bit late, but I'll leave this here for future visitors also struggling with this. $ sudo apt install vim-nox This is the Vim package in Debian Stretch that adds support for ...
user avatar
20 votes
Accepted

How to adjust gVim to my HiDPI display scaling on Windows 10?

I'm on Windows 10, update 1909, and I've resolved this by overriding high DPI settings for gVim to System(Enhanced). Setting GUI font size did not help. Right click on gVim icon -> Properties -> ...
user avatar
  • 358
15 votes

How can I change the font size in gVim?

I have the following in my .vimrc to change font size quickly without changing the font. Works on Windows and GTK. I haven't tested other GUIs. I'm sure I originally copied it from somebody else, ...
user avatar
  • 515
15 votes
Accepted

Browse oldfiles list length

:browse oldfiles and :oldfiles read from the viminfo file, so changing the maximum number of previously edited files to be remembered in the 'viminfo' option should work. You can do this by changing ...
user avatar
14 votes
Accepted

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

When I have to work on Windows (which is more often than I would like), I use Cygwin to get a terminal a little less crappy than the original Windows command line. Cygwin provides an environment which ...
user avatar
  • 46.5k
14 votes
Accepted

Disable Ctrl-Z in normal mode

So there are several things that you need to understand: Firstly you can't use :unset suspend and that is normal. Suspending Vim is not controlled by an option (that you could unset) but by a command:...
user avatar
  • 46.5k
13 votes
Accepted

How do I stop my window from moving when using vsplit?

This happens because when vertical splitting the window, vim needs to add a vertical scrollbar, which causes vim to recalculate the visual size and eventually makes vim jump to a different screen ...
user avatar
12 votes
Accepted

Paste from clipboard into CtrlP input in GVim

You can paste from any register (including the clipboard) into CtrlP, as explained in :help ctrlp-pasting: <Insert>, *'ctrlp-pasting'* <...
user avatar
  • 6,420
12 votes

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

As of Windows 10 Anniversary Update, you can use the Bash on Ubuntu terminal to run a Linux subsystem where you can apt install anything you're used to inside Ubuntu. Your Windows file system is ...
user avatar
11 votes
Accepted

Quickly switch between fonts at runtime

The basic idea could be something like: " Define a list of the fonts you want to use, and the index in the " list of the default font. See :help Lists let g:fc_list = [ \ "DejaVu Sans Mono 9", \ ...
user avatar
  • 4,512
11 votes

How to map two commands with only one key

I would recommend you to use for example <C-P>, since <C-[> is the same as <Esc> and <C-]> is used to jump to a definition of the keyword under the cursor. You can just do ...
user avatar
  • 265
11 votes
Accepted

Can I make gvim not use graphical dialog box for ':set confirm'?

That's a good question actually: I had never thought of this before but I added this setting now that I searched for it :-) From :h gui-w32-dialogs: 6.1 Dialogs The dialogs displayed by the "...
user avatar
  • 46.5k
10 votes

How do I get gvim to start maximised in Windows?

In alternative to the maximized window, why do not gain more space for a full vim multiwindows editing experience with an autostart FULL SCREEN mode? ;-) FULL SCREEN screenshot of the final result (=...
user avatar
10 votes

How can I change the font size in gVim?

Apparently, the way to write the font settings are quite platform-dependent. What worked for me (gVim in MX Linux 17, an XFCE Debian-based Linux distribution): Determine the current font settings in ...
user avatar
  • 201
10 votes
Accepted

Visual Differences between vim on virtualbox Ubuntu guest (through putty) OR gVim on Windows host

PuTTY, like other high-color terminals, only supports a fixed color palette of 256 colors. GVIM can use the full 24-bit RGB color space; that's why you see "finer" nuances there. As for attributes, ...
user avatar
  • 16.9k
10 votes
Accepted

How to map two commands with only one key

You can do this with | (on windows, in the _vimrc file, so you have to replace it with <bar>). e.g. " unix nnoremap <C-[> :set columns+=1 | lines+=1<CR> " windows nnoremap <C-[&...
user avatar
  • 15.2k
10 votes
Accepted

Can I still use console vim if I install a GUI version?

Yes. Vim-gnome does install gvim, but it also installs a much more feature-filled version of command line vim, including Perl, Python, Ruby, and TCL scripting, system-clipboard, newer patches, etc. ...
user avatar
  • 16.8k
10 votes

gvim window looks bad

The problem is probably that you don't have the Consolas font installed and that Vim defaults to an ugly default font. Try using a different font, for example this should work on most Linux systems: ...
user avatar
10 votes

How to adjust gVim to my HiDPI display scaling on Windows 10?

On Windows, the configuration file of gVim is named: _vimrc It is placed in the installation directory, the default being: C:\Program Files (x86)\Vim To edit the file you first need to launch some ...
user avatar
9 votes

How to display Font Awesome in Vim?

First off, Vim can only display a file in a single font, you can't use multiple fonts at the same time. For gVim, you can use guifont to set this to Font Awesome: set guifont=Font\ Awesome\ 14 ...
user avatar
9 votes
Accepted

How to build vim from sources with GUI support?

For configuration command you've specified gnome2 as your main GUI (--enable-gui=gnome2), are you sure it's the right one? Or maybe gnome2 is not enough to enable GUI, so try to add extra --enable-gui,...
user avatar
  • 16.8k
9 votes
Accepted

`gx` not opening url in gvim but works in terminal

I just tried this on a debian with XFCE desktop environment and I can reproduce the issue. Turns out, that gvim calls xdg-open URL to open the URL, but unfortunately, this did not return anything or ...
user avatar

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