diff --git a/eww-bar/.config/eww-bar/eww.yuck b/eww-bar/.config/eww-bar/eww.yuck index 2025b4b..5dec78f 100644 --- a/eww-bar/.config/eww-bar/eww.yuck +++ b/eww-bar/.config/eww-bar/eww.yuck @@ -66,7 +66,7 @@ :max 100 :onchange "pamixer --set-volume $(echo {} | sed 's/\\..*//g')" :value volume) - (eventbox :onscroll "notify-send test {}; if [ '{}' == 'up' ]; then pamixer -i 5; else pamixer -d 5; fi" + (eventbox :onscroll "if [ '{}' == 'up' ]; then pamixer -i 5; else pamixer -d 5; fi" :vexpand true :valign "fill" (box :orientation "v" diff --git a/nvim/.config/nvim/fnl/dots/keybinds.fnl b/nvim/.config/nvim/fnl/dots/keybinds.fnl index d6be058..9b30c5a 100644 --- a/nvim/.config/nvim/fnl/dots/keybinds.fnl +++ b/nvim/.config/nvim/fnl/dots/keybinds.fnl @@ -22,6 +22,11 @@ (utils.keymap :n :MN "lua require('nvim-gehzu').show_definition()" {}) +; Fix keybinds in linewrapped mode +;(utils.keymap [:n] :j "gj") +;(utils.keymap [:n] :k "gk") + + (fn cmd [s desc] [(.. "" s "") desc]) (fn sel-cmd [s desc] [(.. "'<,'>" s "") desc]) (fn rebind [s desc] [s desc]) @@ -60,6 +65,7 @@ "i" [#(req dap.step_into) "into"]}} "m" {:name "+Code actions" + ";" [#(set vim.o.spell (not vim.o.spell)) "Toggle spell checking"] "d" [vim.lsp.buf.hover "Show documentation"] "x" (cmd "Lspsaga preview_definition" "Preview definition") "o" (cmd "SymbolsOutline" "Outline") @@ -94,7 +100,8 @@ "n" (cmd "set relativenumber!" "toggle relative numbers") "m" (cmd "set nonumber! norelativenumber" "toggle numbers") "g" (cmd "ZenMode" "toggle zen mode") - "i" (cmd "IndentGuidesToggle" "toggle indent guides")} + "i" (cmd "IndentGuidesToggle" "toggle indent guides") + "w" (cmd "set wrap! linebreak!" "toggle linewrapping")} "b" {:name "+buffers" "b" (cmd "Buffers" "select open buffer") diff --git a/nvim/.config/nvim/fnl/dots/plugins.fnl b/nvim/.config/nvim/fnl/dots/plugins.fnl index 1802016..ef18a7d 100644 --- a/nvim/.config/nvim/fnl/dots/plugins.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins.fnl @@ -34,6 +34,10 @@ :github/copilot.vim {:opt true :cmd ["Copilot"]} + :lervag/vimtex (cfg "dots.plugins.vimtex" {:opt true :ft ["tex"]}) + :brymer-meneses/grammar-guard.nvim {:opt false + :requires ["williamboman/nvim-lsp-installer" + "neovim/nvim-lspconfig"]} ; sorted from here! :Olical/aniseed {:branch "develop"} diff --git a/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl b/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl index c6da463..d0b2d8a 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl @@ -19,13 +19,13 @@ (fn on_attach [client bufnr] - (pkg lsp_signature.nvim [lsp_signature (require "lsp_signature")] - (lsp_signature.on_attach {:bind true - :hint_scheme "String" - :hint_prefix "ƒ " - :handler_opts {:border "single"} - :use_lspsaga false - :decorator ["`" "`"]})) + ;(pkg lsp_signature.nvim [lsp_signature (require "lsp_signature")] + ;(lsp_signature.on_attach {:bind true + ;:hint_scheme "String" + ;:hint_prefix "ƒ " + ;:handler_opts {:border "single"} + ;:use_lspsaga false + ;:decorator ["`" "`"]})) ;(req dots.utils.highlight :LspDiagnosticsUnderlineError {:gui "underline"}) (if client.resolved_capabilities.document_highlight @@ -71,6 +71,7 @@ (init-lsp :html) (init-lsp :svelte) (init-lsp :elmls) +(init-lsp :texlab) (init-lsp :powershell_es {:bundle_path "/home/leon/powershell"}) @@ -83,15 +84,12 @@ ;(init-lsp :ccls) -(let [ewwls-path "/home/leon/coding/projects/ls-eww/crates/ewwls/target/debug/ewwls"] - (when (vim.fn.filereadable ewwls-path) - (when (not lsp.ewwls) - (set lsp-configs.ewwls - {:default_config {:cmd [ewwls-path] - :filetypes ["yuck"] - :root_dir (fn [fname] (or (lsp.util.find_git_ancestor fname) (vim.loop.os_homedir))) - :settings {}}})) - (init-lsp :ewwls))) + +((. (require "grammar-guard") :init)) +(init-lsp :grammar_guard {:cmd "~/.local/share/nvim/lsp_servers/ltex/ltex-ls/bin/ltex-ls" + :settings {:ltex {:language "de" + :enabled ["latex" "tex"]}}}) + (init-lsp :cssls {:filestypes ["css" "scss" "less" "stylus"] @@ -130,14 +128,29 @@ (vim.fn.expand "$VIMRUNTIME/lua/vim/lsp") true}} :telemetry false}}})) -(when (not lsp.prolog_lsp) - (tset lsp-configs :prolog_lsp - {:default_config {:cmd ["swipl" "-g" "use_module(library(lsp_server))." "-g" "lsp_server:main" "-t" "halt" "--" "stdio"] - :filetypes ["prolog"] - :root_dir (fn [fname] (or (lsp.util.find_git_ancestor fname) (vim.loop.os_homedir))) - :settings {}}})) -(lsp.prolog_lsp.setup {}) + +(comment + (when (not lsp.prolog_lsp) + (tset lsp-configs :prolog_lsp + {:default_config {:cmd ["swipl" "-g" "use_module(library(lsp_server))." "-g" "lsp_server:main" "-t" "halt" "--" "stdio"] + :filetypes ["prolog"] + :root_dir (fn [fname] (or (lsp.util.find_git_ancestor fname) (vim.loop.os_homedir))) + :settings {}}})) + + (lsp.prolog_lsp.setup {})) + + +(comment + (let [ewwls-path "/home/leon/coding/projects/ls-eww/crates/ewwls/target/debug/ewwls"] + (when (vim.fn.filereadable ewwls-path) + (when (not lsp.ewwls) + (set lsp-configs.ewwls + {:default_config {:cmd [ewwls-path] + :filetypes ["yuck"] + :root_dir (fn [fname] (or (lsp.util.find_git_ancestor fname) (vim.loop.os_homedir))) + :settings {}}})) + (init-lsp :ewwls)))) diff --git a/nvim/.config/nvim/fnl/dots/plugins/vimtex.fnl b/nvim/.config/nvim/fnl/dots/plugins/vimtex.fnl new file mode 100644 index 0000000..6ea9c34 --- /dev/null +++ b/nvim/.config/nvim/fnl/dots/plugins/vimtex.fnl @@ -0,0 +1,3 @@ +(module dots.plugins.vimtex) + +(set vim.g.vimtex_view_method "general") diff --git a/xmonad/.xmonad/lib/Config.hs b/xmonad/.xmonad/lib/Config.hs index e9af14a..8724d99 100644 --- a/xmonad/.xmonad/lib/Config.hs +++ b/xmonad/.xmonad/lib/Config.hs @@ -146,7 +146,7 @@ myLayout = noBorders where -- | if the screen is wider than 1900px it's horizontal, so use horizontal layouts. -- if it's not, it's vertical, so use layouts for vertical screens. - layouts = PerScreen.ifWider 1900 + layouts = PerScreen.ifWider 1900 (PerScreen.ifWider 3000 chonkyScreenLayouts (MTog.mkToggle1 ONLYONTOPHALF horizScreenLayouts)) vertScreenLayouts @@ -215,9 +215,9 @@ rectangleCenterPiece ratio (Rectangle rx ry rw rh) = Rectangle start ry width rh data ONLYONTOPHALF = ONLYONTOPHALF deriving (Read, Show, Eq, Typeable) instance MTog.Transformer ONLYONTOPHALF Window where - transform ONLYONTOPHALF layout k = k (onlyOnTopHalf 0.62 layout) (const layout) + transform ONLYONTOPHALF layout k = k (onlyOnTopHalf 0.62 layout) (const layout) -newtype OnlyOnTopHalf a = OnlyOnTopHalf Double deriving (Show, Read) +newtype OnlyOnTopHalf a = OnlyOnTopHalf Double deriving (Show, Read) instance LayoutModifier OnlyOnTopHalf Window where pureModifier (OnlyOnTopHalf ratio) _screenRect _ wins = (fmap (second (rectangleTopHalf ratio)) wins, Nothing) @@ -561,6 +561,31 @@ main = do -- }}} + + +-- | for a list of queries, finds the first one that +-- matches the currently focused window and executes that X action, +-- or a fallback if no window is active. +perQueryAction :: X () -> [(Query Bool, X ())] -> X () +perQueryAction fallback options = withWindowSet $ \ws -> case W.peek ws of + Nothing -> fallback + Just w -> do + matching <- findM (\(q, _) -> runQuery q w) options + maybe fallback snd matching + +findM :: Monad m => (a -> m Bool) -> [a] -> m (Maybe a) +findM _ [] = pure Nothing +findM f (x:xs) = do b <- f x; if b then pure $ Just x else findM f xs + +fooElseBar :: X () +fooElseBar = perQueryAction + (spawn "notify-send no window") + [ ((className =? "Alacritty"), spawn "notify-send kek hehe") + , ((className =? "Google-chrome"), spawn "notify-send chrome user") + ] + + + myActivateManageHook :: ManageHook myActivateManageHook = pure mempty