Compare commits

...

12 commits

Author SHA1 Message Date
8b2f9b6815
zsh: Add transient prompt
As an experimental change (and following my adding a transient prompt
for nushell which I like), this change adds a transient prompt plugin
for zsh. It then defines the 'tansient prompt' prompt to use starship so
functionally nothing should change about the prompt (or the rprompt),
except for being transient, showing only a character for previous prompts.

From: https://github.com/starship/starship/issues/888#issuecomment-3597694479
2025-12-12 09:50:41 +01:00
b6e84bbc99
zsh: Add fzf-tab manpage preview for commands
If a command has a manpage associated, we now display it in the
fzf-preview box that fzf-tab completion shows.
2025-12-12 09:50:40 +01:00
4b720464ff
nvim: Add floating terminal toggle mapping
Follows logic of other toggle maps for neovim, i.e. <leader>tt for
buffer-term and <leader>tT for floating term.
2025-12-12 09:50:39 +01:00
cf544e4740
zk: Check WIKIROOT before adding n alias for zk
Since this function also requires a WIKIROOT to be available in the
environment, we should only define it if that variable is not empty --
just like all the other zk aliases and functions.
2025-12-12 09:50:39 +01:00
6aa8aefe0e
nvim: Add vectorcode codecompanion extension
Installs vectorcode (the cli program) using uv (if `uv` is available on
the system), to provide a RAG tool for your repositories. Can then be
used in codecompanion to provide better coding feedback.
2025-12-12 09:50:38 +01:00
42f2b034b5
zsh: Change autosuggest strategy and max size
New combined strategy will first gather suggestions from the history,
and if none are found fall back on normal completion options (e.g. `ls `
may suggest files in current dir, etc).

Also changed the max size that completions will use as buffer to 20, so
we don't have auto suggestions for _huge_ scripts anymore.
2025-12-12 09:50:38 +01:00
e643a2e45d
zsh: Ignore commands starting with pass for history 2025-12-12 09:50:37 +01:00
d9c88d99f3
zsh: Reverse alias expansion between space and ctrl space
Previously, <space> would expand any alias and all environment
variables while <c-space> would simply put a normal space on the zle
without performing any expansion.

This change reverses this, so that nothing gets expanded by default
_but_ if the user wants to specifically expand something the option
exists to simply use <c-space> to see the expanded version.
2025-12-12 09:50:37 +01:00
5c565b61e1
nvim: Fix codecompanion-history option setting
Missing encasing opts table so the options were ignored, now added.
2025-12-12 09:50:36 +01:00
1c96ea6d81
nvim: Add superhtml lsp
Added html LSP 'superhtml' (only works for HTML5) and also use it for
formatting html (and 'shtml') files, replacing prettier.

Superhtml seems faster at formatting html and allows switching between
single-line and multi-line tags by adding/removing a space in front of
or behind an html tag, very nifty.
2025-12-12 09:50:36 +01:00
f4c439d58e
nvim: Fix nvim log spam
The logging directory in `~/.local/state/nvim/` is absurdly large in my
setup currently.

The prime culprits are `wrapping.nvim` which logs each heuristic
currently, and I've simply disabled logging for.

The bigger one is `lsp.log` which is over 1GB (!) currently, and over
100.000 of those lines were generated by the `htmx-lsp`. That's fair
since it is in early development, so I've removed it for the time being.
2025-12-12 09:50:35 +01:00
d0103297c7
qutebrowser: Fix double start page configuration 2025-12-12 09:50:35 +01:00
9 changed files with 60 additions and 34 deletions

View file

@ -2,6 +2,7 @@
"Arduino.nvim": { "branch": "main", "commit": "774b841ef0306f88318a97d5a3527baa62241f15" },
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"Navigator.nvim": { "branch": "master", "commit": "91d86506ac2a039504d5205d32a1d4bc7aa57072" },
"VectorCode": { "branch": "main", "commit": "171361ea0410e739f9bf2a04c75113cd80d3c0d0" },
"bats.vim": { "branch": "master", "commit": "6a5d2ef22b0ede503d867770afd02ebb1f97b709" },
"blink-copilot": { "branch": "main", "commit": "41e91a659bd9b8cba9ba2ea68a69b52ba5a9ebd8" },
"blink.cmp": { "branch": "main", "commit": "9bcb14b43852a6f2bfd5ac9ef29cb5cf09b1b39b" },

View file

