consistent formatting

This commit is contained in:
elkowar 2021-05-02 17:15:33 +02:00
parent c188b55475
commit 66573e88ea
6 changed files with 189 additions and 189 deletions

View file

@ -25,6 +25,7 @@
" "
asd FUCK FUKC FCUK CUFLKJASDFLKJASDLKJASDLKj
<label text="&lt; &gt; bruh &quot;"/> <label text="&lt; &gt; bruh &quot;"/>
@ -173,10 +174,11 @@
<pxbar/> <pxbar/>
</widget> </widget>
</window> </window>
<window screen="1" name="mw" stacking="fg" focusable="false"> <window screen="0" name="mw" stacking="fg" focusable="false">
<!--<window screen="2" name="mw" stacking="fg" focusable="false">--> <!--<window screen="2" name="mw" stacking="fg" focusable="false">-->
<!--<reserve side="l" distance="500px"/>--> <!--<reserve side="l" distance="500px"/>-->
<geometry anchor="center" width="200px" height="200px" x="0px" y="0px"/> <geometry anchor="center" width="20%" height="50%" x="50px" y="20px"/>
<reserve x="12px" y="20px" side="top" distance="4%" layer="top" exclusive="true"/>
<widget> <widget>
<test ree="test" /> <test ree="test" />
</widget> </widget>

View file

@ -14,17 +14,18 @@
(require "plugins.galaxyline") (require "plugins.galaxyline")
(require "plugins.bufferline") (require "plugins.bufferline")
(local colors (utils.colors)) ;(tset debug :traceback fennel.traceback)
(def colors (utils.colors))
(set vim.g.conjure#client#fennel#aniseed#aniseed_module_prefix "aniseed.") (set vim.g.conjure#client#fennel#aniseed#aniseed_module_prefix "aniseed.")
; Colors ------------------------------------------------------- foldstart ; Colors ------------------------------------------------------- foldstart
(utils.highlight-add (utils.highlight-add
[ "GruvboxBlueSign" "GruvboxAquaSign" "GruvboxRedSign" "GruvboxYellowSign" "GruvboxGreenSign" "GruvboxOrangeSign" "GruvboxPurpleSign"] ["GruvboxBlueSign" "GruvboxAquaSign" "GruvboxRedSign" "GruvboxYellowSign" "GruvboxGreenSign" "GruvboxOrangeSign" "GruvboxPurpleSign"]
{:bg "NONE"}) {:bg "NONE"})
@ -41,8 +42,8 @@
:disable ["lua"]} :disable ["lua"]}
:incremental_selection :incremental_selection
{ :enable true {:enable true
:keymaps { :init_selection "gss" :keymaps {:init_selection "gss"
:node_incremental "gsl" :node_incremental "gsl"
:node_decremental "gsh" :node_decremental "gsh"
:scope_incremental "gsj" :scope_incremental "gsj"
@ -52,7 +53,7 @@
;:rainbow { :enable true ;:rainbow { :enable true
;:extended_mode true} ;:extended_mode true}
:context_commentstring { :enable true}}) :context_commentstring {:enable true}})
;(nvim-biscuits.setup {} ;(nvim-biscuits.setup {}
;{ :on_events ["InsertLeave" "CursorHoldI"]}) ;{ :on_events ["InsertLeave" "CursorHoldI"]})
@ -100,14 +101,11 @@
(utils.keymap :i :<Space> newKey {:buffer true})) (utils.keymap :i :<Space> newKey {:buffer true}))
(fn _G.UnbindSpaceStuff [] (fn _G.UnbindSpaceStuff []
(if (and remapped-space (~= remapped-space {})) (when (and remapped-space (~= remapped-space {}))
(do
(utils.del-keymap :i :<Space> true) (utils.del-keymap :i :<Space> true)
(if (~= remapped-space.old "") (when (~= remapped-space.old "")
(utils.keymap :i :<Space> remapped-space.old {:buffer true})) (utils.keymap :i :<Space> remapped-space.old {:buffer true}))
(set remapped-space nil)))) (set remapped-space nil)))
@ -121,5 +119,4 @@
; foldend ; foldend
; vim:foldmarker=foldstart,foldend ; vim:foldmarker=foldstart,foldend

View file

