February 2026
Timescale DB NixOS
Strange bug.... cannot rebuild nixos with timescale DB as postgresql-setup.service hangs.. (never comples).
Have to:
- go into
localhostpostgres and droptimescaledbandtimescaledb_toolkitextensions - rebuild nixos
- go back into
localhostand re-install extensions
Autoformat enabling and disabling
because i always forget, to enable and disable auto-formatting (conform) for a specific buffer
Vim mode ZSH
Well after many hours of searching, i found out why by default a docker container does NOT support vim mode in ZSH (I never installed the zsh vi mode plugin as it's glitchy).
Turns out we need the EDITOR variable if its set to vim or something like vi ZSH will enable vim bindings... 😆
Docer here: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html
Migration to taskfile
Need to update my readme at some point, have moved from utility script to Taskfile
Recap on magic mode replacements
gosh. i alwasy forget this. the magic modes by deafult escape most (except brackets and stuff. definitely star * symbol)
So for an example i wanted to do - replace all non star with star (realised i could have just replaced all chars would have been simpler but whatever, skill issue)
Nvim prev pos
Wow.... how have i never known this.... To go back to previous cursor positoin
- ''
- ``
` conflicts with my lua console so can use ''
Revisiting folding
So can do it like this (with LSP)
See :h vim.lsp.foldexpr() for more details on how it works
An interactive way to see it for current line is
Whereby line('.') is current line (see :h :line()) and the vim.lsp.foldexpr() takes an arg of the current line number
To use treesitter it must be
see https://neovim.io/doc/user/treesitter.html#vim.treesitter.foldexpr()
Similarly, can test it with
foldlevel / foldlevelstart
foldlevel is the active threshold for a buffer — folds deeper than N are closed.
foldlevelstart sets the initial foldlevel when a buffer opens. Default is 0 (all closed).
Treesitter and folding
Ok so claude came up with a very interesting note about treesitter and how it supports folding.
Treesitter has flags for types of treesitter (nodes?) on which to do folds. For SQL this is https://github.com/nvim-treesitter/nvim-treesitter/blob/master/queries/sql/folds.scm here where it is JUST statement notes. (WITH, SELECT) i believe but not including union selects?
So if i go into a sql file with select * .... union all select the second select is NOT a statement hence can't fold on it!
So have some options:
- use LSP for SQL?
- override treesitter to add fold commands for union/select?
also need to add fallback to indent for
:LspInfowhich is of filetypecheckhealthno supported by treesitter or LSP (i assume)
Also.... trying out the sqls and sqlls couldnt get folding to work?
Well.... checking out https://neovim.io/doc/user/lsp.html it says you need "textDocument/foldingRange" to support folding?
And with sqlls I tried:
And couldnt see it there....
Claude wrote me this a custom fallback function for folding myself?
Nvim glitching after zellij layout change
Symptoms
Intermittent nvim corruption after changing zellij pane layout:
- Display glitch - lines duplicating/overlapping when navigating up/down,
:redraw!doesnt fix, only nvim restart - Cmdline completion broken -
:Lazysubcommands no longer complete (native:e <Tab>still works) - LSP completion broken -
<C-Space>stops triggering blink.cmp completions - Which-key popup gone -
<Space>(leader) moves cursor instead of showing which-key menu, but actual leader bindings like<Space>tvstill work
All symptoms appear together in the same session, always after a zellij layout change (resize/relayout sends SIGWINCH to nvim).
Debugging process
- Initially suspected satellite.nvim (scrollbar redraws on cursor move) - disabled it, issue persisted
- Tried
:redraw!- no effect, ruling out simple terminal redraw issue - Tried narrowing to blink.cmp cmdline config - but native completion worked fine
- Noticed leader key "broken" but actual bindings still worked -> isolated to which-key popup specifically
- Ran
:checkhealthon both a working and broken nvim session, diffed the outputs
Root cause - lspsaga crashing inside which-key
The broken session's checkhealth had stack traces not present in the working session:
The chain: zellij layout change -> VimResized/WinResized -> which-key triggers re-evaluate (triggers.lua:44) -> which-key processes state (state.lua) -> calls into lspsaga's symbol/head.lua:89 which errors -> corrupts which-key's internal state -> popup dies, and the cascading error likely breaks blink.cmp's handlers too.
The broken session also had deprecation warnings (client.supports_method is deprecated, removed in Nvim 0.13) that lspsaga is triggering, suggesting it hasnt been updated for nvim 0.11.5 APIs.
Action taken
Disabled lspsaga for now to see if the issue reoccurs:
If the glitch stops, lspsaga is confirmed as the root cause and needs updating or replacing.
Treesitter folding quirk with multi-line signatures
vim.treesitter.foldexpr() breaks fold hierarchy when a function has a multi-line signature. Example:
The parameters treesitter node spans multiple lines, inflating the fold level to 3 (class > func > parameters). When parameters ends, the foldexpr never drops back to level 2 before try_statement starts its own >3. Vim sees two separate level-3 folds rather than a level-2 fold containing a level-3 fold.
Result: closing the function fold only collapses the signature (lines 108-111), not the body. The try block is a separate fold at the same level.
Key foldexpr syntax (:h fold-expr):
>N= start a new fold at level NN= continue at level N<N= end a fold at level N
Useful built-in level commands:
zm/zr= increment/decrement foldlevel by 1zM/zR= close/open all folds:set foldlevel=N= close all folds deeper than N
Single-line signatures fold correctly. This is not a treesitter parser bug - the parser correctly nests try_statement inside function_definition. The bug is in neovim's vim.treesitter.foldexpr() which translates the tree into fold levels. It counts parameters as a foldable multi-line node at the same depth as try_statement (both direct children of function_definition), so it assigns them the same level instead of treating the function body as deeper than the signature. LSP folding (vim.lsp.foldexpr()) may handle it better but LSP fold support varies by server.

