From 435da2ee8603ed9d7db961c97e51e10f3849c335 Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sat, 8 Jun 2024 14:28:42 -0400 Subject: [PATCH] nvim: added stuff for neovide --- programs | 1 + src/.config/fish/aliases.fish | 9 +++++---- src/.config/nvim/init.vim | 1 + src/.config/nvim/lua/theme.lua | 36 ++++++++++++++++++++++++++++++++++ src/.config/picom/picom.conf | 2 +- src/.local/bin/picomstart.sh | 1 + 6 files changed, 45 insertions(+), 5 deletions(-) diff --git a/programs b/programs index 8db8ce4..69c2ed1 100644 --- a/programs +++ b/programs @@ -139,6 +139,7 @@ arc-gtk-theme lxappearance-gtk3 radare2 typst +neovide # .local/bin/pyinstantref script python-pydbus diff --git a/src/.config/fish/aliases.fish b/src/.config/fish/aliases.fish index f18b057..82c705b 100644 --- a/src/.config/fish/aliases.fish +++ b/src/.config/fish/aliases.fish @@ -1,12 +1,11 @@ # dynamic swallow (dwm patch) function swal - return if command -v dwmswallow > /dev/null dwmswallow "$WINDOWID" $argv end end -alias mpv='swal -c mpv; command mpv' +alias mpv='command mpv' # prevent clobbering files alias mv='mv -n' @@ -15,9 +14,11 @@ 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='swal -c Zathura; zathura' +alias thur='zathura' # stricter sandbox zathura alias zathsec='/usr/bin/zathura -c ~/.config/zathura-sec' @@ -59,7 +60,7 @@ function ldg; $EDITOR ~/dox/not/journal.ldg; end # disable history on units alias units='units -H ""' -alias sxiv='swal; nsxiv' +alias sxiv='nsxiv' # music recognition # an alternative is available at ~/.local/bin/msrec diff --git a/src/.config/nvim/init.vim b/src/.config/nvim/init.vim index ea56157..a841a0f 100755 --- a/src/.config/nvim/init.vim +++ b/src/.config/nvim/init.vim @@ -44,6 +44,7 @@ nmap d "+d vmap d "+d nmap c "+c vmap c "+c +nmap p "+p " 0 is easier to reach so swap these binds nnoremap 0 ^ diff --git a/src/.config/nvim/lua/theme.lua b/src/.config/nvim/lua/theme.lua index 971b0af..e1290c2 100644 --- a/src/.config/nvim/lua/theme.lua +++ b/src/.config/nvim/lua/theme.lua @@ -29,6 +29,7 @@ local styles = colorbuddy.styles Group.new("Normal", colors.noir_4, colors.none, nil) Group.new("StatusLine", colors.noir_4, colors.none, styles.bold) +Group.link("MsgArea", groups.Normal) -- not selected statusline Group.new("StatusLineNC", colors.noir_7, colors.none) Group.link("Gutter", groups.normal) @@ -83,3 +84,38 @@ Group.link("DapUIType", groups["@type.builtin"]) Group.link("DapUIVariable", groups["@variable"]) Group.link("DapUIValue", groups["@number"]) 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(20, 0, vim.schedule_wrap(function() + vim.g.neovide_scale_factor = 1 + end)) + end, + } + ) +end diff --git a/src/.config/picom/picom.conf b/src/.config/picom/picom.conf index ec9a228..d911b8b 100644 --- a/src/.config/picom/picom.conf +++ b/src/.config/picom/picom.conf @@ -29,7 +29,7 @@ shadow-offset-x = -7; shadow-offset-y = -7; # fading -fading = true; +fading = false; fade-in-step = 0.05; fade-out-step = 0.05; fade-delta = 5; diff --git a/src/.local/bin/picomstart.sh b/src/.local/bin/picomstart.sh index af7edef..d4fe577 100755 --- a/src/.local/bin/picomstart.sh +++ b/src/.local/bin/picomstart.sh @@ -3,3 +3,4 @@ picom --window-shader-fg-rule "$HOME/.config/picom/shaders/transparency-sonixd.glsl:class_g = 'feishin'" \ --window-shader-fg-rule "$HOME/.config/picom/shaders/transparency.glsl:class_g = 'qutebrowser'" \ + --window-shader-fg-rule "$HOME/.config/picom/shaders/transparency.glsl:class_g = 'neovide'" \