From 4516223a1e2d5d749e6c30cee4277b54273d9afc Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Tue, 17 Aug 2021 18:38:35 +0200 Subject: [PATCH] Add some nvim stuff, clean up nvim UI --- eww-bar/.config/eww-bar/audio.sh | 6 +++-- nvim/.config/nvim/fnl/dots/keybinds.fnl | 4 ++- nvim/.config/nvim/fnl/dots/plugins.fnl | 26 ++++++++++++------- nvim/.config/nvim/fnl/dots/plugins/lsp.fnl | 5 ++-- .../.config/nvim/fnl/dots/plugins/lspsaga.fnl | 2 +- .../nvim/fnl/dots/plugins/persistence.fnl | 5 ++++ .../.config/nvim/fnl/dots/plugins/trouble.fnl | 15 ++++++----- .../nvim/fnl/dots/plugins/twilight.fnl | 5 ++++ .../nvim/fnl/dots/plugins/zen-mode.fnl | 7 +++++ nvim/.config/nvim/fnl/init.fnl | 16 +++++++++++- nvim/.config/nvim/fnl/macros.fnl | 9 +++++++ 11 files changed, 76 insertions(+), 24 deletions(-) create mode 100644 nvim/.config/nvim/fnl/dots/plugins/persistence.fnl create mode 100644 nvim/.config/nvim/fnl/dots/plugins/twilight.fnl create mode 100644 nvim/.config/nvim/fnl/dots/plugins/zen-mode.fnl diff --git a/eww-bar/.config/eww-bar/audio.sh b/eww-bar/.config/eww-bar/audio.sh index 273ee76..e636dca 100755 --- a/eww-bar/.config/eww-bar/audio.sh +++ b/eww-bar/.config/eww-bar/audio.sh @@ -13,8 +13,10 @@ case "$1" in ;; "volume") pamixer --get-volume; - pactl subscribe | grep --line-buffered "Event 'change' on sink " | while read -r evt; - do pamixer --get-volume; + pactl subscribe \ + | grep --line-buffered "Event 'change' on sink " \ + | while read -r evt; + do pamixer --get-volume | cut -d " " -f1; done ;; "toggle") diff --git a/nvim/.config/nvim/fnl/dots/keybinds.fnl b/nvim/.config/nvim/fnl/dots/keybinds.fnl index daa739e..e652a7e 100644 --- a/nvim/.config/nvim/fnl/dots/keybinds.fnl +++ b/nvim/.config/nvim/fnl/dots/keybinds.fnl @@ -45,6 +45,8 @@ "s" (cmd "w" "Save file") "g" (cmd "Neogit" "Git") + "n" [(. (require :persistence) :load) "Load last session"] + "m" {:name "+Code actions" "d" (cmd "Lspsaga hover_doc" "Show documentation") "b" (cmd "Lspsaga lsp_finder" "Find stuff") @@ -76,7 +78,7 @@ "v" {:name "+view-and-layout" "n" (cmd "set relativenumber!" "toggle relative numbers") "m" (cmd "set nonumber! norelativenumber" "toggle numbers") - "g" (cmd "Goyo | set linebreak" "toggle focus mode") + "g" (cmd "ZenMode" "toggle zen mode") "i" (cmd "IndentGuidesToggle" "toggle indent guides")} "b" {:name "+buffers" diff --git a/nvim/.config/nvim/fnl/dots/plugins.fnl b/nvim/.config/nvim/fnl/dots/plugins.fnl index 1adc5d8..49feef0 100644 --- a/nvim/.config/nvim/fnl/dots/plugins.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins.fnl @@ -11,15 +11,22 @@ :rhysd/conflict-marker.vim {} :wellle/visual-split.vim {} :sindrets/diffview.nvim {} + :folke/persistence.nvim {:mod "dots.plugins.persistence"} + :folke/zen-mode.nvim {:cmd ["ZenMode"] + :mod "dots.plugins.zen-mode"} + :folke/twilight.nvim {:mod "dots.plugins.twilight"} :TimUntersberger/neogit {:mod "dots.plugins.neogit" :cmd ["Neogit"]} :lifepillar/vim-gruvbox8 {:opt false - :config #(do (set vim.g.gruvbox_italics 0) - (set vim.g.gruvbox_italicise_strings 0) - (set vim.g.gruvbox_filetype_hi_groups 1) - (set vim.g.gruvbox_plugin_hi_groups 1) - (vim.cmd "colorscheme gruvbox8"))} + :config + #(do (set vim.g.gruvbox_italics 0) + (set vim.g.gruvbox_italicise_strings 0) + (set vim.g.gruvbox_filetype_hi_groups 1) + (set vim.g.gruvbox_plugin_hi_groups 1) + (vim.cmd "colorscheme gruvbox8") + (req dots.utils.highlight :SignColumn {:bg (. (require :dots.colors) :dark0)}))} + ;(req dots.utils.highlight :LspDiagnosticsUnderlineError {:gui "underline"}))} :nvim-telescope/telescope.nvim {:mod "dots.plugins.telescope" :cmd ["Telescope"] @@ -75,8 +82,6 @@ :tweekmonster/startuptime.vim {:cmd ["StartupTime"]} :tpope/vim-repeat {} - :junegunn/goyo.vim {:cmd "Goyo"} - :lewis6991/gitsigns.nvim {:after ["vim-gruvbox8"] :mod "dots.plugins.gitsigns"} @@ -97,7 +102,7 @@ :iamcco/markdown-preview.nvim {:run vim.fn.mkdp#util#install} :rcarriga/nvim-dap-ui {:opt false - :config #((. (require :dapui) :setup)) + :config #(req dapui.setup) :requires [:mfussenegger/nvim-dap]} :mfussenegger/nvim-dap {:opt false} ;:mod "dots.plugins.nvim-dap"} @@ -151,8 +156,9 @@ ;:bhurlow/vim-parinfer {:ft ["fennel" "carp" "lisp" "elisp"]} ;:eraserhd/parinfer-rust {:run "cargo build --release"} - "elkowar/parinfer-rust" {:run "cargo build --release" - :branch "configure-filetypes"} + :/home/leon/coding/prs/parinfer-rust {} + ;"elkowar/parinfer-rust" {:run "cargo build --release" + ;:branch "yuck"} :bduggan/vim-raku {:ft ["raku"]} :LnL7/vim-nix {:ft ["nix"]} diff --git a/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl b/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl index 0480e03..9c02357 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/lsp.fnl @@ -18,6 +18,7 @@ :use_lspsaga false :decorator ["`" "`"]})) + ;(req dots.utils.highlight :LspDiagnosticsUnderlineError {:gui "underline"}) (if client.resolved_capabilities.document_highlight (do (utils.highlight "LspReferenceRead" {:gui "underline"}) @@ -95,8 +96,8 @@ (let [rust-tools (require "rust-tools")] (rust-tools.setup {:tools {:inlay_hints {:show_parameter_hints false} - :autoSetHints false}})) - ;:server {:cmd ["/home/leon/coding/prs/rust-analyzer/target/release/rust-analyzer"]}})) + :autoSetHints false} + :server {:on_attach on_attach}})) (let [sumneko_root_path (.. vim.env.HOME "/.local/share/lua-language-server") sumneko_binary (.. sumneko_root_path "/bin/Linux/lua-language-server")] diff --git a/nvim/.config/nvim/fnl/dots/plugins/lspsaga.fnl b/nvim/.config/nvim/fnl/dots/plugins/lspsaga.fnl index 453560c..fb9f5ad 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/lspsaga.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/lspsaga.fnl @@ -8,7 +8,7 @@ (saga.init_lsp_saga {:border_style "single" ; single double round plus :code_action_prompt {:enable true - :sign true + :sign false :virtual_text false} :code_action_keys {:quit "" :exec ""} :rename_action_keys {:quit "" :exec ""} diff --git a/nvim/.config/nvim/fnl/dots/plugins/persistence.fnl b/nvim/.config/nvim/fnl/dots/plugins/persistence.fnl new file mode 100644 index 0000000..7f4aac3 --- /dev/null +++ b/nvim/.config/nvim/fnl/dots/plugins/persistence.fnl @@ -0,0 +1,5 @@ +(module dots.plugins.persistence + {autoload {persistence persistence}}) + +(persistence.setup + {:dir (vim.fn.expand (. (vim.fn.stdpath "cache") "/sessions/"))}) diff --git a/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl b/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl index 6abd1c7..8fd5de2 100644 --- a/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl +++ b/nvim/.config/nvim/fnl/dots/plugins/trouble.fnl @@ -9,6 +9,7 @@ :auto_close true :auto_open false :auto_jump ["lsp_definitions" "lsp_workspace_diagnostics"] + :indent_lines false :action_keys {:jump "o" :jump_close "" @@ -16,11 +17,11 @@ :cancel "q" :hover ["a" "K"]}}) -(utils.highlight "LspTroubleFoldIcon" {:bg "NONE" :fg colors.bright_orange}) -(utils.highlight "LspTroubleCount" {:bg "NONE" :fg colors.bright_green}) -(utils.highlight "LspTroubleText" {:bg "NONE" :fg colors.light0}) +(utils.highlight "TroubleFoldIcon" {:bg "NONE" :fg colors.bright_orange}) +(utils.highlight "TroubleCount" {:bg "NONE" :fg colors.bright_green}) +(utils.highlight "TroubleText" {:bg "NONE" :fg colors.light0}) -(utils.highlight "LspTroubleSignError" {:bg "NONE" :fg colors.bright_red}) -(utils.highlight "LspTroubleSignWarning" {:bg "NONE" :fg colors.bright_yellow}) -(utils.highlight "LspTroubleSignInformation" {:bg "NONE" :fg colors.bright_aqua}) -(utils.highlight "LspTroubleSignHint" {:bg "NONE" :fg colors.bright_blue}) +(utils.highlight "TroubleSignError" {:bg "NONE" :fg colors.bright_red}) +(utils.highlight "TroubleSignWarning" {:bg "NONE" :fg colors.bright_yellow}) +(utils.highlight "TroubleSignInformation" {:bg "NONE" :fg colors.bright_aqua}) +(utils.highlight "TroubleSignHint" {:bg "NONE" :fg colors.bright_blue}) diff --git a/nvim/.config/nvim/fnl/dots/plugins/twilight.fnl b/nvim/.config/nvim/fnl/dots/plugins/twilight.fnl new file mode 100644 index 0000000..56fd052 --- /dev/null +++ b/nvim/.config/nvim/fnl/dots/plugins/twilight.fnl @@ -0,0 +1,5 @@ + +(module dots.plugins.twilight + {autoload {twilight twilight}}) + +(twilight.setup) diff --git a/nvim/.config/nvim/fnl/dots/plugins/zen-mode.fnl b/nvim/.config/nvim/fnl/dots/plugins/zen-mode.fnl new file mode 100644 index 0000000..0cb4e95 --- /dev/null +++ b/nvim/.config/nvim/fnl/dots/plugins/zen-mode.fnl @@ -0,0 +1,7 @@ +(module dots.plugins + {autoload {zen-mode zen-mode}}) + + +(zen-mode.setup + {:window {:options {:wrap true}}}) + diff --git a/nvim/.config/nvim/fnl/init.fnl b/nvim/.config/nvim/fnl/init.fnl index e92d8ba..c9259bb 100644 --- a/nvim/.config/nvim/fnl/init.fnl +++ b/nvim/.config/nvim/fnl/init.fnl @@ -101,10 +101,24 @@ (utils.highlight-add :FloatBorder {:bg colors.dark0_hard}) (utils.highlight-add :SpecialComment {:fg colors.dark4}) +(utils.highlight-add + [:LspDiagnosticsSignError :LspDiagnosticsSignWarning :LspDiagnosticsSignInformation :LspDiagnosticsSignHint] + {:bg "NONE"}) +(utils.highlight :LspDiagnosticsUnderlineError {:gui "undercurl"}) + (utils.highlight ["StatusLine" "GalaxyLineInfo" "GalaxySpace" ] {:bg colors.dark1 :fg colors.light0}) (vim.cmd "highlight link Function GruvboxGreen") +(utils.highlight-add :Function {:gui "NONE"}) + + + +(vim.fn.sign_define :LspDiagnosticsSignError {:text "◆"}) +(vim.fn.sign_define :LspDiagnosticsSignWarning {:text "◆"}) +(vim.fn.sign_define :LspDiagnosticsSignHint {:text "◆"}) +(vim.fn.sign_define :LspDiagnosticsSignInformation {:text "◆"}) + ; foldend @@ -116,7 +130,7 @@ ; rust.vim (set vim.g.rust_clip_command "xclip -selection clipboard") -(set vim.g.rustfmt_autosave 1) +;(set vim.g.rustfmt_autosave 1) (set vim.g.conjure#client#fennel#aniseed#aniseed_module_prefix "aniseed.") (set vim.g.vim_parinfer_filetypes ["carp" "fennel" "clojure"]) diff --git a/nvim/.config/nvim/fnl/macros.fnl b/nvim/.config/nvim/fnl/macros.fnl index 6684eec..b594280 100644 --- a/nvim/.config/nvim/fnl/macros.fnl +++ b/nvim/.config/nvim/fnl/macros.fnl @@ -5,6 +5,15 @@ (nvim.ex.autocmd_) ,... (nvim.ex.augroup :END))) + + :req + (fn [name ...] + (let [str (require :aniseed.string) + a (require :aniseed.core) + segs (str.split (tostring name) "%.") + mod (str.join "." (a.butlast segs)) + func (a.last segs)] + `((. (require (tostring ,mod)) (tostring ,func)) ,...))) :autocmd (fn [...]