Skip to content

Commit

Permalink
feat: add neovide
Browse files Browse the repository at this point in the history
  • Loading branch information
TwIStOy committed Mar 6, 2024
1 parent 3cd6c0c commit 221174a
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lua/dotvim/packages/_.lua → lua/dotvim/packages/_/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,8 @@ return {
vim.bo.formatoptions = vim.bo.formatoptions:gsub("o", "")
end,
})
if vim.g.neovide then
require("dotvim.packages._.neovide").setup()
end
end,
}
74 changes: 74 additions & 0 deletions lua/dotvim/packages/_/neovide.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
local M = {}

local function set_ime(args)
if args.event:match("Enter$") then
vim.g.neovide_input_ime = true
else
vim.g.neovide_input_ime = false
end
end

function M.setup()
vim.g.neovide_padding_top = 0
vim.g.neovide_padding_bottom = 0
vim.g.neovide_padding_right = 0
vim.g.neovide_padding_left = 0

vim.g.neovide_transparency = 1
vim.g.neovide_window_blurred = true

vim.g.neovide_hide_mouse_when_typing = false
vim.g.neovide_profiler = false
vim.g.neovide_refresh_rate = 60
vim.g.neovide_no_idle = true
vim.g.neovide_input_macos_alt_is_meta = true

vim.g.neovide_cursor_animation_length = 0
vim.g.neovide_cursor_trail_size = 0

vim.g.neovide_floating_blur_amount_x = 6.0
vim.g.neovide_floating_blur_amount_y = 6.0

vim.g.neovide_floating_shadow = true
vim.g.neovide_floating_z_height = 10
vim.g.neovide_light_angle_degrees = 45
vim.g.neovide_light_radius = 5

vim.g.neovide_scroll_animation_length = 0.2

vim.g.neovide_underline_automatic_scaling = true
vim.g.neovide_underline_stroke_scale = 0.6

vim.g.neovide_native_border_width = 1.0
vim.g.neovide_native_border_inactive_color = 0xffff0000
vim.g.neovide_native_border_active_color = 0xff477fef
vim.g.neovide_unlink_border_highlights = true

vim.o.winblend = 20
vim.o.pumblend = 20

vim.g.neovide_input_ime = false

local ime_input = vim.api.nvim_create_augroup("ime_input", { clear = true })

vim.api.nvim_create_autocmd({ "InsertEnter", "InsertLeave" }, {
group = ime_input,
pattern = "*",
callback = set_ime,
})

vim.api.nvim_create_autocmd({ "CmdlineEnter", "CmdlineLeave" }, {
group = ime_input,
pattern = "[/\\?]",
callback = set_ime,
})

-- clipboard
vim.keymap.set("v", "<D-c>", '"+y') -- Copy
vim.keymap.set("n", "<D-v>", '"+P') -- Paste normal mode
vim.keymap.set("v", "<D-v>", '"+P') -- Paste visual mode
vim.keymap.set("c", "<D-v>", "<C-R>+") -- Paste command mode
vim.keymap.set("i", "<D-v>", '<ESC>l"+Pli') -- Paste insert mode
end

return M
1 change: 0 additions & 1 deletion lua/ht/conf/gui/neovide.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ function M.setup()
vim.g.neovide_underline_stroke_scale = 0.6

vim.g.neovide_native_border_width = 1.0
-- vim.g.neovide_native_border_inactive_color = 0xff22262c
vim.g.neovide_native_border_inactive_color = 0xffff0000
vim.g.neovide_native_border_active_color = 0xff477fef
vim.g.neovide_unlink_border_highlights = true
Expand Down

0 comments on commit 221174a

Please sign in to comment.