@ -72,7 +72,7 @@ local languages = {
dap = { "delve" },
},
graphql = { format = { graphql = { "prettier" } } },
html = { lsp = { htmx = {} }, format = { html = { "prettier", "rustywind" } } },
html = { lsp = { superhtml = {} }, format = { shtml = { "superhtml" }, html = { "superhtml", "rustywind" } } },
julia = { lsp = { julials = {} }, ts = { "julia" } },
json = {
lsp = { jsonls = {} },

View file

@ -89,6 +89,16 @@ return {
{ "ibhagwan/fzf-lua", optional = true },
"ravitemer/codecompanion-history.nvim",
"jinzhongjia/codecompanion-gitcommit.nvim",
{
"Davidyz/VectorCode",
cond = vim.fn.executable("uv") == 1,
version = "*",
build = 'uv tool install -U "vectorcode[mcp,lsp]"',
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
async_backend = "lsp", -- requires cli install as `uv tool install vectorcode[lsp]`
},
},
{ -- enable mcp server agent extensions
"ravitemer/mcphub.nvim",
@ -175,11 +185,13 @@ return {
extensions = {
history = {
enabled = true,
auto_save = false,
expiration_days = 7,
opts = {
auto_save = true,
expiration_days = 14,
picker = "fzf-lua",
delete_on_clearing_chat = true,
},
},
gitcommit = {
enabled = true,
callback = "codecompanion._extensions.gitcommit",
@ -203,6 +215,7 @@ return {
show_result_in_chat = true, -- Show tool results directly in chat buffer
},
},
vectorcode = {},
},
prompt_library = {
["DevOps strategy"] = {

View file

@ -75,9 +75,11 @@ local prose_plugs = {
"andrewferrier/wrapping.nvim",
opts = {
create_keymaps = false,
create_commands = false,
notify_on_switch = false,
auto_set_mode_filetype_allowlist = prose_ft,
softener = { quarto = 2.0, markdown = 2.0, djot = 2.0 },
log_path = "/dev/null", -- disable logging for normal operations
},
ft = prose_ft,
keys = {

View file

@ -72,7 +72,8 @@ return { -- simple programmable terminal toggling for nvim
end,
cmd = { "ToggleTerm", "TermExec", "Lazygit", "Pythonterm", "Euporieterm" },
keys = {
{ "<leader>tt", ":ToggleTerm<cr>", desc = "terminal" },
{ "<leader>tt", ":ToggleTerm<cr>", desc = "terminal buffer" },
{ "<leader>tT", ":ToggleTerm direction='float'<cr>", desc = "terminal floating" },
{ "<leader>tg", ":Lazygit<cr>", desc = "git floating" },
{ "<leader>tG", ":Lazygit!<cr>", desc = "git buffer" },
{ "<leader>tp", ":Pythonterm<cr>", desc = "python floating" },

View file

@ -98,4 +98,5 @@ colorscheme = f"{state_dir}/qutebrowser/colorscheme.py"
if os.path.isfile(colorscheme):
config.source(colorscheme)
c.url.start_pages = "https://html.duckduckgo.com/lite"
c.url.start_pages = ["https://html.duckduckgo.com/lite"]
c.url.default_page = "https://html.duckduckgo.com/lite"

View file

@ -30,5 +30,3 @@ c.url.searchengines = {
"w": "https://en.wikipedia.org/w/index.php?search={}",
"yt": "https://yewtu.be/search?q={}",
}
c.url.default_page = "https://start.duckduckgo.com"
c.url.start_pages = ["https://start.duckduckgo.com"]

View file

@ -29,6 +29,7 @@ if command -v zr >/dev/null 2>&1; then
zdharma-continuum/fast-syntax-highlighting \
zsh-users/zsh-autosuggestions \
zsh-users/zsh-completions \
olets/zsh-transient-prompt \
)
else # or manually
@ -43,9 +44,13 @@ else # or manually
[ -e $PLUG_FOLDER/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ] && source $PLUG_FOLDER/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
[ -e $PLUG_FOLDER/alias-tips/alias-tips.plugin.zsh ] && source $PLUG_FOLDER/alias-tips/alias-tips.plugin.zsh
[ -e $PLUG_FOLDER/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh ] && source $PLUG_FOLDER/zsh-autosuggestions/zsh-autosuggestions.plugin.zsh
[ -e $PLUG_FOLDER/zsh-transient-prompt/transient-prompt.plugin.zsh ] && source $PLUG_FOLDER/zsh-transient-prompt/transient-prompt.plugin.zsh
fi
unset PLUG_FOLDER
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20
# simple fzf-tab settings
zstyle ":fzf-tab:*" fzf-flags "--ansi" "--expect='$continuous_trigger,$print_query'" "--color=hl:$(($#headers == 0 ? 108 : 255))" "--nth=2,3" "--layout=reverse" "--height=${FZF_TMUX_HEIGHT:-75%}" "--tiebreak=begin" "-m" "--bind=tab:down,btab:up,change:top,ctrl-space:toggle" "--cycle" "--query=$query" "--header-lines=$#headers" "--print-query"
@ -91,8 +96,11 @@ zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath'
# show systemd unit status
zstyle ':fzf-tab:complete:systemctl-*:*' fzf-preview 'SYSTEMD_COLORS=1 systemctl status $word'
# env var contents
zstyle ':fzf-tab:complete:(-command-|-parameter-|-brace-parameter-|export|unset|expand):*' \
zstyle ':fzf-tab:complete:(-parameter-|-brace-parameter-|export|unset|expand):*' \
fzf-preview 'echo ${(P)word}'
# give MAN pages for cmds or show their expanded path
zstyle ':fzf-tab:complete:-command-:*' fzf-preview \
'(out=$(tldr --color always "$word") 2>/dev/null && echo $out) || (out=$(MANWIDTH=$FZF_PREVIEW_COLUMNS man "$word") 2>/dev/null && echo $out) || (out=$(which "$word") && echo $out) || echo "${(P)word}"'
# show hostname if we are in a distrobox environment
if [ -n "$DISTROBOX_ENTER_PATH" ] && [ -f /run/.containerenv ]; then
@ -127,6 +135,9 @@ ENABLE_CORRECTION="true"
setopt autocd
eval "$(starship init zsh)"
TRANSIENT_PROMPT_PROMPT='$(starship prompt --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")'
TRANSIENT_PROMPT_RPROMPT='$(starship prompt --right --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")'
TRANSIENT_PROMPT_TRANSIENT_PROMPT='$(starship module character)'
eval "$(zoxide init zsh)"
eval "$(atuin init zsh)"
export CARAPACE_BRIDGES='zsh,fish,bash,inshellisense' # optional
@ -158,7 +169,7 @@ setopt pushd_ignore_dups
export HISTSIZE=1000000
export SAVEHIST=1000000
export HISTFILE="$XDG_DATA_HOME/zsh_history"
export HISTORY_IGNORE="(jrnl *|l *|ls *|z *|cd *|cd -|pwd|pwd *|exit|date)"
export HISTORY_IGNORE="(jrnl *|pass *|l *|ls *|z *|cd *|cd -|pwd|pwd *|exit|date)"
## Set ZSH History aliases
# Show the top 5 commands used in recent history
@ -171,16 +182,17 @@ alias history="fc -l -d -D"
### Glob Alias expansion
# Expand aliases inline - see http://blog.patshead.com/2012/11/automatically-expaning-zsh-global-aliases---simplified.html
globalias() {
if [[ $LBUFFER =~ [A-Z0-9]+$ ]]; then
zle _expand_alias
zle expand-word
fi
zle self-insert
zle magic-space
}
zle -N globalias
bindkey " " globalias
bindkey "^ " magic-space # control-space to bypass completion
bindkey -M isearch " " magic-space # normal space during searches
bindkey -M emacs "^ " globalias # expand anything when hitting <c-space>
bindkey -M viins "^ " globalias # only expand when in insert mode for vi
bindkey -M emacs " " self-insert
bindkey -M viins " " self-insert
bindkey -M vicmd " " self-insert # space puts a space, even in cmd mode
bindkey -M isearch " " self-insert # normal space during searches
# allow inserting previous arguments in the current zle input
# see https://stackoverflow.com/a/34861762
@ -234,8 +246,6 @@ bindkey -M vicmd 'C' _run-cdi
# insert-mode keybind is above, using regular fzf sourcing
bindkey -M vicmd 'T' fzf-file-widget
# space puts a space, even in cmd mode
bindkey -a ' ' magic-space
# always allow backspace/delete to remove letters
bindkey '^?' backward-delete-char
bindkey -a '^?' backward-delete-char

View file

@ -1,5 +1,7 @@
#!/usr/bin/env sh
#
# We have a local wiki
if [ -n "${WIKIROOT}" ]; then
_zk_wiki() {
zk --working-dir="$WIKIROOT" "$@"
@ -13,8 +15,6 @@ n() {
fi
}
# We have a local wiki
if [ -n "${WIKIROOT}" ]; then
# open notes with my vim zettelkasten plugin
# TODO better implementation conditional on zk.nvim & zettelkasten existing
# nvim +'lua pcall(require "zk.commands"') --headless +qa 2>&1 or similar to check - but slow