nvim: tweak neovide more

This commit is contained in:
dogeystamp 2024-06-08 18:54:54 -04:00
parent 57feef79eb
commit c7f5a86783
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
4 changed files with 24 additions and 6 deletions

View File

@ -14,9 +14,6 @@ alias cp='cp -n'
# run this before opening, e.g., mpv or zathura
abbr -a -- ds swal;
# neovide
alias nv 'swal -c neovide; neovide'
# zathura
alias thur='zathura'
# stricter sandbox zathura

View File

@ -1,3 +1,6 @@
local confutil = require("confutil")
local keymap = confutil.keymap
------
-- color theme
------
@ -112,10 +115,13 @@ if vim.g.neovide then
once = true,
callback = function()
vim.g.neovide_scale_factor = 1.01
vim.uv.new_timer():start(20, 0, vim.schedule_wrap(function()
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

View File

@ -53,9 +53,9 @@ export MRSS_DIR="$HOME/dox/rss"
export REM_FILE="$HOME/dox/not/rem"
# Set default programs
export EDITOR="nvim"
export EDITOR="nv"
export BROWSER="qutebrowser"
# man pager
# man pager (neovide doesn't support this yet https://github.com/neovide/neovide/issues/1865)
export MANPAGER='nvim +Man!'
export MANWIDTH=165

15
src/.local/bin/nv Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
# Small wrapper over neovide/neovim
swal() {
if command -v dwmswallow > /dev/null; then
dwmswallow "$WINDOWID" -c neovide
fi
}
if ! command -v neovide > /dev/null || [ -z "$DISPLAY" ]; then
nvim "$@"
else
swal
neovide "$@"
fi