Skip to content

tenxsoydev/size-matters.nvim

Repository files navigation

size-matters.nvim

☕ Soydev plugin series.

Lua plugin that adds dynamic font scaling to modern neovim GUI clients like neovide or goneovim.

Keymaps Commands
Increase font size Ctrl++ / Ctrl+ScrollUp FontSizeUp <num>
Decrease font size Ctrl+- / Ctrl+ScrollDown FontSizeDown <num>
Reset font to default Ctrl+Alt+= FontReset

Installation

A simple way to install the plugin is via a plugin manager. E.g., packer.nvim

use "tenxsoydev/size-matters.nvim"

Then just load it like most other plugins. Additionally, you can wrap it in a condition to only be loaded when using a GUI client. E.g.,

if vim.g.neovide or vim.g.goneovim or vim.g.nvui or vim.g.gnvim then
	require("size-matters")
end

Configuration

If you want to change some configurations, those are the defaults

require("size-matters").setup({
	default_mappings = true,
	-- font resize step size
	step_size = 1,
	notifications = {
		enable = true,
		-- ms how long a notification should be displayed (only applies if notify is used)
		timeout = 150,
		-- the notifications position may be affected by the time it takes for the client to re-render
		-- to address this, it can be displayed with a delay.
		delay = 300,
	}
	-- the font loaded when using the reset cmd / shortcut
	reset_font = vim.api.nvim_get_option("guifont"),
})

Requirements

nvim >= v0.7 - as APIs introduced with v0.7 are used.

Outlook

  • Notifications when changing the font-size
  • User settings. E.g., to disable default mappings / notification visibility
  • Commands can send custom font sizing values
  • Branch with support for versions < 0.7 (if there is a community need for it)

About

Dynamic font scaling for Neovim GUI clients.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published