2

On Windows 7, using the gvim_9.1.0912_x64.exe installer. Start gVim, then go to the Edit menu -> Select Font, select your favorite font and font size.

But after you restart gVim, it will still be the default font and font size. This happens even if you run gVim as an administrator. It can't remember the changes.

Is this a feature of gVim itself? Is there any profile written to make gVim remember its own settings?

2
  • Welcome to Vi and Vim SE. Note that this site is in English only. I took the liberty of removing the non-English part (believing it to be the exact same question). I also made some changes to the question itself to try and improve its readability. In case I missed something, feel free to improve further. Commented Dec 9, 2024 at 7:59
  • 4
    vi.stackexchange.com/a/38178/71 Commented Dec 9, 2024 at 9:01

3 Answers 3

4

I would do:

  • Select the font using the GUI (that you can also trigger with the :set guifont=* command)
  • Find out the gVim name of the font by using the Vim command :set guifont?
  • Edit ~\_vimrc file and add set guifont=the\ font\ name where the font name is the gVim name of the font (you need to escape the spaces within font name).
2

Yes, Vim does not save any "settings" specifically. Instead, it runs initialization script(s) that contain commands that may set options (and, also, do many other things).

The main info source is a builtin help system. You can find "user manual" menu item in gVim, or simply type :h user-manual to read user manual. Specifically chapter 5 (:h usr_05.txt) where your question addressed in detail.

1
  • Also :help gui-font Commented Dec 9, 2024 at 17:50
0

You may find useful this plugin I made to simplify setting guifont in a portable way: https://github.com/awvalenti/vim-simple-guifont. Your vimrc (or gvimrc, if you prefer) goes like this and the plugin handles all the OS specific stuff:

silent! call simple_guifont#Set(
  ['Cascadia Code PL', 'JetBrains Mono', 'Hack'], 'Consolas', 14)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.