Fix guifont issues
This commit is contained in:
parent
ba7f1b0c00
commit
33d89b9d15
@ -264,35 +264,6 @@ require("lazy").setup({
|
|||||||
|
|
||||||
-- Utilities
|
-- Utilities
|
||||||
'nvim-lua/plenary.nvim',
|
'nvim-lua/plenary.nvim',
|
||||||
{
|
|
||||||
"ThePrimeagen/99",
|
|
||||||
config = function()
|
|
||||||
local _99 = require("99")
|
|
||||||
_99.setup({
|
|
||||||
-- When setting this to something that is not inside the CWD tools
|
|
||||||
-- such as claude code or opencode will have permission issues
|
|
||||||
-- and generation will fail refer to tool documentation to resolve
|
|
||||||
-- https://opencode.ai/docs/permissions/#external-directories
|
|
||||||
-- https://code.claude.com/docs/en/permissions#read-and-edit
|
|
||||||
tmp_dir = "./tmp",
|
|
||||||
provider = _99.Providers.OpenCodeProvider,
|
|
||||||
model = "kimi-k2.5",
|
|
||||||
})
|
|
||||||
|
|
||||||
-- take extra note that i have visual selection only in v mode
|
|
||||||
-- technically whatever your last visual selection is, will be used
|
|
||||||
-- so i have this set to visual mode so i dont screw up and use an
|
|
||||||
-- old visual selection
|
|
||||||
--
|
|
||||||
-- likely ill add a mode check and assert on required visual mode
|
|
||||||
-- so just prepare for it now
|
|
||||||
vim.keymap.set("v", "<leader>9v", function() _99.visual() end)
|
|
||||||
|
|
||||||
--- if you have a request you dont want to make any changes, just cancel it
|
|
||||||
vim.keymap.set("n", "<leader>9x", function() _99.stop_all_requests() end)
|
|
||||||
vim.keymap.set("n", "<leader>9s", function() _99.search() end)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
}, {
|
}, {
|
||||||
install = {
|
install = {
|
||||||
colorscheme = { "gruvbox-material" },
|
colorscheme = { "gruvbox-material" },
|
||||||
@ -311,7 +282,7 @@ vim.opt.completeopt = { 'menu', 'menuone', 'noselect' }
|
|||||||
vim.opt.cpoptions:append('$')
|
vim.opt.cpoptions:append('$')
|
||||||
vim.opt.cursorline = true
|
vim.opt.cursorline = true
|
||||||
vim.opt.expandtab = true
|
vim.opt.expandtab = true
|
||||||
vim.opt.guifont = { 'JetBrains_Mono:h9', 'Consolas:h9', 'InputMonoCondensed:h9' }
|
vim.opt.guifont = 'JetBrains_Mono,Consolas:h9'
|
||||||
vim.opt.hlsearch = false
|
vim.opt.hlsearch = false
|
||||||
vim.opt.ignorecase = true
|
vim.opt.ignorecase = true
|
||||||
vim.opt.linebreak = true
|
vim.opt.linebreak = true
|
||||||
@ -448,18 +419,28 @@ end
|
|||||||
-- Keymaps
|
-- Keymaps
|
||||||
-- ============================================================================
|
-- ============================================================================
|
||||||
|
|
||||||
-- Font size adjustment (GUI only)
|
local function adjust_fontsize(amount)
|
||||||
vim.keymap.set('n', '<C-Up>', function()
|
-- Get current font and size
|
||||||
vim.opt.guifont = vim.fn.substitute(vim.opt.guifont:get()[1] or '', ':h\\zs\\d\\+', function(m)
|
local current_font = vim.opt.guifont:get()[1] or "Consolas"
|
||||||
return tostring(tonumber(m) + 1)
|
local current_size = tonumber(current_font:match(":h(%d+)")) or 12
|
||||||
end, 'g')
|
|
||||||
end, { silent = true })
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<C-Down>', function()
|
-- Extract font name (everything before :h)
|
||||||
vim.opt.guifont = vim.fn.substitute(vim.opt.guifont:get()[1] or '', ':h\\zs\\d\\+', function(m)
|
local font_name = current_font:match("^(.+):h%d+") or current_font
|
||||||
return tostring(tonumber(m) - 1)
|
|
||||||
end, 'g')
|
-- Calculate new size
|
||||||
end, { silent = true })
|
local new_size = math.max(6, current_size + amount) -- Minimum size of 6
|
||||||
|
|
||||||
|
-- Apply new font setting
|
||||||
|
if vim.g.neovide then
|
||||||
|
vim.opt.guifont = font_name .. ":h" .. new_size
|
||||||
|
else
|
||||||
|
vim.cmd("GuiFont! " .. font_name .. ":h" .. new_size)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Numpad mappings
|
||||||
|
vim.keymap.set('n', '<C-=>', function() adjust_fontsize(1) end)
|
||||||
|
vim.keymap.set('n', '<C-->', function() adjust_fontsize(-1) end)
|
||||||
|
|
||||||
-- FZF Bindings
|
-- FZF Bindings
|
||||||
vim.keymap.set('n', '<leader>h', '<cmd>FzfLua oldfiles<cr>')
|
vim.keymap.set('n', '<leader>h', '<cmd>FzfLua oldfiles<cr>')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user