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;"/>
@ -173,10 +174,11 @@
<pxbar/>
</widget>
</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">-->
<!--<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>
<test ree="test" />
</widget>

View file

@ -14,18 +14,19 @@
(require "plugins.galaxyline")
(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.")
; Colors ------------------------------------------------------- foldstart
(utils.highlight-add
[ "GruvboxBlueSign" "GruvboxAquaSign" "GruvboxRedSign" "GruvboxYellowSign" "GruvboxGreenSign" "GruvboxOrangeSign" "GruvboxPurpleSign"]
{:bg "NONE"})
["GruvboxBlueSign" "GruvboxAquaSign" "GruvboxRedSign" "GruvboxYellowSign" "GruvboxGreenSign" "GruvboxOrangeSign" "GruvboxPurpleSign"]
{:bg "NONE"})
@ -34,25 +35,25 @@
; Treesitter ------------------------------------------------------- foldstart
(nvim-treesitter-configs.setup
{:ensure_installed "all"
:highlight {:enable true
:disable ["fennel"]}
:indent {:enable true
:disable ["lua"]}
{:ensure_installed "all"
:highlight {:enable true
:disable ["fennel"]}
:indent {:enable true
:disable ["lua"]}
:incremental_selection
{ :enable true
:keymaps { :init_selection "gss"
:node_incremental "gsl"
:node_decremental "gsh"
:scope_incremental "gsj"
:scope_decremental "gsk"}}
:incremental_selection
{:enable true
:keymaps {:init_selection "gss"
:node_incremental "gsl"
:node_decremental "gsh"
:scope_incremental "gsj"
:scope_decremental "gsk"}}
; disabled due to it fucking with gitsigns.nvim
;:rainbow { :enable true
;:extended_mode true}
; disabled due to it fucking with gitsigns.nvim
;:rainbow { :enable true
;:extended_mode true}
:context_commentstring { :enable true}})
:context_commentstring {:enable true}})
;(nvim-biscuits.setup {}
;{ :on_events ["InsertLeave" "CursorHoldI"]})
@ -83,12 +84,12 @@
(let [diffview (require "diffview")
cb (. (require "diffview.config") :diffview_callback)]
(diffview.setup
{:diff_binaries false
:file_panel {:width 35
:use_icons false}
:key_bindings {:view {:<leader>dn (cb "select_next_entry")
:<leader>dp (cb "select_prev_entry")
:<leader>dd (cb "toggle_files")}}}))
{:diff_binaries false
:file_panel {:width 35
:use_icons false}
:key_bindings {:view {:<leader>dn (cb "select_next_entry")
:<leader>dp (cb "select_prev_entry")
:<leader>dd (cb "toggle_files")}}}))
; foldend
@ -100,17 +101,14 @@
(utils.keymap :i :<Space> newKey {:buffer true}))
(fn _G.UnbindSpaceStuff []
(if (and remapped-space (~= remapped-space {}))
(do
(utils.del-keymap :i :<Space> true)
(if (~= remapped-space.old "")
(utils.keymap :i :<Space> remapped-space.old {:buffer true}))
(set remapped-space nil))))
(when (and remapped-space (~= remapped-space {}))
(utils.del-keymap :i :<Space> true)
(when (~= remapped-space.old "")
(utils.keymap :i :<Space> remapped-space.old {:buffer true}))
(set remapped-space nil)))
(nvim.command "autocmd! InsertLeave * :call v:lua.UnbindSpaceStuff()")
(utils.keymap :n "<Tab>j" ":call v:lua.RebindShit('_')<CR>")
(utils.keymap :n "<Tab>k" ":call v:lua.RebindShit('::')<CR>")
@ -121,5 +119,4 @@
; foldend
; vim:foldmarker=foldstart,foldend

View file

