config
This commit is contained in:
parent
63ec10c09a
commit
873bf0f315
16 changed files with 515 additions and 137 deletions
186
.config/fish/completions/bun.fish
Normal file
186
.config/fish/completions/bun.fish
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
# This is terribly complicated
|
||||
# It's because:
|
||||
# 1. bun run has to have dynamic completions
|
||||
# 2. there are global options
|
||||
# 3. bun {install add remove} gets special options
|
||||
# 4. I don't know how to write fish completions well
|
||||
# Contributions very welcome!!
|
||||
|
||||
function __fish__get_bun_bins
|
||||
string split ' ' (bun getcompletes b)
|
||||
end
|
||||
|
||||
function __fish__get_bun_scripts
|
||||
set -lx SHELL bash
|
||||
set -lx MAX_DESCRIPTION_LEN 40
|
||||
string trim (string split '\n' (string split '\t' (bun getcompletes z)))
|
||||
end
|
||||
|
||||
function __fish__get_bun_packages
|
||||
if test (commandline -ct) != ""
|
||||
set -lx SHELL fish
|
||||
string split ' ' (bun getcompletes a (commandline -ct))
|
||||
end
|
||||
end
|
||||
|
||||
function __history_completions
|
||||
set -l tokens (commandline --current-process --tokenize)
|
||||
history --prefix (commandline) | string replace -r \^$tokens[1]\\s\* "" | string replace -r \^$tokens[2]\\s\* "" | string split ' '
|
||||
end
|
||||
|
||||
function __fish__get_bun_bun_js_files
|
||||
string split ' ' (bun getcompletes j)
|
||||
end
|
||||
|
||||
set -l bun_install_boolean_flags yarn production optional development no-save dry-run force no-cache silent verbose global
|
||||
set -l bun_install_boolean_flags_descriptions "Write a yarn.lock file (yarn v1)" "Don't install devDependencies" "Add dependency to optionalDependencies" "Add dependency to devDependencies" "Don't update package.json or save a lockfile" "Don't install anything" "Always request the latest versions from the registry & reinstall all dependencies" "Ignore manifest cache entirely" "Don't output anything" "Excessively verbose logging" "Use global folder"
|
||||
|
||||
set -l bun_builtin_cmds_without_run dev create help bun upgrade discord install remove add init pm x
|
||||
set -l bun_builtin_cmds_accepting_flags create help bun upgrade discord run init link unlink pm x
|
||||
|
||||
function __bun_complete_bins_scripts --inherit-variable bun_builtin_cmds_without_run -d "Emit bun completions for bins and scripts"
|
||||
# Do nothing if we already have a builtin subcommand,
|
||||
# or any subcommand other than "run".
|
||||
if __fish_seen_subcommand_from $bun_builtin_cmds_without_run
|
||||
or not __fish_use_subcommand && not __fish_seen_subcommand_from run
|
||||
return
|
||||
end
|
||||
# Do we already have a bin or script subcommand?
|
||||
set -l bins (__fish__get_bun_bins)
|
||||
if __fish_seen_subcommand_from $bins
|
||||
return
|
||||
end
|
||||
# Scripts have descriptions appended with a tab separator.
|
||||
# Strip off descriptions for the purposes of subcommand testing.
|
||||
set -l scripts (__fish__get_bun_scripts)
|
||||
if __fish_seen_subcommand_from (string split \t -f 1 -- $scripts)
|
||||
return
|
||||
end
|
||||
# Emit scripts.
|
||||
for script in $scripts
|
||||
echo $script
|
||||
end
|
||||
# Emit binaries and JS files (but only if we're doing `bun run`).
|
||||
if __fish_seen_subcommand_from run
|
||||
for bin in $bins
|
||||
echo "$bin"\t"package bin"
|
||||
end
|
||||
for file in (__fish__get_bun_bun_js_files)
|
||||
echo "$file"\t"Bun.js"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Clear existing completions
|
||||
complete -e -c bun
|
||||
|
||||
# Dynamically emit scripts and binaries
|
||||
complete -c bun -f -a "(__bun_complete_bins_scripts)"
|
||||
|
||||
# Complete flags if we have no subcommand or a flag-friendly one.
|
||||
set -l flag_applies "__fish_use_subcommand; or __fish_seen_subcommand_from $bun_builtin_cmds_accepting_flags"
|
||||
complete -c bun \
|
||||
-n $flag_applies --no-files -s 'u' -l 'origin' -r -d 'Server URL. Rewrites import paths'
|
||||
complete -c bun \
|
||||
-n $flag_applies --no-files -s 'p' -l 'port' -r -d 'Port number to start server from'
|
||||
complete -c bun \
|
||||
-n $flag_applies --no-files -s 'd' -l 'define' -r -d 'Substitute K:V while parsing, e.g. --define process.env.NODE_ENV:\"development\"'
|
||||
complete -c bun \
|
||||
-n $flag_applies --no-files -s 'e' -l 'external' -r -d 'Exclude module from transpilation (can use * wildcards). ex: -e react'
|
||||
complete -c bun \
|
||||
-n $flag_applies --no-files -l 'use' -r -d 'Use a framework (ex: next)'
|
||||
complete -c bun \
|
||||
-n $flag_applies --no-files -l 'hot' -r -d 'Enable hot reloading in Bun\'s JavaScript runtime'
|
||||
|
||||
# Complete dev and create as first subcommand.
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'dev' -d 'Start dev server'
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'create' -f -d 'Create a new project from a template'
|
||||
|
||||
# Complete "next" and "react" if we've seen "create".
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from create" -a 'next' -d 'new Next.js project'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from create" -a 'react' -d 'new React project'
|
||||
|
||||
# Complete "upgrade" as first subcommand.
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'upgrade' -d 'Upgrade bun to the latest version' -x
|
||||
# Complete "-h/--help" unconditionally.
|
||||
complete -c bun \
|
||||
-s "h" -l "help" -d 'See all commands and flags' -x
|
||||
|
||||
# Complete "-v/--version" if we have no subcommand.
|
||||
complete -c bun \
|
||||
-n "not __fish_use_subcommand" -l "version" -s "v" -d 'Bun\'s version' -x
|
||||
|
||||
# Complete additional subcommands.
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'discord' -d 'Open bun\'s Discord server' -x
|
||||
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'bun' -d 'Generate a new bundle'
|
||||
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from bun" -F -d 'Bundle this'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from create; and __fish_seen_subcommand_from react next" -F -d "Create in directory"
|
||||
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'init' -F -d 'Start an empty Bun project'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'install' -f -d 'Install packages from package.json'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'add' -F -d 'Add a package to package.json'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_use_subcommand" -a 'remove' -F -d 'Remove a package from package.json'
|
||||
|
||||
|
||||
for i in (seq (count $bun_install_boolean_flags))
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from install add remove" -l "$bun_install_boolean_flags[$i]" -d "$bun_install_boolean_flags_descriptions[$i]"
|
||||
end
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from install add remove" -l 'cwd' -d 'Change working directory'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from install add remove" -l 'cache-dir' -d 'Choose a cache directory (default: $HOME/.bun/install/cache)'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from add" -d 'Popular' -a '(__fish__get_bun_packages)'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from add" -d 'History' -a '(__history_completions)'
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from pm; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts) cache;" -a 'bin ls cache hash hash-print hash-string' -f
|
||||
|
||||
complete -c bun \
|
||||
-n "__fish_seen_subcommand_from pm; and __fish_seen_subcommand_from cache; and not __fish_seen_subcommand_from (__fish__get_bun_bins) (__fish__get_bun_scripts);" -a 'rm' -f
|
||||
|
||||
# Add built-in subcommands with descriptions.
|
||||
complete -c bun -n "__fish_use_subcommand" -a "create" -f -d "Create a new project from a template"
|
||||
complete -c bun -n "__fish_use_subcommand" -a "build bun" --require-parameter -F -d "Transpile and bundle one or more files"
|
||||
complete -c bun -n "__fish_use_subcommand" -a "upgrade" -d "Upgrade Bun"
|
||||
complete -c bun -n "__fish_use_subcommand" -a "run" -d "Run a script or package binary"
|
||||
complete -c bun -n "__fish_use_subcommand" -a "install" -d "Install dependencies from package.json" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "remove" -d "Remove a dependency from package.json" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "add" -d "Add a dependency to package.json" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "init" -d "Initialize a Bun project in this directory" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "link" -d "Register or link a local npm package" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "unlink" -d "Unregister a local npm package" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "pm" -d "Additional package management utilities" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "x" -d "Execute a package binary, installing if needed" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "outdated" -d "Display the latest versions of outdated dependencies" -f
|
||||
complete -c bun -n "__fish_use_subcommand" -a "publish" -d "Publish your package from local to npm" -f
|
||||
|
|
@ -1,8 +1,13 @@
|
|||
set fish_greeting
|
||||
|
||||
if status is-interactive
|
||||
# Commands to run in interactive sessions can go here
|
||||
end
|
||||
|
||||
set -Ux CODESTRAL_API_KEY "ZWftIpfTx8WRIryPLEAsxgvdSq5qFQzM"
|
||||
set -Ux GEMINI_API_KEY "AIzaSyDLj_88cpI9Lcn1cWt15ATbYmuZPH1ADZw"
|
||||
set -Ux ANTHROPIC_API_KEY "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"
|
||||
|
||||
|
||||
set -gx EDITOR nvim
|
||||
|
||||
fx --comp fish | source
|
||||
|
|
@ -11,4 +16,9 @@ zoxide init fish | source
|
|||
|
||||
fzf --fish | source
|
||||
|
||||
syncthing install-completions | source
|
||||
|
||||
# bun
|
||||
set --export BUN_INSTALL "$HOME/.bun"
|
||||
set --export PATH $BUN_INSTALL/bin $PATH
|
||||
|
||||
set --export PATH ~/.scripts/ $PATH
|
||||
|
|
|
|||
|
|
@ -2,3 +2,4 @@ jorgebucaran/fisher
|
|||
jhillyerd/plugin-git
|
||||
jorgebucaran/nvm.fish
|
||||
wfxr/forgit
|
||||
berk-karaal/loadenv.fish
|
||||
|
|
|
|||
|
|
@ -1,15 +1,20 @@
|
|||
# This file contains fish universal variable definitions.
|
||||
# VERSION: 3.0
|
||||
SETUVAR --export ELECTRON_OZONE_PLATFORM_HINT:auto
|
||||
SETUVAR --export ANTHROPIC_API_KEY:sk\x2dant\x2dapi03\x2dFMw8IxaPY3F325O1xsjf85pu27fQ2YPm1qqHAE1zhBZOZEEfxp6TZ1bm_e3nwH8rKKUelk5l9ubbnWElm\x2dEqMA\x2dDlv2CgAA
|
||||
SETUVAR --export BW_SESSION:nxtK9DrMCaIYFXA79A63KTkSriH3kdhdA0\x2bbkaReipqPBYUavEyxA9AXWuYnDRiYiBBBs9QC3E\x2bmI4byR1FuzA\x3d\x3d
|
||||
SETUVAR --export CLAUDE_API_KEY:sk\x2dant\x2dapi03\x2dFMw8IxaPY3F325O1xsjf85pu27fQ2YPm1qqHAE1zhBZOZEEfxp6TZ1bm_e3nwH8rKKUelk5l9ubbnWElm\x2dEqMA\x2dDlv2CgAA
|
||||
SETUVAR --export CODESTRAL_API_KEY:ZWftIpfTx8WRIryPLEAsxgvdSq5qFQzM
|
||||
SETUVAR --export FZF_DEFAULT_OPTS:\x2d\x2dwalker\x2dskip\x3d\x2esteam\x2c\x2evscode\x2c\x2ecargo\x2c\x2enpm\x2c\x2envm\x2cSteam\x2cgo\x2c\x2ecache\x2c\x2epub\x2dcache\x2c\x2erustup\x2c\x2ecfgstore
|
||||
SETUVAR --export GEMINI_API_KEY:AIzaSyDLj_88cpI9Lcn1cWt15ATbYmuZPH1ADZw
|
||||
SETUVAR --export --path PATH:/usr/local/bin\x1e/usr/local/sbin\x1e/usr/bin\x1e/usr/sbin\x1e/usr/local/go/bin
|
||||
SETUVAR --export RANGER_LOAD_DEFAULT_RC:FALSE
|
||||
SETUVAR Z_DATA_DIR:/home/foton/\x2elocal/share/z
|
||||
SETUVAR __fish_initialized:3800
|
||||
SETUVAR _fisher_berk_2D_karaal_2F_loadenv_2E_fish_files:\x7e/\x2econfig/fish/functions/loadenv\x2efish
|
||||
SETUVAR _fisher_jhillyerd_2F_plugin_2D_git_files:\x7e/\x2econfig/fish/functions/__git\x2ebranch_has_wip\x2efish\x1e\x7e/\x2econfig/fish/functions/__git\x2ecurrent_branch\x2efish\x1e\x7e/\x2econfig/fish/functions/__git\x2edefault_branch\x2efish\x1e\x7e/\x2econfig/fish/functions/__git\x2edestroy\x2efish\x1e\x7e/\x2econfig/fish/functions/__git\x2einit\x2efish\x1e\x7e/\x2econfig/fish/functions/gbage\x2efish\x1e\x7e/\x2econfig/fish/functions/gbda\x2efish\x1e\x7e/\x2econfig/fish/functions/gdv\x2efish\x1e\x7e/\x2econfig/fish/functions/gignored\x2efish\x1e\x7e/\x2econfig/fish/functions/glp\x2efish\x1e\x7e/\x2econfig/fish/functions/grename\x2efish\x1e\x7e/\x2econfig/fish/functions/grt\x2efish\x1e\x7e/\x2econfig/fish/functions/gtest\x2efish\x1e\x7e/\x2econfig/fish/functions/gtl\x2efish\x1e\x7e/\x2econfig/fish/functions/gunwip\x2efish\x1e\x7e/\x2econfig/fish/functions/gwip\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/git\x2efish
|
||||
SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish
|
||||
SETUVAR _fisher_jorgebucaran_2F_nvm_2E_fish_files:\x7e/\x2econfig/fish/functions/_nvm_index_update\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_list\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_activate\x2efish\x1e\x7e/\x2econfig/fish/functions/_nvm_version_deactivate\x2efish\x1e\x7e/\x2econfig/fish/functions/nvm\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/nvm\x2efish\x1e\x7e/\x2econfig/fish/completions/nvm\x2efish
|
||||
SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ejhillyerd/plugin\x2dgit\x1ejorgebucaran/nvm\x2efish\x1ewfxr/forgit
|
||||
SETUVAR _fisher_plugins:jorgebucaran/fisher\x1ejhillyerd/plugin\x2dgit\x1ejorgebucaran/nvm\x2efish\x1ewfxr/forgit\x1eberk\x2dkaraal/loadenv\x2efish
|
||||
SETUVAR _fisher_upgraded_to_4_4:\x1d
|
||||
SETUVAR _fisher_wfxr_2F_forgit_files:\x7e/\x2econfig/fish/conf\x2ed/bin\x1e\x7e/\x2econfig/fish/conf\x2ed/forgit\x2eplugin\x2efish\x1e\x7e/\x2econfig/fish/completions/_git\x2dforgit\x1e\x7e/\x2econfig/fish/completions/git\x2dforgit\x2ebash\x1e\x7e/\x2econfig/fish/completions/git\x2dforgit\x2efish
|
||||
SETUVAR fish_color_autosuggestion:4c566a
|
||||
|
|
@ -51,4 +56,4 @@ SETUVAR fish_pager_color_selected_background:\x2d\x2dbackground\x3dbrblack
|
|||
SETUVAR fish_pager_color_selected_completion:\x1d
|
||||
SETUVAR fish_pager_color_selected_description:\x1d
|
||||
SETUVAR fish_pager_color_selected_prefix:\x1d
|
||||
SETUVAR fish_user_paths:/home/foton/\x2elocal/bin\x1e/opt/ghostty\x1e/opt/keymapp\x1e/opt/zen\x1e/home/foton/\x2ebin/stylua\x1e/home/foton/\x2ebin/lua\x2dlsp/bin\x1e/home/foton/\x2escripts\x1e/home/foton/\x2ebin\x1e/opt/Obsidian\x1e/home/foton/go/bin\x1e/home/foton/code/dart\x2dsdk/bin\x1e/home/greg/\x2elocal/bin\x1e/home/greg/\x2ebin\x1e/home/greg/\x2ecargo/bin\x1e/home/greg/go/bin\x1e/usr/local/go/bin
|
||||
SETUVAR fish_user_paths:/var/lib/flatpak/exports/bin\x1e/home/foton/\x2elocal/bin\x1e/opt/ghostty\x1e/opt/keymapp\x1e/opt/zen\x1e/home/foton/\x2ebin/stylua\x1e/home/foton/\x2ebin/lua\x2dlsp/bin\x1e/home/foton/\x2escripts\x1e/home/foton/\x2ebin\x1e/opt/Obsidian\x1e/home/foton/go/bin\x1e/home/foton/code/dart\x2dsdk/bin\x1e/home/greg/\x2elocal/bin\x1e/home/greg/\x2ebin\x1e/home/greg/\x2ecargo/bin\x1e/home/greg/go/bin\x1e/usr/local/go/bin
|
||||
|
|
|
|||
27
.config/fish/functions/bw_open.fish
Executable file
27
.config/fish/functions/bw_open.fish
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/fish
|
||||
|
||||
function bw_open --description "Ensure Bitwarden session is valid"
|
||||
|
||||
# If no session exists OR session invalid → re-auth
|
||||
if not bw unlock --check >/dev/null 2>&1
|
||||
|
||||
echo "Unlocking Bitwarden..."
|
||||
|
||||
# Ask for password only once
|
||||
if not set -q BW_PASSWORD
|
||||
read -sP "Bitwarden master password: " BW_PASSWORD
|
||||
echo
|
||||
end
|
||||
|
||||
# Login if needed
|
||||
if not bw login --check >/dev/null 2>&1
|
||||
bw login --raw $argv[1] $BW_PASSWORD >/dev/null
|
||||
end
|
||||
|
||||
# Unlock and store as universal variable
|
||||
set -Ux BW_SESSION (bw unlock --raw $BW_PASSWORD)
|
||||
end
|
||||
|
||||
echo $BW_SESSION
|
||||
end
|
||||
|
||||
91
.config/fish/functions/loadenv.fish
Executable file
91
.config/fish/functions/loadenv.fish
Executable file
|
|
@ -0,0 +1,91 @@
|
|||
function loadenv
|
||||
builtin argparse h/help print printb U/unload -- $argv
|
||||
or return 1
|
||||
|
||||
if set -q _flag_help
|
||||
echo "Usage: loadenv [OPTIONS] [FILE]"
|
||||
echo ""
|
||||
echo "Export keys and values from a dotenv file."
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " --help, -h Show this help message"
|
||||
echo " --print Print env keys (export preview)"
|
||||
echo " --printb Print keys with surrounding brackets"
|
||||
echo " --unload, -U Unexport all keys defined in the dotenv file"
|
||||
echo ""
|
||||
echo "Arguments:"
|
||||
echo " FILE Path to dotenv file (default: .env)"
|
||||
return 0
|
||||
end
|
||||
|
||||
if test (builtin count $argv) -gt 1
|
||||
echo "Too many arguments. Only one argument is allowed. Use --help for more information."
|
||||
return 1
|
||||
end
|
||||
|
||||
set -l dotenv_file ".env"
|
||||
if test (builtin count $argv) -eq 1
|
||||
set dotenv_file $argv[1]
|
||||
end
|
||||
|
||||
if not test -f $dotenv_file
|
||||
echo "Error: File '$dotenv_file' not found in the current directory."
|
||||
return 1
|
||||
end
|
||||
|
||||
set -l mode load
|
||||
if set -q _flag_print
|
||||
set mode print
|
||||
else if set -q _flag_printb
|
||||
set mode printb
|
||||
else if set -q _flag_unload
|
||||
set mode unload
|
||||
end
|
||||
|
||||
set lineNumber 0
|
||||
|
||||
for line in (command cat $dotenv_file)
|
||||
set lineNumber (math $lineNumber + 1)
|
||||
|
||||
# Skip empty lines and comment lines
|
||||
if string match -qr '^\s*$|^\s*#' $line
|
||||
continue
|
||||
end
|
||||
|
||||
if not string match -qr '^[A-Za-z_][A-Za-z0-9_]*=' $line
|
||||
echo "Error: invalid declaration (line $lineNumber): $line"
|
||||
return 1
|
||||
end
|
||||
|
||||
# Parse key and value
|
||||
set -l key (string split -m 1 '=' $line)[1]
|
||||
set -l after_equals_sign (string split -m 1 '=' $line)[2]
|
||||
|
||||
set -l value
|
||||
set -l double_quoted_value_regex '^"(.*)"\s*(?:#.*)*$'
|
||||
set -l single_quoted_value_regex '^\'(.*)\'\s*(?:#.*)*$'
|
||||
set -l plain_value_regex '^([^\'"\s]*)\s*(?:#.*)*$'
|
||||
if string match -qgr $double_quoted_value_regex $after_equals_sign
|
||||
set value (string match -gr $double_quoted_value_regex $after_equals_sign)
|
||||
else if string match -qgr $single_quoted_value_regex $after_equals_sign
|
||||
set value (string match -gr $single_quoted_value_regex $after_equals_sign)
|
||||
else if string match -qgr $plain_value_regex $after_equals_sign
|
||||
set value (string match -gr $plain_value_regex $after_equals_sign)
|
||||
else
|
||||
echo "Error: invalid value (line $lineNumber): $line"
|
||||
return 1
|
||||
end
|
||||
|
||||
switch $mode
|
||||
case print
|
||||
echo "$key=$value"
|
||||
case printb
|
||||
echo "[$key=$value]"
|
||||
case load
|
||||
set -gx $key $value
|
||||
case unload
|
||||
set -e $key
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -1,34 +1,35 @@
|
|||
{
|
||||
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
|
||||
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
|
||||
"aerial.nvim": { "branch": "master", "commit": "5c0df1679bf7c814c924dc6646cc5291daca8363" },
|
||||
"auto-session": { "branch": "main", "commit": "2374591ad5187e6697d9b4a683027ad33771381f" },
|
||||
"blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" },
|
||||
"conform.nvim": { "branch": "master", "commit": "973f3cb73887d510321653044791d7937c7ec0fa" },
|
||||
"flash.nvim": { "branch": "main", "commit": "3c942666f115e2811e959eabbdd361a025db8b63" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"hardtime.nvim": { "branch": "main", "commit": "6d7664d5bdfaea44c5f50b29f5239fab7b00c273" },
|
||||
"LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" },
|
||||
"aerial.nvim": { "branch": "master", "commit": "7a6a42791eb2b54a7115c7db4488981f93471770" },
|
||||
"auto-session": { "branch": "main", "commit": "dcbc339a1a0e6505f755d980ad11f892b6a8d492" },
|
||||
"blink.cmp": { "branch": "main", "commit": "4b18c32adef2898f95cdef6192cbd5796c1a332d" },
|
||||
"conform.nvim": { "branch": "master", "commit": "c2526f1cde528a66e086ab1668e996d162c75f4f" },
|
||||
"flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" },
|
||||
"hardtime.nvim": { "branch": "main", "commit": "b4e431934af1fe224a3a801f632c008278cb7628" },
|
||||
"js-i18n.nvim": { "branch": "main", "commit": "5157a1c1a47b14aa77fa6e50626dc1add4d1a618" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "7f0bf635082bb9b7d2b37766054526a6ccafdb85" },
|
||||
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "21c2a84ce368e99b18f52ab348c4c02c32c02fcf" },
|
||||
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
|
||||
"mentor.nvim": { "branch": "main", "commit": "54733a923072d57e50f3acc0d850fbd0b3b95f8a" },
|
||||
"neotest": { "branch": "master", "commit": "3c81345c28cd639fcc02843ed3653be462f47024" },
|
||||
"neotest-jest": { "branch": "main", "commit": "46ccc50273838f0b48e3c4814c1c46c0ccfe9edf" },
|
||||
"minuet-ai.nvim": { "branch": "main", "commit": "3d25c24487876676d29d325c01ce108cbdbd0753" },
|
||||
"neotest": { "branch": "master", "commit": "deadfb1af5ce458742671ad3a013acb9a6b41178" },
|
||||
"neotest-jest": { "branch": "main", "commit": "3f0cc2cff1ee05394081805c622dc2551b54d8c4" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "9141be4c1332afc83bdf1b0278dbb030f75ff8e3" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "44acfe887d4056f704ccc4f17513ed41c9e2b2e6" },
|
||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||
"nvim-surround": { "branch": "main", "commit": "7a7a78a52219a3312c1fcabf880cea07a7956a5f" },
|
||||
"nvim-surround": { "branch": "main", "commit": "1098d7b3c34adcfa7feb3289ee434529abd4afd1" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "3362099de3368aa620a8105b19ed04c2053e38c0" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "5df2eab599e06c48d04ea7e89cbaa3cdb4e09538" },
|
||||
"smear-cursor.nvim": { "branch": "main", "commit": "58e69a911e7f5296b3d7fec5e7414df5a4ac91fb" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
||||
"typescript-tools.nvim": { "branch": "master", "commit": "3c501d7c7f79457932a8750a2a1476a004c5c1a9" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
||||
"render-markdown.nvim": { "branch": "main", "commit": "48b4175dbca8439d30c1f52231cbe5a712c8f9d9" },
|
||||
"smear-cursor.nvim": { "branch": "main", "commit": "c85bdbb25db096fbcf616bc4e1357bd61fe2c199" },
|
||||
"snacks.nvim": { "branch": "main", "commit": "da230e3ca8146da4b73752daaf0a1d07d343c12d" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" },
|
||||
"typescript-tools.nvim": { "branch": "master", "commit": "c2f5910074103705661e9651aa841e0d7eea9932" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ vim.keymap.set({ "n", "v" }, "d", '"_d', { desc = "delete without cut" })
|
|||
vim.keymap.set({ "n", "v" }, "c", '"_c', { desc = "delete without cut" })
|
||||
vim.keymap.set({ "v", "n" }, "vv", "<C-v>", { desc = "vv for visual block" })
|
||||
vim.keymap.set("i", "jj", "<ESC>", { silent = true, desc = "back to normal with jj" })
|
||||
vim.keymap.set("v", "p", '"_dp', { desc = "do not overwrite 0 register when pasting over selection" })
|
||||
vim.keymap.set("v", "p", '"_dP', { desc = "do not overwrite 0 register when pasting over selection" })
|
||||
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
||||
-- for people to discover. Otherwise, you normally need to pres <C-\><C-n>, which
|
||||
-- is not what someone will guess without a bit more experience.
|
||||
|
|
@ -80,3 +80,4 @@ end, { desc = "show diagnostics in floating window" })
|
|||
|
||||
vim.keymap.set("n", "<leader>j", ":try | cprev | catch | clast | catch | endtry<cr>zz", { desc = "quickfix prev" })
|
||||
vim.keymap.set("n", "<leader>k", ":try | cnext | catch | cfirst | catch | endtry<cr>zz", { desc = "quickfix next" })
|
||||
vim.keymap.set("n", "<leader>qf", ":Cfilter! ", { desc = "quickfix filter" })
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ vim.opt.shiftwidth = 2 -- insert 4 spaces on a tab
|
|||
vim.opt.expandtab = true -- tabs are spaces, mainly because of python
|
||||
|
||||
-- UI config
|
||||
vim.opt.number = true -- show absolute number
|
||||
vim.opt.relativenumber = true -- add numbers to each line on the left side
|
||||
vim.opt.number = false -- show absolute number
|
||||
vim.opt.relativenumber = false -- add numbers to each line on the left side
|
||||
vim.opt.cursorline = true -- highlight cursor line underneath the cursor horizontally
|
||||
vim.opt.splitbelow = true -- open new vertical split bottom
|
||||
vim.opt.splitright = true -- open new horizontal splits right
|
||||
|
|
@ -55,8 +55,8 @@ end)
|
|||
-- Save undo history
|
||||
vim.opt.undofile = true
|
||||
|
||||
-- Keep signcolumn on by default
|
||||
vim.opt.signcolumn = "yes"
|
||||
-- Off signcolumn on by default
|
||||
vim.opt.signcolumn = "no"
|
||||
|
||||
-- Decrease update time
|
||||
vim.opt.updatetime = 250
|
||||
|
|
|
|||
|
|
@ -4,20 +4,34 @@ return {
|
|||
highlight_on_hover = true,
|
||||
highlight_on_jump = 300,
|
||||
autojump = true,
|
||||
post_jump_cmd = "normal! zz",
|
||||
post_jump_cmd = "normal! zzl",
|
||||
filter_kind = {
|
||||
"Array",
|
||||
"Boolean",
|
||||
"Class",
|
||||
"Constant",
|
||||
"Constructor",
|
||||
"Enum",
|
||||
"EnumMember",
|
||||
"Event",
|
||||
"Field",
|
||||
"File",
|
||||
"Function",
|
||||
"Interface",
|
||||
"Module",
|
||||
"Key",
|
||||
"Method",
|
||||
"Struct",
|
||||
"Module",
|
||||
"Namespace",
|
||||
"Null",
|
||||
"Number",
|
||||
"Object",
|
||||
"Operator",
|
||||
"Package",
|
||||
"Property",
|
||||
"String",
|
||||
"Struct",
|
||||
"TypeParameter",
|
||||
"Variable",
|
||||
},
|
||||
},
|
||||
-- Optional dependencies
|
||||
|
|
@ -30,10 +44,20 @@ return {
|
|||
"<leader>ss",
|
||||
function()
|
||||
require("aerial").snacks_picker({
|
||||
layout = "left",
|
||||
layout = {
|
||||
cycle = true,
|
||||
width = 1,
|
||||
min_width = 1,
|
||||
min_height = 1,
|
||||
height = 1,
|
||||
--- Use the default layout or vertical if the window is too narrow
|
||||
preset = function()
|
||||
return vim.o.columns >= 120 and "default" or "vertical"
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
desc = "LSP Symbols",
|
||||
desc = "Symbols",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,79 +4,72 @@ return {
|
|||
{ "L3MON4D3/LuaSnip", version = "v2.*" },
|
||||
},
|
||||
version = "1.*",
|
||||
opts = {
|
||||
fuzzy = {
|
||||
-- implementation = "rust",
|
||||
use_frecency = true,
|
||||
use_proximity = true,
|
||||
use_unsafe_no_lock = false,
|
||||
sorts = {
|
||||
-- function(a, b)
|
||||
-- if (a.client_name == nil or b.client_name == nil) or (a.client_name == b.client_name) then
|
||||
-- return
|
||||
-- end
|
||||
-- return b.client_name == "emmet_language_server"
|
||||
-- end,
|
||||
"exact",
|
||||
"score",
|
||||
"sort_text",
|
||||
config = function()
|
||||
require("blink.cmp").setup({
|
||||
fuzzy = {
|
||||
frecency = {
|
||||
enabled = true,
|
||||
unsafe_no_lock = false,
|
||||
},
|
||||
use_proximity = true,
|
||||
sorts = {
|
||||
-- "exact",
|
||||
"score",
|
||||
"sort_text",
|
||||
"label",
|
||||
},
|
||||
},
|
||||
},
|
||||
keymap = {
|
||||
preset = "enter",
|
||||
["<C-space>"] = { "hide", "show", "fallback" },
|
||||
},
|
||||
completion = {
|
||||
trigger = {
|
||||
-- show_in_snippet = false,
|
||||
keymap = {
|
||||
preset = "enter",
|
||||
["<C-space>"] = { "hide", "show", "fallback" },
|
||||
["<A-y>"] = require("minuet").make_blink_map(),
|
||||
},
|
||||
-- Disable showing for all alphanumeric keywords by default. Prefer LSP specific trigger
|
||||
-- characters.
|
||||
-- trigger = { show_on_keyword = false },
|
||||
-- Controls whether the documentation window will automatically show when selecting a completion item
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 500,
|
||||
window = {
|
||||
completion = {
|
||||
trigger = {
|
||||
prefetch_on_insert = false,
|
||||
-- show_in_snippet = false,
|
||||
},
|
||||
-- Disable showing for all alphanumeric keywords by default. Prefer LSP specific trigger
|
||||
-- characters.
|
||||
-- trigger = { show_on_keyword = false },
|
||||
-- Controls whether the documentation window will automatically show when selecting a completion item
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 500,
|
||||
window = {
|
||||
border = "rounded",
|
||||
scrollbar = false,
|
||||
},
|
||||
},
|
||||
menu = {
|
||||
border = "rounded",
|
||||
draw = { gap = 2 },
|
||||
scrollbar = false,
|
||||
},
|
||||
},
|
||||
menu = {
|
||||
border = "rounded",
|
||||
draw = { gap = 2 },
|
||||
scrollbar = false,
|
||||
},
|
||||
},
|
||||
snippets = { preset = "luasnip" },
|
||||
sources = {
|
||||
-- add lazydev to your completion providers
|
||||
default = { "lazydev", "snippets", "lsp", "path", "buffer" },
|
||||
providers = {
|
||||
lazydev = {
|
||||
name = "LazyDev",
|
||||
module = "lazydev.integrations.blink",
|
||||
-- make lazydev completions top priority (see `:h blink.cmp`)
|
||||
score_offset = 100,
|
||||
snippets = { preset = "luasnip" },
|
||||
sources = {
|
||||
-- add lazydev to your completion providers
|
||||
default = { "lazydev", "lsp", "snippets", "path", "buffer" },
|
||||
providers = {
|
||||
lazydev = {
|
||||
name = "LazyDev",
|
||||
module = "lazydev.integrations.blink",
|
||||
-- make lazydev completions top priority (see `:h blink.cmp`)
|
||||
score_offset = 100,
|
||||
},
|
||||
minuet = {
|
||||
name = "minuet",
|
||||
module = "minuet.blink",
|
||||
async = true,
|
||||
-- Should match minuet.config.request_timeout * 1000,
|
||||
-- since minuet.config.request_timeout is in seconds
|
||||
timeout_ms = 3000,
|
||||
score_offset = 50, -- Gives minuet higher priority among suggestions
|
||||
},
|
||||
},
|
||||
-- snippets = {
|
||||
-- min_keyword_length = 1,
|
||||
-- score_offset = 4,
|
||||
-- },
|
||||
-- lsp = {
|
||||
-- min_keyword_length = 3,
|
||||
-- score_offset = 3,
|
||||
-- },
|
||||
-- path = {
|
||||
-- min_keyword_length = 3,
|
||||
-- score_offset = 2,
|
||||
-- },
|
||||
-- buffer = {
|
||||
-- min_keyword_length = 5,
|
||||
-- score_offset = 1,
|
||||
-- },
|
||||
},
|
||||
},
|
||||
signature = { enabled = true },
|
||||
},
|
||||
signature = { enabled = true },
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ return {
|
|||
javascriptreact = { "biome", "biome-organize-imports" },
|
||||
typescript = { "biome", "biome-organize-imports" },
|
||||
typescriptreact = { "biome", "biome-organize-imports" },
|
||||
json = { "biome" },
|
||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
},
|
||||
|
|
|
|||
58
.config/nvim/lua/plugins/minuet.lua
Normal file
58
.config/nvim/lua/plugins/minuet.lua
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
return {
|
||||
{
|
||||
"milanglacier/minuet-ai.nvim",
|
||||
config = function()
|
||||
require("minuet").setup({
|
||||
provider = "gemini",
|
||||
provider_options = {
|
||||
claude = {
|
||||
max_tokens = 512,
|
||||
model = "claude-haiku-4-5",
|
||||
},
|
||||
codestral = {
|
||||
optional = {
|
||||
max_tokens = 256,
|
||||
stop = { "\n\n" },
|
||||
},
|
||||
},
|
||||
gemini = {
|
||||
model = "gemini-2.0-flash",
|
||||
optional = {
|
||||
generationConfig = {
|
||||
maxOutputTokens = 256,
|
||||
-- When using `gemini-2.5-flash`, it is recommended to entirely
|
||||
-- disable thinking for faster completion retrieval.
|
||||
thinkingConfig = {
|
||||
thinkingBudget = 0,
|
||||
},
|
||||
},
|
||||
safetySettings = {
|
||||
{
|
||||
-- HARM_CATEGORY_HATE_SPEECH,
|
||||
-- HARM_CATEGORY_HARASSMENT
|
||||
-- HARM_CATEGORY_SEXUALLY_EXPLICIT
|
||||
category = "HARM_CATEGORY_DANGEROUS_CONTENT",
|
||||
-- BLOCK_NONE
|
||||
threshold = "BLOCK_ONLY_HIGH",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
virtualtext = {
|
||||
auto_trigger_ft = { "lua", "typescript", "typescriptreact", "javascript" },
|
||||
keymap = {
|
||||
accept = "<A-CR>",
|
||||
accept_line = "<A-S>CR",
|
||||
accept_n_lines = "<A-z>",
|
||||
prev = "<A-j>",
|
||||
next = "<A-k>",
|
||||
dismiss = "<A-e>",
|
||||
},
|
||||
show_on_completion_menu = true,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
return {
|
||||
"folke/snacks.nvim",
|
||||
tag = "v2.23.0",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
---@type snacks.Config
|
||||
|
|
@ -11,10 +12,10 @@ return {
|
|||
notifier = {
|
||||
enabled = true,
|
||||
timeout = 10000,
|
||||
width = { min = 40, max = 1000 },
|
||||
width = { min = 40, max = 100 },
|
||||
height = { min = 1, max = 1000 },
|
||||
},
|
||||
image = {},
|
||||
image = { enabled = false },
|
||||
picker = {
|
||||
matcher = {
|
||||
fuzzy = true, -- use fuzzy matching
|
||||
|
|
@ -228,33 +229,6 @@ return {
|
|||
end,
|
||||
desc = "Goto T[y]pe Definition",
|
||||
},
|
||||
-- {
|
||||
-- "<leader>ss",
|
||||
-- function()
|
||||
-- Snacks.picker.lsp_symbols({
|
||||
-- layout = "left",
|
||||
-- filter = {
|
||||
-- default = {
|
||||
-- "Class",
|
||||
-- "Constructor",
|
||||
-- "Enum",
|
||||
-- -- "Field",
|
||||
-- "Function",
|
||||
-- "Interface",
|
||||
-- "Method",
|
||||
-- "Module",
|
||||
-- "Namespace",
|
||||
-- "Package",
|
||||
-- "Property",
|
||||
-- "Struct",
|
||||
-- "Trait",
|
||||
-- "Variable",
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
-- end,
|
||||
-- desc = "LSP Symbols",
|
||||
-- },
|
||||
{
|
||||
"<leader>sw",
|
||||
function()
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ set $up k
|
|||
set $right l
|
||||
set $term wezterm
|
||||
set $browser firefox
|
||||
set $clipboard copyq show
|
||||
set $menu fish -c 'rofi -show run -terminal $term'
|
||||
set $windows fish -c 'rofi -show window'
|
||||
set $laptop eDP-1
|
||||
|
|
@ -131,6 +132,7 @@ input "type:keyboard" {
|
|||
bindsym --to-code $mod+Shift+q kill
|
||||
bindsym --to-code $mod+Space exec $menu
|
||||
bindsym --to-code $mod+Tab exec $windows
|
||||
bindsym --to-code Shift+Space exec $clipboard
|
||||
bindsym --to-code $mod+Backspace exec ~/.scripts/kitty_shell.fish ~/.scripts/power.fish
|
||||
bindsym --to-code $mod+Apostrophe exec ~/.scripts/shot.fish
|
||||
|
||||
|
|
@ -257,6 +259,7 @@ exec syncthing serve
|
|||
exec swaylock
|
||||
exec tuxedo-control-center --tray
|
||||
exec swaykbdd
|
||||
exec copyq
|
||||
|
||||
### Idle configuration
|
||||
#
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ config.keys = {
|
|||
{ key = "v", mods = "CTRL", action = wezterm.action.PasteFrom("Clipboard") },
|
||||
{ key = "c", mods = "CTRL", action = wezterm.action.CopyTo("ClipboardAndPrimarySelection") },
|
||||
{ key = "C", mods = "CTRL", action = wezterm.action.SendString("\x03") },
|
||||
{
|
||||
key = "Enter",
|
||||
mods = "ALT",
|
||||
action = wezterm.action.DisableDefaultAssignment,
|
||||
},
|
||||
}
|
||||
|
||||
-- and finally, return the configuration to wezterm
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue