From eb6337b9882a3caa72dc9d5a752856191443d800 Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Sun, 7 Nov 2021 12:30:08 +0100 Subject: [PATCH] Fix some vim stuff --- eww-bar/.config/eww-bar/eww.yuck | 63 ++++++++++--------- nvim/.config/nvim/fnl/dots/keybinds.fnl | 14 +++-- nvim/.config/nvim/fnl/dots/plugins.fnl | 12 ++-- .../.config/nvim/fnl/dots/plugins/lspsaga.fnl | 26 ++++---- .../.config/nvim/fnl/dots/plugins/trouble.fnl | 2 +- 5 files changed, 62 insertions(+), 55 deletions(-) diff --git a/eww-bar/.config/eww-bar/eww.yuck b/eww-bar/.config/eww-bar/eww.yuck index 01edf8f..2025b4b 100644 --- a/eww-bar/.config/eww-bar/eww.yuck +++ b/eww-bar/.config/eww-bar/eww.yuck @@ -22,27 +22,34 @@ :class "time" hour min sec)) + +(defwidget metric [icon ?font-size] + (box :class "metric" + :orientation "v" + (label :class "metric-icon" + :style {font-size != "" ? "font-size: ${font-size}rem;" : ""} + :text icon) + (children))) + (defwidget bottom [screen] (box :orientation "v" :valign "end" :space-evenly true :spacing "5" - (box :class "metric" :orientation "v" - ;(button :onclick "eww -c /home/leon/.config/eww-bar open --toggle music_popup --screen ${screen}" ) - "" - (music-button)) + + (metric :icon "" :font-size 1 (music-button)) + (volume) - (box :class "metric" :orientation "v" - (label :class "metric-icon" :style "font-size: 0.8rem;" :text "") + + (metric :icon "" + :font-size 0.8 "${round((1 - (EWW_DISK["/"].free / EWW_DISK["/"].total)) * 100, 0)}%") - (box :class "metric" :orientation "v" - (label :class "metric-icon":text "") - "${round(EWW_RAM.used_mem_perc, 0)}%") - (box :class "metric" :orientation "v" - (label :class "metric-icon" :text "") - "${round(EWW_CPU.avg, 0)}%") - (box :class "metric" - (date)))) + + (metric :icon "" "${round(EWW_RAM.used_mem_perc, 0)}%") + + (metric :icon "" "${round(EWW_CPU.avg, 0)}%") + + (box :class "metric" (date)))) (defwidget music-button [] (button :onclick "playerctl play-pause" @@ -53,23 +60,23 @@ :orientation "v" :space-evenly false :valign "fill" - :vexpand false (scale :orientation "h" :min 0 :max 100 :onchange "pamixer --set-volume $(echo {} | sed 's/\\..*//g')" :value volume) - (box :orientation "v" - :valign "fill" - :vexpand true - (button :onclick "./audio.sh toggle" - :onscroll "notify-send test {}; if [ '{}' == 'up' ]; then pamixer -i 5; else pamixer -d 5; fi" - (label :style "font-size: 1.2em; font-family: DejaVuSansMono Nerd Font Mono" - :text audio_sink)) - (button :onclick "pavucontrol &" - :onscroll "if [ '{}' == 'up' ]; then pamixer -i 5; else pamixer -d 5; fi" - "${volume}%")))) + (eventbox :onscroll "notify-send test {}; if [ '{}' == 'up' ]; then pamixer -i 5; else pamixer -d 5; fi" + :vexpand true + :valign "fill" + (box :orientation "v" + :valign "fill" + :vexpand true + (button :onclick "./audio.sh toggle" + (label :style "font-size: 1.2em; font-family: DejaVuSansMono Nerd Font Mono" + :text audio_sink)) + (button :onclick "pavucontrol &" + "${volume}%"))))) @@ -91,7 +98,7 @@ :initial `{"status": ""}` ` playerctl metadata --format '{ "status": "{{status}}", "artist": "{{artist}}", "title": "{{title}}"}' || echo '{"status": ""}'; - playerctl --follow metadata --format '{ "status": "{{status}}", "artist": "{{artist}}", "title": "{{title}}"}' + # playerctl --follow metadata --format '{ "status": "{{status}}", "artist": "{{artist}}", "title": "{{title}}"}' `) (defpoll hour :interval "1s" "date +%H") @@ -106,10 +113,6 @@ (defvar workspaces_1_yuck "") (defvar workspaces_2_yuck "") -; these are not needed because updates are done via update-workspaces.sh triggered from xmonad -;(deflisten workspaces_0_yuck "./workspaces.sh 0") -;(deflisten workspaces_1_yuck "./workspaces.sh 1") -;(deflisten workspaces_2_yuck "./workspaces.sh 2") (defwindow bar_1 :monitor 1 diff --git a/nvim/.config/nvim/fnl/dots/keybinds.fnl b/nvim/.config/nvim/fnl/dots/keybinds.fnl index 53fe9a5..d6be058 100644 --- a/nvim/.config/nvim/fnl/dots/keybinds.fnl +++ b/nvim/.config/nvim/fnl/dots/keybinds.fnl @@ -3,7 +3,8 @@ nvim aniseed.nvim utils dots.utils wk which-key - treesitter-selection nvim-treesitter.incremental_selection} + treesitter-selection nvim-treesitter.incremental_selection + lspactions lspactions} require-macros [macros]}) ; undo autopairs fuckup @@ -31,6 +32,7 @@ (vim.lsp.buf.formatting) (vim.cmd "Neoformat"))) + (wk.setup {}) (wk.register {"c" {:name "+comment out"} @@ -71,14 +73,14 @@ "A" (cmd "Lspsaga show_cursor_diagnostics" "Cursor diagnostics") "a" (cmd "Lspsaga show_line_diagnostics" "Line diagnostics") "h" (cmd "RustToggleInlayHints" "Toggle inlay hints") - "r" [vim.lsp.buf.references "Show references"] ; trouble broken? - ;"r" (cmd "Trouble lsp_references" "Show references") + "r" (cmd "Trouble lsp_references" "Show references") "E" (cmd "Trouble lsp_document_diagnostics" "List diagnostics") "e" (cmd "Trouble lsp_workspace_diagnostics" "Show diagnostics") - "t" [vim.lsp.buf.type_definition "Go to type-definition"] - ;"t" [vim.lsp.buf.declaration "Go to declaration"] - "g" [vim.lsp.buf.definition "Go to definition"] + "t" (cmd "Trouble lsp_type_definitions" "Go to type-definition") "i" (cmd "Trouble lsp_implementations" "Show implementation") + "g" (cmd "Trouble lsp_definitions" "Go to definition") + ;"g" [vim.lsp.buf.definition "Go to definition"] + ;"t" [vim.lsp.buf.declaration "Go to declaration"] "f" [format "format file"] "," (cmd "RustRunnables" "Run rust stuff")} diff --git a/nvim/.config/nvim/fnl/dots/plugins.fnl b/nvim/.config/nvim/fnl/dots/plugins.fnl index 742bd99..1802016 100644 --- a/nvim/.config/nvim/fnl/dots/plugins.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins.fnl @@ -32,6 +32,7 @@ (use ; sort me pls + :github/copilot.vim {:opt true :cmd ["Copilot"]} ; sorted from here! @@ -41,8 +42,8 @@ :norcalli/nvim.lua {} :lifepillar/vim-gruvbox8 (cfg "dots.plugins.gruvbox8") :kyazdani42/nvim-web-devicons {} - :folke/which-key.nvim {} + :Famiu/feline.nvim (cfg "dots.plugins.feline") :akinsho/nvim-bufferline.lua (cfg "dots.plugins.bufferline") @@ -117,11 +118,12 @@ :ray-x/lsp_signature.nvim {:events [:BufEnter]} :weilbith/nvim-code-action-menu {} - :elkowar/trouble.nvim {:config #(require "dots.plugins.trouble") - :cmd ["Trouble" "TroubleClose" "TroubleRefresh" "TroubleToggle"]} + ;:elkowar/trouble.nvim {:config #(require "dots.plugins.trouble") + ;:cmd ["Trouble" "TroubleClose" "TroubleRefresh" "TroubleToggle"] + + "/home/leon/coding/prs/trouble.nvim" {:opt false :config #(require "dots.plugins.trouble") + :cmd ["Trouble" "TroubleClose" "TroubleRefresh" "TroubleToggle"]} - ;"/home/leon/coding/prs/trouble.nvim" {:opt false :config #(require "dots.plugins.trouble") - ;:cmd ["Trouble" "TroubleClose" "TroubleRefresh" "TroubleToggle"]} ;:folke/lsp-trouble.nvim {:opt false :config #(require "dots.plugins.trouble") ;:cmd ["Trouble" "TroubleClose" "TroubleRefresh" "TroubleToggle"]} diff --git a/nvim/.config/nvim/fnl/dots/plugins/lspsaga.fnl b/nvim/.config/nvim/fnl/dots/plugins/lspsaga.fnl index fb9f5ad..ca12437 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/lspsaga.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/lspsaga.fnl @@ -5,19 +5,19 @@ require {saga lspsaga}}) -(saga.init_lsp_saga - {:border_style "single" ; single double round plus - :code_action_prompt {:enable true - :sign false - :virtual_text false} - :code_action_keys {:quit "" :exec ""} - :rename_action_keys {:quit "" :exec ""} - :finder_action_keys {:quit "" - :open "" - :vsplit "v" - :split "b" - :scroll_up "" - :scroll_down ""}}) +;(saga.init_lsp_saga + ;{:border_style "single" ; single double round plus + ;:code_action_prompt {:enable true + ;:sign false + ;:virtual_text false} + ;:code_action_keys {:quit "" :exec ""} + ;:rename_action_keys {:quit "" :exec ""} + ;:finder_action_keys {:quit "" + ;:open "" + ;:vsplit "v" + ;:split "b" + ;:scroll_up "" + ;:scroll_down ""}}) (utils.highlight ["LspFloatWinBorder" diff --git a/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl b/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl index 8fd5de2..d675d38 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl @@ -8,7 +8,7 @@ :auto_preview true :auto_close true :auto_open false - :auto_jump ["lsp_definitions" "lsp_workspace_diagnostics"] + :auto_jump ["lsp_definitions" "lsp_workspace_diagnostics" "lsp_type_definitions"] :indent_lines false :action_keys {:jump "o"