From a86abb6e56e9ba409bb2b8b93774b15a651457b9 Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Sat, 8 May 2021 20:18:22 +0200 Subject: [PATCH] cleanup --- files/.config/nvim/fnl/colors.fnl | 38 +++++++++++++ files/.config/nvim/fnl/init.fnl | 7 ++- files/.config/nvim/fnl/macros.fnl | 3 +- files/.config/nvim/fnl/plugins.fnl | 24 +-------- files/.config/nvim/fnl/plugins/bufferline.fnl | 4 +- files/.config/nvim/fnl/plugins/galaxyline.fnl | 3 +- files/.config/nvim/fnl/plugins/gitsigns.fnl | 31 +++++------ files/.config/nvim/fnl/plugins/lsp.fnl | 4 +- files/.config/nvim/fnl/plugins/telescope.fnl | 2 - files/.config/nvim/fnl/utils.fnl | 53 +++++-------------- files/.config/nvim/init.vim | 8 +-- 11 files changed, 82 insertions(+), 95 deletions(-) create mode 100644 files/.config/nvim/fnl/colors.fnl diff --git a/files/.config/nvim/fnl/colors.fnl b/files/.config/nvim/fnl/colors.fnl new file mode 100644 index 0000000..ee9a113 --- /dev/null +++ b/files/.config/nvim/fnl/colors.fnl @@ -0,0 +1,38 @@ +(module colors + {} + {:dark0_hard "#1d2021" + :dark0 "#282828" + :dark0_soft "#32302f" + :dark1 "#3c3836" + :dark2 "#504945" + :dark3 "#665c54" + :dark4 "#7c6f64" + :light0_hard "#f9f5d7" + :light0 "#fbf1c7" + :light0_soft "#f2e5bc" + :light1 "#ebdbb2" + :light2 "#d5c4a1" + :light3 "#bdae93" + :light4 "#a89984" + :bright_red "#fb4934" + :bright_green "#b8bb26" + :bright_yellow "#fabd2f" + :bright_blue "#83a598" + :bright_purple "#d3869b" + :bright_aqua "#8ec07c" + :bright_orange "#fe8019" + :neutral_red "#cc241d" + :neutral_green "#98971a" + :neutral_yellow "#d79921" + :neutral_blue "#458588" + :neutral_purple "#b16286" + :neutral_aqua "#689d6a" + :neutral_orange "#d65d0e" + :faded_red "#9d0006" + :faded_green "#79740e" + :faded_yellow "#b57614" + :faded_blue "#076678" + :faded_purple "#8f3f71" + :faded_aqua "#427b58" + :faded_orange "#af3a03" + :gray "#928374"}) diff --git a/files/.config/nvim/fnl/init.fnl b/files/.config/nvim/fnl/init.fnl index 719f54c..11919d2 100644 --- a/files/.config/nvim/fnl/init.fnl +++ b/files/.config/nvim/fnl/init.fnl @@ -3,7 +3,8 @@ str aniseed.string nvim aniseed.nvim a aniseed.core - fennel aniseed.fennel} + fennel aniseed.fennel + colors colors} require-macros [macros]}) (macro make-errors-epic [f] @@ -14,10 +15,8 @@ (make-errors-epic (require "plugins.lsp")) (make-errors-epic (require "keybinds")) -(def- colors utils.colors) -(pkg conjure [] - (set vim.g.conjure#client#fennel#aniseed#aniseed_module_prefix "aniseed.")) +(set vim.g.conjure#client#fennel#aniseed#aniseed_module_prefix "aniseed.") ; Colors ------------------------------------------------------- foldstart diff --git a/files/.config/nvim/fnl/macros.fnl b/files/.config/nvim/fnl/macros.fnl index 5c28378..ea9e040 100644 --- a/files/.config/nvim/fnl/macros.fnl +++ b/files/.config/nvim/fnl/macros.fnl @@ -26,7 +26,8 @@ :pkg (fn [name mappings ...] - (if (~= nil (. packer_plugins `,(tostring name))) + ;(if (~= nil (. packer_plugins `,(tostring name))) + (if true `(let ,mappings ,...) (print (.. "plugin disabled " `,(tostring name))))) diff --git a/files/.config/nvim/fnl/plugins.fnl b/files/.config/nvim/fnl/plugins.fnl index 8012922..2cccbdc 100644 --- a/files/.config/nvim/fnl/plugins.fnl +++ b/files/.config/nvim/fnl/plugins.fnl @@ -1,27 +1,7 @@ (module plugins - {require {utils utils - a aniseed.core - packer packer} - require-macros [macros]}) + {require {utils utils}}) -(defn safe-require-plugin-config [name] - (xpcall - #(require name) - #(a.println (.. "Error sourcing " name ":\n" (fennel.traceback $1))))) - -(defn- use [...] - "Iterates through the arguments as pairs and calls packer's function for - each of them. Works around Fennel not liking mixed associative and sequential - tables as well." - (let [pkgs [...]] - (packer.startup - (fn [use] - (each-pair [name opts pkgs] - (-?> (. opts :mod) (safe-require-plugin-config)) - (use (a.assoc opts 1 name))))))) - - -(use +(utils.use :nvim-telescope/telescope.nvim {:mod "plugins.telescope" :requires [:nvim-lua/popup.nvim :nvim-lua/plenary.nvim]} diff --git a/files/.config/nvim/fnl/plugins/bufferline.fnl b/files/.config/nvim/fnl/plugins/bufferline.fnl index 9ce1edd..1620628 100644 --- a/files/.config/nvim/fnl/plugins/bufferline.fnl +++ b/files/.config/nvim/fnl/plugins/bufferline.fnl @@ -3,9 +3,9 @@ fennel aniseed.fennel nvim aniseed.nvim utils utils - bufferline bufferline}}) + bufferline bufferline + colors colors}}) -(def- colors utils.colors) ; :h bufferline-lua-highlights (let [selected {:guibg colors.neutral_aqua :guifg colors.dark0 :gui ""} diff --git a/files/.config/nvim/fnl/plugins/galaxyline.fnl b/files/.config/nvim/fnl/plugins/galaxyline.fnl index facfde0..74904eb 100644 --- a/files/.config/nvim/fnl/plugins/galaxyline.fnl +++ b/files/.config/nvim/fnl/plugins/galaxyline.fnl @@ -3,6 +3,7 @@ fennel aniseed.fennel nvim aniseed.nvim utils utils + colors colors galaxyline galaxyline gl-condition galaxyline.condition @@ -12,8 +13,6 @@ require-macros [macros]}) -(def- colors utils.colors) - (local modes {:n {:text "NORMAL" :colors {:bg colors.neutral_aqua :fg colors.dark0}} :i {:text "INSERT" :colors {:bg colors.neutral_yellow :fg colors.dark0}} diff --git a/files/.config/nvim/fnl/plugins/gitsigns.fnl b/files/.config/nvim/fnl/plugins/gitsigns.fnl index 1c320dc..d82c0ed 100644 --- a/files/.config/nvim/fnl/plugins/gitsigns.fnl +++ b/files/.config/nvim/fnl/plugins/gitsigns.fnl @@ -1,19 +1,20 @@ (module plugins.gitsigns {autoload {utils utils + colors colors gitsigns gitsigns}}) -; ; https://github.com/lewis6991/gitsigns.nvim -; (gitsigns.setup -; {:signs {:add {:text "▍"} -; :change {:text "▍"} -; :delete {:text "▍"} -; :topdelete {:text "▍"} -; :changedelete {:text "▍"}} -; :keymaps {:noremap true -; :buffer true} -; :current_line_blame true -; :update_debounce 100}) -; -; (utils.highlight "GitSignsAdd" {:bg "NONE" :fg colors.bright_aqua}) -; (utils.highlight "GitSignsDelete" {:bg "NONE" :fg colors.neutral_red}) -; (utils.highlight "GitSignsChange" {:bg "NONE" :fg colors.bright_blue}) +; https://github.com/lewis6991/gitsigns.nvim +(gitsigns.setup + {:signs {:add {:text "▍"} + :change {:text "▍"} + :delete {:text "▍"} + :topdelete {:text "▍"} + :changedelete {:text "▍"}} + :keymaps {:noremap true + :buffer true} + :current_line_blame true + :update_debounce 100}) + +(utils.highlight "GitSignsAdd" {:bg "NONE" :fg colors.bright_aqua}) +(utils.highlight "GitSignsDelete" {:bg "NONE" :fg colors.neutral_red}) +(utils.highlight "GitSignsChange" {:bg "NONE" :fg colors.bright_blue}) diff --git a/files/.config/nvim/fnl/plugins/lsp.fnl b/files/.config/nvim/fnl/plugins/lsp.fnl index a297d59..6265c43 100644 --- a/files/.config/nvim/fnl/plugins/lsp.fnl +++ b/files/.config/nvim/fnl/plugins/lsp.fnl @@ -4,11 +4,11 @@ nvim aniseed.nvim lsp lspconfig lsp-configs lspconfig.configs - utils utils} + utils utils + colors colors} require-macros [macros]}) -(def- colors utils.colors) (pkg symbols-outline.nvim [symbols-outline (require "symbols-outline")] (symbols-outline.setup { :highlight_hovered_item true :show_guides true})) diff --git a/files/.config/nvim/fnl/plugins/telescope.fnl b/files/.config/nvim/fnl/plugins/telescope.fnl index 524c6da..5e04013 100644 --- a/files/.config/nvim/fnl/plugins/telescope.fnl +++ b/files/.config/nvim/fnl/plugins/telescope.fnl @@ -7,6 +7,4 @@ {:defaults {:i { "" actions.close}}}) -(telescope.load_extension "media_files") - (utils.keymap :n : ":Telescope find_files") diff --git a/files/.config/nvim/fnl/utils.fnl b/files/.config/nvim/fnl/utils.fnl index eeac5c1..b3dd1bf 100644 --- a/files/.config/nvim/fnl/utils.fnl +++ b/files/.config/nvim/fnl/utils.fnl @@ -43,54 +43,25 @@ (nvim.buf_del_keymap 0 mode from) (nvim.del_keymap mode from))) -(defn- use [...] - "Iterates through the arguments as pairs and calls packer's function for + +(defn- safe-require-plugin-config [name] + (xpcall + #(require name) + #(a.println (.. "Error sourcing " name ":\n" (fennel.traceback $1))))) + +(defn use [...] + "Iterates through the arguments as pairs and calls packer's function for each of them. Works around Fennel not liking mixed associative and sequential - tables as well." - (let [pkgs [...]] + tables as well. + Additionally sources the file set in the :mod field of the plugin options" + (let [pkgs [...] + packer (require "packer")] (packer.startup (fn [use] (each-pair [name opts pkgs] (-?> (. opts :mod) (safe-require-plugin-config)) (use (a.assoc opts 1 name))))))) -(def colors - { :dark0_hard "#1d2021" - :dark0 "#282828" - :dark0_soft "#32302f" - :dark1 "#3c3836" - :dark2 "#504945" - :dark3 "#665c54" - :dark4 "#7c6f64" - :light0_hard "#f9f5d7" - :light0 "#fbf1c7" - :light0_soft "#f2e5bc" - :light1 "#ebdbb2" - :light2 "#d5c4a1" - :light3 "#bdae93" - :light4 "#a89984" - :bright_red "#fb4934" - :bright_green "#b8bb26" - :bright_yellow "#fabd2f" - :bright_blue "#83a598" - :bright_purple "#d3869b" - :bright_aqua "#8ec07c" - :bright_orange "#fe8019" - :neutral_red "#cc241d" - :neutral_green "#98971a" - :neutral_yellow "#d79921" - :neutral_blue "#458588" - :neutral_purple "#b16286" - :neutral_aqua "#689d6a" - :neutral_orange "#d65d0e" - :faded_red "#9d0006" - :faded_green "#79740e" - :faded_yellow "#b57614" - :faded_blue "#076678" - :faded_purple "#8f3f71" - :faded_aqua "#427b58" - :faded_orange "#af3a03" - :gray "#928374"}) (defn surround-if-present [a mid b] (if mid diff --git a/files/.config/nvim/init.vim b/files/.config/nvim/init.vim index 3239cf6..5ecf793 100644 --- a/files/.config/nvim/init.vim +++ b/files/.config/nvim/init.vim @@ -243,10 +243,10 @@ let g:qs_lazy_highlight = 1 -au VimEnter * RainbowParenthesesToggle -au Syntax * RainbowParenthesesLoadRound -au Syntax * RainbowParenthesesLoadSquare -au Syntax * RainbowParenthesesLoadBraces +" au VimEnter * RainbowParenthesesToggle +" au Syntax * RainbowParenthesesLoadRound +" au Syntax * RainbowParenthesesLoadSquare +" au Syntax * RainbowParenthesesLoadBraces