1
0
Fork 0

update configuration

This commit is contained in:
Daniel Kempkens 2024-06-19 10:10:24 +02:00
parent 9aff3f5d27
commit ce5f9e935d
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
5 changed files with 26 additions and 21 deletions

View file

@ -57,7 +57,7 @@
(keymap.set :n :<leader>dli :<cmd>LspInfo<CR> {:desc "LSP Info"}) (keymap.set :n :<leader>dli :<cmd>LspInfo<CR> {:desc "LSP Info"})
(keymap.set :n :<leader>dlr :<cmd>LspRestart<CR> {:desc "Restart LSP"}) (keymap.set :n :<leader>dlr :<cmd>LspRestart<CR> {:desc "Restart LSP"})
(keymap.set :n :<leader>ds #(vim.diagnostic.open_float {:scope :line}) (keymap.set :n :<leader>ds #(vim.diagnostic.open_float {:scope :line})
{:desc "Show Diagnostics"}) {:desc "Show Line Diagnostics"})
(keymap.set :n :<leader>dtp :<cmd>TSPlaygroundToggle<CR> (keymap.set :n :<leader>dtp :<cmd>TSPlaygroundToggle<CR>
{:desc "Toggle Treetsitter Playground"}) {:desc "Toggle Treetsitter Playground"})
;; Other Mappings ;; Other Mappings

View file

@ -41,7 +41,7 @@
(each [_ diagnostic (pairs diagnostics)] (each [_ diagnostic (pairs diagnostics)]
(let [lnum (+ diagnostic.lnum 1) (let [lnum (+ diagnostic.lnum 1)
current (cached-sign :diagnostics bufnr lnum)] current (cached-sign :diagnostics bufnr lnum)]
(when (or (= current nil) (> diagnostic.severity current.severity)) (when (or (= current nil) (< diagnostic.severity current.severity))
(tset cache :diagnostics bufnr lnum (tset cache :diagnostics bufnr lnum
{:severity diagnostic.severity {:severity diagnostic.severity
:col diagnostic.col :col diagnostic.col
@ -59,27 +59,14 @@
(when (= current nil) (when (= current nil)
(tset cache :gitsigns bufnr lnum {:name details.sign_hl_group}))))))) (tset cache :gitsigns bufnr lnum {:name details.sign_hl_group})))))))
(aucmd :DiagnosticChanged (aucmd [:BufEnter :CursorHold :CursorHoldI :DiagnosticChanged]
{:callback #(let [full-mode (. (api.nvim_get_mode) :mode)
mode (full-mode:sub 1 1)]
(when (not= mode :i)
(update-cache-diagnostics $1.buf $1.data.diagnostics)))
:group augroup
:desc "Update cached diagnostic signs"})
(aucmd :CursorHold
{:callback #(update-cache-diagnostics $1.buf {:callback #(update-cache-diagnostics $1.buf
(vim.diagnostic.get $1.buf)) (vim.diagnostic.get $1.buf))
:group augroup :group augroup
:desc "Periodically update cached diagnostics"}) :desc "Update cached diagnostic signs"})
(aucmd :InsertLeave
{:callback (fn [args]
(vim.defer_fn #(update-cache-diagnostics args.buf
(vim.diagnostic.get args.buf))
1000))
:group augroup
:desc "Update diagnostics after leaving insert mode"})
(aucmd :User {:pattern :GitSignsUpdate (aucmd :User {:pattern :GitSignsUpdate
:callback #(update-cache-gitsigns $1.buf) :callback #(when (not= $1.data nil)
(update-cache-gitsigns $1.data.buffer))
:group augroup :group augroup
:desc "Update cached gitsigns signs"}) :desc "Update cached gitsigns signs"})
(aucmd :BufWipeout (aucmd :BufWipeout

View file

@ -10,7 +10,9 @@
repo (require :nifoc.repo) repo (require :nifoc.repo)
nifoc-treesitter (require :nifoc.treesitter) nifoc-treesitter (require :nifoc.treesitter)
navic (require :nvim-navic) navic (require :nvim-navic)
neogit (require :neogit)] neogit (require :neogit)
telescope-builtin (require :telescope.builtin)
telescope-themes (require :telescope.themes)]
(fn buffer-variable-exists? [key] (fn buffer-variable-exists? [key]
(not= (. vim :b key) nil)) (not= (. vim :b key) nil))
@ -204,6 +206,8 @@
self.info self.info
self.hints])))) self.hints]))))
:update [:DiagnosticChanged :BufEnter] :update [:DiagnosticChanged :BufEnter]
:on_click {:name :heirline_diagnostics_list
:callback #(telescope-builtin.diagnostics (telescope-themes.get_ivy {:bufnr 0}))}
1 mod.space-if-count 1 mod.space-if-count
2 {:provider (fn [self] 2 {:provider (fn [self]
(let [spacer (if (or (> self.warnings 0) (let [spacer (if (or (> self.warnings 0)

View file

@ -180,6 +180,7 @@
;:freetype_render_target :HorizontalLcd ;:freetype_render_target :HorizontalLcd
:harfbuzz_features disable-ligatures-flags :harfbuzz_features disable-ligatures-flags
:allow_square_glyphs_to_overflow_width :WhenFollowedBySpace :allow_square_glyphs_to_overflow_width :WhenFollowedBySpace
:adjust_window_size_when_changing_font_size false
;; Keys ;; Keys
:keys [{:key :UpArrow :keys [{:key :UpArrow
:mods :SHIFT :mods :SHIFT

View file

@ -14,6 +14,7 @@ let
"wide" "wide"
"two-pane" "two-pane"
"column" "column"
"bsp"
]; ];
enables-layout-hud = true; enables-layout-hud = true;
enables-layout-hud-on-space-change = true; enables-layout-hud-on-space-change = true;
@ -77,14 +78,26 @@ let
toggle-float = { mod = "mod2"; key = "t"; }; toggle-float = { mod = "mod2"; key = "t"; };
select-tall-layout = { mod = "mod2"; key = "a"; }; select-tall-layout = { mod = "mod2"; key = "a"; };
select-wide-layout = { mod = "mod2"; key = "s"; };
select-fullscreen-layout = { mod = "mod2"; key = "f"; }; select-fullscreen-layout = { mod = "mod2"; key = "f"; };
select-wide-layout = { mod = "mod2"; key = "s"; };
select-two-pane-layout = { mod = "mod2"; key = "2"; };
select-column-layout = { mod = "mod2"; key = "c"; }; select-column-layout = { mod = "mod2"; key = "c"; };
select-bsp-layout = { mod = "mod2"; key = "p"; };
display-current-layout = { mod = "mod1"; key = "i"; }; display-current-layout = { mod = "mod1"; key = "i"; };
reevaluate-windows = { mod = "mod2"; key = "b"; }; reevaluate-windows = { mod = "mod2"; key = "b"; };
throw-space-left = disable-keybinding; throw-space-left = disable-keybinding;
throw-space-right = disable-keybinding; throw-space-right = disable-keybinding;
throw-space-1 = disable-keybinding;
throw-space-2 = disable-keybinding;
throw-space-3 = disable-keybinding;
throw-space-4 = disable-keybinding;
throw-space-5 = disable-keybinding;
throw-space-6 = disable-keybinding;
throw-space-7 = disable-keybinding;
throw-space-8 = disable-keybinding;
throw-space-9 = disable-keybinding;
throw-space-10 = disable-keybinding;
toggle-tiling = disable-keybinding; toggle-tiling = disable-keybinding;