From 494f8924e93056935efd73060c84559af1b58211 Mon Sep 17 00:00:00 2001 From: Keith Simmons Date: Sun, 2 Jan 2022 23:35:41 -0800 Subject: [PATCH] Add mapping for testing out fonts --- src/bridge/ui_commands.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bridge/ui_commands.rs b/src/bridge/ui_commands.rs index ec07bba..7dd7241 100644 --- a/src/bridge/ui_commands.rs +++ b/src/bridge/ui_commands.rs @@ -145,7 +145,9 @@ impl ParallelCommand { } ParallelCommand::DisplayAvailableFonts(fonts) => { let mut content: Vec = vec![ - "What follows are the font names available for guifont. To use one of these, type:", + "What follows are the font names available for guifont. You can try any of them with in normal mode.", + "", + "To switch to one of them, use one of them, type:", "", " :set guifont=:h", "", @@ -158,6 +160,7 @@ impl ParallelCommand { "", " :set guifont=Cascadia\\ Code\\ PL,Delugia\\ Nerd\\ Font:h12", "", + "Make sure to add the above command when you're happy with it to your .vimrc file or similar config to make it permanent.", "------------------------------", "Available Fonts on this System", "------------------------------", @@ -177,6 +180,11 @@ impl ParallelCommand { ) .await .ok(); + nvim.command( + "nnoremap lua vim.opt.guifont=vim.fn.getline('.')", + ) + .await + .ok(); } #[cfg(windows)] ParallelCommand::RegisterRightClick => {