improve nvim formatting

This commit is contained in:
elkowar 2021-06-14 10:44:59 +02:00
parent a54384fa2b
commit 74e8063bfc
No known key found for this signature in database
GPG key ID: E321AD71B1D1F27F
7 changed files with 33 additions and 7 deletions

View file

@ -12,9 +12,11 @@
<def name="test"> <def name="test">
<box class="{{some_var}}" space-evenly="false" spacing="10"> <box class="{{some_var}}" space-evenly="false" spacing="10">
<scale value="{{scaleval}}" orientation="v" min="0" max="100" flipped="true" />
<box space-evenly="false" orientation="v"> <box space-evenly="false" orientation="v">
asdasdfflmao asdasdfflmao
<box> |  {{ round((EWW_NET["enp34s0"].NET_UP) * 8 / (1024 * 1024), 2)}} <box> |  {{ round((EWW_NET["enp34s0"].NET_UP) * 8 / (1024 * 1024), 2)}}
 {{ round((EWW_NET["enp34s0"].NET_DOWN) * 8 / (1024 * 1024), 2)}}  {{ round((EWW_NET["enp34s0"].NET_DOWN) * 8 / (1024 * 1024), 2)}}
|  {{EWW_RAM}} |  {{EWW_RAM}}
@ -27,7 +29,6 @@
asdf {{ round(0.1234, 2) }} asdf {{ round(0.1234, 2) }}
</box> </box>
<scale value="50" orientation="v" min="0" max="100" flipped="true" />
<button onclick="pgrep 'eww' &amp;&amp; echo '' || echo ''" cursor="wait">Test bug</button> <button onclick="pgrep 'eww' &amp;&amp; echo '' || echo ''" cursor="wait">Test bug</button>
<button <button
@ -110,6 +111,10 @@
</var> </var>
<var name="some_var"></var> <var name="some_var"></var>
<var name="code"></var> <var name="code"></var>
<script-var name="scaleval" interval="50ms">
echo 25
</script-var>
<var name="song-image"></var> <var name="song-image"></var>

View file