@ -13,15 +13,15 @@
(wk.setup {})
(fn cmd [s desc] [(.. "<cmd>" s "<cr>") desc]) (fn cmd [s desc] [(.. "<cmd>" s "<cr>") desc])
(fn le [s desc] (cmd (.. "call luaeval(\"" s "\")") desc)) (fn le [s desc] (cmd (.. "call luaeval(\"" s "\")") desc))
(fn rebind [s desc] [s desc]) (fn rebind [s desc] [s desc])
(wk.setup {})
(wk.register (wk.register
{ "c" { :name "+comment out"} {"c" {:name "+comment out"}
"e" { :name "+emmet"} "e" {:name "+emmet"}
"h" (cmd "bprevious" "previous buffer") "h" (cmd "bprevious" "previous buffer")
"l" (cmd "bnext" "next buffer") "l" (cmd "bnext" "next buffer")
@ -29,7 +29,7 @@
"p" (cmd "Telescope file_browser" "Open file-browser") "p" (cmd "Telescope file_browser" "Open file-browser")
":" (cmd "Telescope commands" "Search command with fzf") ":" (cmd "Telescope commands" "Search command with fzf")
"m" { :name "+Code actions" "m" {:name "+Code actions"
"d" (cmd "Lspsaga hover_doc" "Show documentation") "d" (cmd "Lspsaga hover_doc" "Show documentation")
"b" (cmd "Lspsaga lsp_finder" "Find stuff") "b" (cmd "Lspsaga lsp_finder" "Find stuff")
"x" (cmd "Lspsaga preview_definition" "Preview definition") "x" (cmd "Lspsaga preview_definition" "Preview definition")
@ -49,43 +49,43 @@
"f" [vim.lsp.buf.formatting "format file"] "f" [vim.lsp.buf.formatting "format file"]
"h" (cmd "RustToggleInlayHints" "Toggle inlay hints")} "h" (cmd "RustToggleInlayHints" "Toggle inlay hints")}
"f" { :name "+folds" "f" {:name "+folds"
"o" (cmd "foldopen" "open fold") "o" (cmd "foldopen" "open fold")
"n" (cmd "foldclose" "close fold") "n" (cmd "foldclose" "close fold")
"j" (rebind "zj" "jump to next fold") "j" (rebind "zj" "jump to next fold")
"k" (rebind "zk" "jump to previous fold")} "k" (rebind "zk" "jump to previous fold")}
"v" { :name "+view-and-layout" "v" {:name "+view-and-layout"
"n" (cmd "set relativenumber!" "toggle relative numbers") "n" (cmd "set relativenumber!" "toggle relative numbers")
"m" (cmd "set nonumber! norelativenumber" "toggle numbers") "m" (cmd "set nonumber! norelativenumber" "toggle numbers")
"g" (cmd "Goyo | set linebreak" "toggle focus mode") "g" (cmd "Goyo | set linebreak" "toggle focus mode")
"i" (cmd "IndentGuidesToggle" "toggle indent guides")} "i" (cmd "IndentGuidesToggle" "toggle indent guides")}
"b" { :name "+buffers" "b" {:name "+buffers"
"b" (cmd "Buffers" "select open buffer") "b" (cmd "Buffers" "select open buffer")
"c" (cmd "bdelete!" "close open buffer") "c" (cmd "bdelete!" "close open buffer")
"w" (cmd "bwipeout!" "wipeout open buffer")}} "w" (cmd "bwipeout!" "wipeout open buffer")}}
{ :prefix "<leader>"}) {:prefix "<leader>"})
(wk.register (wk.register
{ "<tab>" "which_key_ignore" {"<tab>" "which_key_ignore"
"gss" "init selection" "gss" "init selection"
"z" { :name "+folds" "z" {:name "+folds"
"c" (cmd "foldclose" "close fold") "c" (cmd "foldclose" "close fold")
"o" (cmd "foldopen" "open fold")}}) "o" (cmd "foldopen" "open fold")}})
(wk.register (wk.register
{ "<tab>" "which_key_ignore"} {"<tab>" "which_key_ignore"}
{ :mode "i"}) {:mode "i"})
(wk.register (wk.register
{ :name "+Selection" {:name "+Selection"
"j" "increment selection" "j" "increment selection"
"k" "decrement selection" "k" "decrement selection"
"l" "increment node" "l" "increment node"
"h" "decrement node"} "h" "decrement node"}
{ :prefix "gs" {:prefix "gs"
:mode "v"}) :mode "v"})