@ -13,80 +13,80 @@
(wk.setup {})
(fn cmd [s desc] [(.. "<cmd>" s "<cr>") desc])
(fn le [s desc] (cmd (.. "call luaeval(\"" s "\")") desc))
(fn rebind [s desc] [s desc])
(wk.setup {})
(wk.register
{ "c" { :name "+comment out"}
"e" { :name "+emmet"}
{"c" {:name "+comment out"}
"e" {:name "+emmet"}
"h" (cmd "bprevious" "previous buffer")
"l" (cmd "bnext" "next buffer")
"o" (cmd "Telescope live_grep" "Grep files")
"p" (cmd "Telescope file_browser" "Open file-browser")
":" (cmd "Telescope commands" "Search command with fzf")
"h" (cmd "bprevious" "previous buffer")
"l" (cmd "bnext" "next buffer")
"o" (cmd "Telescope live_grep" "Grep files")
"p" (cmd "Telescope file_browser" "Open file-browser")
":" (cmd "Telescope commands" "Search command with fzf")
"m" { :name "+Code actions"
"d" (cmd "Lspsaga hover_doc" "Show documentation")
"b" (cmd "Lspsaga lsp_finder" "Find stuff")
"x" (cmd "Lspsaga preview_definition" "Preview definition")
"o" (cmd "SymbolsOutline" "Outline")
"S" (cmd "Telescope lsp_document_symbols" "Symbols in document")
"s" (cmd "Telescope lsp_dynamic_workspace_symbols" "Symbols in workspace")
"t" (cmd "Lspsaga signature_help" "Show signature help")
"n" (cmd "Lspsaga rename" "Rename")
"v" (cmd "Lspsaga code_action" "Apply codeaction")
"a" (cmd "Lspsaga show_cursor_diagnostics" "Cursor diagnostics")
"A" (cmd "Lspsaga show_line_diagnostics" "Line diagnostics")
"E" (cmd "Telescope lsp_workspace_diagnostics" "List diagnostics")
"r" (cmd "Telescope lsp_references" "Show references")
"e" (cmd "LspTroubleOpen" "Show diagnostics")
"g" [vim.lsp.buf.definition "Go to definition"]
"i" [vim.lsp.buf.implementation "Show implementation"]
"f" [vim.lsp.buf.formatting "format file"]
"h" (cmd "RustToggleInlayHints" "Toggle inlay hints")}
"m" {:name "+Code actions"
"d" (cmd "Lspsaga hover_doc" "Show documentation")
"b" (cmd "Lspsaga lsp_finder" "Find stuff")
"x" (cmd "Lspsaga preview_definition" "Preview definition")
"o" (cmd "SymbolsOutline" "Outline")
"S" (cmd "Telescope lsp_document_symbols" "Symbols in document")
"s" (cmd "Telescope lsp_dynamic_workspace_symbols" "Symbols in workspace")
"t" (cmd "Lspsaga signature_help" "Show signature help")
"n" (cmd "Lspsaga rename" "Rename")
"v" (cmd "Lspsaga code_action" "Apply codeaction")
"a" (cmd "Lspsaga show_cursor_diagnostics" "Cursor diagnostics")
"A" (cmd "Lspsaga show_line_diagnostics" "Line diagnostics")
"E" (cmd "Telescope lsp_workspace_diagnostics" "List diagnostics")
"r" (cmd "Telescope lsp_references" "Show references")
"e" (cmd "LspTroubleOpen" "Show diagnostics")
"g" [vim.lsp.buf.definition "Go to definition"]
"i" [vim.lsp.buf.implementation "Show implementation"]
"f" [vim.lsp.buf.formatting "format file"]
"h" (cmd "RustToggleInlayHints" "Toggle inlay hints")}
"f" { :name "+folds"
"o" (cmd "foldopen" "open fold")
"n" (cmd "foldclose" "close fold")
"j" (rebind "zj" "jump to next fold")
"k" (rebind "zk" "jump to previous fold")}
"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")
"i" (cmd "IndentGuidesToggle" "toggle indent guides")}
"f" {:name "+folds"
"o" (cmd "foldopen" "open fold")
"n" (cmd "foldclose" "close fold")
"j" (rebind "zj" "jump to next fold")
"k" (rebind "zk" "jump to previous fold")}
"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")
"i" (cmd "IndentGuidesToggle" "toggle indent guides")}
"b" { :name "+buffers"
"b" (cmd "Buffers" "select open buffer")
"c" (cmd "bdelete!" "close open buffer")
"w" (cmd "bwipeout!" "wipeout open buffer")}}
"b" {:name "+buffers"
"b" (cmd "Buffers" "select open buffer")
"c" (cmd "bdelete!" "close open buffer")
"w" (cmd "bwipeout!" "wipeout open buffer")}}
{ :prefix "<leader>"})
{:prefix "<leader>"})
(wk.register
{ "<tab>" "which_key_ignore"
"gss" "init selection"
"z" { :name "+folds"
"c" (cmd "foldclose" "close fold")
"o" (cmd "foldopen" "open fold")}})
{"<tab>" "which_key_ignore"
"gss" "init selection"
"z" {:name "+folds"
"c" (cmd "foldclose" "close fold")
"o" (cmd "foldopen" "open fold")}})
(wk.register
{ "<tab>" "which_key_ignore"}
{ :mode "i"})
{"<tab>" "which_key_ignore"}
{:mode "i"})
(wk.register
{ :name "+Selection"
"j" "increment selection"
"k" "decrement selection"
"l" "increment node"
"h" "decrement node"}
{ :prefix "gs"
:mode "v"})
{:name "+Selection"
"j" "increment selection"
"k" "decrement selection"
"l" "increment node"
"h" "decrement node"}
{:prefix "gs"
:mode "v"})
(set nvim.o.timeoutlen 200)

