From be6c16189410b280dd9f94cc2821ffcbd721dbc2 Mon Sep 17 00:00:00 2001 From: triethyl Date: Mon, 7 Jul 2025 11:43:06 -0400 Subject: working on neovim Former-commit-id: 025d1930a0ae07909efe826cc902424ff57d5ce9 --- pkgs/custom-neovim/config/lua/neovide.lua | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 pkgs/custom-neovim/config/lua/neovide.lua (limited to 'pkgs/custom-neovim/config/lua/neovide.lua') diff --git a/pkgs/custom-neovim/config/lua/neovide.lua b/pkgs/custom-neovim/config/lua/neovide.lua new file mode 100644 index 0000000..0476765 --- /dev/null +++ b/pkgs/custom-neovim/config/lua/neovide.lua @@ -0,0 +1,46 @@ +if vim.g.neovide then + vim.o.guifont = "CodeNewRoman Nerd Font:h12" + vim.g.neovide_scale_factor = 0.8 + + -- Zoom keymaps. + local change_scale_factor = function(delta) + vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta + end + vim.keymap.set("n", "", function() + change_scale_factor(1.1) + end) + vim.keymap.set("n", "", function() + change_scale_factor(1/1.1) + end) + + -- Standard terminal emulator keymaps. + vim.api.nvim_set_keymap("c", "", "+", { noremap = true }) -- Paste in command mode. + vim.api.nvim_set_keymap('t', '', '"+Pi', {noremap = true}) -- Paste in terminal mode. + + + local positionAnimationLength = 0.2 + local scrollAnimationFarLines = 0.1 + local scrollAnimationLength = 0.1 + vim.g.neovide_position_animation_length = positionAnimationLength + vim.g.neovide_scroll_animation_far_lines = scrollAnimationFarLines + vim.g.neovide_scroll_animation_length = scrollAnimationLength + + -- Don't smooth scroll in terminals. + vim.api.nvim_create_autocmd("BufEnter", { + pattern = "*", + callback = function(args) + local filetype = vim.api.nvim_buf_get_option(args.buf, "filetype") + + -- When entering terminal for first time I noticed the filetype is empty + if filetype == '' or filetype == 'terminal' then + vim.g.neovide_position_animation_length = 0 + vim.g.neovide_scroll_animation_far_lines = 0 + vim.g.neovide_scroll_animation_length = 0 + else + vim.g.neovide_position_animation_length = positionAnimationLength + vim.g.neovide_scroll_animation_far_lines = scrollAnimationFarLines + vim.g.neovide_scroll_animation_length = scrollAnimationLength + end + end, + }) +end -- cgit v1.2.3 From fd886e18472da2884ea6c593aecfbfc7bc658cbf Mon Sep 17 00:00:00 2001 From: triethyl Date: Sat, 12 Jul 2025 22:23:30 -0400 Subject: working on custom nvim Former-commit-id: 7eeb50b4c2b95b3d917b37a3a6f0b98ed7b0d077 --- pkgs/custom-neovim/config/lua/neovide.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'pkgs/custom-neovim/config/lua/neovide.lua') diff --git a/pkgs/custom-neovim/config/lua/neovide.lua b/pkgs/custom-neovim/config/lua/neovide.lua index 0476765..dc804fc 100644 --- a/pkgs/custom-neovim/config/lua/neovide.lua +++ b/pkgs/custom-neovim/config/lua/neovide.lua @@ -1,16 +1,17 @@ if vim.g.neovide then +-- if false then vim.o.guifont = "CodeNewRoman Nerd Font:h12" - vim.g.neovide_scale_factor = 0.8 + -- vim.g.neovide_scale_factor = 0.8 -- Zoom keymaps. local change_scale_factor = function(delta) - vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta + vim.g.neovide_scale_factor = vim.g.neovide_scale_factor + delta end vim.keymap.set("n", "", function() - change_scale_factor(1.1) + change_scale_factor(1) end) vim.keymap.set("n", "", function() - change_scale_factor(1/1.1) + change_scale_factor(-1) end) -- Standard terminal emulator keymaps. -- cgit v1.2.3