View file

@ -8,11 +8,11 @@
(local colors (utils.colors)) (local colors (utils.colors))
; :h bufferline-lua-highlights ; :h bufferline-lua-highlights
(let [selected { :guibg colors.neutral_aqua :guifg colors.dark0 :gui ""} (let [selected {:guibg colors.neutral_aqua :guifg colors.dark0 :gui ""}
visible { :guibg colors.dark1 :guifg colors.neutral_aqua :gui ""}] visible {:guibg colors.dark1 :guifg colors.neutral_aqua :gui ""}]
(bufferline.setup (bufferline.setup
{ :options {:options
{ :diagnostics "nvim_lsp" {:diagnostics "nvim_lsp"
:diagnostics_indicator (fn [cnt lvl diagnostics-dict] (.. " (" cnt ")")) :diagnostics_indicator (fn [cnt lvl diagnostics-dict] (.. " (" cnt ")"))
:show_buffer_close_icons false :show_buffer_close_icons false
:show_close_icon false :show_close_icon false
@ -22,7 +22,7 @@
; https://github.com/akinsho/nvim-bufferline.lua/blob/4ebab39af2376b850724dd29c29579c8e024abe6/lua/bufferline/config.lua#L74 ; https://github.com/akinsho/nvim-bufferline.lua/blob/4ebab39af2376b850724dd29c29579c8e024abe6/lua/bufferline/config.lua#L74
:highlights :highlights
{ :fill { :guibg colors.dark0 :guifg colors.light0} {:fill {:guibg colors.dark0 :guifg colors.light0}
:background visible :background visible
:buffer_visible visible :buffer_visible visible
:buffer_selected selected :buffer_selected selected
@ -40,17 +40,17 @@
:duplicate_visible visible :duplicate_visible visible
:duplicate_selected selected :duplicate_selected selected
:diagnostic { :gui "" :guibg colors.dark1 :guifg colors.neutral_red} :diagnostic {:gui "" :guibg colors.dark1 :guifg colors.neutral_red}
:diagnostic_visible { :gui "" :guibg colors.dark1 :guifg colors.neutral_red} :diagnostic_visible {:gui "" :guibg colors.dark1 :guifg colors.neutral_red}
:diagnostic_selected { :gui "" :guibg colors.neutral_aqua :guifg colors.faded_red} :diagnostic_selected {:gui "" :guibg colors.neutral_aqua :guifg colors.faded_red}
:info_diagnostic { :gui "" :guibg colors.dark1 :guifg colors.neutral_blue} :info_diagnostic {:gui "" :guibg colors.dark1 :guifg colors.neutral_blue}
:info_diagnostic_visible { :gui "" :guibg colors.dark1 :guifg colors.neutral_blue} :info_diagnostic_visible {:gui "" :guibg colors.dark1 :guifg colors.neutral_blue}
:info_diagnostic_selected { :gui "" :guibg colors.neutral_aqua :guifg colors.faded_blue} :info_diagnostic_selected {:gui "" :guibg colors.neutral_aqua :guifg colors.faded_blue}
:warning_diagnostic { :gui "" :guibg colors.dark1 :guifg colors.neutral_yellow} :warning_diagnostic {:gui "" :guibg colors.dark1 :guifg colors.neutral_yellow}
:warning_diagnostic_visible { :gui "" :guibg colors.dark1 :guifg colors.neutral_yellow} :warning_diagnostic_visible {:gui "" :guibg colors.dark1 :guifg colors.neutral_yellow}
:warning_diagnostic_selected { :gui "" :guibg colors.neutral_aqua :guifg colors.faded_yellow} :warning_diagnostic_selected {:gui "" :guibg colors.neutral_aqua :guifg colors.faded_yellow}
:separator visible :separator visible
:indicator_selected {:guibg colors.neutral_aqua :guifg colors.neutral_aqua} :indicator_selected {:guibg colors.neutral_aqua :guifg colors.neutral_aqua}
@ -61,5 +61,5 @@
:tab {:guibg colors.bright_yellow :guifg colors.bright_yellow}}})) :tab {:guibg colors.bright_yellow :guifg colors.bright_yellow}}}))
(utils.highlight :BufferLineInfoSelected { :bg colors.neutral_aqua :fg colors.dark0 :gui "NONE"}) (utils.highlight :BufferLineInfoSelected {:bg colors.neutral_aqua :fg colors.dark0 :gui "NONE"})

View file

@ -15,23 +15,23 @@
(local colors (utils.colors)) (local colors (utils.colors))
(local modes (local modes
{ :n { :text "NORMAL" :colors { :bg colors.neutral_aqua :fg colors.dark0}} {:n {:text "NORMAL" :colors {:bg colors.neutral_aqua :fg colors.dark0}}
:i { :text "INSERT" :colors { :bg colors.neutral_yellow :fg colors.dark0}} :i {:text "INSERT" :colors {:bg colors.neutral_yellow :fg colors.dark0}}
:c { :text "CMD" :colors { :bg colors.neutral_aqua :fg colors.dark0}} :c {:text "CMD" :colors {:bg colors.neutral_aqua :fg colors.dark0}}
:ce { :text "NORMEX" :colors { :bg colors.neutral_aqua :fg colors.dark0}} :ce {:text "NORMEX" :colors {:bg colors.neutral_aqua :fg colors.dark0}}
:cv { :text "EX" :colors { :bg colors.neutral_aqua :fg colors.dark0}} :cv {:text "EX" :colors {:bg colors.neutral_aqua :fg colors.dark0}}
:ic { :text "INSCOMP" :colors { :bg colors.neutral_aqua :fg colors.dark0}} :ic {:text "INSCOMP" :colors {:bg colors.neutral_aqua :fg colors.dark0}}
:no { :text "OP-PENDING" :colors { :bg colors.neutral_aqua :fg colors.dark0}} :no {:text "OP-PENDING" :colors {:bg colors.neutral_aqua :fg colors.dark0}}
:r { :text "HIT-ENTER" :colors { :bg colors.neutral_aqua :fg colors.dark0}} :r {:text "HIT-ENTER" :colors {:bg colors.neutral_aqua :fg colors.dark0}}
:r? { :text "CONFIRM" :colors { :bg colors.neutral_aqua :fg colors.dark0}} :r? {:text "CONFIRM" :colors {:bg colors.neutral_aqua :fg colors.dark0}}
:R { :text "REPLACE" :colors { :bg colors.neutral_aqua :fg colors.dark0}} :R {:text "REPLACE" :colors {:bg colors.neutral_aqua :fg colors.dark0}}
:Rv { :text "VIRTUAL" :colors { :bg colors.neutral_aqua :fg colors.dark0}} :Rv {:text "VIRTUAL" :colors {:bg colors.neutral_aqua :fg colors.dark0}}
:s { :text "SELECT" :colors { :bg colors.neutral_aqua :fg colors.dark0}} :s {:text "SELECT" :colors {:bg colors.neutral_aqua :fg colors.dark0}}
:S { :text "SELECT" :colors { :bg colors.neutral_aqua :fg colors.dark0}} :S {:text "SELECT" :colors {:bg colors.neutral_aqua :fg colors.dark0}}
:t { :text "TERM" :colors { :bg colors.neutral_aqua :fg colors.dark0}} :t {:text "TERM" :colors {:bg colors.neutral_aqua :fg colors.dark0}}
:v { :text "VISUAL" :colors { :bg colors.neutral_blue :fg colors.dark0}} :v {:text "VISUAL" :colors {:bg colors.neutral_blue :fg colors.dark0}}
:V { :text "VISUAL LINE" :colors { :bg colors.neutral_blue :fg colors.dark0}} :V {:text "VISUAL LINE" :colors {:bg colors.neutral_blue :fg colors.dark0}}
"" { :text "VISUAL BLOCK" :colors { :bg colors.neutral_blue :fg colors.dark0}}}) "" {:text "VISUAL BLOCK" :colors {:bg colors.neutral_blue :fg colors.dark0}}})
(fn buf-name-empty? [] (fn buf-name-empty? []
@ -39,15 +39,14 @@
(fn get-current-file-name [] (fn get-current-file-name []
(let [file (nvim.fn.expand "%:t")] (let [file (nvim.fn.expand "%:t")]
(if (if (a.empty? file) ""
(a.empty? file) ""
nvim.bo.readonly (.. "RO " file) nvim.bo.readonly (.. "RO " file)
(and nvim.bo.modifiable nvim.bo.modified) (.. file " ") (and nvim.bo.modifiable nvim.bo.modified) (.. file " ")
file))) file)))
(fn get-mode-data [] (fn get-mode-data []
(or (. modes (nvim.fn.mode)) (or (. modes (nvim.fn.mode))
{ :text (nvim.fn.mode) {:text (nvim.fn.mode)
:colors {:bg colors.neutral_orange :fg colors.dark0}})) :colors {:bg colors.neutral_orange :fg colors.dark0}}))
(fn vim-mode-provider [] (fn vim-mode-provider []
@ -61,10 +60,10 @@
(set galaxyline.section.left (set galaxyline.section.left
[ { :ViMode { :provider vim-mode-provider}} [{:ViMode {:provider vim-mode-provider}}
{ :FileName { :provider get-current-file-name {:FileName {:provider get-current-file-name
:highlight [colors.light4 colors.dark1]}} :highlight [colors.light4 colors.dark1]}}
{ :Space { :provider (fn [] "") {:Space {:provider (fn [] "")
:highlight [colors.light0 colors.dark1]}}]) :highlight [colors.light0 colors.dark1]}}])
(fn make-lsp-diagnostic-provider [kind] (fn make-lsp-diagnostic-provider [kind]
@ -77,33 +76,34 @@
(if (= "master" branch) "" branch))) (if (= "master" branch) "" branch)))
(set galaxyline.section.right (set galaxyline.section.right
[ { :GitBranch { :provider git-branch-provider [{:GitBranch {:provider git-branch-provider
:highlight [colors.light4 colors.dark1]}} :highlight [colors.light4 colors.dark1]}}
{ :FileType { :provider (fn [] nvim.bo.filetype) {:FileType {:provider (fn [] nvim.bo.filetype)
:highlight [colors.neutral_aqua colors.dark1]}} :highlight [colors.neutral_aqua colors.dark1]}}
{ :DiagnosticInfo { :provider (make-lsp-diagnostic-provider "Info") {:DiagnosticInfo {:provider (make-lsp-diagnostic-provider "Info")
:highlight [colors.dark1 colors.neutral_blue]}} :highlight [colors.dark1 colors.neutral_blue]}}
{ :DiagnosticWarn { :provider (make-lsp-diagnostic-provider "Warning") {:DiagnosticWarn {:provider (make-lsp-diagnostic-provider "Warning")
:highlight [colors.dark1 colors.neutral_yellow] :highlight [colors.dark1 colors.neutral_yellow]
:separator ""}} :separator ""}}
{ :DiagnosticError { :provider (make-lsp-diagnostic-provider "Error") {:DiagnosticError {:provider (make-lsp-diagnostic-provider "Error")
:highlight [colors.dark1 colors.bright_red] :highlight [colors.dark1 colors.bright_red]
:separator ""}} :separator ""}}
{ :LineInfo { :provider (fn [] (.. " " (gl-fileinfo.line_column) " ")) {:LineInfo {:provider (fn [] (.. " " (gl-fileinfo.line_column) " "))
:highlight "GalaxyViMode" :highlight "GalaxyViMode"
:separator ""}}]) :separator ""}}])
(do (do
(fn add-segment-defaults [data] (fn add-segment-defaults [data]
(a.merge { :highlight [colors.light0 colors.dark1] (a.merge {:highlight [colors.light0 colors.dark1]
:separator " " :separator " "
:separator_highlight "StatusLine"} :separator_highlight "StatusLine"}
data)) data))
(fn map-gl-section [f section] (fn map-gl-section [f section]
(icollect [_ elem (ipairs section)] (icollect [_ elem (ipairs section)]
(collect [k v (pairs elem)] (values k (f v))))) (collect [k v (pairs elem)]
(values k (f v)))))
(set galaxyline.section.left (map-gl-section add-segment-defaults galaxyline.section.left)) (set galaxyline.section.left (map-gl-section add-segment-defaults galaxyline.section.left))
(set galaxyline.section.right (map-gl-section add-segment-defaults galaxyline.section.right))) (set galaxyline.section.right (map-gl-section add-segment-defaults galaxyline.section.right)))

View file

@ -40,6 +40,7 @@
(defn colors [] (defn colors []
{ :dark0_hard "#1d2021" { :dark0_hard "#1d2021"
:dark0 "#282828" :dark0 "#282828"