View file

@ -8,58 +8,58 @@
(local colors (utils.colors))
; :h bufferline-lua-highlights
(let [selected { :guibg colors.neutral_aqua :guifg colors.dark0 :gui ""}
visible { :guibg colors.dark1 :guifg colors.neutral_aqua :gui ""}]
(bufferline.setup
{ :options
{ :diagnostics "nvim_lsp"
:diagnostics_indicator (fn [cnt lvl diagnostics-dict] (.. " (" cnt ")"))
:show_buffer_close_icons false
:show_close_icon false
:show_tab_indicators false
:enforce_regular_tabs false
:tab_size 10}
(let [selected {:guibg colors.neutral_aqua :guifg colors.dark0 :gui ""}
visible {:guibg colors.dark1 :guifg colors.neutral_aqua :gui ""}]
(bufferline.setup
{:options
{:diagnostics "nvim_lsp"
:diagnostics_indicator (fn [cnt lvl diagnostics-dict] (.. " (" cnt ")"))
:show_buffer_close_icons false
:show_close_icon false
:show_tab_indicators false
:enforce_regular_tabs false
:tab_size 10}
; https://github.com/akinsho/nvim-bufferline.lua/blob/4ebab39af2376b850724dd29c29579c8e024abe6/lua/bufferline/config.lua#L74
:highlights
{ :fill { :guibg colors.dark0 :guifg colors.light0}
:background visible
:buffer_visible visible
:buffer_selected selected
:modified visible
:modified_visible visible
:modified_selected selected
:error visible
:error_selected selected
:error_visible selected
:warning visible
:warning_selected selected
:warning_visible visible
; https://github.com/akinsho/nvim-bufferline.lua/blob/4ebab39af2376b850724dd29c29579c8e024abe6/lua/bufferline/config.lua#L74
:highlights
{:fill {:guibg colors.dark0 :guifg colors.light0}
:background visible
:buffer_visible visible
:buffer_selected selected
:modified visible
:modified_visible visible
:modified_selected selected
:error visible
:error_selected selected
:error_visible selected
:warning visible
:warning_selected selected
:warning_visible visible
:duplicate visible
:duplicate_visible visible
:duplicate_selected selected
:duplicate visible
:duplicate_visible visible
:duplicate_selected selected
:diagnostic { :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 {: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}
:info_diagnostic { :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 {: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}
:warning_diagnostic { :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 {: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}
:separator visible
:indicator_selected {:guibg colors.neutral_aqua :guifg colors.neutral_aqua}
:separator visible
:indicator_selected {:guibg colors.neutral_aqua :guifg colors.neutral_aqua}
; stuff I've never seen before :thonk:
:pick_selected {:guibg colors.bright_red :guifg colors.bright_red}
:tab_selected {:guibg colors.bright_green :guifg colors.bright_green}
:tab {:guibg colors.bright_yellow :guifg colors.bright_yellow}}}))
; stuff I've never seen before :thonk:
:pick_selected {:guibg colors.bright_red :guifg colors.bright_red}
:tab_selected {:guibg colors.bright_green :guifg colors.bright_green}
: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 modes
{ :n { :text "NORMAL" :colors { :bg colors.neutral_aqua :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}}
:ce { :text "NORMEX" :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}}
: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 "CONFIRM" :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}}
: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}}
:v { :text "VISUAL" :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}}})
{:n {:text "NORMAL" :colors {:bg colors.neutral_aqua :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}}
:ce {:text "NORMEX" :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}}
: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 "CONFIRM" :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}}
: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}}
:v {:text "VISUAL" :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}}})
(fn buf-name-empty? []
@ -39,16 +39,15 @@
(fn get-current-file-name []
(let [file (nvim.fn.expand "%:t")]
(if
(a.empty? file) ""
nvim.bo.readonly (.. "RO " file)
(and nvim.bo.modifiable nvim.bo.modified) (.. file " ")
file)))
(if (a.empty? file) ""
nvim.bo.readonly (.. "RO " file)
(and nvim.bo.modifiable nvim.bo.modified) (.. file " ")
file)))
(fn get-mode-data []
(or (. modes (nvim.fn.mode))
{ :text (nvim.fn.mode)
:colors {:bg colors.neutral_orange :fg colors.dark0}}))
{:text (nvim.fn.mode)
:colors {:bg colors.neutral_orange :fg colors.dark0}}))
(fn vim-mode-provider []
(let [modedata (get-mode-data)]
@ -61,11 +60,11 @@
(set galaxyline.section.left
[ { :ViMode { :provider vim-mode-provider}}
{ :FileName { :provider get-current-file-name
:highlight [colors.light4 colors.dark1]}}
{ :Space { :provider (fn [] "")
:highlight [colors.light0 colors.dark1]}}])
[{:ViMode {:provider vim-mode-provider}}
{:FileName {:provider get-current-file-name
:highlight [colors.light4 colors.dark1]}}
{:Space {:provider (fn [] "")
:highlight [colors.light0 colors.dark1]}}])
(fn make-lsp-diagnostic-provider [kind]
(fn []
@ -77,33 +76,34 @@
(if (= "master" branch) "" branch)))
(set galaxyline.section.right
[ { :GitBranch { :provider git-branch-provider
:highlight [colors.light4 colors.dark1]}}
{ :FileType { :provider (fn [] nvim.bo.filetype)
:highlight [colors.neutral_aqua colors.dark1]}}
[{:GitBranch {:provider git-branch-provider
:highlight [colors.light4 colors.dark1]}}
{:FileType {:provider (fn [] nvim.bo.filetype)
:highlight [colors.neutral_aqua colors.dark1]}}
{ :DiagnosticInfo { :provider (make-lsp-diagnostic-provider "Info")
:highlight [colors.dark1 colors.neutral_blue]}}
{ :DiagnosticWarn { :provider (make-lsp-diagnostic-provider "Warning")
:highlight [colors.dark1 colors.neutral_yellow]
:separator ""}}
{ :DiagnosticError { :provider (make-lsp-diagnostic-provider "Error")
:highlight [colors.dark1 colors.bright_red]
:separator ""}}
{ :LineInfo { :provider (fn [] (.. " " (gl-fileinfo.line_column) " "))
:highlight "GalaxyViMode"
:separator ""}}])
{:DiagnosticInfo {:provider (make-lsp-diagnostic-provider "Info")
:highlight [colors.dark1 colors.neutral_blue]}}
{:DiagnosticWarn {:provider (make-lsp-diagnostic-provider "Warning")
:highlight [colors.dark1 colors.neutral_yellow]
:separator ""}}
{:DiagnosticError {:provider (make-lsp-diagnostic-provider "Error")
:highlight [colors.dark1 colors.bright_red]
:separator ""}}
{:LineInfo {:provider (fn [] (.. " " (gl-fileinfo.line_column) " "))
:highlight "GalaxyViMode"
:separator ""}}])
(do
(fn add-segment-defaults [data]
(a.merge { :highlight [colors.light0 colors.dark1]
:separator " "
:separator_highlight "StatusLine"}
data))
(a.merge {:highlight [colors.light0 colors.dark1]
:separator " "
:separator_highlight "StatusLine"}
data))
(fn map-gl-section [f 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.right (map-gl-section add-segment-defaults galaxyline.section.right)))

View file

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