@ -37,11 +37,13 @@ in
ra = "ranger"; ra = "ranger";
gaa = "git add --all"; gaa = "git add --all";
lg = "lazygit";
gc = "git commit -m "; gc = "git commit -m ";
gp = "git push"; gp = "git push";
gst = "git status"; gst = "git status";
g = "git fuzzy"; g = "git fuzzy";
cr = "cargo run --"; cr = "cargo run --";
y = "z";
}; };
home.packages = with pkgs; lib.mkMerge [ home.packages = with pkgs; lib.mkMerge [
@ -77,7 +79,6 @@ in
gtop gtop
nix-prefetch nix-prefetch
cargo-bloat cargo-bloat
sccache
bpytop bpytop
cargo-watch cargo-watch
cargo-expand cargo-expand

View file

@ -154,6 +154,7 @@ in
initExtra = '' initExtra = ''
eval $(opam env) eval $(opam env)
eval $(luarocks path --lua-version=5.4) eval $(luarocks path --lua-version=5.4)
eval "$(zoxide init zsh)"
export MANPAGER='nvim +Man! +"set nocul" +"set noshowcmd" +"set noruler" +"set noshowmode" +"set laststatus=2" +"set statusline=\ %t"' export MANPAGER='nvim +Man! +"set nocul" +"set noshowcmd" +"set noruler" +"set noshowmode" +"set laststatus=2" +"set statusline=\ %t"'
export MANPAGER='nvim +Man! +"set nocul" +"set noshowcmd" +"set noruler" +"set noshowmode" +"set laststatus=0"' export MANPAGER='nvim +Man! +"set nocul" +"set noshowcmd" +"set noruler" +"set noshowmode" +"set laststatus=0"'

View file

@ -13,6 +13,9 @@
(utils.keymap :n :K "<Nop>") (utils.keymap :n :K "<Nop>")
(utils.keymap :v :K "<Nop>") (utils.keymap :v :K "<Nop>")
(utils.keymap :i "" "<C-w>")
(utils.keymap :i :<C-h> "<C-w>")
(utils.keymap :i :<C-BS> "<C-w>")
(utils.keymap :n :MM "<cmd>lua require('nvim-gehzu').go_to_definition()<CR>" {}) (utils.keymap :n :MM "<cmd>lua require('nvim-gehzu').go_to_definition()<CR>" {})
(utils.keymap :n :MN "<cmd>lua require('nvim-gehzu').show_definition()<CR>" {}) (utils.keymap :n :MN "<cmd>lua require('nvim-gehzu').show_definition()<CR>" {})
@ -21,6 +24,12 @@
(fn cmd [s desc] [(.. "<cmd>" s "<cr>") desc]) (fn cmd [s desc] [(.. "<cmd>" s "<cr>") desc])
(fn rebind [s desc] [s desc]) (fn rebind [s desc] [s desc])
(defn format []
(if (a.some #$1.resolved_capabilities.document_formatting (vim.lsp.get_active_clients))
(vim.lsp.buf.formatting)
(vim.cmd "Neoformat")))
(wk.setup {}) (wk.setup {})
(wk.register (wk.register
{"c" {:name "+comment out"} {"c" {:name "+comment out"}
@ -51,7 +60,8 @@
"e" (cmd "Trouble lsp_workspace_diagnostics" "Show diagnostics") "e" (cmd "Trouble lsp_workspace_diagnostics" "Show diagnostics")
"g" [vim.lsp.buf.definition "Go to definition"] "g" [vim.lsp.buf.definition "Go to definition"]
"i" [vim.lsp.buf.implementation "Show implementation"] "i" [vim.lsp.buf.implementation "Show implementation"]
"f" [vim.lsp.buf.formatting "format file"]} "f" [format "format file"]
"," (cmd "RustRunnables" "Run rust stuff")}
"f" {:name "+folds" "f" {:name "+folds"
"o" (cmd "foldopen" "open fold") "o" (cmd "foldopen" "open fold")

View file

@ -104,6 +104,8 @@
:glepnir/lspsaga.nvim {:after "vim-gruvbox8" :glepnir/lspsaga.nvim {:after "vim-gruvbox8"
:mod "dots.plugins.lspsaga"} :mod "dots.plugins.lspsaga"}
:sbdchd/neoformat {}
;; -------------------- ;; --------------------
:Olical/conjure {} :Olical/conjure {}
@ -152,6 +154,7 @@
:edwinb/idris2-vim {:ft ["idris2"]} :edwinb/idris2-vim {:ft ["idris2"]}
;:ShinKage/nvim-idris2 {} ;:ShinKage/nvim-idris2 {}
:vmchale/ats-vim {:ft ["ats" "dats" "sats"]} :vmchale/ats-vim {:ft ["ats" "dats" "sats"]}
:google/vim-jsonnet {}
:bakpakin/fennel.vim {}) :bakpakin/fennel.vim {})

View file

@ -56,7 +56,6 @@
;{:properties ["documentation" "detail" "additionalTextEdits"]}) ;{:properties ["documentation" "detail" "additionalTextEdits"]})
;(init-lsp :rust_analyzer {:capabilities capabilities})) ;(init-lsp :rust_analyzer {:capabilities capabilities}))
(init-lsp :tsserver {:root_dir (lsp.util.root_pattern "package.json")})
(init-lsp :jsonls {:commands {:Format [ #(vim.lsp.buf.range_formatting [] [0 0] [(vim.fn.line "$") 0])]}}) (init-lsp :jsonls {:commands {:Format [ #(vim.lsp.buf.range_formatting [] [0 0] [(vim.fn.line "$") 0])]}})
(init-lsp :denols {:root_dir (better_root_pattern [".git"] ["package.json"])}) (init-lsp :denols {:root_dir (better_root_pattern [".git"] ["package.json"])})
(init-lsp :hls {:settings {:languageServerHaskell {:formattingProvider "stylish-haskell"}}}) (init-lsp :hls {:settings {:languageServerHaskell {:formattingProvider "stylish-haskell"}}})
@ -66,11 +65,17 @@
(init-lsp :erlangls) (init-lsp :erlangls)
(init-lsp :yamlls) (init-lsp :yamlls)
(init-lsp :html) (init-lsp :html)
;(init-lsp :clangd)
;(init-lsp :ccls)
(init-lsp :cssls {:filestypes ["css" "scss" "less" "stylus"] (init-lsp :cssls {:filestypes ["css" "scss" "less" "stylus"]
:settings {:css {:validate true} :settings {:css {:validate true}
:less {:validate true} :less {:validate true}
:scss {:validate true}}}) :scss {:validate true}}})
(lsp.tsserver.setup {:root_dir (lsp.util.root_pattern "package.json")
:on_attach (fn [client bufnr]
(set client.resolved_capabilities.document_formatting false)
(on_attach client bufnr))})
(let [rust-tools (require "rust-tools")] (let [rust-tools (require "rust-tools")]
@ -107,7 +112,8 @@
(vim.lsp.buf_request 0 (vim.lsp.buf_request 0
:textDocument/semanticTokens/full :textDocument/semanticTokens/full
{:textDocument (vim.lsp.util.make_text_document_params)} {:textDocument (vim.lsp.util.make_text_document_params)}
nil))) nil)
vim.NIL))
(when (not lsp.idris2_lsp) (when (not lsp.idris2_lsp)
(set lsp-configs.idris2_lsp (set lsp-configs.idris2_lsp

View file

@ -205,9 +205,9 @@ interval = 600
[module/gpuinfo] [module/gpuinfo]
type = custom/script type = custom/script
exec = "sudo ~/scripts/gpuinfo.sh" exec = echo "$(radeontop -l 1 -d - | grep -o -e "gpu[^.]*" | sed "s/gpu //")%" || echo ""
format = "%{F#d3869b}%{T3}%{T-}%{F-} <label>" format = "%{F#d3869b}%{T3}%{T-}%{F-} <label>"
click-left = "~/.config/polybar/polybar-scripts/toggle_gpuinfo_window.sh 'sudo /home/leon/scripts/gpuinfo.sh --watch'" click-left = "~/.config/polybar/polybar-scripts/toggle_gpuinfo_window.sh radeontop"
interval = 2 interval = 2
[module/pulseaudio-control] [module/pulseaudio-control]