Getting a more readable font

29 views
Skip to first unread message

Eric Weir

unread,
Apr 16, 2023, 10:15:36 AM4/16/23
to vim_mac

Typing :set guifont=* calls up the mac font picker. With the font picker open I get this:


Restarting Vim I get this:


Why are they different? How can I get the first setting to stick?

Thanks,

------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA  USA
eew...@comcast.net 

"(I)t is important that awake people be awake... the darkness around us is deep."

- William Stafford

Yee Cheng Chin

unread,
Apr 16, 2023, 2:21:11 PM4/16/23
to vim...@googlegroups.com
After you picked the font, the setting is only set in memory. You need to change your vimrc for the setting to persist. The easiest way to find out what the font is set to is by doing "set guifont?", which will show you what the font picker chose. You can copy that setting to your vimrc for it to stick.

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/F996FF7B-A09B-4B6D-B3C7-F484BEF5C0DE%40comcast.net.

Yongwei Wu

unread,
Apr 17, 2023, 10:28:25 AM4/17/23
to vim...@googlegroups.com
utf-10???

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_mac/F996FF7B-A09B-4B6D-B3C7-F484BEF5C0DE%40comcast.net.


--
Yongwei Wu
URL: http://wyw.dcweb.cn/

Eric Weir

unread,
Apr 17, 2023, 12:53:24 PM4/17/23
to vim_mac

> On Apr 17, 2023, at 10:28 AM, Yongwei Wu <wuyo...@gmail.com> wrote:
>
> utf-10???

That was something I did groping for a solution. I had no idea what I was doing. I’ve since returned it to uff-8

------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA USA
eew...@comcast.net

"(I)t is important that awake people be awake... the darkness around us is. deep."

- William Stafford

Eric Weir

unread,
Apr 17, 2023, 12:58:00 PM4/17/23
to vim_mac

> On Apr 16, 2023, at 2:20 PM, Yee Cheng Chin <ychin....@gmail.com> wrote:
>
> After you picked the font, the setting is only set in memory. You need to change your vimrc for the setting to persist. The easiest way to find out what the font is set to is by doing "set guifont?", which will show you what the font picker chose. You can copy that setting to your vimrc for it to stick.

Somehow, something I thought I’d already done worked on a second try. Or so it seemed. Menlo:h14 gives me what I was groping for.

Thanks,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA USA
eew...@comcast.net

“Look deep into nature, you will understand everything better.”

- Albert Einstein

Yee Cheng Chin

unread,
Apr 18, 2023, 11:58:25 AM4/18/23
to vim...@googlegroups.com
No, please don't set fileencoding, encoding, or fileformats in your vimrc at all. That's not where those settings should go and in fact you should rarely need to set these settings. The default works just fine. I recommend reading the documentation on what each one does. Online snippets like StackOverflow and great for addressing specific needs but they are not good for setting up a vimrc cohesively.

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+u...@googlegroups.com.

Tony Mechelynck

unread,
Apr 18, 2023, 9:20:27 PM4/18/23
to vim_mac
On Tuesday, April 18, 2023 at 5:58:25 PM UTC+2 Yee Cheng Chin wrote:
No, please don't set fileencoding, encoding, or fileformats in your vimrc at all. That's not where those settings should go and in fact you should rarely need to set these settings. The default works just fine. I recommend reading the documentation on what each one does. Online snippets like StackOverflow and great for addressing specific needs but they are not good for setting up a vimrc cohesively.

Setting 'encoding' etc. in the vimrc _may_ be a good idea if they aren't yet set to utf-8 (this usually means on Windows but it might happen on any weirdly set system). The snippet below, somewhere near the top of your vimrc, will make sure that Vim, on any system, uses utf-8 internally, which will allow it to process files in any encoding (for some unusual ones you may have to tell it what to use in the :new or :edit command for the file, see ":help ++enc"). This snippet is written using non-vim9 syntax; I've liberally added comments (take them or leave them, they make of course no difference to the snippet's working) to make it easier to understand.

" save the keyboard locale if defaulted to the same as 'encoding'
if &tenc == ""
    let &tenc = &enc
endif
" if 'encoding' is not already some Unicode Transfer Format,
" use UTF-8
if &enc !~? '^u'
    set enc=utf-8
endif
" The following ('fencs' with a final s) defines the heuristic to use
" when reading a file, to determine its encoding.
" It is a comma-separated list with no intervening spaces.
" It may be varied as follows:
" * ucs-bom should come first; it will recognize Unicode files having
" a BOM (byte-order mark ; "encoding mark" would be a better
" designation) i.e. a U+FEFF codepoint as the very first character.
" * utf-8 should come next ; it will recognize files encoded in UTF-8
" even without BOM.
" * default will use (if possible) the system default locale
" ($LC_CTYPE or equivalent) as set on your computer. If it is an 8-bit
" encoding it will always be accepted.
" * latin1 (or some other predefined 8-bit encoding) should come last,
" especially if the default encoding is not before it or is not 8-bit. It will
" catch whatever has not yet been caught by whatever is to its left.
set fencs=ucs-bom,utf-8,default,latin1
" The following ('fenc' without the final s, defined globally) defines
" what to use when creating a new file from scratch.
" One advantage of UTF-8 is that files containing only characters
" in the range 0x00 to 0x7F are represented identically in UTF-8
" and in (7-bit) us-ascii. You might prefer some other default: YMMV.
setg fenc=utf-8

Best regards,
Tony.

Lifepillar

unread,
Apr 20, 2023, 2:10:31 PM4/20/23
to vim...@googlegroups.com
On 2023-04-19, Tony Mechelynck <antoine.m...@gmail.com> wrote:
> On Tuesday, April 18, 2023 at 5:58:25 PM UTC+2 Yee Cheng Chin wrote:
>
> No, please *don't* set fileencoding, encoding, or fileformats in your vimrc
> at all. That's not where those settings should go and in fact you should
> rarely need to set these settings. The default works just fine. I recommend
> reading the documentation on what each one does. Online snippets like
> StackOverflow and great for addressing specific needs but they are not good
> for setting up a vimrc cohesively.
>
> Setting 'encoding' etc. in the vimrc _may_ be a good idea >

Thanks for this thorough description of the settings. I will only add
that `:help encoding` in MacVim has this note:

NOTE: For MacVim and GTK+, it is highly recommended to set 'encoding'
to "utf-8". Although care has been taken to allow different values of
'encoding', "utf-8" is the natural choice for the environment and
avoids unnecessary conversion overhead.

Best,
Life.

Yee Cheng Chin

unread,
Apr 23, 2023, 7:48:42 AM4/23/23
to vim...@googlegroups.com
That's fair. It's ok to set encoding to utf-8. MacVim sets it for you as default anyway so it's not necessary, but it could be useful to set that in vimrc to maintain cross-compatibility, if you use Vim on platforms where that is not the case.

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages