From 7d782c4af6a369ec5a802eeededf18e5f355088b Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 26 Mar 2026 20:42:05 +0100 Subject: update dotfiles from work --- .config/coc/extensions/package.json | 5 ++-- .config/fcitx5/conf/classicui.conf | 8 +++--- .config/git/config##template | 2 ++ .config/lf/lfrc | 1 + .config/nvim/color-tweaks.vim | 3 +- .config/nvim/init.vim | 5 ++-- .local/share/bin/kbindicator | 6 ++-- .local/share/bin/mk | 14 ++++++++-- .local/share/bin/preview | 36 ++++++++++++++++-------- .local/share/fcitx5/themes/default/base.conf | 42 ---------------------------- .zshrc | 24 ++++++++++++++++ 11 files changed, 78 insertions(+), 68 deletions(-) delete mode 100644 .local/share/fcitx5/themes/default/base.conf diff --git a/.config/coc/extensions/package.json b/.config/coc/extensions/package.json index fc6acf7..b648463 100644 --- a/.config/coc/extensions/package.json +++ b/.config/coc/extensions/package.json @@ -13,9 +13,10 @@ "coc-deno": ">=3.15.0", "coc-sh": ">=1.2.4", "coc-solargraph": ">=1.2.4", - "coc-pyright": ">=1.1.405" + "coc-pyright": ">=1.1.405", + "coc-cmake": ">=0.2.2" }, "disabled": [], "locked": [], - "lastUpdate": 1756725613973 + "lastUpdate": 1762931212912 } \ No newline at end of file diff --git a/.config/fcitx5/conf/classicui.conf b/.config/fcitx5/conf/classicui.conf index 670d3d8..9b98e74 100644 --- a/.config/fcitx5/conf/classicui.conf +++ b/.config/fcitx5/conf/classicui.conf @@ -17,17 +17,17 @@ PreferTextIcon=True # アイコンにレイアウト名を表示する ShowLayoutNameInIcon=False # 入力メソッドの言語を使用してテキストを表示する -UseInputMethodLanguageToDisplayText=True +UseInputMethodLanguageToDisplayText=False # テーマ -Theme=default +Theme=mode # ダークテーマ -DarkTheme=default-dark +DarkTheme=mode # システムのライト/ダーク配色に従う UseDarkTheme=False # テーマとデスクトップでサポートされている場合は、システムのアクセントカラーに従う UseAccentColor=True # X11 で Per Screen DPI を使用する -PerScreenDPI=True +PerScreenDPI=False # フォント DPI を Wayland で強制する ForceWaylandDPI=0 # Wayland で分数スケールを有効にする diff --git a/.config/git/config##template b/.config/git/config##template index 3c996ba..85f9b50 100644 --- a/.config/git/config##template +++ b/.config/git/config##template @@ -47,3 +47,5 @@ tabs = 2 side-by-side = false syntax-theme = base16 +[safe] + directory = * diff --git a/.config/lf/lfrc b/.config/lf/lfrc index 295077d..d01b837 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -7,6 +7,7 @@ set info size set dircounts set mouse true +set cleaner clean set previewer preview cmd open $open $fx diff --git a/.config/nvim/color-tweaks.vim b/.config/nvim/color-tweaks.vim index 70ef552..2fd2227 100644 --- a/.config/nvim/color-tweaks.vim +++ b/.config/nvim/color-tweaks.vim @@ -38,5 +38,4 @@ hi CocWarningSign guibg=NONE hi! link Conceal Comment hi! link WinSeparator LineNr -hi! link NonText vimContinueComment - +hi! link NonText EndOfBuffer diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index f3424ca..fbd8fb5 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -22,8 +22,8 @@ set guifont=monospace:h7.5:#e-subpixelantialias set linespace=3 set tabpagemax=999 set breakindent -set breakindentopt+=list:-1 -set showbreak=~\ +set breakindentopt+=list:-1,shift:-2 +set showbreak=:\ set formatoptions+=mM set tags^=build/tags set ssop-=options @@ -81,6 +81,7 @@ Plug 'editorconfig/editorconfig-vim' Plug 'rickhowe/diffunitsyntax' Plug 'lervag/file-line' Plug 'vim-scripts/AnsiEsc.vim' +Plug 'vim-scripts/taglist.vim' " language plugins Plug 'lervag/vimtex' diff --git a/.local/share/bin/kbindicator b/.local/share/bin/kbindicator index ca2acfd..6ffcd53 100755 --- a/.local/share/bin/kbindicator +++ b/.local/share/bin/kbindicator @@ -2,9 +2,9 @@ query_kb_layout() { CONTROLLER="$(qdbus 'org.fcitx.Fcitx5' '/controller' 'org.fcitx.Fcitx.Controller1.CurrentInputMethod')" case $CONTROLLER in - "keyboard-us") echo "us" ;; - "keyboard-us-intl") echo "us-intl" ;; - "mozc") echo "jp" ;; + "keyboard-us") echo "英数" ;; + "keyboard-us-intl") echo "英数(国際)" ;; + "mozc") echo "日本語" ;; *) ;; esac } diff --git a/.local/share/bin/mk b/.local/share/bin/mk index 83baf01..9283753 100755 --- a/.local/share/bin/mk +++ b/.local/share/bin/mk @@ -12,9 +12,19 @@ showmode() { mode_west() { showmode 'west' [ -z "$*" ] && set -- build - exec west "$@" + west "$@" + ec=$? + + ninja -C build -t deps | sed -n 's/^ \{4\}//p' | sort -u | ctags -L - -f build/tags 2>/dev/null & + + exit $ec } -[ -e "west.yml" ] && mode_west "$@" +path="." +for x in $(seq 10) ; do + [ -e "$path/.west" ] && mode_west "$@" + [ "$path" -ef "$path/.." ] && break + path="$path/.." +done mode_cmake() { showmode 'cmake' diff --git a/.local/share/bin/preview b/.local/share/bin/preview index 141d03c..819938b 100755 --- a/.local/share/bin/preview +++ b/.local/share/bin/preview @@ -3,7 +3,7 @@ echo "error: no input file" exit 1 } -[ -n "$2" ] && WIDTH="$(( "$2" - 3 ))" || WIDTH="$(tput cols)" +[ -n "$2" ] && WIDTH="$(( "$2" - 1 ))" || WIDTH="$(tput cols)" [ -n "$3" ] && HEIGHT="$3" || HEIGHT="$(tput lines)" [ -n "$4" ] && POS_X="$4" || POS_X="0" [ -n "$5" ] && POS_Y="$5" || POS_Y="0" @@ -11,7 +11,10 @@ MIMETYPE="$(file --mime-type -Lb "$FILE")" EXT="${FILE#*.}" -[ "$EXT" = "md" ] && [ "$MIMETYPE" = "text/plain" ] && MIMETYPE="application/markdown" +if [ "$MIMETYPE" = "text/plain" ] ; then + [ "$EXT" = "md" ] && MIMETYPE="text/markdown" + [ "$EXT" = "rst" ] && MIMETYPE="text/x-rst" +fi [ "$MIMETYPE" = "application/javascript" ] && MIMETYPE="text/javascript" render_manpage() { @@ -24,12 +27,24 @@ EOF case "$MIMETYPE" in image/*) - echo '{ - "action": "add", - "x": 0, - "y": 0, - "path": "/home/loek/docs/frob.jpg" - }' | ueberzug layer --parser json + if [ -z "$UB_SOCKET" ] ; then + echo "ueberzug not available" + else + ueberzugpp cmd \ + --socket "$UB_SOCKET" \ + --action add \ + --identifier PREVIEW \ + --file "$FILE" \ + --max-width "$WIDTH" --max-height "$HEIGHT" \ + --xpos "$POS_X" --ypos "$POS_Y" + exit 1 # <- disable cache + fi + ;; + text/markdown) + pandoc --from=gfm --to=man "$FILE" | render_manpage + ;; + text/x-rst) + pandoc --from=rst --to=man "$FILE" | render_manpage ;; text/*) bat \ @@ -47,9 +62,6 @@ case "$MIMETYPE" in application/vnd.rar) bsdtar -tf "$FILE" ;; - application/markdown) - pandoc --from=gfm --to=man "$FILE" | render_manpage - ;; application/json) jq --color-output . "$FILE" ;; @@ -59,3 +71,5 @@ case "$MIMETYPE" in ;; esac +exit 0 + diff --git a/.local/share/fcitx5/themes/default/base.conf b/.local/share/fcitx5/themes/default/base.conf deleted file mode 100644 index 4a27495..0000000 --- a/.local/share/fcitx5/themes/default/base.conf +++ /dev/null @@ -1,42 +0,0 @@ -# vim:ft=dosini -[Metadata] -Name=default -Version=0.1 -Author=loek -Description=custom theme -ScaleWithDPI=True - -[InputPanel] -Font=sans-serif 12 - -[InputPanel/Background/Margin] -Left=0 -Right=0 -Top=0 -Bottom=0 - -[Menu/Background/Margin] -Left=0 -Right=0 -Top=0 -Bottom=0 - -[Menu/ContentMargin] -Left=0 -Right=0 -Top=0 -Bottom=0 - -[Menu/Highlight/Margin] -Left=0 -Right=0 -Top=0 -Bottom=0 - -[Menu/TextMargin] -Left=0 -Right=0 -Top=0 -Bottom=0 - - diff --git a/.zshrc b/.zshrc index 86569e3..f90402e 100644 --- a/.zshrc +++ b/.zshrc @@ -38,3 +38,27 @@ bindkey '^[[Z' reverse-menu-complete setopt PROMPT_SUBST export VIRTUAL_ENV_DISABLE_PROMPT=y PROMPT='$(eo=%{ ec=%} prompt)' + +# auto venv +function cd() { + builtin cd "$@" + + if [ -n "$VIRTUAL_ENV" ] ; then + if [[ "$PWD"/ != "$(dirname "$VIRTUAL_ENV")"/* ]] ; then + deactivate + else + return + fi + fi + + git_dir="$(git rev-parse --show-toplevel 2>/dev/null)" + for dir in ./ "$git_dir" ../ "$git_dir/.." ; do + [ ! -d "$dir" ] && continue + for file in "$dir"/.env "$dir"/venv/bin/activate ; do + [ ! -e "$file" ] && continue + source "$file" + return + done + done +} + -- cgit v1.2.3