nvim: split off neovide config
This commit is contained in:
parent
c7f5a86783
commit
9fbc579684
45
src/.config/nvim/lua/frontend.lua
Normal file
45
src/.config/nvim/lua/frontend.lua
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
--------------------------------
|
||||||
|
--------------------------------
|
||||||
|
-- gui frontend settings
|
||||||
|
--------------------------------
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
vim.o.guifont = "JetBrains Mono:h10"
|
||||||
|
|
||||||
|
if vim.g.neovide then
|
||||||
|
local confutil = require("confutil")
|
||||||
|
local keymap = confutil.keymap
|
||||||
|
|
||||||
|
vim.g.neovide_padding_top = 8
|
||||||
|
vim.g.neovide_padding_bottom = 8
|
||||||
|
vim.g.neovide_padding_left = 8
|
||||||
|
vim.g.transparency = 0
|
||||||
|
vim.g.neovide_background_color = "#000000" .. 0
|
||||||
|
|
||||||
|
vim.g.neovide_cursor_animate_in_insert_mode = false
|
||||||
|
|
||||||
|
-- hack to unscrew the scaling issues
|
||||||
|
-- sometimes opening neovide on a tiling wm makes it not occupy the entire window until resized
|
||||||
|
vim.api.nvim_create_augroup("NeovideScale", {})
|
||||||
|
vim.api.nvim_create_autocmd(
|
||||||
|
"FocusGained",
|
||||||
|
{
|
||||||
|
group = "NeovideScale",
|
||||||
|
once = true,
|
||||||
|
callback = function()
|
||||||
|
vim.g.neovide_scale_factor = 1.01
|
||||||
|
vim.uv.new_timer():start(40, 0, vim.schedule_wrap(function()
|
||||||
|
vim.g.neovide_scale_factor = 1
|
||||||
|
end))
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
-- no terminal, no Ctrl-Shift-V paste
|
||||||
|
keymap("<C-S-V>", '<Esc>"+p', { mode = { "n", "i" } })
|
||||||
|
|
||||||
|
-- "new-term" in working directory
|
||||||
|
keymap("<C-S-Return>", function()
|
||||||
|
vim.system({ 'alacritty' }, { detach = true })
|
||||||
|
end, { mode = { "n", "i", "v", "t" } })
|
||||||
|
end
|
@ -41,6 +41,7 @@ keymap("<leader>eb", "<cmd>Telescope keymaps<cr>")
|
|||||||
--------------------------------
|
--------------------------------
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
|
require("frontend")
|
||||||
require("theme")
|
require("theme")
|
||||||
require("snippets")
|
require("snippets")
|
||||||
|
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
local confutil = require("confutil")
|
|
||||||
local keymap = confutil.keymap
|
|
||||||
|
|
||||||
------
|
------
|
||||||
-- color theme
|
-- color theme
|
||||||
------
|
------
|
||||||
@ -87,41 +84,3 @@ Group.link("DapUIType", groups["@type.builtin"])
|
|||||||
Group.link("DapUIVariable", groups["@variable"])
|
Group.link("DapUIVariable", groups["@variable"])
|
||||||
Group.link("DapUIValue", groups["@number"])
|
Group.link("DapUIValue", groups["@number"])
|
||||||
Group.link("DapUIFloatBorder", groups.FloatBorder)
|
Group.link("DapUIFloatBorder", groups.FloatBorder)
|
||||||
|
|
||||||
--------------------------------
|
|
||||||
--------------------------------
|
|
||||||
-- gui frontend settings
|
|
||||||
--------------------------------
|
|
||||||
--------------------------------
|
|
||||||
|
|
||||||
vim.o.guifont = "JetBrains Mono:h10"
|
|
||||||
|
|
||||||
if vim.g.neovide then
|
|
||||||
vim.g.neovide_padding_top = 8
|
|
||||||
vim.g.neovide_padding_bottom = 8
|
|
||||||
vim.g.neovide_padding_left = 8
|
|
||||||
vim.g.transparency = 0
|
|
||||||
vim.g.neovide_background_color = "#000000" .. 0
|
|
||||||
|
|
||||||
vim.g.neovide_cursor_animate_in_insert_mode = false
|
|
||||||
|
|
||||||
-- hack to unscrew the scaling issues
|
|
||||||
-- sometimes opening neovide on a tiling wm makes it not occupy the entire window until resized
|
|
||||||
vim.api.nvim_create_augroup("NeovideScale", {})
|
|
||||||
vim.api.nvim_create_autocmd(
|
|
||||||
"FocusGained",
|
|
||||||
{
|
|
||||||
group = "NeovideScale",
|
|
||||||
once = true,
|
|
||||||
callback = function()
|
|
||||||
vim.g.neovide_scale_factor = 1.01
|
|
||||||
vim.uv.new_timer():start(40, 0, vim.schedule_wrap(function()
|
|
||||||
vim.g.neovide_scale_factor = 1
|
|
||||||
end))
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
-- no terminal, no Ctrl-Shift-V paste
|
|
||||||
keymap("<C-S-V>", '<Esc>"+p', { mode = { "n", "i" } })
|
|
||||||
end
|
|
||||||
|
Loading…
Reference in New Issue
Block a user