├── .github └── workflows │ ├── aqua.yaml │ └── prettier.yaml ├── .gitignore ├── LICENSE.md ├── Makefile ├── README.md ├── bin ├── cb ├── chromium-browser-wrapper ├── colortable ├── flower ├── pathshorten ├── rgif ├── tovim └── yabai-util ├── config ├── X11 │ └── xkb │ │ ├── compat │ │ └── mine │ │ ├── keymap │ │ └── mine │ │ └── symbols │ │ └── mine ├── afx │ └── afx.yaml ├── applications │ ├── chromium-browser-wrapper.desktop │ ├── discord.desktop │ ├── element.desktop │ ├── misskey.desktop │ └── vim-jp-slack.desktop ├── aqua │ ├── aqua-policy.yaml │ ├── aqua.yaml │ └── experimental.yaml ├── bat │ ├── config │ └── themes │ │ └── Midnight.hybrid.tmTheme ├── btop │ ├── btop.conf │ ├── btop.conf.patch │ └── themes │ │ └── tokyo-night.theme ├── ciw │ └── list ├── curlrc ├── dunst │ └── dunstrc ├── efm-langserver │ └── config.yaml ├── fcitx5 │ ├── conf │ │ ├── skk.conf │ │ └── xcb.conf │ ├── config │ ├── dictionary_list │ └── profile ├── fontconfig │ └── fonts.conf ├── gh │ ├── config.yml │ └── extension ├── git │ ├── commit_template │ ├── config │ ├── delta.gitconfig │ ├── diff.sh │ ├── editor.sh │ └── ignore ├── gtk-3.0 │ └── settings.ini ├── i3 │ ├── config │ └── hatsunemiku.conf ├── jq │ └── 4513echo │ │ └── ripgrep.jq ├── libskk │ └── rules │ │ └── StickyShift │ │ ├── keymap │ │ ├── hiragana.json │ │ └── katakana.json │ │ ├── metadata.json │ │ └── rom-kana │ │ └── default.json ├── nvim │ ├── after │ │ ├── ftplugin │ │ │ └── help.vim │ │ ├── queries │ │ │ ├── toml │ │ │ │ ├── highlights.scm │ │ │ │ └── injections.scm │ │ │ ├── unifieddiff │ │ │ │ └── highlights.scm │ │ │ ├── uri │ │ │ │ └── highlights.scm │ │ │ └── vim │ │ │ │ ├── highlights.scm │ │ │ │ └── injections.scm │ │ └── syntax │ │ │ ├── diff.vim │ │ │ ├── json.vim │ │ │ └── vim.vim │ ├── autoload │ │ ├── lightline │ │ │ ├── colorscheme │ │ │ │ └── mini.vim │ │ │ └── component │ │ │ │ └── vimrc.vim │ │ ├── pinkyless │ │ │ └── keyboard │ │ │ │ └── JIS.vim │ │ ├── quickrun │ │ │ └── hook │ │ │ │ └── denops_interrupt.vim │ │ ├── user.vim │ │ └── user │ │ │ ├── colorscheme.vim │ │ │ ├── launcher.vim │ │ │ └── plugins │ │ │ ├── lsp.vim │ │ │ ├── pum.vim │ │ │ ├── skkeleton.vim │ │ │ └── sonictemplate.vim │ ├── denops │ │ ├── @ddc-filters │ │ │ └── sorter_file.ts │ │ ├── @ddu-filters │ │ │ ├── matcher_action.ts │ │ │ ├── matcher_colorscheme.ts │ │ │ └── matcher_source.ts │ │ ├── @ddu-sources │ │ │ ├── gin_action.ts │ │ │ ├── quickfix.ts │ │ │ └── scrapbox_pages.ts │ │ └── vimrc │ │ │ └── main.ts │ ├── doc │ │ ├── dotfiles.txt │ │ └── tags │ ├── dpp │ │ ├── colorscheme.toml │ │ ├── ddc.toml │ │ ├── ddu.toml │ │ ├── dpp.toml │ │ ├── ftplugin.toml │ │ ├── init.toml │ │ ├── neovim.toml │ │ ├── plugin.toml │ │ ├── textobj.toml │ │ └── vim.toml │ ├── ftdetect │ │ └── vimrc.vim │ ├── init.vim │ ├── lua │ │ └── vimrc │ │ │ ├── autocmd.lua │ │ │ ├── clipboard.lua │ │ │ ├── init.lua │ │ │ ├── neovide.lua │ │ │ └── plugins │ │ │ ├── fidget.lua │ │ │ ├── lsp │ │ │ ├── init.lua │ │ │ ├── lua_help.lua │ │ │ └── util.lua │ │ │ └── treesitter.lua │ ├── rc │ │ ├── autocmd.rc.vim │ │ ├── dpp.rc.vim │ │ ├── dpp.ts │ │ ├── init.rc.vim │ │ ├── keymap.rc.vim │ │ ├── option.rc.vim │ │ └── var.rc.vim │ ├── setting │ │ ├── ddc.ts │ │ ├── ddc.vim │ │ ├── ddu.ts │ │ ├── ddu.vim │ │ ├── dein.toml.json │ │ ├── lexima.vim │ │ └── skkeleton.vim │ ├── snippets │ │ ├── _highlight_test.json │ │ ├── gitcommit.json │ │ ├── help.json │ │ ├── json.json │ │ ├── markdown.json │ │ ├── sh.json │ │ ├── toml.json │ │ ├── typescript.json │ │ └── vim.json │ └── template │ │ ├── help │ │ └── base-help.txt │ │ ├── toml │ │ └── base-pyproject.toml │ │ └── vim │ │ └── base-plugin.vim ├── pip │ └── pip.conf ├── profile ├── python │ ├── poetry.lock │ ├── pyproject.toml │ └── startup.py ├── ripgrep │ └── config ├── rofi │ ├── config.rasi │ └── hatsunemiku.rasi ├── skhd │ └── skhdrc ├── stylua │ └── stylua.toml ├── systemd │ └── user │ │ └── templates │ │ ├── docker.service │ │ ├── nightlock.service │ │ └── nightlock.timer ├── tmux │ ├── colors.tmux │ ├── flowers.txt │ ├── keymaps.tmux │ ├── navigator.tmux │ ├── options.tmux │ ├── plugins.tmux │ └── tmux.conf ├── vimrc ├── wezterm │ └── wezterm.lua ├── xinitrc ├── xremap │ └── config.yml ├── yabai │ └── yabairc └── zsh │ ├── .zshenv │ ├── .zshrc │ ├── aliases.zsh │ ├── completion.zsh │ ├── completions │ └── .gitkeep │ ├── dircolors │ ├── functions.zsh │ ├── option.zsh │ ├── plugins.zsh │ └── prompt.zsh ├── manifest.tsv ├── renovate.json ├── scripts ├── Brewfile ├── gen_stat.sh ├── link.sh ├── mac_defaults.sh └── vim_plugins.awk └── up /.github/workflows/aqua.yaml: -------------------------------------------------------------------------------- 1 | name: aqua 2 | 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | branches: [main] 8 | 9 | jobs: 10 | test: 11 | strategy: 12 | matrix: 13 | goos: [darwin, linux] 14 | goarch: [amd64, arm64] 15 | runs-on: ubuntu-latest 16 | env: 17 | AQUA_CONFIG: config/aqua/aqua.yaml 18 | AQUA_LOG_COLOR: always 19 | AQUA_POLICY_CONFIG: config/aqua/aqua-policy.yaml 20 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 21 | steps: 22 | - uses: actions/checkout@v4 23 | # NOTE: use paths-filter instead of on.pull_request.paths to trigger test always 24 | - uses: dorny/paths-filter@v3 25 | id: filter 26 | with: 27 | filters: | 28 | aqua: 29 | - .github/workflows/aqua.yaml 30 | - config/aqua/aqua.yaml 31 | - config/aqua/experimental.yaml 32 | - name: Install aqua 33 | if: steps.filter.outputs.aqua == 'true' 34 | uses: aquaproj/aqua-installer@v3.0.1 35 | with: 36 | aqua_version: v2.48.1 37 | - uses: actions/setup-go@v5 38 | if: steps.filter.outputs.aqua == 'true' 39 | with: 40 | go-version: "1.24.3" 41 | - name: Run test 42 | if: steps.filter.outputs.aqua == 'true' 43 | run: aqua install 44 | env: 45 | AQUA_GOARCH: ${{ matrix.goarch }} 46 | AQUA_GOOS: ${{ matrix.goos }} 47 | -------------------------------------------------------------------------------- /.github/workflows/prettier.yaml: -------------------------------------------------------------------------------- 1 | name: prettier 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - "**/*.yaml" 9 | - "**/*.yml" 10 | pull_request: 11 | branches: 12 | - main 13 | paths: 14 | - "**/*.yaml" 15 | - "**/*.yml" 16 | 17 | jobs: 18 | prettier: 19 | runs-on: ubuntu-latest 20 | steps: 21 | - uses: actions/checkout@v4 22 | - name: Install prettier 23 | run: npm install --location=global prettier 24 | - name: Check style 25 | run: prettier --check ./**/*.yaml .??*/**/*.yaml ./**/*.yml 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # vim 2 | config/nvim/colors/* 3 | config/nvim/tags 4 | 5 | # zsh 6 | config/zsh/.zcompdump* 7 | config/zsh/.zinit/* 8 | config/zsh/completions/* 9 | config/zsh/.zcompcache/* 10 | config/zsh/.zsh_sessions/* 11 | 12 | # gh 13 | config/gh/hosts.yml 14 | 15 | # btop 16 | config/btop/btop.log 17 | 18 | # fcitx5 19 | config/fcitx5/* 20 | !config/fcitx5/config 21 | !config/fcitx5/dictionary_list 22 | !config/fcitx5/profile 23 | !config/fcitx5/conf/ 24 | config/fcitx5/conf/* 25 | !config/fcitx5/conf/skk.conf 26 | !config/fcitx5/conf/xcb.conf 27 | 28 | # systemd 29 | config/systemd/user/* 30 | !config/systemd/user/templates/ 31 | 32 | !**/.gitkeep 33 | # vim:ft=gitignore 34 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Hibiki 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | export 2 | DOTPATH ?= $(realpath $(dir $(lastword $(MAKEFILE_LIST)))) 3 | XDG_CONFIG_HOME ?= $(HOME)/.config 4 | XDG_CACHE_HOME ?= $(HOME)/.cache 5 | XDG_DATA_HOME ?= $(HOME)/.local/share 6 | XDG_STATE_HOME ?= $(HOME)/.local/state 7 | 8 | .DEFAULT_GOAL := help 9 | 10 | .PHONY: help 11 | help: ## Show targets in this Makefile 12 | ifeq ($(TARGET),) 13 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \ 14 | | sort \ 15 | | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-16s\033[m %s\n", $$1, $$2}' 16 | @echo 'Please run `$(MAKE) help TARGET=` to see more detail of each of the targets.' 17 | else 18 | @awk -v TARGET=$(TARGET) \ 19 | 'BEGIN {found = 0}; /^[^\t#]|^$$/ {found = $$1 == TARGET ":" || (found && $$1 ~ /^(if|else|endif)/)}; found' \ 20 | $(MAKEFILE_LIST) 21 | endif 22 | 23 | .PHONY: init 24 | init: ## Initialize enviroment settings 25 | mkdir -p $(XDG_CONFIG_HOME) 26 | mkdir -p $(XDG_CACHE_HOME) 27 | mkdir -p $(XDG_STATE_HOME) 28 | mkdir -p $(XDG_DATA_HOME) 29 | mkdir -p $(HOME)/.local/bin 30 | mkdir -p $(HOME)/Develops 31 | 32 | .PHONY: deploy 33 | deploy: ## Create symlinks to actual directories 34 | @echo 'Deploying dotfiles...' 35 | @$(DOTPATH)/scripts/link.sh link 36 | 37 | .PHONY: update 38 | update: ## Fetch and rebase all changes from remote repository 39 | @echo 'Updating dotfiles...' 40 | ifneq ($(shell git rev-parse --abbrev-ref HEAD),main) 41 | ifneq ($(FETCH_FROM_MAIN),) 42 | git stash 43 | git switch -m main 44 | endif 45 | endif 46 | git fetch origin 47 | git rebase --autostash --stat FETCH_HEAD 48 | ifneq ($(shell git rev-parse --abbrev-ref HEAD),main) 49 | ifneq ($(FETCH_FROM_MAIN),) 50 | git switch -m - 51 | git stash pop 52 | git rebase --autostash --stat main 53 | endif 54 | endif 55 | 56 | .PHONY: install 57 | install: update init deploy ## Initialize and deploy dotfiles 58 | @echo 'Please run `exec $$SHELL -l` to reload shell.' 59 | 60 | .PHONY: clean 61 | clean: ## Remove symlinks from actual directories 62 | @echo 'Cleaning dotfiles...' 63 | @$(DOTPATH)/scripts/link.sh unlink 64 | 65 | .PHONY: python 66 | python: ## Install and initialize python enviroments 67 | python3 -m venv $(XDG_DATA_HOME)/poetry 68 | $(XDG_DATA_HOME)/poetry/bin/python -m pip install poetry 69 | cd $(XDG_CONFIG_HOME)/python; \ 70 | $(XDG_DATA_HOME)/poetry/bin/poetry install 71 | 72 | .PHONY: aqua 73 | aqua: ## Install and initialize aqua enviroments 74 | ifeq ($(shell command -v aqua),) 75 | curl -sSfL https://raw.githubusercontent.com/aquaproj/aqua-installer/v4.0.0/aqua-installer | bash -s -- -v v2.48.1 76 | else 77 | aqua update-aqua 78 | endif 79 | $${AQUA_ROOT_DIR:-$$XDG_DATA_HOME/aquaproj-aqua}/bin/aqua install --all 80 | 81 | .PHONY: rust 82 | rust: ## Install and initialize rust enviroments 83 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path 84 | rustup update nightly 85 | rustup default nightly 86 | -------------------------------------------------------------------------------- /bin/cb: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # based on: 3 | # https://github.com/jimrobinson/osc52 4 | # https://github.com/jkc-sw/toclip 5 | 6 | set -ue 7 | 8 | if [ $# -gt 0 ]; then 9 | input="$*" 10 | else 11 | input="$(cat /dev/stdin)" 12 | fi 13 | 14 | if [ -z "$input" ]; then 15 | echo 'No value to copy to clipboard' 1>&2 16 | exit 1 17 | fi 18 | 19 | wrap_tmux() { 20 | printf "\ePtmux;\e%s\e\\" "$*" 21 | } 22 | 23 | wrap_osc52() { 24 | printf '\e]52;c;%s\a' "$(printf '%s' "$*" | head -c 74994 | base64 | tr -d '\r\n')" 25 | } 26 | 27 | if [ -n "${TMUX:-}" ]; then 28 | TMUX_TTY="$(tmux list-panes -F '#{pane_active} #{pane_tty}' | awk '$1 == "1" { print $2; exit; }')" 29 | wrap_tmux "$(wrap_osc52 "$input")" > "$TMUX_TTY" 30 | else 31 | wrap_osc52 "$input" > /dev/tty 32 | fi 33 | -------------------------------------------------------------------------------- /bin/chromium-browser-wrapper: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec chromium-browser --enable-features=WebUIDarkMode --force-dark-mode "$@" 3 | -------------------------------------------------------------------------------- /bin/colortable: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ue -o pipefail 4 | 5 | colortable() { 6 | local c 7 | for c in {0..255}; do 8 | printf '\e[38;5;%dm %03d\e[m' "$c" "$c" 9 | [[ $(("$c" % 16)) -eq 15 ]] && echo 10 | done 11 | echo 12 | } 13 | 14 | printcolor() { 15 | printf '\e[48;5;%dm\e[38;5;250m%6d \e[m' "$1" "$1" 16 | } 17 | 18 | colortable_rich() { 19 | local r b g 20 | for r in {0..4}; do 21 | for b in {0..5}; do 22 | printcolor $(("$r" * 36 + 5 * 6 + "$b" + 16)) 23 | done 24 | echo 25 | done 26 | for g in {0..5}; do 27 | for b in {0..5}; do 28 | printcolor $((5 * 36 + 30 - "$g" * 6 + "$b" + 16)) 29 | done 30 | for r in {1..5}; do 31 | printcolor $((180 - "$r" * 36 + 30 - "$g" * 6 + 5 + 16)) 32 | done 33 | echo 34 | done 35 | } 36 | 37 | colortable_system() { 38 | local c 39 | for c in {0..15}; do 40 | printf '\e[48;5;%dm \e[m' "$c" 41 | [[ $(("$c" % 8)) -eq 7 ]] && echo 42 | done 43 | echo 44 | } 45 | 46 | colortable_text() { 47 | printf '\e[0m 0 Normal\e[m\n' 48 | printf '\e[1m 1 Bold\e[m\n' 49 | printf '\e[2m 2 Dim\e[m\n' 50 | printf '\e[3m 3 Italic\e[m\n' 51 | printf '\e[4m 4 Underline\e[m\n' 52 | printf '\e[5m 5 Blink\e[m\n' 53 | printf '\e[6m 6 Quick Blink\e[m\n' 54 | printf '\e[7m 7 Reverse\e[m\n' 55 | printf '\e[8m 8 Hidden\e[m(Hidden)\n' 56 | printf '\e[9m 9 Strikethrough\e[m\n' 57 | } 58 | 59 | case "$*" in 60 | rich) colortable_rich ;; 61 | system) colortable_system ;; 62 | text) colortable_text ;; 63 | '') colortable ;; 64 | *) 65 | echo "Invalid arguments: $*" 1>&2 66 | exit 1 67 | ;; 68 | esac 69 | -------------------------------------------------------------------------------- /bin/flower: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | index="$(tr -dc 0-9 < /dev/random | head -c 3 | sed 's/^0\+//')" 4 | index=$((${index:-0} % 26 + 1)) 5 | printf '%s' "$(head -$index < "$XDG_CONFIG_HOME/tmux/flowers.txt" | tail -1)" 6 | -------------------------------------------------------------------------------- /bin/pathshorten: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -ue -o pipefail 4 | 5 | if [[ $# -gt 0 ]]; then 6 | dir="$*" 7 | else 8 | dir="$(cat /dev/stdin)" 9 | fi 10 | 11 | tilde='~' 12 | tildepath="${dir/#$HOME/$tilde}" 13 | read -ra patharray <<< "${tildepath//\// }" 14 | result='' 15 | 16 | for ((i = 0; i < ${#patharray[@]}; i++)); do 17 | # shellcheck disable=SC2004 18 | if [[ "$(($i + 1))" == "${#patharray[@]}" ]]; then 19 | result+="${patharray[$i]}" 20 | break 21 | fi 22 | if [[ ${patharray[$i]:0:1} =~ ^\. ]]; then 23 | result+="${patharray[$i]:0:2}/" 24 | else 25 | result+="${patharray[$i]:0:1}/" 26 | fi 27 | done 28 | 29 | echo -n "$result" 30 | -------------------------------------------------------------------------------- /bin/rgif: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # rgif -- Ripgrep interactive with fzf 3 | # It requires fzf 0.30.0+, Ripgrep, bat 4 | # from https://github.com/junegunn/fzf/blob/3c868d79/ADVANCED.md#switching-between-ripgrep-mode-and-fzf-mode 5 | 6 | set -ue -o pipefail 7 | 8 | # Switch between Ripgrep launcher mode (CTRL-R) and fzf filtering mode (CTRL-F) 9 | RG_CMD='rg --column --line-number --no-heading --color=always --smart-case' 10 | INITIAL_QUERY="$*" 11 | 12 | FZF_DEFAULT_COMMAND="$RG_CMD $(printf '%q' "$INITIAL_QUERY")" \ 13 | fzf --ansi \ 14 | --color "hl:-1:underline,hl+:-1:underline:reverse" \ 15 | --disabled --query "$INITIAL_QUERY" \ 16 | --bind "change:reload:sleep 0.1; $RG_CMD {q} || :" \ 17 | --bind "ctrl-f:unbind(change,ctrl-f)+change-prompt(fzf> )+enable-search+clear-query+rebind(ctrl-r)" \ 18 | --bind "ctrl-r:unbind(ctrl-r)+change-prompt(Ripgrep> )+disable-search+reload($RG_CMD {q} || :)+rebind(change,ctrl-f)" \ 19 | --prompt 'Ripgrep> ' \ 20 | --delimiter : \ 21 | --header '╱ CTRL-R (Ripgrep mode) ╱ CTRL-F (fzf mode) ╱' \ 22 | --preview 'bat --color=always {1} --highlight-line {2}' \ 23 | --preview-window 'up,60%,border-bottom,+{2}+3/3,~3' 24 | -------------------------------------------------------------------------------- /bin/tovim: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # from https://vim-jp.org/blog/2015/10/15/tovim-on-shell-command-pipes.html 3 | set -ue -o pipefail 4 | 5 | tmpfile="$(mktemp)" 6 | trap 'rm $tmpfile' ERR 7 | 8 | if [[ -p "/dev/stdin" ]]; then 9 | cat - > "$tmpfile" 10 | fi 11 | vim "$tmpfile" < /dev/tty > /dev/tty 12 | cat "$tmpfile" 13 | rm "$tmpfile" 14 | -------------------------------------------------------------------------------- /bin/yabai-util: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ue 3 | 4 | focus_space() { 5 | jq_query='.[] | select(.["has-focus"]).index' 6 | if [ -z "$1" ] || [ "$(yabai -m query --spaces | jq -r "$jq_query")" = "$1" ]; then 7 | return 8 | fi 9 | if ! yabai -m space --focus "$1"; then 10 | yabai -m space --create 11 | yabai -m space --focus "$1" 12 | fi 13 | } 14 | 15 | screencapture() { 16 | command screencapture -T0.5 ~/Pictures/screenshot-"$(date +%F_%H%M%S)"-all.png 17 | osascript -e 'display notification "Screencapture saved" with title "Screencapture"' 18 | } 19 | 20 | screencapture_selected() { 21 | command screencapture -T0.5 -s ~/Pictures/screenshot-"$(date +%F_%H%M%S)"-selected.png 22 | osascript -e 'display notification "Screencapture saved" with title "Screencapture"' 23 | } 24 | 25 | case "$1" in 26 | focus_space) focus_space "$2" ;; 27 | screencapture) screencapture ;; 28 | screencapture_selected) screencapture_selected ;; 29 | *) exit 1 ;; 30 | esac 31 | -------------------------------------------------------------------------------- /config/X11/xkb/compat/mine: -------------------------------------------------------------------------------- 1 | default xkb_compatibility "mine" { 2 | // Sticky keys 3 | interpret Shift_L+Any { action = LatchMods(modifiers = modMapMods); }; 4 | interpret Control_L+Any { action = LatchMods(modifiers = modMapMods); }; 5 | interpret Alt_L+Any { action = LatchMods(modifiers = modMapMods); }; 6 | interpret Super_L+Any { action = LatchMods(modifiers = modMapMods); }; 7 | }; 8 | // vim:ft=xkb 9 | -------------------------------------------------------------------------------- /config/X11/xkb/keymap/mine: -------------------------------------------------------------------------------- 1 | xkb_keymap { 2 | xkb_keycodes { include "evdev+aliases(qwerty)" }; 3 | xkb_types { include "complete" }; 4 | xkb_compat { include "complete+japan+mine" }; 5 | xkb_symbols { include "pc+jp+inet(evdev)+terminate(ctrl_alt_bksp)+mine" }; 6 | xkb_geometry { include "pc(pc105)" }; 7 | }; 8 | // vim:ft=xkb 9 | -------------------------------------------------------------------------------- /config/X11/xkb/symbols/mine: -------------------------------------------------------------------------------- 1 | default partial modifier_keys 2 | xkb_symbols "mine" { 3 | // Swap CapsLock and Control 4 | replace key { [ Control_L, Control_L ] }; 5 | replace key { [ Caps_Lock ] }; 6 | 7 | // Adjust underscore 8 | key { [ underscore, underscore ] }; 9 | }; 10 | // vim:ft=xkb 11 | -------------------------------------------------------------------------------- /config/afx/afx.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | github: 3 | - name: nurse/nkf 4 | description: Netword Kanji Filter 5 | owner: nurse 6 | repo: nkf 7 | command: 8 | build: 9 | steps: 10 | - make 11 | - make install prefix=~/.local 12 | link: 13 | - from: nkf 14 | 15 | - name: high-moctane/mocword-data 16 | description: Predict next words. 17 | owner: high-moctane 18 | repo: mocword-data 19 | release: 20 | name: mocword.sqlite.gz 21 | tag: eng20200217 22 | command: 23 | env: 24 | MOCWORD_DATA: $XDG_CACHE_HOME/mocword/mocword.sqlite 25 | link: 26 | - from: mocword.sqlite 27 | to: $XDG_CACHE_HOME/mocword/mocword.sqlite 28 | 29 | # - name: koron/cmigemo 30 | # description: C/Migemo 31 | # owner: koron 32 | # repo: cmigemo 33 | # command: 34 | # build: 35 | # steps: 36 | # - ./configure 37 | # # NOTE: Require editing /etc/ld.so.conf.d/*.conf and execute `ldconfig` 38 | # - make gcc-install prefix=~/.local FILTER_CP932='nkf -s' FILTER_EUCJP='nkf -e' 39 | # link: 40 | # - from: build/cmigemo 41 | 42 | # - name: tats/w3m 43 | # description: "Debian's w3m: WWW browsable pager" 44 | # owner: tats 45 | # repo: w3m 46 | # command: 47 | # build: 48 | # steps: 49 | # # NOTE: Require `apt install libgc-dev` 50 | # - ./configure 51 | # - make 52 | # - make install prefix=~/.local 53 | # link: 54 | # - from: w3m 55 | 56 | # - name: yusukebe/gh-markdown-preview 57 | # description: GitHub CLI extension to preview Markdown looks like GitHub. 58 | # owner: yusukebe 59 | # repo: gh-markdown-preview 60 | # as: 61 | # gh-extension: 62 | # name: gh-markdown-preview 63 | # tag: v1.4.0 64 | 65 | - name: kawarimidoll/gh-q 66 | description: A gh extension to clone GitHub repositories using fzf and ghq. 67 | owner: kawarimidoll 68 | repo: gh-q 69 | as: 70 | gh-extension: 71 | name: gh-q 72 | -------------------------------------------------------------------------------- /config/applications/chromium-browser-wrapper.desktop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env xdg-open 2 | [Desktop Entry] 3 | Version=1.0 4 | NoDisplay=true 5 | Name=Chromium Web Browser Wrapper 6 | Name[ja]=Chromium ウェブ・ブラウザ Wrapper 7 | GenericName=Web Browser 8 | GenericName[ja]=ウェブ・ブラウザ 9 | Comment=Access the Internet with Dark Mode 10 | Comment[ja]=インターネットにアクセス 11 | Exec=chromium-browser-wrapper %U 12 | Terminal=false 13 | X-MultipleArgs=false 14 | Type=Application 15 | Icon=chromium-browser 16 | Categories=Network;WebBrowser; 17 | StartupNotify=true 18 | Actions=NewWindow;Incognito;TempProfile; 19 | 20 | [Desktop Action NewWindow] 21 | Name=Open a New Window 22 | Name[ja]=新しいウィンドウを開く 23 | Exec=chromium-browser-wrapper 24 | 25 | [Desktop Action Incognito] 26 | Name=Open a New Window in incognito mode 27 | Name[ja]=新しいシークレット ウィンドウを開く 28 | Exec=chromium-browser-wrapper --incognito 29 | 30 | [Desktop Action TempProfile] 31 | Name=Open a New Window with a temporary profile 32 | Name[ja]=一時プロファイルで新しいウィンドウを開く 33 | Exec=chromium-browser-wrapper --temp-profile 34 | -------------------------------------------------------------------------------- /config/applications/discord.desktop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env xdg-open 2 | [Desktop Entry] 3 | Type=Application 4 | Name=Discord 5 | Comment=Discord PWA client 6 | # from https://discord.com/branding 7 | Icon=discord 8 | Exec=chromium-browser-wrapper --app=https://discord.com/app 9 | Terminal=false 10 | StartupNotify=true 11 | StartupWMClass=discord.com 12 | -------------------------------------------------------------------------------- /config/applications/element.desktop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env xdg-open 2 | [Desktop Entry] 3 | Type=Application 4 | Name=Element 5 | Comment=Matrix PWA client with Element 6 | Icon=element 7 | Exec=chromium-browser-wrapper --app=https://app.element.io 8 | Terminal=false 9 | StartupNotify=true 10 | StartupWMClass=app.element.io 11 | -------------------------------------------------------------------------------- /config/applications/misskey.desktop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env xdg-open 2 | [Desktop Entry] 3 | Type=Application 4 | Version=13.6.1 5 | Name=Misskey.io 6 | Comment=Misskey.io PWA client 7 | # from https://github.com/misskey-dev/assets/blob/fb10fb514c/favicon.png 8 | Icon=misskey 9 | Exec=chromium-browser-wrapper --app=https://misskey.io 10 | Terminal=false 11 | StartupNotify=true 12 | StartupWMClass=misskey.io 13 | -------------------------------------------------------------------------------- /config/applications/vim-jp-slack.desktop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env xdg-open 2 | [Desktop Entry] 3 | Type=Application 4 | Name=vim-jp Slack 5 | Comment=vim-jp Slack PWA client 6 | Icon=vim-jp 7 | Exec=chromium-browser-wrapper --app=https://vim-jp.slack.com 8 | Terminal=false 9 | StartupNotify=true 10 | StartupWMClass=vim-jp.slack.com 11 | -------------------------------------------------------------------------------- /config/aqua/aqua-policy.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # aqua Policy 3 | # https://aquaproj.github.io/ 4 | registries: 5 | # Example 6 | - name: local 7 | type: local 8 | path: experimental.yaml 9 | # - name: aqua-registry 10 | # type: github_content 11 | # repo_owner: aquaproj 12 | # repo_name: aqua-registry 13 | # ref: semver(">= 3.0.0") # ref is optional 14 | # path: registry.yaml 15 | - type: standard 16 | ref: semver(">= 3.0.0") 17 | packages: 18 | # Example 19 | - registry: local # allow all packages in the Registry 20 | # - name: cli/cli # allow only a specific package. The default value of registry is "standard" 21 | # - name: cli/cli 22 | # version: semver(">= 2.0.0") # version is optional 23 | - registry: standard 24 | -------------------------------------------------------------------------------- /config/aqua/aqua.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # aqua - Declarative CLI Version Manager 3 | # https://aquaproj.github.io/ 4 | registries: 5 | - type: standard 6 | ref: v4.374.0 # renovate: depName=aquaproj/aqua-registry 7 | - name: local 8 | type: local 9 | path: experimental.yaml 10 | 11 | packages: 12 | - name: ajeetdsouza/zoxide@v0.9.8 13 | - name: aquaproj/aqua-installer@v4.0.0 14 | - name: aquaproj/registry-tool@v0.3.5 15 | - name: aristocratos/btop@v1.4.3 16 | - name: b3nj5m1n/xdg-ninja@v0.2.0.1 17 | - name: babarot/afx@v0.2.1 18 | - name: BurntSushi/ripgrep@14.1.1 19 | - name: charmbracelet/glow@v2.1.1 20 | - name: cli/cli@v2.74.0 21 | - name: dandavison/delta@0.18.2 22 | - name: denoland/deno@v2.3.5 23 | - name: dylanaraps/neofetch@7.1.0 24 | - name: Enter-tainer/typstyle@v0.13.9 25 | - name: eza-community/eza@v0.21.3 26 | - name: golang.org/x/tools/gopls@v0.18.1 27 | - name: golang/go@go1.24.3 28 | - name: hadolint/hadolint@v2.12.0 29 | - name: hairyhenderson/gomplate@v4.3.2 30 | - name: high-moctane/mocword@v0.2.0 31 | - name: itchyny/gojq@v0.12.17 32 | - name: itchyny/mmv@v0.1.6 33 | - name: JohnnyMorganz/StyLua@v2.1.0 34 | - name: jqlang/jq@jq-1.8.0 35 | - name: junegunn/fzf/fzf-tmux@v0.62.0 36 | - name: junegunn/fzf@v0.62.0 37 | - name: k0kubun/xremap/x11@v0.16.6 38 | - name: ko1nksm/getoptions/gengetoptions@v3.3.2 39 | - name: ko1nksm/getoptions@v3.3.2 40 | - name: koalaman/shellcheck@v0.10.0 41 | - name: LuaLS/lua-language-server@3.14.0 42 | - name: mattn/efm-langserver@v0.0.54 43 | - name: mvdan/sh@v3.11.0 44 | - name: Myriad-Dreamin/tinymist@v0.13.12 45 | - name: nametake/golangci-lint-langserver@v0.0.11 46 | - name: nektos/act@v0.2.78 47 | - name: noahgorstein/jqp@v0.7.0 48 | - name: nodejs/node@v24.1.0 49 | - name: oven-sh/bun@bun-v1.2.15 50 | - name: rhysd/actionlint@v1.7.7 51 | - name: rhysd/hgrep@v0.3.8 52 | - name: rhysd/vim-startuptime@v1.3.2 53 | - name: sharkdp/bat@v0.25.0 54 | - name: sharkdp/fd@v10.2.0 55 | - name: sharkdp/hexyl@v0.16.0 56 | - name: sharkdp/hyperfine@v1.19.0 57 | - name: sharkdp/pastel@v0.10.0 58 | - name: sheepla/longgopher@v0.0.3 59 | - name: simeji/jid@v0.7.6 60 | - name: tamasfe/taplo/full@0.9.3 61 | - name: TomWright/dasel@v2.8.1 62 | - name: tree-sitter/tree-sitter@v0.25.5 63 | - name: typst/typst@v0.13.1 64 | - name: x-motemen/ghq@v1.8.0 65 | - name: XAMPPRocky/tokei@v12.1.2 66 | - name: ziglang/zig@0.14.1 67 | 68 | # local registry 69 | - name: thinca/ciw 70 | registry: local 71 | version: master 72 | - name: machikado-network/sakura@v0.4.3 73 | registry: local 74 | - name: rrethy/hexokinase 75 | registry: local 76 | version: master 77 | - name: pipeseroni/pipes.sh@v1.3.0 78 | registry: local 79 | -------------------------------------------------------------------------------- /config/aqua/experimental.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | packages: 3 | # init: a 4 | 5 | # init: b 6 | 7 | # init: c 8 | 9 | # init: d 10 | 11 | # init: e 12 | 13 | # init: f 14 | 15 | # init: g 16 | 17 | # init: h 18 | 19 | # init: i 20 | 21 | # init: j 22 | 23 | # init: k 24 | 25 | # init: l 26 | 27 | # init: m 28 | - type: github_release 29 | repo_owner: machikado-network 30 | repo_name: sakura 31 | asset: "{{.Version}}-{{.Arch}}-{{.OS}}" 32 | format: raw 33 | replacements: 34 | amd64: x86_64 35 | arm64: aarch64 36 | linux: unknown-linux-gnu 37 | supported_envs: 38 | - linux 39 | 40 | # init: n 41 | 42 | # init: o 43 | 44 | # init: p 45 | - type: github_content 46 | repo_owner: pipeseroni 47 | repo_name: pipes.sh 48 | path: pipes.sh 49 | description: Animated pipes terminal screensaver 50 | format: raw 51 | supported_envs: 52 | - darwin 53 | - linux 54 | 55 | # init: q 56 | 57 | # init: r 58 | - type: go_install 59 | repo_owner: rrethy 60 | repo_name: hexokinase 61 | description: Fast text scraper to find and convert colours (hex, rgb, rgb, hsl, web colours, custom patterns, etc.) into hex values 62 | 63 | # init: s 64 | 65 | # init: t 66 | - type: github_content 67 | repo_owner: thinca 68 | repo_name: ciw 69 | path: bin/ciw 70 | description: A wrapper to install cli binary from language associated package manager 71 | 72 | # init: u 73 | 74 | # init: v 75 | 76 | # init: w 77 | 78 | # init: x 79 | 80 | # init: y 81 | 82 | # init: z 83 | -------------------------------------------------------------------------------- /config/bat/config: -------------------------------------------------------------------------------- 1 | # Set the theme to "Midnight.hybrid" 2 | # NOTE: theme is from https://github.com/avvyas/theme-midnight 3 | --theme="Midnight.hybrid" 4 | 5 | # Show line numbers,Git modifications and file header (but no grid) 6 | # --style="numbers,changes,header" 7 | 8 | # Use italic text on the terminal (not supported on all terminals) 9 | --italic-text=always 10 | 11 | # Use ".gitignore"-style highlighting for ".ignore" files 12 | --map-syntax ".ignore:Git Ignore" 13 | 14 | # Show non-printable characters like space, tab or newline 15 | # --show-all 16 | 17 | # vim:ft=conf 18 | -------------------------------------------------------------------------------- /config/btop/btop.conf.patch: -------------------------------------------------------------------------------- 1 | diff --git a/config/btop/btop.conf b/config/btop/btop.conf 2 | --- a/config/btop/btop.conf 3 | +++ b/config/btop/btop.conf 4 | @@ -2,7 +2,8 @@ 5 | 6 | #* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes. 7 | #* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes" 8 | -color_theme = "Default" 9 | +# from https://github.com/aristocratos/btop/blob/main/themes/tokyo-night.theme 10 | +color_theme = "tokyo-night" 11 | 12 | #* If the theme set background should be shown, set to False if you want terminal background transparency. 13 | theme_background = True 14 | @@ -22,7 +23,7 @@ presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:defaul 15 | 16 | #* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists. 17 | #* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift. 18 | -vim_keys = False 19 | +vim_keys = True 20 | 21 | #* Rounded corners on boxes, is ignored if TTY mode is ON. 22 | rounded_corners = True 23 | @@ -32,7 +33,7 @@ rounded_corners = True 24 | #* "block" has half the resolution of braille but uses more common characters. 25 | #* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY. 26 | #* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view. 27 | -graph_symbol = "braille" 28 | +graph_symbol = "tty" 29 | 30 | # Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty". 31 | graph_symbol_cpu = "default" 32 | @@ -47,10 +48,10 @@ graph_symbol_net = "default" 33 | graph_symbol_proc = "default" 34 | 35 | #* Manually set which boxes to show. Available values are "cpu mem net proc", separate values with whitespace. 36 | -shown_boxes = "cpu mem net proc" 37 | +shown_boxes = "cpu proc" 38 | 39 | #* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs. 40 | -update_ms = 2000 41 | +update_ms = 500 42 | 43 | #* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct", 44 | #* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly. 45 | @@ -101,7 +102,7 @@ cpu_invert_lower = True 46 | cpu_single_graph = False 47 | 48 | #* Show cpu box at bottom of screen instead of top. 49 | -cpu_bottom = False 50 | +cpu_bottom = True 51 | 52 | #* Shows the system uptime in the CPU box. 53 | show_uptime = True 54 | @@ -209,4 +210,4 @@ selected_battery = "Auto" 55 | 56 | #* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG". 57 | #* The level set includes all lower levels, i.e. "DEBUG" will show all logging info. 58 | -log_level = "WARNING" 59 | \ No newline at end of file 60 | +log_level = "INFO" 61 | -------------------------------------------------------------------------------- /config/btop/themes/tokyo-night.theme: -------------------------------------------------------------------------------- 1 | # Theme: tokyo-night 2 | # By: Pascal Jaeger 3 | 4 | # Main bg 5 | theme[main_bg]="#1a1b26" 6 | 7 | # Main text color 8 | theme[main_fg]="#cfc9c2" 9 | 10 | # Title color for boxes 11 | theme[title]="#cfc9c2" 12 | 13 | # Higlight color for keyboard shortcuts 14 | theme[hi_fg]="#7dcfff" 15 | 16 | # Background color of selected item in processes box 17 | theme[selected_bg]="#414868" 18 | 19 | # Foreground color of selected item in processes box 20 | theme[selected_fg]="#cfc9c2" 21 | 22 | # Color of inactive/disabled text 23 | theme[inactive_fg]="#565f89" 24 | 25 | # Misc colors for processes box including mini cpu graphs, details memory graph and details status text 26 | theme[proc_misc]="#7dcfff" 27 | 28 | # Cpu box outline color 29 | theme[cpu_box]="#565f89" 30 | 31 | # Memory/disks box outline color 32 | theme[mem_box]="#565f89" 33 | 34 | # Net up/down box outline color 35 | theme[net_box]="#565f89" 36 | 37 | # Processes box outline color 38 | theme[proc_box]="#565f89" 39 | 40 | # Box divider line and small boxes line color 41 | theme[div_line]="#565f89" 42 | 43 | # Temperature graph colors 44 | theme[temp_start]="#9ece6a" 45 | theme[temp_mid]="#e0af68" 46 | theme[temp_end]="#f7768e" 47 | 48 | # CPU graph colors 49 | theme[cpu_start]="#9ece6a" 50 | theme[cpu_mid]="#e0af68" 51 | theme[cpu_end]="#f7768e" 52 | 53 | # Mem/Disk free meter 54 | theme[free_start]="#9ece6a" 55 | theme[free_mid]="#e0af68" 56 | theme[free_end]="#f7768e" 57 | 58 | # Mem/Disk cached meter 59 | theme[cached_start]="#9ece6a" 60 | theme[cached_mid]="#e0af68" 61 | theme[cached_end]="#f7768e" 62 | 63 | # Mem/Disk available meter 64 | theme[available_start]="#9ece6a" 65 | theme[available_mid]="#e0af68" 66 | theme[available_end]="#f7768e" 67 | 68 | # Mem/Disk used meter 69 | theme[used_start]="#9ece6a" 70 | theme[used_mid]="#e0af68" 71 | theme[used_end]="#f7768e" 72 | 73 | # Download graph colors 74 | theme[download_start]="#9ece6a" 75 | theme[download_mid]="#e0af68" 76 | theme[download_end]="#f7768e" 77 | 78 | # Upload graph colors 79 | theme[upload_start]="#9ece6a" 80 | theme[upload_mid]="#e0af68" 81 | theme[upload_end]="#f7768e" 82 | -------------------------------------------------------------------------------- /config/ciw/list: -------------------------------------------------------------------------------- 1 | cargo:cargo-expand 2 | cargo:dont 3 | go:github.com/b4b4r07/git-bump 4 | go:github.com/fedeztk/got/cmd/got 5 | go:github.com/haya14busa/hyperlink/cmd/hyperlink 6 | go:github.com/jmhobbs/terminal-parrot 7 | go:github.com/mattn/longcat 8 | go:github.com/motemen/sbx 9 | go:github.com/sheepla/fzenn 10 | go:github.com/syumai/longify 11 | npm:npm 12 | npm:pnpm 13 | npm:prettier 14 | -------------------------------------------------------------------------------- /config/curlrc: -------------------------------------------------------------------------------- 1 | http1.1 2 | 3 | referer = ";auto" 4 | 5 | connect-timeout = 300 6 | speed-time = 120 7 | speed-limit = 9000000 8 | 9 | location 10 | 11 | retry = 4 12 | retry-delay = 5 13 | retry-max-time = 10 14 | 15 | silent 16 | show-error 17 | 18 | write-out = "\n" 19 | -------------------------------------------------------------------------------- /config/efm-langserver/config.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | version: 2 3 | lint-debounce: 0.5s 4 | root-markers: 5 | - .git/ 6 | - .git 7 | tools: 8 | textlint-lint: &textlint-lint 9 | prefix: textlint 10 | lint-command: > 11 | deno run --allow-all --no-lock 12 | npm:textlint --cache --format=unix --no-color ${INPUT} 13 | lint-ignore-exit-code: true 14 | lint-formats: 15 | - "%f:%l:%c: %m [%trror/%r]" 16 | - "%E%f:%l:%c: %m" 17 | root-markers: 18 | - .textlintrc 19 | - .textlintrc.json 20 | - .textlintrc.yaml 21 | - .textlintrc.yml 22 | require-marker: true 23 | commands: 24 | - title: textlint fix 25 | command: deno 26 | arguments: 27 | - run 28 | - --allow-all 29 | - --no-lock 30 | - npm:textlint 31 | - --cache 32 | - --fix 33 | - ${INPUT} 34 | 35 | hadolint-lint: &hadolint-lint 36 | prefix: hadolint 37 | lint-command: hadolint 38 | lint-formats: 39 | - "%f:%l DL%n %t%*[a-z]: %m" 40 | 41 | fixjson-format: &fixjson-format 42 | format-command: > 43 | deno run --allow-all --no-config --no-lock --node-modules-dir=false 44 | npm:fixjson --stdin-filename ${INPUT} 45 | format-stdin: true 46 | 47 | stylua-format: &stylua-format 48 | format-command: stylua --search-parent-directories - 49 | format-stdin: true 50 | 51 | shellcheck-lint: &shellcheck-lint 52 | prefix: shellcheck 53 | lint-command: shellcheck -f gcc -x - 54 | lint-stdin: true 55 | lint-formats: 56 | - "%f:%l:%c: %t%*[^:]: %m [SC%n]" 57 | 58 | shfmt-format: &shfmt-format 59 | format-command: shfmt -s -ln bash -i 2 -bn -ci -sr 60 | format-stdin: true 61 | 62 | actionlint-lint: &actionlint-lint 63 | prefix: actionlint 64 | lint-command: "bash -c \"[[ '${INPUT}' =~ \\\\.github/workflows/ ]]\" && actionlint -oneline -no-color -" 65 | lint-stdin: true 66 | lint-formats: 67 | - "%f:%l:%c: %m" 68 | root-markers: 69 | - .github 70 | 71 | languages: 72 | dockerfile: 73 | - <<: *hadolint-lint 74 | json: 75 | - <<: *fixjson-format 76 | markdown: 77 | - <<: *textlint-lint 78 | lua: 79 | - <<: *stylua-format 80 | sh: 81 | - <<: *shellcheck-lint 82 | - <<: *shfmt-format 83 | yaml: 84 | - <<: *actionlint-lint 85 | -------------------------------------------------------------------------------- /config/fcitx5/conf/skk.conf: -------------------------------------------------------------------------------- 1 | # 入力方式 2 | Rule=StickyShift 3 | # 句読点スタイル 4 | PunctuationStyle=Japanese 5 | # 初期入力モード 6 | InitialInputMode=Hiragana 7 | # ページサイズ 8 | PageSize=7 9 | # 候補のレイアウト 10 | Candidate Layout=Vertical 11 | # 確定時にリターンキーを押しても改行を挿入しない 12 | EggLikeNewLine=True 13 | # 注釈を表示 14 | ShowAnnotation=True 15 | # 候補の選択に使用するキー 16 | CandidateChooseKey="Qwerty Center Row (a,s,d,...)" 17 | # 候補ウィンドウを表示するまでの候補数 18 | NTriggersToShowCandWin=2 19 | 20 | [CandidatesPageUpKey] 21 | 0=Page_Up 22 | 23 | [CandidatesPageDownKey] 24 | 0=Next 25 | 26 | [CursorUp] 27 | 0=Up 28 | 29 | [CursorDown] 30 | 0=Down 31 | 32 | -------------------------------------------------------------------------------- /config/fcitx5/conf/xcb.conf: -------------------------------------------------------------------------------- 1 | # システム XKB 設定のオーバーライドを許可する 2 | Allow Overriding System XKB Settings=False 3 | # 常にレイアウトをグループレイアウトのみにする 4 | AlwaysSetToGroupLayout=True 5 | 6 | -------------------------------------------------------------------------------- /config/fcitx5/config: -------------------------------------------------------------------------------- 1 | [Hotkey] 2 | # トリガーキーを押すたびに切り替える 3 | EnumerateWithTriggerKeys=True 4 | # 切り替え時は第1入力メソッドをスキップする 5 | EnumerateSkipFirst=False 6 | 7 | [Hotkey/TriggerKeys] 8 | 0=Control+space 9 | 1=Zenkaku_Hankaku 10 | 2=Hangul 11 | 12 | [Hotkey/AltTriggerKeys] 13 | 0=Shift_L 14 | 15 | [Hotkey/EnumerateForwardKeys] 16 | 0=Control+Shift_L 17 | 18 | [Hotkey/EnumerateBackwardKeys] 19 | 0=Control+Shift_R 20 | 21 | [Hotkey/EnumerateGroupForwardKeys] 22 | 0=Super+space 23 | 24 | [Hotkey/EnumerateGroupBackwardKeys] 25 | 0=Shift+Super+space 26 | 27 | [Hotkey/ActivateKeys] 28 | 0=Henkan 29 | 30 | [Hotkey/DeactivateKeys] 31 | 0=Muhenkan 32 | 33 | [Hotkey/PrevPage] 34 | 0=Up 35 | 36 | [Hotkey/NextPage] 37 | 0=Down 38 | 39 | [Hotkey/PrevCandidate] 40 | 0=Shift+Tab 41 | 42 | [Hotkey/NextCandidate] 43 | 0=Tab 44 | 45 | [Hotkey/TogglePreedit] 46 | 0=Control+Alt+P 47 | 48 | [Behavior] 49 | # デフォルトで有効にする 50 | ActiveByDefault=False 51 | # 入力状態を共有する 52 | ShareInputState=No 53 | # アプリケーションにプリエディットを表示する 54 | PreeditEnabledByDefault=True 55 | # 入力メソッドを切り替える際に入力メソッドの情報を表示する 56 | ShowInputMethodInformation=True 57 | # フォーカスを変更する際に入力メソッドの情報を表示する 58 | showInputMethodInformationWhenFocusIn=False 59 | # 入力メソッドの情報をコンパクトに表示する 60 | CompactInputMethodInformation=True 61 | # 第1入力メソッドの情報を表示する 62 | ShowFirstInputMethodInformation=True 63 | # デフォルトのページサイズ 64 | DefaultPageSize=5 65 | # XKB オプションより優先する 66 | OverrideXkbOption=False 67 | # カスタム XKB オプション 68 | CustomXkbOption= 69 | # Force Enabled Addons 70 | EnabledAddons= 71 | # Force Disabled Addons 72 | DisabledAddons= 73 | # Preload input method to be used by default 74 | PreloadInputMethod=True 75 | 76 | -------------------------------------------------------------------------------- /config/fcitx5/dictionary_list: -------------------------------------------------------------------------------- 1 | type=file,file=/home/hibiki/.local/share/skk/SKK-JISYO.user,mode=readwrite,encoding=UTF-8 2 | type=file,file=/home/hibiki/.local/share/skk/SKK-JISYO.4513echo,mode=readonly,encoding=UTF-8 3 | type=file,file=/usr/share/skk/SKK-JISYO.L,mode=readonly 4 | -------------------------------------------------------------------------------- /config/fcitx5/profile: -------------------------------------------------------------------------------- 1 | [Groups/0] 2 | # Group Name 3 | Name=デフォルト 4 | # Layout 5 | Default Layout=jp 6 | # Default Input Method 7 | DefaultIM=skk 8 | 9 | [Groups/0/Items/0] 10 | # Name 11 | Name=keyboard-jp 12 | # Layout 13 | Layout= 14 | 15 | [Groups/0/Items/1] 16 | # Name 17 | Name=skk 18 | # Layout 19 | Layout= 20 | 21 | [GroupOrder] 22 | 0=デフォルト 23 | 24 | -------------------------------------------------------------------------------- /config/fontconfig/fonts.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | serif 6 | 7 | Noto Serif 8 | Noto Serif CJK JP 9 | 10 | 11 | 12 | sans-serif 13 | 14 | Noto Sans 15 | Noto Sans CJK JP 16 | 17 | 18 | 19 | monospace 20 | 21 | HackGen35 Console NFJ 22 | Noto Sans Mono CJK JP 23 | Noto Sans Mono 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /config/gh/config.yml: -------------------------------------------------------------------------------- 1 | # What protocol to use when performing git operations. Supported values: ssh, https 2 | git_protocol: https 3 | # What editor gh should run when creating issues, pull requests, etc. If blank, will refer to environment. 4 | editor: nvim 5 | # When to interactively prompt. This is a global config that cannot be overridden by hostname. Supported values: enabled, disabled 6 | prompt: enabled 7 | # A pager program to send command output to, e.g. "less". Set the value to "cat" to disable the pager. 8 | pager: 9 | # Aliases allow you to create nicknames for gh commands 10 | aliases: 11 | assets: > 12 | !gh release list | fzf --preview 'gh release view {1} | head -100' | awk '{print $1}' | xargs gh release view 13 | co: pr checkout 14 | current: repo view --json nameWithOwner --jq '.nameWithOwner' 15 | default-branch: repo view --json defaultBranchRef --jq '.defaultBranchRef.name' 16 | description: repo view --json description --jq '.description' 17 | forked: repo list --json nameWithOwner,isFork --jq '.[] | select(.isFork) | .nameWithOwner' 18 | starred: api --paginate /user/starred --jq 'map(.full_name)[]' 19 | stars: repo view --json stargazerCount --jq '.stargazerCount' 20 | # The path to a unix socket through which send HTTP connections. If blank, HTTP traffic will be handled by net/http.DefaultTransport. 21 | http_unix_socket: 22 | # What web browser gh should use when opening URLs. If blank, will refer to environment. 23 | browser: 24 | -------------------------------------------------------------------------------- /config/gh/extension: -------------------------------------------------------------------------------- 1 | gh dash 2 | gh eco coloradocolby/gh-eco v0.1.0 3 | gh gh kawarimidoll/gh-gh b80a55bc 4 | gh graph kawarimidoll/gh-graph 30a1fa20 5 | gh i gennaro-tedesco/gh-i v0.0.6 6 | gh install redraw/gh-install cffe5802 7 | gh notify meiji163/gh-notify eef345c4 8 | gh ost mattn/gh-ost 7f4381fb 9 | gh q kawarimidoll/gh-q 5dc627f3 10 | gh user-stars korosuke613/gh-user-stars 1829ccdb 11 | gh userfetch sheepla/gh-userfetch 9c90b188 12 | -------------------------------------------------------------------------------- /config/git/commit_template: -------------------------------------------------------------------------------- 1 | ; build ; Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) 2 | ; chore ; Changes to the build process or auxiliary tools and libraries such as documentation generation 3 | ; ci ; Changes to our CI configuration files and scripts (examples: CircleCi, SauceLabs) 4 | ; docs ; Documentation only changes 5 | ; feat ; A new feature 6 | ; fix ; A bug fix 7 | ; perf ; A code change that improves performance 8 | ; refactor ; A code change that neither fixes a bug nor adds a feature 9 | ; test ; Adding missing tests or correcting existing tests 10 | 11 | ; [optional body] 12 | 13 | ; [optional footer(s)] 14 | ; BREAKING CHANGE: 15 | ; DEPRECATED: 16 | 17 | ; ========== 18 | ; Conventional Commits 19 | ; - https://www.conventionalcommits.org/ja/v1.0.0/ 20 | ; Commit Message Guidelines 21 | ; - https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit 22 | ; vim:ft=gitcommit 23 | -------------------------------------------------------------------------------- /config/git/config: -------------------------------------------------------------------------------- 1 | [user] 2 | name = 4513ECHO 3 | email = mail@4513echo.dev 4 | signingKey = C2DB74FEBDBD70BAB486B87D0A1D7A083E45B697 5 | 6 | [core] 7 | editor = $HOME/.config/git/editor.sh 8 | quotepath = false 9 | commentChar = ";" 10 | 11 | [pager] 12 | diff = $HOME/.config/git/diff.sh | less -R 13 | log = $HOME/.config/git/diff.sh | less -R 14 | show = $HOME/.config/git/diff.sh | less -R 15 | 16 | [color] 17 | ui = auto 18 | diff = auto 19 | status = auto 20 | branch = auto 21 | 22 | [init] 23 | defaultBranch = main 24 | 25 | [push] 26 | default = simple 27 | autoSetupRemote = true 28 | 29 | [pull] 30 | rebase = false 31 | ff = only 32 | 33 | [rerere] 34 | enabled = true 35 | 36 | [status] 37 | showUntrackedFiles = all 38 | 39 | [commit] 40 | template = ~/.config/git/commit_template 41 | verbose = true 42 | gpgSign = true 43 | 44 | [diff] 45 | tool = vimdiff 46 | algorithm = histogram 47 | compactionHeuristic = true 48 | colorMoved = dimmed-zebra 49 | colorMovedWS = allow-indentation-change 50 | 51 | [difftool] 52 | prompt = false 53 | 54 | [merge] 55 | conflictstyle = diff3 56 | ff = false 57 | 58 | [fetch] 59 | prune = true 60 | 61 | [rebase] 62 | autostash = true 63 | 64 | [alias] 65 | ### command abbrev ### 66 | adn = add --intent-to-add # -N 67 | adp = add --patch # -p 68 | adu = add --update # -u 69 | br = branch 70 | df = diff 71 | dft = difftool 72 | pushf = push --force-with-lease --force-if-includes 73 | st = status 74 | stat = diff --stat 75 | sw = switch 76 | ### feature shortcut ### 77 | alias = !git config --get-regexp "^alias" | sed 's@alias\\.\\(\\S*\\) \\(.*\\)@\\1\\\t -> \\2@' 78 | contributors = shortlog --summary --numbered --email 79 | default-branch = !git symbolic-ref refs/remotes/origin/HEAD | sed "s@refs/remotes/origin/@@" 80 | dirs = !git ls-files | sed -e "/^[^\\/]*$/d" -e "s:/[^/]*$::" | uniq 81 | fixit = commit --amend --no-edit 82 | get = "!f(){ \ 83 | ghq get --update $1; \ 84 | cd \"$(ghq list --exact --full-path $1)\"; \ 85 | [ -z \"$(git config --get remote.origin.gh-resolved)\" ] && gh repo set-default /dev/tty; \ 86 | git remote get-url upstream 2>/dev/null >&2 || \ 87 | git remote add upstream \"$(gh repo view --json url --jq .url)\"; \ 88 | echo $PWD; \ 89 | };f" 90 | graph = log --graph --date=short --decorate=short --pretty=format:'%Cgreen%h %Creset%cd %Cblue%cn %Cred%d %Creset%s' 91 | sha = "!f(){ git rev-parse --short \"${1:-HEAD}\"; };f" 92 | home = !git switch $(git default-branch) 93 | ignored = !git status --ignored --short | awk '$1 == \"!!\" {print $2}' 94 | latest = describe --tags --abbrev=0 95 | recommit = commit --amend 96 | root = rev-parse --show-toplevel 97 | sync = "!f(){ \ 98 | [ -z \"$(git config --get remote.origin.gh-resolved)\" ] && gh repo set-default /dev/tty; \ 99 | [ -z \"$(gh repo view \"$(git config --get remote.origin.url)\" --json isFork --jq '.isFork and empty')\" ] && { \ 100 | git remote get-url upstream 2>/dev/null >&2 || \ 101 | git remote add upstream \"$(gh repo view --json url --jq .url)\"; \ 102 | git pull upstream \"$(git default-branch)\"; \ 103 | }; \ 104 | git fetch --prune; \ 105 | git pull origin \"$(git default-branch)\"; \ 106 | };f" 107 | uncommit = reset --soft HEAD^ 108 | unstage = restore --staged 109 | untrack = rm --cached 110 | 111 | [credential "https://github.com"] 112 | helper = !gh auth git-credential 113 | [credential "https://gist.github.com"] 114 | helper = !gh auth git-credential 115 | 116 | [ghq] 117 | root = ~/Develops 118 | 119 | [include] 120 | path = ~/.gitconfig.local 121 | path = ./delta.gitconfig 122 | 123 | # vim:ft=gitconfig 124 | -------------------------------------------------------------------------------- /config/git/delta.gitconfig: -------------------------------------------------------------------------------- 1 | [interactive] 2 | diffFilter = delta --color-only --features=interactive\\ hybrid 3 | 4 | [diff] 5 | colorMoved = default 6 | 7 | [delta] 8 | features = decorations hybrid 9 | 10 | [delta "interactive"] 11 | keep-plus-minus-markers = false 12 | 13 | [delta "decorations"] 14 | navigate = true 15 | 16 | [delta "hybrid"] 17 | # author: https://github.com/4513ECHO 18 | # original theme is from https://github.com/w0ng/vim-hybrid 19 | # syntax-theme is from https://github.com/avvyas/theme-midnight 20 | syntax-theme = Midnight.hybrid 21 | dark = true 22 | true-color = always 23 | file-added-label = [+] 24 | file-copied-label = [C] 25 | file-modified-label = [M] 26 | file-removed-label = [-] 27 | file-renamed-label = [R] 28 | file-style = "#81a2be" 29 | grep-file-style = "#81a2be" 30 | grep-line-number-style = "#81a2be" 31 | line-numbers = true 32 | line-numbers-left-style = "#81a2be" 33 | line-numbers-minus-style = "#cc6666" 34 | line-numbers-plus-style = "#5f875f" 35 | line-numbers-right-style = "#81a2be" 36 | minus-emph-style = syntax "#bf4040" 37 | minus-style = syntax "#cc6666" 38 | plus-emph-style = syntax "#4a694a" 39 | plus-style = syntax "#5f875f" 40 | tabs = 8 41 | 42 | # vim:ft=gitconfig 43 | -------------------------------------------------------------------------------- /config/git/diff.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | if [ -n "${GIT_DIFFER:-}" ]; then 4 | $GIT_DIFFER "$@" 5 | exit $? 6 | fi 7 | if command -v delta > /dev/null; then 8 | delta "$@" 9 | elif command -v diff-highlight > /dev/null; then 10 | diff-highlight "$@" 11 | elif [ -x /usr/share/doc/git/contrib/diff-highlight/diff-highlight ]; then 12 | /usr/share/doc/git/contrib/diff-highlight/diff-highlight "$@" 13 | elif [ -x /usr/share/git/diff-highlight/diff-highlight ]; then 14 | /usr/share/git/diff-highlight/diff-highlight "$@" 15 | else 16 | cat "$@" 17 | fi 18 | -------------------------------------------------------------------------------- /config/git/editor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ue 3 | if [ -n "${GIT_EDITOR:-}" ]; then 4 | $GIT_EDITOR "$@" 5 | exit $? 6 | fi 7 | if [ -n "${NVIM:-}" ] || [ -n "${VIM_TERMINAL:-}" ]; then 8 | $EDITOR "$@" 9 | elif command -v nvim > /dev/null; then 10 | nvim "$@" 11 | else 12 | vim "$@" 13 | fi 14 | -------------------------------------------------------------------------------- /config/git/ignore: -------------------------------------------------------------------------------- 1 | # Python 2 | __pycache__/ 3 | venv/ 4 | .venv/ 5 | .env 6 | 7 | # vim 8 | [._]*.s[a-v][a-z] 9 | !*.svg 10 | [._]*.sw[a-p] 11 | [._]s[a-rt-v][a-z] 12 | [._]ss[a-gi-z] 13 | [._]sw[a-p] 14 | Session.vim 15 | Sessionx.vim 16 | .netrwhist 17 | *~ 18 | tags/ 19 | [._]*.un~ 20 | 21 | # node 22 | node_modules/ 23 | 24 | # macOS 25 | .DS_Store 26 | .AppleDouble 27 | .LSOverride 28 | 29 | # others 30 | *.log 31 | *.tmp 32 | *.bak 33 | *.bk 34 | .vimrc.local 35 | *.zwc 36 | 37 | !**.gitkeep 38 | # vim:ft=gitignore 39 | -------------------------------------------------------------------------------- /config/gtk-3.0/settings.ini: -------------------------------------------------------------------------------- 1 | [Settings] 2 | gtk-application-prefer-dark-theme = true 3 | -------------------------------------------------------------------------------- /config/i3/config: -------------------------------------------------------------------------------- 1 | # i3 config file (v4) 2 | # 3 | # Please see https://i3wm.org/docs/userguide.html for a complete reference! 4 | 5 | set $mod Mod4 6 | 7 | # Font for window titles. Will also be used by the bar unless a different font 8 | # is used in the bar {} block below. 9 | font pango:monospace 8 10 | 11 | # Use Mouse+$mod to drag floating windows to their wanted position 12 | floating_modifier $mod 13 | 14 | # title on bar 15 | title_align center 16 | 17 | # diable focus when hovering mouse 18 | focus_follows_mouse no 19 | 20 | # Wallpaper 21 | exec --no-startup-id feh --bg-scale --no-fehbg ~/Pictures/wallpaper.jpg 22 | # Screen locker 23 | exec --no-startup-id xautolock -time 5 -locker 'i3lock-fancy' -detectsleep 24 | 25 | # start a terminal 26 | bindsym $mod+Return exec i3-sensible-terminal 27 | 28 | # start a browser 29 | bindsym $mod+b exec --no-startup-id sensible-browser 30 | 31 | # kill focused window 32 | bindsym $mod+Shift+q kill 33 | bindsym $mod+F4 kill 34 | 35 | # start rofi (a program launcher) 36 | bindsym $mod+d exec --no-startup-id rofi -show combi 37 | 38 | # change focus 39 | bindsym $mod+h focus left 40 | bindsym $mod+j focus down 41 | bindsym $mod+k focus up 42 | bindsym $mod+l focus right 43 | 44 | # move focused window 45 | bindsym $mod+Shift+h move left 46 | bindsym $mod+Shift+j move down 47 | bindsym $mod+Shift+k move up 48 | bindsym $mod+Shift+l move right 49 | 50 | # split in horizontal/vertical orientation 51 | bindsym $mod+v split horizontal 52 | bindsym $mod+s split vertical 53 | 54 | # enter fullscreen mode for the focused container 55 | bindsym $mod+f fullscreen toggle 56 | 57 | # change container layout 58 | set $layout "layout [(h)orizontal/(v)ertical/t(o)ggle split/(s)tacking/(t)abbed/(f)loating]" 59 | mode $layout { 60 | bindsym h layout splitv; mode "default" 61 | bindsym v layout splith; mode "default" 62 | bindsym o layout toggle split; mode "default" 63 | bindsym s layout stacking; mode "default" 64 | bindsym t layout tabbed; mode "default" 65 | bindsym f floating toggle; mode "default" 66 | # back to normal: Enter or Escape or $mod+w 67 | bindsym Return mode "default" 68 | bindsym Escape mode "default" 69 | bindsym $mod+w mode "default" 70 | } 71 | bindsym $mod+w mode $layout 72 | 73 | # change focus between tiling / floating windows 74 | bindsym $mod+space focus mode_toggle 75 | 76 | # focus the parent container 77 | bindsym $mod+a focus parent 78 | 79 | # Define names for default workspaces for which we configure key bindings later on. 80 | # We use variables to avoid repeating the names in multiple places. 81 | set $ws1 "1" 82 | set $ws2 "2" 83 | set $ws3 "3" 84 | set $ws4 "4" 85 | set $ws5 "5" 86 | set $ws6 "6" 87 | set $ws7 "7" 88 | set $ws8 "8" 89 | set $ws9 "9" 90 | set $ws10 "10" 91 | 92 | # switch to workspace 93 | bindsym $mod+1 workspace number $ws1 94 | bindsym $mod+2 workspace number $ws2 95 | bindsym $mod+3 workspace number $ws3 96 | bindsym $mod+4 workspace number $ws4 97 | bindsym $mod+5 workspace number $ws5 98 | bindsym $mod+6 workspace number $ws6 99 | bindsym $mod+7 workspace number $ws7 100 | bindsym $mod+8 workspace number $ws8 101 | bindsym $mod+9 workspace number $ws9 102 | bindsym $mod+0 workspace number $ws10 103 | 104 | # move focused container to workspace 105 | bindsym $mod+Shift+1 move container to workspace number $ws1 106 | bindsym $mod+Shift+2 move container to workspace number $ws2 107 | bindsym $mod+Shift+3 move container to workspace number $ws3 108 | bindsym $mod+Shift+4 move container to workspace number $ws4 109 | bindsym $mod+Shift+5 move container to workspace number $ws5 110 | bindsym $mod+Shift+6 move container to workspace number $ws6 111 | bindsym $mod+Shift+7 move container to workspace number $ws7 112 | bindsym $mod+Shift+8 move container to workspace number $ws8 113 | bindsym $mod+Shift+9 move container to workspace number $ws9 114 | bindsym $mod+Shift+0 move container to workspace number $ws10 115 | 116 | # reload the configuration file 117 | bindsym $mod+Shift+c reload 118 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3) 119 | bindsym $mod+Shift+r restart 120 | # exit i3 (logs you out of your X session) 121 | bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" 122 | 123 | # Take screenshot 124 | bindsym Print exec maim --format=png ~/Pictures/screenshot-$(date +%F_%H%M%S)-all.png 125 | bindsym $mod+Print exec maim --format=png --window $(xdotool getactivewindow) ~/Pictures/screenshot-$(date +%F_%H%M%S)-current.png 126 | bindsym Shift+Print exec maim --format=png --select ~/Pictures/screenshot-$(date +%F_%H%M%S)-selected.png 127 | 128 | # resize window (you can also use the mouse for that) 129 | mode "resize" { 130 | # Pressing left will shrink the window’s width. 131 | # Pressing right will grow the window’s width. 132 | # Pressing up will shrink the window’s height. 133 | # Pressing down will grow the window’s height. 134 | bindsym h resize shrink width 10 px or 10 ppt 135 | bindsym j resize grow height 10 px or 10 ppt 136 | bindsym k resize shrink height 10 px or 10 ppt 137 | bindsym l resize grow width 10 px or 10 ppt 138 | # back to normal: Enter or Escape or $mod+r 139 | bindsym Return mode "default" 140 | bindsym Escape mode "default" 141 | bindsym $mod+r mode "default" 142 | } 143 | bindsym $mod+r mode "resize" 144 | 145 | include ~/.config/i3/hatsunemiku.conf 146 | -------------------------------------------------------------------------------- /config/i3/hatsunemiku.conf: -------------------------------------------------------------------------------- 1 | # hatsunemiku theme 2 | # based on a template generated by https://thomashunter.name/i3-configurator/ 3 | 4 | # class border bground text indicator child_border 5 | client.focused #4A4B4B #13868C #DCD7D7 #12868C #4A4B4B 6 | client.focused_inactive #4A4B4B #4A4B4B #DCDCD7 #4A4B4B #4A4B4B 7 | client.unfocused #242829 #242829 #7B8B99 #242829 #242829 8 | client.urgent #DF2683 #DF2683 #DCDCD7 #DF2683 #DF2683 9 | client.placeholder #000000 #0C0C0C #DCDCD7 #000000 #0C0C0C 10 | 11 | client.background #242829 12 | 13 | # Start i3bar to display a workspace bar (plus the system information i3status 14 | # finds out, if available) 15 | bar { 16 | status_command i3status 17 | position top 18 | 19 | colors { 20 | background #000000 21 | statusline #DFD7D7 22 | separator #4A4B4B 23 | 24 | focused_workspace #12868C #12868C #DFD7D7 25 | active_workspace #4A4B4B #4A4B4B #DFD7D7 26 | inactive_workspace #4A4B4B #4A4B4B #7B8B99 27 | urgent_workspace #DF2683 #DF2683 #DFD7D7 28 | binding_mode #DF2683 #DF2683 #DFD7D7 29 | } 30 | } 31 | 32 | # vim:ft=i3config 33 | -------------------------------------------------------------------------------- /config/jq/4513echo/ripgrep.jq: -------------------------------------------------------------------------------- 1 | module { 2 | name: "4513echo/ripgrep", 3 | version: "0.1.0" 4 | }; 5 | 6 | # based on https://github.com/thinca/config/blob/eb27ff47/dotfiles/dot.vim/vimrc#L598 7 | def parse: 8 | select(.type == "match") 9 | | .data as $data 10 | | $data.submatches[] 11 | | [$data.path.text, $data.line_number, .start + 1, .end + 1, $data.lines.text // "" | sub("\n$"; "")] 12 | | join(":"); 13 | -------------------------------------------------------------------------------- /config/libskk/rules/StickyShift/keymap/hiragana.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": [ 3 | "default/hiragana" 4 | ], 5 | "define": { 6 | "keymap": { 7 | ";": "start-preedit-no-delete" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /config/libskk/rules/StickyShift/keymap/katakana.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": [ 3 | "default/katakana" 4 | ], 5 | "define": { 6 | "keymap": { 7 | ";": "start-preedit-no-delete" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /config/libskk/rules/StickyShift/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Stichy Shift", 3 | "description": "Enable Sticky Shift" 4 | } 5 | -------------------------------------------------------------------------------- /config/libskk/rules/StickyShift/rom-kana/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "include": [ 3 | "default/default" 4 | ], 5 | "define": { 6 | "rom-kana": { 7 | "!": ["", "!"], 8 | "(": ["", "("], 9 | ")": ["", ")"], 10 | "va": ["", "ゔぁ"], 11 | "ve": ["", "ゔぇ"], 12 | "vi": ["", "ゔぃ"], 13 | "vo": ["", "ゔぉ"], 14 | "vu": ["", "ゔ"], 15 | "z ": ["", " "] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /config/nvim/after/ftplugin/help.vim: -------------------------------------------------------------------------------- 1 | " from https://thinca.hatenablog.com/entry/20110903/1314982646 2 | if &buftype ==# 'help' 3 | finish 4 | endif 5 | 6 | setlocal list tabstop=8 shiftwidth=8 softtabstop=8 7 | setlocal noexpandtab textwidth=78 colorcolumn=+1 conceallevel=0 8 | setlocal iskeyword+=- iskeyword+=# iskeyword+=: 9 | if has('nvim') 10 | setlocal winhighlight=helpBar:Special,helpBacktick:Special,helpStar:Special,helpIgnore:Special 11 | endif 12 | 13 | nnoremap q 14 | nnoremap 15 | inoremap = repeat('=', &textwidth) 16 | inoremap - repeat('-', &textwidth) 17 | nnoremap [Toggle]c call toggle_conceal() 18 | 19 | function! s:toggle_conceal() abort 20 | let &l:conceallevel = &l:conceallevel ? 0 : 3 21 | setlocal conceallevel? 22 | endfunction 23 | 24 | " based on https://github.com/Shougo/shougo-s-github/blob/553c4e3c/vim/rc/deinft.vim#L136 25 | function! s:right_align(lnum) abort 26 | let m = a:lnum->getline()->matchlist('\v' .. [ 27 | \ '^(\s*\S+%(\s\S+)?)?\s+(\*\S+\*)\s*$', 28 | \ '^(\*\S+\*)\s\s+(\S.+)\s*$']->join('|')) 29 | if empty(m) 30 | return 31 | endif 32 | let [m1, m2] = [m[1] ?? m[3], m[2] ?? m[4]] 33 | 34 | return (m1 .. repeat(' ', &l:textwidth - len(m1) - len(m2)) .. m2) 35 | \ ->setline(a:lnum) 36 | endfunction 37 | function! s:right_aligns(start, end) abort 38 | call range(a:start, a:end)->map({ _, lnum -> s:right_align(lnum) }) 39 | endfunction 40 | command! -bar -buffer -range RightAlign 41 | \ call s:right_aligns(expand(''), expand('')) 42 | 43 | nnoremap mm RightAlign 44 | xnoremap mm :RightAlign 45 | -------------------------------------------------------------------------------- /config/nvim/after/queries/toml/highlights.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | ((pair 3 | (bare_key) @_key 4 | (string) @none) 5 | (#vim-match? @_key "^hook_\w*") 6 | (#offset! @none 0 3 0 -3)) 7 | ((pair 8 | (bare_key) @_key 9 | (string) @none) 10 | (#vim-match? @_key "^hook_\w*") 11 | (#vim-match? @none "^('[^']|\"[^\"])") 12 | (#offset! @none 0 1 0 -1)) 13 | ((pair 14 | (bare_key) @_key 15 | (string) @none) 16 | (#vim-match? @_key "^lua_\w*") 17 | (#offset! @none 0 3 0 -3)) 18 | ((pair 19 | (bare_key) @_key 20 | (string) @none) 21 | (#vim-match? @_key "^lua_\w*") 22 | (#vim-match? @none "^('[^']|\"[^\"])") 23 | (#offset! @none 0 1 0 -1)) 24 | ((table 25 | (bare_key) @_key 26 | (pair 27 | (string) @none)) 28 | (#eq? @_key "ftplugins") 29 | (#offset! @none 0 3 0 -3)) 30 | ((table 31 | (dotted_key) @_key 32 | (pair 33 | (string) @none)) 34 | (#eq? @_key "plugins.ftplugin") 35 | (#offset! @none 0 3 0 -3)) 36 | -------------------------------------------------------------------------------- /config/nvim/after/queries/toml/injections.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | ((pair 3 | (bare_key) @_key 4 | (string) @injection.content) 5 | (#vim-match? @_key "^hook_\w*") 6 | (#set! injection.language "vim") 7 | (#offset! @injection.content 0 3 0 -3)) 8 | ((pair 9 | (bare_key) @_key 10 | (string) @injection.content) 11 | (#vim-match? @_key "^hook_\w*") 12 | (#vim-match? @injection.content "^('[^']|\"[^\"])") 13 | (#set! injection.language "vim") 14 | (#offset! @injection.content 0 1 0 -1)) 15 | ((pair 16 | (bare_key) @_key 17 | (string) @injection.content) 18 | (#vim-match? @_key "^lua_\w*") 19 | (#set! injection.language "lua") 20 | (#offset! @injection.content 0 3 0 -3)) 21 | ((pair 22 | (bare_key) @_key 23 | (string) @injection.content) 24 | (#vim-match? @_key "^lua_\w*") 25 | (#vim-match? @injection.content "^('[^']|\"[^\"])") 26 | (#set! injection.language "lua") 27 | (#offset! @injection.content 0 1 0 -1)) 28 | ((table 29 | (bare_key) @_key 30 | (pair 31 | (string) @injection.content)) 32 | (#eq? @_key "ftplugins") 33 | (#set! injection.language "vim") 34 | (#offset! @injection.content 0 3 0 -3)) 35 | ((table 36 | (dotted_key) @_key 37 | (pair 38 | (string) @injection.content)) 39 | (#eq? @_key "plugins.ftplugin") 40 | (#set! injection.language "vim") 41 | (#offset! @injection.content 0 3 0 -3)) 42 | 43 | ((table_array_element 44 | (pair 45 | (bare_key) @_key 46 | (string) @injection.content)) 47 | (#eq? @_key "repo") 48 | (#set! injection.language "uri") 49 | (#offset! @injection.content 0 1 0 -1)) 50 | -------------------------------------------------------------------------------- /config/nvim/after/queries/unifieddiff/highlights.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | (git_diff_header) @type 3 | 4 | [ 5 | (git_old_mode) 6 | (git_new_mode) 7 | (git_deleted_file_mode) 8 | (git_new_file_mode) 9 | (git_copy_from) 10 | (git_copy_to) 11 | (git_rename_from) 12 | (git_rename_to) 13 | (git_similarity_index) 14 | (git_dissimilarity_index) 15 | (git_index) 16 | ] @preproc 17 | 18 | (from_file_line) @diff.minus 19 | (to_file_line) @diff.plus 20 | 21 | (line_deleted "-" @diff.minus @markup.strong) 22 | (line_deleted (body) @diff.minus) 23 | 24 | (line_added "+" @diff.plus @markup.strong) 25 | (line_added (body) @diff.plus) 26 | -------------------------------------------------------------------------------- /config/nvim/after/queries/uri/highlights.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | (uri) @markup.link.uri 3 | 4 | ((uri 5 | [ (scheme) ":" ] @conceal 6 | (authority 7 | (host) @_host)) 8 | (#eq? @_host "github.com") 9 | (#set! conceal "")) 10 | ((uri 11 | (authority 12 | (host) @_host) @conceal) 13 | (#eq? @_host "github.com") 14 | (#set! conceal "")) 15 | -------------------------------------------------------------------------------- /config/nvim/after/queries/vim/highlights.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | ((field_expression) 3 | field: (identifier) @property) 4 | -------------------------------------------------------------------------------- /config/nvim/after/queries/vim/injections.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | 3 | ; :execute command 4 | ((execute_statement 5 | (string_literal) @injection.content) 6 | (#set! injection.language "vim") 7 | (#offset! @injection.content 0 1 0 -1)) 8 | 9 | ; command-modifiers 10 | ((unknown_builtin_statement 11 | (unknown_command_name) @_cmd 12 | (arguments) @injection.content) 13 | (#any-of? @_cmd 14 | "abroveleft" "belowright" 15 | "botright" "browse" "confirm" "hide" "keepalt" 16 | "keepjumps" "keepmarks" "keeppatterns" "leftabrove" 17 | "lockmarks" "noswapfile" "rightbelow" "silent" "tab" 18 | "topleft" "verbose" "vertical" 19 | "noautocmd" "sandbox" "unsilent") 20 | (#set! injection.language "vim")) 21 | 22 | ((comment) @injection.content 23 | (function_definition) 24 | (#set! injection.language "jsdoc") 25 | (#offset! @injection.content 0 1 0 0)) 26 | -------------------------------------------------------------------------------- /config/nvim/after/syntax/diff.vim: -------------------------------------------------------------------------------- 1 | " specific comment char (e.g. git core.commentChar) 2 | let s:char = (getline('$')->matchstr('^[#;@!$%^&|:]\S\@!') ?? '#')->escape('^$.*[]~\"/') 3 | execute $'syn match diffComment "^{s:char}.*$"' 4 | -------------------------------------------------------------------------------- /config/nvim/after/syntax/json.vim: -------------------------------------------------------------------------------- 1 | " vsnip snippet 2 | syn match jsonSnippetTabstop '\$\d\+' containedin=jsonString 3 | syn match jsonSnippetVariable '\$[A-Z_]\+' containedin=jsonString 4 | syn cluster jsonSnippetMarks contains=jsonSnippetTabstop,jsonSnippetPlaceholder,jsonSnippetChoice 5 | syn region jsonSnippetPlaceholder matchgroup=jsonSnippetTabstop 6 | \ start='\${\d\+:' end='}' oneline 7 | \ contains=@jsonSnippetMarks 8 | \ containedin=jsonString 9 | syn region jsonSnippetChoice matchgroup=jsonSnippetTabstop 10 | \ start='\${\d\+|' end='|}' oneline 11 | \ contains=@jsonSnippetMarks,jsonSnippetChoiceDelimiter 12 | \ containedin=jsonString 13 | syn match jsonSnippetChoiceDelimiter ',' contained 14 | 15 | if get(g:, 'vsnip_syntax_vimexpr', v:true) 16 | syn include @vimExpr syntax/vim.vim 17 | syn region jsonSnippetVimExpr matchgroup=jsonSnippetTabstop 18 | \ start='\${VIM:' end='}' oneline keepend 19 | \ contains=@vimExpr containedin=jsonString 20 | endif 21 | 22 | hi def link jsonSnippetTabstop PreProc 23 | hi def link jsonSnippetVariable Constant 24 | hi def link jsonSnippetPlaceholder jsonString 25 | hi def link jsonSnippetChoice jsonString 26 | hi def link jsonSnippetChoiceDelimiter Delimiter 27 | -------------------------------------------------------------------------------- /config/nvim/after/syntax/vim.vim: -------------------------------------------------------------------------------- 1 | " Boolean (for Vim9) 2 | syn match vimBoolean /\v%(v:)?%(true|false)/ containedin=vimIsCommand,vimVar,vimFBVar 3 | hi def link vimBoolean Boolean 4 | -------------------------------------------------------------------------------- /config/nvim/autoload/lightline/colorscheme/mini.vim: -------------------------------------------------------------------------------- 1 | let s:bg = ['#1d1f21', 15] 2 | let s:fg = ['#707880', 0] 3 | 4 | let s:p = #{ normal: {}, inactive: {}, tabline: {} } 5 | let s:p.normal.info = [ [ s:bg, s:fg ] ] 6 | let s:p.normal.error = [ [ s:bg, s:fg ] ] 7 | let s:p.normal.warning = [ [ s:bg, s:bg ] ] 8 | let s:p.normal.right = [ [ s:fg, s:bg ], [ s:fg, s:bg ] ] 9 | let s:p.normal.middle = [ [ s:fg, s:bg ] ] 10 | let s:p.normal.left = [ [ s:bg, s:fg ], [ s:fg, s:bg ] ] 11 | let s:p.inactive.left = [ [ s:fg, s:bg ], [ s:fg, s:bg ] ] 12 | let s:p.inactive.right = [ [ s:fg, s:bg ], [ s:fg, s:bg ] ] 13 | let s:p.inactive.middle = [ [ s:fg, s:bg ] ] 14 | let s:p.tabline.left = [ [ s:fg, s:bg ] ] 15 | let s:p.tabline.tabsel = [ [ s:fg, s:bg ] ] 16 | let s:p.tabline.middle = [ [ s:fg, s:bg ] ] 17 | let s:p.tabline.right = [ [ s:fg, s:bg ] ] 18 | 19 | let g:lightline#colorscheme#mini#palette = lightline#colorscheme#flatten(s:p) 20 | -------------------------------------------------------------------------------- /config/nvim/autoload/lightline/component/vimrc.vim: -------------------------------------------------------------------------------- 1 | let s:lightline_ignore_filetypes = ['ddu-ff', 'molder'] 2 | 3 | let s:statuswidth = { -> &laststatus > 2 ? &columns : winwidth(0) } 4 | 5 | function! lightline#component#vimrc#colorscheme() abort 6 | return s:statuswidth() > 70 ? g:->get('colors_name', '') : '' 7 | endfunction 8 | 9 | function! lightline#component#vimrc#file_format() abort 10 | return &fileformat !=# 'unix' && s:statuswidth() > 70 ? &fileformat 11 | \ : '' 12 | endfunction 13 | 14 | function! lightline#component#vimrc#file_encoding() abort 15 | return &fileencoding !=# 'utf-8' && s:statuswidth() > 70 ? &fileencoding 16 | \ : '' 17 | endfunction 18 | 19 | function! lightline#component#vimrc#filename() abort 20 | if &filetype ==# 'ddu-ff' 21 | return '' 22 | elseif s:statuswidth() > 50 23 | return bufname()->fnamemodify(':t') ?? '[No name]' 24 | endif 25 | return '' 26 | endfunction 27 | 28 | " from https://github.com/thinca/config/blob/4b02d5ab/dotfiles/dot.vim/vimrc#L2263 29 | let s:skkeleton_modes = #{ 30 | \ hira: 'あ', 31 | \ kata: 'ア', 32 | \ hankata: 'ァア', 33 | \ zenkaku: 'a', 34 | \ abbrev: '/a', 35 | \ } 36 | 37 | function! lightline#component#vimrc#mode() abort 38 | if exists('*submode#current') && submode#current() !=# '' 39 | let mode = submode#current() 40 | elseif exists('*skkeleton#is_enabled') && skkeleton#is_enabled() 41 | let skk_mode = skkeleton#mode() 42 | let mode = s:skkeleton_modes->get(skk_mode, skk_mode) 43 | elseif b:->get('pinkyless_capslock', v:false) 44 | let mode = 'Capslock' 45 | else 46 | let mode = lightline#mode() 47 | endif 48 | return s:statuswidth() > 70 ? mode : mode->strcharpart(0, 1) 49 | endfunction 50 | 51 | function! lightline#component#vimrc#readonly() abort 52 | return index(s:lightline_ignore_filetypes, &filetype) > -1 ? '' 53 | \ : &filetype ==# 'help' && &buftype ==# 'help' ? '' 54 | \ : &readonly ? 'RO' : '' 55 | endfunction 56 | 57 | function! lightline#component#vimrc#modified() abort 58 | return index(s:lightline_ignore_filetypes, &filetype) > -1 ? '' 59 | \ : &filetype ==# 'help' && &buftype ==# 'help' ? '' 60 | \ : &modified ? '+' 61 | \ : &modifiable ? '' 62 | \ : '-' 63 | endfunction 64 | 65 | function! lightline#component#vimrc#protocol() abort 66 | return bufname() =~# '^\a\+://' && s:statuswidth() > 70 ? 67 | \ bufname()->matchstr('^\a\+\ze://')->printf('(%s)') 68 | \ : '' 69 | endfunction 70 | 71 | function! lightline#component#vimrc#tabname(tabpagenr) abort 72 | let buflist = tabpagebuflist(a:tabpagenr) 73 | let bufnr = buflist[tabpagewinnr(a:tabpagenr) - 1] 74 | let fname = expand($'#{bufnr}:p') 75 | let cwd = getcwd(-1, a:tabpagenr) 76 | return buflist->len() > 1 || fname->stridx(cwd) ==# 0 77 | \ || bufnr->getbufvar('&filetype') ==# 'molder' ? 78 | \ cwd->fnamemodify(':t') 79 | \ : fname->fnamemodify(':t') ?? '[No name]' 80 | endfunction 81 | -------------------------------------------------------------------------------- /config/nvim/autoload/pinkyless/keyboard/JIS.vim: -------------------------------------------------------------------------------- 1 | let s:keyboard = {} 2 | let s:symbol_map = { 3 | \ ';': '+', 4 | \ '1': '!', '2': '"', '3': '#', '4': '$', '5': '%', 5 | \ '6': '&', '7': "'", '8': '(', '9': ')', 6 | \ ',': '<', '.': '>', '/': '?', '-': '=', '^': '~', 7 | \ '[': '{', ']': '}', '@': '`', ':': '*', '¥': '|', 8 | \ } 9 | let s:symbol_map_r = pinkyless#util#swap(s:symbol_map) 10 | 11 | function! s:keyboard.shift(char) abort 12 | return a:char =~# '\l' ? toupper(a:char) 13 | \ : s:symbol_map->get(a:char, a:char) 14 | endfunction 15 | 16 | function! s:keyboard.unshift(char) abort 17 | return a:char =~# '\L' ? tolower(a:char) 18 | \ : s:symbol_map_r->get(a:char, a:char) 19 | endfunction 20 | 21 | function! s:keyboard.swap(char) abort 22 | return index(self.keys(), a:char) < 0 ? self.unshift(a:char) 23 | \ : self.shift(a:char) 24 | endfunction 25 | 26 | let s:keys = split('abcdefghijklmnopqrstuvwxyz', '\zs')->extend(keys(s:symbol_map)) 27 | function! s:keyboard.keys() abort 28 | return s:keys 29 | endfunction 30 | 31 | let s:shift_keys = split('ABCDEFGHIJKLMNOPQRSTUVWXYZ', '\zs')->extend(values(s:symbol_map)) 32 | function! s:keyboard.shift_keys() abort 33 | return s:shift_keys 34 | endfunction 35 | 36 | function! pinkyless#keyboard#JIS#define() abort 37 | return s:keyboard 38 | endfunction 39 | -------------------------------------------------------------------------------- /config/nvim/autoload/quickrun/hook/denops_interrupt.vim: -------------------------------------------------------------------------------- 1 | function! quickrun#hook#denops_interrupt#new() abort 2 | return #{ 3 | \ config: {}, 4 | \ on_ready: { -> denops#notify('vimrc', 'registerSweeper', []) }, 5 | \ on_exit: { -> denops#notify('vimrc', 'unregisterSweeper', []) }, 6 | \ } 7 | endfunction 8 | -------------------------------------------------------------------------------- /config/nvim/autoload/user.vim: -------------------------------------------------------------------------------- 1 | function! user#title_string() abort 2 | let f = expand('%:t') 3 | let d = expand('%:~:h')->pathshorten() 4 | let r = getcwd()->fnamemodify(':~')->pathshorten() 5 | if &buftype ==# 'help' 6 | let [dir, file] = ['help', f] 7 | elseif &buftype ==# 'terminal' 8 | let [dir, file] = ['terminal', f] 9 | elseif &buftype ==# 'nofile' 10 | let [dir, file] = &filetype ==# 'molder' ? 11 | \ [d, f] 12 | \ : [r, bufname()] 13 | elseif &buftype ==# 'quickfix' 14 | let [dir, file] = [r, 'QuickFix'] 15 | else 16 | let [dir, file] = [d ?? r, f] 17 | endif 18 | return $'{file} ({dir}) - {toupper(v:progname)}' 19 | endfunction 20 | 21 | function! user#google(query) abort 22 | let cmd = ['w3m', $'https://google.com/search?q={a:query}'] 23 | if has('nvim') 24 | new 25 | call termopen(cmd) 26 | else 27 | call term_start(cmd, #{ term_finish: 'close' }) 28 | endif 29 | endfunction 30 | 31 | function! user#auto_mkdir(dir, force) abort 32 | let msg = $'"{a:dir}" is not a directory. Create?' 33 | if !isdirectory(a:dir) && 34 | \ (a:force || confirm(msg, "&Yes\n&No", 2) < 2) 35 | call mkdir(a:dir, 'p') 36 | endif 37 | endfunction 38 | 39 | function! user#is_at_end() abort 40 | return mode() ==# 'c' ? 41 | \ getcmdpos() > strlen(getcmdline()) 42 | \ : col('.') > strlen(getline('.')) 43 | endfunction 44 | -------------------------------------------------------------------------------- /config/nvim/autoload/user/colorscheme.vim: -------------------------------------------------------------------------------- 1 | function! user#colorscheme#get() abort 2 | return g:->get('user#colorscheme#_colorschemes', {}) 3 | endfunction 4 | 5 | function! user#colorscheme#lightline() abort 6 | return g:colors_name ==# 'random' ? 'default' 7 | \ : user#colorscheme#get() 8 | \ ->get(g:colors_name, {}) 9 | \ ->get('lightline', g:colors_name) 10 | endfunction 11 | 12 | function! user#colorscheme#random() abort 13 | let list = user#colorscheme#get()->keys() 14 | return list->get(rand() % list->len()) 15 | \ ->user#colorscheme#command() 16 | endfunction 17 | 18 | function! user#colorscheme#set_customize() abort 19 | let customize = user#colorscheme#get()->get(g:colors_name) 20 | if empty(customize) 21 | return 22 | endif 23 | let highlight = customize->get('highlight') 24 | if !empty(highlight) 25 | " TODO: use hlset() or nvim_set_hl() 26 | for [group, attr] in items(highlight) 27 | let attrs = '' 28 | for [name, value] in items(attr) 29 | let attrs ..= $'{name}={value} ' 30 | endfor 31 | execute 'hi' group attrs 32 | endfor 33 | endif 34 | " TODO: edit v:colornames if exists 35 | let terminal = customize->get('terminal') 36 | if !empty(terminal) 37 | call s:set_terminal_colors( 38 | \ terminal is# 'mini' ? [ 39 | \ '#1d1f21', '#cc6666', '#b5bd68', '#f0c674', '#81a2be', '#b294bb', '#8abeb7', '#d3d7cf', 40 | \ '#707880', '#cc6666', '#b5bd68', '#de955f', '#729fcf', '#b294bb', '#005f5f', '#707880', 41 | \ ] 42 | \ : terminal 43 | \ ) 44 | elseif !has('nvim') && exists('g:terminal_color_0') 45 | let g:terminal_ansi_colors = range(16) 46 | \ ->map({ -> g:->get($'terminal_color_{v:val}', '#000000') }) 47 | elseif has('nvim') && exists('g:terminal_ansi_colors') 48 | for i in range(16) 49 | let g:terminal_color_{i} = g:terminal_ansi_colors[i] 50 | endfor 51 | endif 52 | let link = customize->get('link') 53 | if !empty(link) 54 | for [linked, base] in items(link) 55 | execute 'hi! link' linked base 56 | endfor 57 | endif 58 | endfunction 59 | 60 | function! s:set_terminal_colors(list) abort 61 | if has('nvim') 62 | for i in range(16) 63 | let g:terminal_color_{i} = a:list[i] 64 | endfor 65 | else 66 | let g:terminal_ansi_colors = a:list 67 | endif 68 | endfunction 69 | 70 | function! user#colorscheme#command(colorscheme, reload = v:false) abort 71 | if empty(user#colorscheme#get()) 72 | return 73 | endif 74 | let colorscheme = a:reload ? g:colors_name : a:colorscheme 75 | if empty(colorscheme) && !a:reload 76 | echo g:colors_name 77 | return 78 | endif 79 | if colorscheme ==# 'random' 80 | return user#colorscheme#random() 81 | endif 82 | " NOTE: Use :silent to ignore W18 83 | execute 'silent colorscheme' colorscheme 84 | if !has('nvim') 85 | " Reload syntax for typescript-vim 86 | let &l:syntax = &l:syntax 87 | endif 88 | endfunction 89 | 90 | function! user#colorscheme#update_lightline() abort 91 | if !exists('g:lightline') 92 | return 93 | endif 94 | " NOTE: See `:help lightline-problem-13` 95 | let name = user#colorscheme#lightline() 96 | let g:lightline.colorscheme = name 97 | " NOTE: Reload colorscheme file to support 'background' change 98 | execute $'runtime autoload/lightline/colorscheme/{name}.vim' 99 | call lightline#init() 100 | call lightline#colorscheme() 101 | call lightline#update() 102 | endfunction 103 | 104 | function! user#colorscheme#completion(...) abort 105 | return user#colorscheme#get()->keys()->sort()->join("\n") 106 | endfunction 107 | -------------------------------------------------------------------------------- /config/nvim/autoload/user/launcher.vim: -------------------------------------------------------------------------------- 1 | function! s:echo(...) abort 2 | for chunk in a:000 3 | execute 'echohl' chunk->get(1, 'NONE') 4 | echon chunk[0] 5 | echohl NONE 6 | endfor 7 | endfunction 8 | 9 | function! user#launcher#select(config = g:launcher_config) abort 10 | call copy(a:config)->map({ -> s:echo([$'{v:key}: '], [v:val.char, 'Statement'], [' ']) }) 11 | let char = getcharstr() 12 | redraw | echo '' 13 | call user#launcher#run(copy(a:config)->filter({ -> v:val.char ==# char })) 14 | endfunction 15 | 16 | function! user#launcher#run(launcher) abort 17 | let launcher = values(a:launcher)->get(0) 18 | if empty(launcher) 19 | return 20 | endif 21 | let Run = launcher.run 22 | if launcher->get('nested', v:false) && type(Run) == v:t_dict 23 | call user#launcher#select(Run) 24 | elseif type(Run) == v:t_func 25 | call call(Run, []) 26 | elseif type(Run) == v:t_string 27 | execute Run 28 | endif 29 | endfunction 30 | -------------------------------------------------------------------------------- /config/nvim/autoload/user/plugins/pum.vim: -------------------------------------------------------------------------------- 1 | if has('nvim') 2 | function! user#plugins#pum#reverse_hl(name) abort 3 | let hl = nvim_get_hl(0, #{ name: a:name, link: v:false }) 4 | if !hl->get('reverse', v:false) 5 | return 6 | endif 7 | unlet hl.reverse 8 | let [fg, bg] = [hl->get('fg', v:null), hl->get('bg', v:null)] 9 | eval hl ->extend(fg isnot# v:null ? #{ bg: fg->printf('#%06x') } : {}) 10 | \ ->extend(bg isnot# v:null ? #{ fg: bg->printf('#%06x') } : {}) 11 | \ ->{ hl -> nvim_set_hl(0, 'PmenuSel', hl) }() 12 | endfunction 13 | else 14 | function! user#plugins#pum#reverse_hl(name) abort 15 | let [hl] = hlget(a:name, v:true) 16 | if !hl->get('gui', {})->get('reverse', v:false) 17 | return 18 | endif 19 | unlet hl.gui.reverse hl.cterm.reverse 20 | let [fg, bg] = [hl->get('guifg', v:null), hl->get('guibg', v:null)] 21 | eval hl ->extend(fg isnot# v:null ? #{ guibg: fg } : {}) 22 | \ ->extend(bg isnot# v:null ? #{ guifg: bg } : {}) 23 | \ ->extend(#{ force: v:true }) 24 | \ ->{ hl -> hlset([hl]) }() 25 | endfunction 26 | endif 27 | -------------------------------------------------------------------------------- /config/nvim/autoload/user/plugins/skkeleton.vim: -------------------------------------------------------------------------------- 1 | " Show mode and henkan state on virtual text 2 | " original code by @uga-rosa and @kawarimidoll 3 | " based on https://github.com/kuuote/dotvim/blob/6a69151c/conf/plug/skkeleton.lua#L32 4 | " https://zenn.dev/link/comments/35eef680583339 5 | 6 | let s:skk_modes = #{ 7 | \ hira: 'あ', 8 | \ kata: 'ア', 9 | \ hankata: 'ァア', 10 | \ zenkaku: 'a', 11 | \ abbrev: '/a', 12 | \ } 13 | let s:prev_phase = '' 14 | 15 | if has('nvim') 16 | let s:ns = nvim_create_namespace('skkeleton') 17 | let s:mode_id = 1 18 | let s:state_id = 2 19 | function! s:set() abort 20 | let skk_mode = skkeleton#mode() 21 | call nvim_buf_set_extmark(0, s:ns, line('.') - 1, col('.') - 1, #{ 22 | \ id: s:mode_id, 23 | \ virt_text: [[s:skk_modes->get(skk_mode, skk_mode), 'PmenuSel']], 24 | \ virt_text_pos: 'eol', 25 | \ }) 26 | endfunction 27 | function! s:show_phase(marker, new) abort 28 | let [row, col] = a:new ? 29 | \ [line('.') - 1, col('.') - 1] 30 | \ : nvim_buf_get_extmark_by_id(0, s:ns, s:state_id, {}) 31 | call nvim_buf_set_extmark(0, s:ns, row, col, #{ 32 | \ id: s:state_id, 33 | \ virt_text: [[a:marker, 'PmenuSel']], 34 | \ virt_text_pos: 'inline', 35 | \ right_gravity: v:false, 36 | \ }) 37 | endfunction 38 | 39 | function! s:reset() abort 40 | call nvim_buf_clear_namespace(0, s:ns, 0, -1) 41 | endfunction 42 | function! s:reset_phase() abort 43 | call nvim_buf_del_extmark(0, s:ns, s:state_id) 44 | endfunction 45 | else 46 | let s:prop_type = 'skkeleton_show_mode' 47 | let s:prop_type_phase = 'skkeleton_show_phase' 48 | call prop_type_add(s:prop_type, #{ highlight: 'PmenuSel' }) 49 | call prop_type_add(s:prop_type_phase, #{ highlight: 'PmenuSel', start_incl: v:true }) 50 | function! s:set() abort 51 | call s:reset() 52 | let skk_mode = skkeleton#mode() 53 | call prop_add(line('.'), 0, #{ 54 | \ type: s:prop_type, 55 | \ text: s:skk_modes->get(skk_mode, skk_mode), 56 | \ text_align: 'after', 57 | \ }) 58 | endfunction 59 | 60 | function! s:show_phase(marker, new) abort 61 | let coord = a:new ? 62 | \ #{ lnum: line('.'), col: col('.') } 63 | \ : prop_find(#{ type: s:prop_type_phase, skipstart: v:true }) 64 | \ ?? #{ lnum: line('.'), col: col('.') } 65 | call s:reset_phase() 66 | call prop_add(coord.lnum, coord.col, #{ 67 | \ type: s:prop_type_phase, 68 | \ text: a:marker, 69 | \ }) 70 | endfunction 71 | 72 | function! s:reset() abort 73 | call prop_remove(#{ type: s:prop_type }) 74 | endfunction 75 | function! s:reset_phase() abort 76 | call prop_remove(#{ type: s:prop_type_phase }) 77 | endfunction 78 | endif 79 | 80 | function! user#plugins#skkeleton#show_mode() abort 81 | call s:set() 82 | if g:skkeleton#state.phase !=# s:prev_phase 83 | let phase = g:skkeleton#state.phase 84 | if phase ==# 'input:okurinasi' 85 | call s:show_phase('▽', v:true) 86 | elseif phase ==# 'input:okuriari' 87 | call s:show_phase(s:prev_phase ==# 'input:okurinasi' ? '▽' : '▼', v:false) 88 | elseif phase ==# 'henkan' 89 | call s:show_phase('▼', v:false) 90 | else 91 | call s:reset_phase() 92 | endif 93 | endif 94 | let s:prev_phase = g:skkeleton#state.phase 95 | endfunction 96 | 97 | function! user#plugins#skkeleton#hide_mode() abort 98 | call s:reset() 99 | call s:reset_phase() 100 | endfunction 101 | -------------------------------------------------------------------------------- /config/nvim/autoload/user/plugins/sonictemplate.vim: -------------------------------------------------------------------------------- 1 | function! user#plugins#sonictemplate#help() abort 2 | return expand('%:t:r')->substitute('_', '-', 'g') 3 | endfunction 4 | -------------------------------------------------------------------------------- /config/nvim/denops/@ddc-filters/sorter_file.ts: -------------------------------------------------------------------------------- 1 | import type { Item } from "jsr:@shougo/ddc-vim@^7.0.0/types"; 2 | import { 3 | BaseFilter, 4 | type FilterArguments, 5 | } from "jsr:@shougo/ddc-vim@^7.0.0/filter"; 6 | // based on https://github.com/kuuote/dotvim/blob/92773506/denops/%40ddc-filters/sorter_file.ts 7 | 8 | const kindRankDefinition: Record = { 9 | "dir": 1, 10 | "file": 2, 11 | "sym=dir": 3, 12 | "sym=file": 4, 13 | "symlink": 5, 14 | }; 15 | const menuRankDefinition: Record = { 16 | "buf": 1, 17 | "cwd": 2, 18 | }; 19 | 20 | // See :help ddc-file-display-rules 21 | function parseMenu(menu?: string): string { 22 | if (menu === undefined) { 23 | return ""; 24 | } 25 | const isRelative = menu.startsWith("/"); 26 | // TODO: handle "^" 27 | return isRelative ? menu.slice(1, 4) : menu.slice(0, 3); 28 | } 29 | 30 | type Params = Record; 31 | 32 | export class Filter extends BaseFilter { 33 | override filter(args: FilterArguments): Promise { 34 | return Promise.resolve(args.items.sort((a, b) => { 35 | const menuRank = // Compare menu 36 | (menuRankDefinition[parseMenu(a.menu)] ?? 99) - 37 | (menuRankDefinition[parseMenu(b.menu)] ?? 99); 38 | if (menuRank !== 0) { 39 | return menuRank; 40 | } 41 | 42 | const kindRank = // Compare kind 43 | (kindRankDefinition[String(a.kind)] ?? 99) - 44 | (kindRankDefinition[String(b.kind)] ?? 99); 45 | if (kindRank !== 0) { 46 | return kindRank; 47 | } 48 | 49 | // Return the original order if the kind is the same 50 | return 0; 51 | })); 52 | } 53 | 54 | params(): Params { 55 | return {}; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /config/nvim/denops/@ddu-filters/matcher_action.ts: -------------------------------------------------------------------------------- 1 | import { 2 | BaseFilter, 3 | type FilterArguments, 4 | } from "jsr:@shougo/ddu-vim@^6.1.0/filter"; 5 | import type { DduItem } from "jsr:@shougo/ddu-vim@^6.1.0/types"; 6 | import { ensure, is } from "jsr:@core/unknownutil@^4.3.0"; 7 | 8 | export type Params = { 9 | ignoredActions: Record; 10 | }; 11 | 12 | const isItem = is.ObjectOf({ 13 | items: is.ArrayOf(is.ObjectOf({ 14 | __sourceName: is.String, 15 | kind: is.String, 16 | })), 17 | }); 18 | const isActionData = is.ObjectOf({ action: is.String }); 19 | 20 | export class Filter extends BaseFilter { 21 | override filter(args: FilterArguments): Promise { 22 | if (args.items.length === 0) { 23 | return Promise.resolve(args.items); 24 | } 25 | const { __sourceName, kind } = ensure(args.items.at(0)?.action, isItem) 26 | .items.at(0)!; 27 | const ignoredActions = args.filterParams.ignoredActions[__sourceName] ?? 28 | args.filterParams.ignoredActions[kind]; 29 | return Promise.resolve( 30 | ignoredActions 31 | ? args.items.filter((item) => 32 | !ignoredActions.includes(ensure(item.action, isActionData).action) 33 | ) 34 | : args.items, 35 | ); 36 | } 37 | 38 | override params(): Params { 39 | return { 40 | ignoredActions: { 41 | buffer: ["browse", "copy", "executeSystem", "newDirectory", "newFile"], 42 | dpp: ["browse", "copy", "executeSystem", "newDirectory", "newFile"], 43 | mr: ["browse", "copy", "executeSystem", "newDirectory", "newFile"], 44 | mrr: ["browse", "copy", "executeSystem", "newDirectory", "newFile"], 45 | mrw: ["browse", "copy", "executeSystem", "newDirectory", "newFile"], 46 | }, 47 | }; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /config/nvim/denops/@ddu-filters/matcher_colorscheme.ts: -------------------------------------------------------------------------------- 1 | import { 2 | BaseFilter, 3 | type FilterArguments, 4 | type OnInitArguments, 5 | } from "jsr:@shougo/ddu-vim@^6.1.0/filter"; 6 | import type { DduItem } from "jsr:@shougo/ddu-vim@^6.1.0/types"; 7 | import { ensure, is } from "jsr:@core/unknownutil@^4.3.0"; 8 | 9 | export type Params = Record; 10 | 11 | export class Filter extends BaseFilter { 12 | #colorschemes: string[] = []; 13 | 14 | override async onInit(args: OnInitArguments): Promise { 15 | this.#colorschemes = Object.keys( 16 | ensure( 17 | await args.denops.call("user#colorscheme#get"), 18 | is.RecordOf(is.Record), 19 | ), 20 | ); 21 | } 22 | 23 | override filter(args: FilterArguments): Promise { 24 | return Promise.resolve( 25 | args.items.filter((item) => 26 | this.#colorschemes.includes( 27 | ensure(item.action, is.ObjectOf({ name: is.String })).name, 28 | ) 29 | ), 30 | ); 31 | } 32 | 33 | override params(): Params { 34 | return {}; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /config/nvim/denops/@ddu-filters/matcher_source.ts: -------------------------------------------------------------------------------- 1 | import { 2 | BaseFilter, 3 | type FilterArguments, 4 | } from "jsr:@shougo/ddu-vim@^6.1.0/filter"; 5 | import type { DduItem } from "jsr:@shougo/ddu-vim@^6.1.0/types"; 6 | import { ensure, is } from "jsr:@core/unknownutil@^4.3.0"; 7 | 8 | export type Params = { 9 | ignoredSources: string[]; 10 | }; 11 | 12 | export class Filter extends BaseFilter { 13 | override filter(args: FilterArguments): Promise { 14 | return Promise.resolve( 15 | args.items.filter((item) => 16 | !args.filterParams.ignoredSources.includes( 17 | ensure(item.action, is.ObjectOf({ name: is.String })).name, 18 | ) 19 | ), 20 | ); 21 | } 22 | 23 | override params(): Params { 24 | return { 25 | ignoredSources: ["action", "file_external", "custom-list", "ddc"], 26 | }; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /config/nvim/denops/@ddu-sources/gin_action.ts: -------------------------------------------------------------------------------- 1 | import { 2 | BaseSource, 3 | type GatherArguments, 4 | } from "jsr:@shougo/ddu-vim@^6.1.0/source"; 5 | import { 6 | ActionFlags, 7 | type Actions, 8 | type Item, 9 | } from "jsr:@shougo/ddu-vim@^6.1.0/types"; 10 | import type { ActionData } from "jsr:@shougo/ddu-kind-word@^0.4.1"; 11 | import { ensure } from "jsr:@denops/std@^7.2.0/buffer"; 12 | import { rawString, useEval } from "jsr:@denops/std@^7.2.0/eval"; 13 | 14 | type Params = Record; 15 | const collector = 16 | "maplist()->filter({ -> v:val.lhs->stridx('(gin-action') ==# 0 })->map({ -> v:val.lhs })"; 17 | 18 | export class Source extends BaseSource { 19 | override kind = "word"; 20 | 21 | override gather( 22 | args: GatherArguments, 23 | ): ReadableStream[]> { 24 | return ReadableStream.from(this.#processItems(args)); 25 | } 26 | 27 | override actions: Actions = { 28 | async execute(args) { 29 | await useEval(args.denops, async (denops) => { 30 | for (const item of args.items) { 31 | const { text } = item.action as ActionData; 32 | await denops.call( 33 | "feedkeys", 34 | rawString`${text.replaceAll("<", "\\<")}`, 35 | "mi", 36 | ); 37 | } 38 | }); 39 | return ActionFlags.None; 40 | }, 41 | }; 42 | 43 | override params(): Params { 44 | return {}; 45 | } 46 | 47 | async *#processItems( 48 | args: GatherArguments, 49 | ): AsyncGenerator[]> { 50 | const items = await ensure( 51 | args.denops, 52 | args.context.bufNr, 53 | () => args.denops.eval(collector) as Promise, 54 | ); 55 | yield items 56 | .map((text) => ({ 57 | word: text.match(/\(gin-action-(.*)\)/)![1], 58 | action: { text }, 59 | })); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /config/nvim/denops/@ddu-sources/quickfix.ts: -------------------------------------------------------------------------------- 1 | import type { Denops } from "jsr:@denops/std@^7.2.0"; 2 | import * as fn from "jsr:@denops/std@^7.2.0/function"; 3 | import type { ActionData } from "jsr:@shougo/ddu-kind-file@^0.9.0"; 4 | import { 5 | BaseSource, 6 | type GatherArguments, 7 | } from "jsr:@shougo/ddu-vim@^6.1.0/source"; 8 | import type { Item } from "jsr:@shougo/ddu-vim@^6.1.0/types"; 9 | import { accumulate } from "jsr:@milly/denops-batch-accumulate@^1.0.1"; 10 | 11 | type Params = { 12 | useLoclist: boolean; 13 | }; 14 | interface QflistItem { 15 | bufnr: number; 16 | lnum: number; 17 | col: number; 18 | text: string; 19 | } 20 | 21 | export class Source extends BaseSource { 22 | override kind = "file"; 23 | 24 | override gather( 25 | args: GatherArguments, 26 | ): ReadableStream[]> { 27 | const func: [string, ...unknown[]] = args.sourceParams.useLoclist 28 | ? ["getloclist", 0] 29 | : ["getqflist"]; 30 | return ReadableStream.from(this.#processItems(args.denops, func)); 31 | } 32 | 33 | override params(): Params { 34 | return { 35 | useLoclist: false, 36 | }; 37 | } 38 | 39 | async *#processItems( 40 | denops: Denops, 41 | func: [string, ...unknown[]], 42 | ): AsyncGenerator[]> { 43 | const items = await denops.call(...func) as QflistItem[]; 44 | yield await accumulate( 45 | denops, 46 | async (denops) => 47 | await Promise.all(items.map((item) => this.#processItem(denops, item))), 48 | ); 49 | } 50 | 51 | async #processItem( 52 | denops: Denops, 53 | item: QflistItem, 54 | ): Promise> { 55 | const bufname = await fn.bufname(denops, item.bufnr); 56 | return { 57 | word: item.text, 58 | display: `${bufname}|${item.lnum} col ${item.col}|${item.text}`, 59 | action: { 60 | ...item, 61 | lineNr: item.lnum, 62 | }, 63 | }; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /config/nvim/denops/@ddu-sources/scrapbox_pages.ts: -------------------------------------------------------------------------------- 1 | import type { ActionData } from "jsr:@4513echo/ddu-kind-url@^0.6.0"; 2 | import { 3 | BaseSource, 4 | type GatherArguments, 5 | type OnInitArguments, 6 | } from "jsr:@shougo/ddu-vim@^6.1.0/source"; 7 | import type { Item } from "jsr:@shougo/ddu-vim@^6.1.0/types"; 8 | import type { 9 | BasePage, 10 | PageList, 11 | } from "https://pax.deno.dev/scrapbox-jp/types@0.9.0/rest.ts"; 12 | 13 | type Params = { 14 | project: string; 15 | rawTextUrl: boolean; 16 | }; 17 | 18 | export class Source extends BaseSource { 19 | override kind = "url"; 20 | #pages: Record = {}; 21 | 22 | override async onInit(args: OnInitArguments): Promise { 23 | if (!args.sourceParams.project) { 24 | await args.denops.call( 25 | "ddu#util#print_error", 26 | "Invalid sourceParams: project is empty", 27 | "ddu-source-scrapbox_pages", 28 | ); 29 | return; 30 | } 31 | const response = await fetch( 32 | `https://scrapbox.io/api/pages/${args.sourceParams.project}`, 33 | ); 34 | if (response.ok) { 35 | const result = await response.json() as PageList; 36 | this.#pages[args.sourceParams.project] = result.pages; 37 | } 38 | } 39 | 40 | override gather( 41 | args: GatherArguments, 42 | ): ReadableStream[]> { 43 | const items = this.#pages[args.sourceParams.project] 44 | .map((item): Item => ({ 45 | word: item.title, 46 | action: { 47 | url: [ 48 | "https://scrapbox.io/", 49 | args.sourceParams.rawTextUrl ? "api/pages/" : "", 50 | args.sourceParams.project, 51 | "/" + encodeURI(item.title.replaceAll(" ", "_")), 52 | args.sourceParams.rawTextUrl ? "/text" : "", 53 | ].join(""), 54 | }, 55 | })); 56 | return ReadableStream.from([items]); 57 | } 58 | 59 | override params(): Params { 60 | /* NOTE: These values are my personal preferences. 61 | I will change these when publishing as plugin. */ 62 | return { 63 | project: "4513echo", 64 | rawTextUrl: true, 65 | }; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /config/nvim/denops/vimrc/main.ts: -------------------------------------------------------------------------------- 1 | import type { Denops, Entrypoint } from "jsr:@denops/std@^7.2.0"; 2 | import { is } from "jsr:@core/unknownutil@^4.3.0/is"; 3 | import { ensure } from "jsr:@core/unknownutil@^4.3.0/ensure"; 4 | import { exists } from "jsr:@std/fs@^1.0.2/exists"; 5 | import { expandGlob } from "jsr:@std/fs@^1.0.2/expand-glob"; 6 | import { join } from "jsr:@std/path@^1.0.3/join"; 7 | 8 | const decoder = new TextDecoder(); 9 | 10 | export const main: Entrypoint = (denops) => { 11 | denops.dispatcher = { 12 | async meta(): Promise { 13 | return { 14 | meta: denops.meta, 15 | denoVersion: Deno.version, 16 | nvimVersion: denops.meta.host === "nvim" 17 | ? await denops.call("luaeval", "vim.version()") 18 | : null, 19 | }; 20 | }, 21 | 22 | async jseval(expr, ctx): Promise { 23 | const fn = async function () {}.constructor( 24 | "denops", 25 | "_A", 26 | `"use strict";return ${ensure(expr, is.String).trim()};`, 27 | ) as (denops: Denops, _A: unknown) => Promise; 28 | return await fn(denops, ctx); 29 | }, 30 | 31 | getUuid(): Promise { 32 | return Promise.resolve(crypto.randomUUID()); 33 | }, 34 | 35 | async ensureSkkJisyo(arg: unknown): Promise { 36 | const root = ensure(arg, is.String); 37 | return (await Array.fromAsync(expandGlob("SKK-JISYO.*", { root }))) 38 | .map((entry) => entry.path) 39 | .concat(await downloadLJisyo(root)) 40 | .sort((a) => a.endsWith(".L") ? 2 : a.endsWith(".emoji-ja") ? 1 : -1); 41 | }, 42 | 43 | async getGlobalTsdk(): Promise { 44 | const [{ stdout: denoInfo }, { stdout: vtslsInfo }] = await Promise.all( 45 | [[], ["npm:@vtsls/language-server"]].map((name) => 46 | new Deno.Command("deno", { 47 | args: ["info", "--json"].concat(name), 48 | stdout: "piped", 49 | }).output() 50 | ), 51 | ); 52 | 53 | const { npmCache } = ensure( 54 | JSON.parse(decoder.decode(denoInfo)), 55 | is.ObjectOf({ npmCache: is.String }), 56 | ); 57 | const { npmPackages } = ensure( 58 | JSON.parse(decoder.decode(vtslsInfo)), 59 | is.ObjectOf({ npmPackages: is.Record }), 60 | ); 61 | const [, { version }] = ensure( 62 | Object.entries(npmPackages) 63 | .find(([name]) => name.startsWith("typescript@")), 64 | is.TupleOf([is.String, is.ObjectOf({ version: is.String })]), 65 | ); 66 | return join(npmCache, "registry.npmjs.org", "typescript", version, "lib"); 67 | }, 68 | 69 | // TODO: split to a new plugin "quickrun-hook-denops-interrupt"? 70 | registerSweeper(): void { 71 | this.sweep = async () => { 72 | await denops.cmd("echomsg 'Sweeping quickrun sessions'"); 73 | await denops.call("quickrun#session#sweep"); 74 | }; 75 | denops.interrupted?.addEventListener("abort", this.sweep); 76 | }, 77 | 78 | unregisterSweeper(): void { 79 | denops.interrupted?.removeEventListener("abort", this.sweep); 80 | }, 81 | }; 82 | 83 | return { 84 | async [Symbol.asyncDispose](): Promise { 85 | await denops.cmd("echomsg 'Goodbye, Denops'"); 86 | }, 87 | }; 88 | }; 89 | 90 | async function downloadLJisyo(root: string): Promise { 91 | const jisyoFile = join(root, "SKK-JISYO.L"); 92 | const url = "https://skk-dev.github.io/dict/SKK-JISYO.L.gz"; 93 | if ( 94 | Deno.build.os === "linux" && 95 | await exists("/usr/share/skk/SKK-JISYO.L", { isFile: true }) 96 | ) { 97 | return ["/usr/share/skk/SKK-JISYO.L"]; 98 | } 99 | if (!(await exists(jisyoFile, { isFile: true }))) { 100 | const file = await Deno.mkdir(root, { recursive: true }) 101 | .then(() => Deno.create(jisyoFile)); 102 | const response = await fetch(url); 103 | if (!response.ok || !response.body) { 104 | throw new Error("Failed to download SKK-JISYO.L"); 105 | } 106 | response.body 107 | .pipeThrough(new DecompressionStream("gzip")) 108 | .pipeTo(file.writable); 109 | } 110 | return [jisyoFile]; 111 | } 112 | 113 | -------------------------------------------------------------------------------- /config/nvim/doc/tags: -------------------------------------------------------------------------------- 1 | :ColorScheme dotfiles.txt /*:ColorScheme* 2 | :DeinUpdateMine dotfiles.txt /*:DeinUpdateMine* 3 | :MiniNote dotfiles.txt /*:MiniNote* 4 | :RTP dotfiles.txt /*:RTP* 5 | :RandomColorScheme dotfiles.txt /*:RandomColorScheme* 6 | :WWW dotfiles.txt /*:WWW* 7 | SPACE-W dotfiles.txt /*SPACE-W* 8 | SPACE-f dotfiles.txt /*SPACE-f* 9 | SPACE-w dotfiles.txt /*SPACE-w* 10 | dark-powered dotfiles.txt /*dark-powered* 11 | directory-structure dotfiles.txt /*directory-structure* 12 | dotfiles dotfiles.txt /*dotfiles* 13 | dotfiles-CTRL-L dotfiles.txt /*dotfiles-CTRL-L* 14 | dotfiles-Y dotfiles.txt /*dotfiles-Y* 15 | dotfiles-^ dotfiles.txt /*dotfiles-^* 16 | dotfiles-about dotfiles.txt /*dotfiles-about* 17 | dotfiles-colorscheme dotfiles.txt /*dotfiles-colorscheme* 18 | dotfiles-commands dotfiles.txt /*dotfiles-commands* 19 | dotfiles-contents dotfiles.txt /*dotfiles-contents* 20 | dotfiles-interface dotfiles.txt /*dotfiles-interface* 21 | dotfiles-introdution dotfiles.txt /*dotfiles-introdution* 22 | dotfiles-mapleader dotfiles.txt /*dotfiles-mapleader* 23 | dotfiles-mappings dotfiles.txt /*dotfiles-mappings* 24 | dotfiles.txt dotfiles.txt /*dotfiles.txt* 25 | -------------------------------------------------------------------------------- /config/nvim/dpp/ddc.toml: -------------------------------------------------------------------------------- 1 | [[plugins]] 2 | repo = 'https://github.com/Shougo/ddc.vim' 3 | depends = ['denops.vim', 'pum.vim'] 4 | on_event = ['InsertEnter'] 5 | hooks_file = '$MYVIMDIR/setting/ddc.vim' 6 | 7 | # UI 8 | 9 | [[plugins]] 10 | repo = 'https://github.com/Shougo/ddc-ui-pum' 11 | 12 | # sources 13 | 14 | [[plugins]] 15 | repo = 'https://github.com/4513ECHO/ddc-github' 16 | 17 | [[plugins]] 18 | repo = 'https://github.com/LumaKernel/ddc-source-file' 19 | 20 | [[plugins]] 21 | repo = 'https://github.com/Shougo/ddc-source-around' 22 | 23 | [[plugins]] 24 | repo = 'https://github.com/Shougo/ddc-source-cmdline' 25 | 26 | [[plugins]] 27 | repo = 'https://github.com/Shougo/ddc-source-input' 28 | 29 | [[plugins]] 30 | repo = 'https://github.com/Shougo/ddc-source-line' 31 | 32 | [[plugins]] 33 | repo = 'https://github.com/Shougo/ddc-source-lsp' 34 | 35 | [[plugins]] 36 | repo = 'https://github.com/Shougo/ddc-source-mocword' 37 | 38 | [[plugins]] 39 | repo = 'https://github.com/Shougo/ddc-source-omni' 40 | 41 | [[plugins]] 42 | repo = 'https://github.com/Shougo/ddc-source-shell-native' 43 | 44 | [[plugins]] 45 | repo = 'https://github.com/Shougo/ddc-source-vim' 46 | 47 | [[plugins]] 48 | repo = 'https://github.com/delphinus/ddc-source-tmux' 49 | 50 | [[plugins]] 51 | repo = 'https://github.com/hrsh7th/vim-vsnip' 52 | on_event = ['InsertEnter'] 53 | hook_add = ''' 54 | let g:vsnip_snippet_dir = g:config_home .. '/snippets' 55 | inoremap vsnip#available(1) ? '(vsnip-expand-or-jump)' : '' 56 | snoremap vsnip#available(1) ? '(vsnip-expand-or-jump)' : '' 57 | ''' 58 | 59 | [[plugins]] 60 | repo = 'https://github.com/uga-rosa/ddc-source-buffer' 61 | 62 | [[plugins]] 63 | repo = 'https://github.com/uga-rosa/ddc-source-vsnip' 64 | 65 | [[plugins]] 66 | repo = 'https://github.com/vim-skk/skkeleton' 67 | denops_wait = false 68 | on_map = { ict = '' } 69 | hooks_file = '$MYVIMDIR/setting/skkeleton.vim' 70 | 71 | # filters 72 | 73 | [[plugins]] 74 | repo = 'https://github.com/Shougo/ddc-filter-converter_remove_overlap' 75 | 76 | [[plugins]] 77 | repo = 'https://github.com/matsui54/ddc-converter_truncate' 78 | 79 | [[plugins]] 80 | repo = 'https://github.com/tani/ddc-fuzzy' 81 | hook_add = ''' 82 | autocmd vimrc ColorScheme * hi def link FuzzyAccent Number 83 | ''' 84 | 85 | # popup windows 86 | 87 | [[plugins]] 88 | repo = 'https://github.com/Shougo/pum.vim' 89 | hook_add = ''' 90 | autocmd vimrc ColorScheme * call user#plugins#pum#reverse_hl('PmenuSel') 91 | ''' 92 | hook_source = ''' 93 | call pum#set_option(#{ 94 | \ highlight_columns: #{ 95 | \ kind: 'Type', 96 | \ }, 97 | \ max_columns: #{}, 98 | \ max_width: 100, 99 | \ padding: v:true, 100 | \ preview: v:true, 101 | \ preview_border: 'single', 102 | \ preview_delay: 50, 103 | \ preview_width: 100, 104 | \ scrollbar_char: '█', 105 | \ }) 106 | ''' 107 | 108 | [[plugins]] 109 | repo = 'https://github.com/matsui54/denops-signature_help' 110 | depends = ['denops.vim'] 111 | hook_add = ''' 112 | autocmd vimrc TextChangedI * ++once call dpp#source('denops-signature_help') 113 | ''' 114 | hook_source = ''' 115 | let g:signature_help_config = #{ 116 | \ maxWidth: 100, 117 | \ } 118 | call signature_help#enable() 119 | ''' 120 | -------------------------------------------------------------------------------- /config/nvim/dpp/ddu.toml: -------------------------------------------------------------------------------- 1 | [[plugins]] 2 | repo = 'https://github.com/Shougo/ddu.vim' 3 | depends = ['denops.vim'] 4 | on_func = ['ddu#start'] 5 | hooks_file = '$MYVIMDIR/setting/ddu.vim' 6 | 7 | [[plugins]] 8 | repo = 'https://github.com/Shougo/ddu-commands.vim' 9 | depends = ['ddu.vim'] 10 | on_cmd = ['Ddu'] 11 | 12 | # UI 13 | 14 | [[plugins]] 15 | repo = 'https://github.com/Shougo/cmdline.vim' 16 | on_ft = ['ddu-ff'] 17 | hook_source = ''' 18 | function! s:cmdline_set_option() 19 | call cmdline#set_option(#{ 20 | \ border: 'rounded', 21 | \ col: &columns / 6, 22 | \ row: &lines / 6 - 3, 23 | \ highlight_border: 'Identifier', 24 | \ width: &columns / 3 * 2, 25 | \ }) 26 | endfunction 27 | autocmd vimrc VimResized * call s:cmdline_set_option() 28 | call s:cmdline_set_option() 29 | ''' 30 | 31 | [[plugins]] 32 | repo = 'https://github.com/Shougo/ddu-ui-ff' 33 | 34 | # filters 35 | 36 | [[plugins]] 37 | repo = 'https://github.com/Shougo/ddu-filter-matcher_hidden' 38 | 39 | [[plugins]] 40 | repo = 'https://github.com/Shougo/ddu-filter-matcher_relative' 41 | 42 | [[plugins]] 43 | repo = 'https://github.com/Shougo/ddu-filter-matcher_substring' 44 | 45 | [[plugins]] 46 | repo = 'https://github.com/yuki-yano/ddu-filter-fzf' 47 | 48 | # kinds 49 | 50 | [[plugins]] 51 | repo = 'https://github.com/4513ECHO/ddu-kind-url' 52 | 53 | [[plugins]] 54 | repo = 'https://github.com/Shougo/ddu-kind-file' 55 | 56 | [[plugins]] 57 | repo = 'https://github.com/Shougo/ddu-kind-word' 58 | 59 | # sources 60 | 61 | [[plugins]] 62 | repo = 'https://github.com/4513ECHO/ddu-source-colorscheme' 63 | 64 | [[plugins]] 65 | repo = 'https://github.com/4513ECHO/ddu-source-emoji' 66 | 67 | [[plugins]] 68 | repo = 'https://github.com/4513ECHO/ddu-source-ghq' 69 | 70 | [[plugins]] 71 | repo = 'https://github.com/4513ECHO/ddu-source-pypi_classifiers' 72 | 73 | [[plugins]] 74 | repo = 'https://github.com/4513ECHO/ddu-source-source' 75 | 76 | [[plugins]] 77 | repo = 'https://github.com/kuuote/ddu-source-git_diff' 78 | 79 | [[plugins]] 80 | repo = 'https://github.com/kuuote/ddu-source-git_status' 81 | 82 | [[plugins]] 83 | repo = 'https://github.com/kuuote/ddu-source-mr' 84 | 85 | [[plugins]] 86 | repo = 'https://github.com/kuuote/ddu-source-tags' 87 | 88 | [[plugins]] 89 | repo = 'https://github.com/Shougo/ddu-source-action' 90 | 91 | [[plugins]] 92 | repo = 'https://github.com/Shougo/ddu-source-file' 93 | 94 | [[plugins]] 95 | repo = 'https://github.com/Shougo/ddu-source-file_rec' 96 | 97 | [[plugins]] 98 | repo = 'https://github.com/Shougo/ddu-source-register' 99 | 100 | [[plugins]] 101 | repo = 'https://github.com/matsui54/ddu-source-file_external' 102 | 103 | [[plugins]] 104 | repo = 'https://github.com/matsui54/ddu-source-command_history' 105 | 106 | [[plugins]] 107 | repo = 'https://github.com/matsui54/ddu-source-help' 108 | 109 | [[plugins]] 110 | repo = 'https://github.com/shun/ddu-source-buffer' 111 | 112 | [[plugins]] 113 | repo = 'https://github.com/shun/ddu-source-rg' 114 | 115 | [[plugins]] 116 | repo = 'https://github.com/uga-rosa/ddu-source-lsp' 117 | 118 | [[plugins]] 119 | repo = 'https://github.com/yuki-yano/ddu-source-nvim-notify' 120 | -------------------------------------------------------------------------------- /config/nvim/dpp/dpp.toml: -------------------------------------------------------------------------------- 1 | [[plugins]] 2 | repo = 'https://github.com/vim-denops/denops.vim' 3 | hook_add = ''' 4 | let g:denops_server_addr = '127.0.0.1:32123' 5 | let g:denops#server#deno_args = [ 6 | \ '--quiet', 7 | \ '--no-lock', 8 | \ '--allow-all', 9 | \ '--unstable-kv', 10 | \ ] 11 | noremap call denops#interrupt() 12 | noremap! call denops#interrupt() 13 | ''' 14 | 15 | [[plugins]] 16 | repo = 'https://github.com/Shougo/dpp.vim' 17 | 18 | [[plugins]] 19 | repo = 'https://github.com/Shougo/dpp-ext-installer' 20 | 21 | [[plugins]] 22 | repo = 'https://github.com/Shougo/dpp-ext-lazy' 23 | 24 | [[plugins]] 25 | repo = 'https://github.com/Shougo/dpp-ext-toml' 26 | 27 | [[plugins]] 28 | repo = 'https://github.com/Shougo/dpp-protocol-git' 29 | -------------------------------------------------------------------------------- /config/nvim/dpp/init.toml: -------------------------------------------------------------------------------- 1 | [[plugins]] 2 | repo = 'https://github.com/delphinus/vim-auto-cursorline' 3 | hook_add = ''' 4 | let g:auto_cursorline_wait_ms = 4000 5 | ''' 6 | [plugins.ftplugin] 7 | qf = ''' 8 | let b:auto_cursorline_disabled = v:true 9 | ''' 10 | molder = ''' 11 | let b:auto_cursorline_disabled = v:true 12 | ''' 13 | ddu-ff = ''' 14 | let b:auto_cursorline_disabled = v:true 15 | ''' 16 | fern = ''' 17 | let b:auto_cursorline_disabled = v:true 18 | ''' 19 | 20 | [[plugins]] 21 | repo = 'https://github.com/itchyny/vim-highlighturl' 22 | 23 | [[plugins]] 24 | repo = 'https://github.com/itchyny/vim-parenmatch' 25 | 26 | [[plugins]] 27 | repo = 'https://github.com/lambdalisue/vim-guise' 28 | depends = ['denops.vim'] 29 | hook_add = ''' 30 | let g:guise_edit_opener = 'split' 31 | ''' 32 | 33 | [[plugins]] 34 | repo = 'https://github.com/lambdalisue/vim-mr' 35 | # from https://github.com/kuuote/dotvim/commit/eef000e6 36 | on_event = ['BufNewFile', 'BufReadPre', 'BufWritePre'] 37 | hook_add = ''' 38 | let s:predicates = [ 39 | \ { fname -> fname !~# '/.git/COMMIT_EDITMSG$' }, 40 | \ { fname -> fname !~# '\v/doc/.+\.%(txt|jax)$' }, 41 | \ ] 42 | let g:mr#mru#predicates = s:predicates 43 | let g:mr#mrw#predicates = s:predicates 44 | 45 | function! s:mr_clean(kind = 'mru') abort 46 | let s:kind = a:kind 47 | eval g:mr#{a:kind}#predicates->reduce({ acc, Pred -> 48 | \ acc->extend(mr#{s:kind}#list()->copy()->filter({ -> !Pred(v:val) })) 49 | \ }, []) 50 | \ ->foreach({ -> mr#{s:kind}#delete(v:val) }) 51 | endfunction 52 | function! s:mr_complete(...) 53 | return ['mru', 'mrw', 'mrr', 'mrd']->join("\n") 54 | endfunction 55 | command! -nargs=? -complete=custom,s:mr_complete -bar MrClean call s:mr_clean() 56 | ''' 57 | 58 | [[plugins]] 59 | repo = 'https://github.com/mattn/vim-molder' 60 | # from https://github.com/kuuote/dotvim/commit/09151c52 61 | lazy = true 62 | hook_add = ''' 63 | function! s:molder_init() abort 64 | if isdirectory(expand('%:p')) 65 | call dpp#source('vim-molder') 66 | call molder#init() 67 | autocmd! vimrc_molder 68 | endif 69 | endfunction 70 | augroup vimrc_molder 71 | autocmd! 72 | autocmd BufEnter * call s:molder_init() 73 | augroup END 74 | ''' 75 | [plugins.ftplugin] 76 | molder = ''' 77 | setlocal nolist nospell 78 | nnoremap (molder-reload)set nohlsearch 79 | nnoremap q q 80 | nnoremap <2-LeftMouse> (molder-open) 81 | nnoremap (molder-open) 82 | nnoremap R printf('edit %s', 83 | \ systemlist('git rev-parse --show-superproject-working-tree --show-toplevel')[0]) 84 | nnoremap . $'edit {getcwd()}' 85 | nnoremap j line('.') == line('$') ? 'gg' : 'j' 86 | nnoremap k line('.') == 1 ? 'G' : 'k' 87 | ''' 88 | 89 | [[plugins]] 90 | repo = 'https://github.com/mattn/vim-molder-operations' 91 | [plugins.ftplugin] 92 | molder = ''' 93 | nnoremap dd (molder-operations-delete) 94 | nnoremap r (molder-operations-rename) 95 | ''' 96 | 97 | [[plugins]] 98 | repo = 'https://github.com/rafamadriz/friendly-snippets' 99 | 100 | [[plugins]] 101 | repo = 'https://github.com/roxma/vim-tmux-clipboard' 102 | if = '!has("gui_running")' 103 | 104 | [[plugins]] 105 | # repo = 'https://github.com/vim-denops/denops-shared-server.vim' 106 | repo = 'https://github.com/4513ECHO/denops-shared-server.vim' 107 | rev = 'sync-environment' 108 | depends = ['denops.vim'] 109 | hook_add = ''' 110 | function! s:dss(action) abort 111 | call denops_shared_server#{a:action}() 112 | endfunction 113 | function! s:dss_complete(...) abort 114 | return ['install', 'uninstall', 'restart']->join("\n") 115 | endfunction 116 | command! -nargs=1 -complete=custom,s:dss_complete -bar DenopsSharedServer call s:dss() 117 | ''' 118 | 119 | [[plugins]] 120 | repo = 'https://github.com/vim-denops/denops-startup-recorder.vim' 121 | 122 | [[plugins]] 123 | repo = 'https://github.com/vim-jp/vimdoc-ja' 124 | -------------------------------------------------------------------------------- /config/nvim/dpp/neovim.toml: -------------------------------------------------------------------------------- 1 | [[plugins]] 2 | repo = 'https://github.com/4513ECHO/treesitter-compat-highlights.nvim' 3 | 4 | [[plugins]] 5 | repo = 'https://github.com/b0o/SchemaStore.nvim' 6 | 7 | [[plugins]] 8 | repo = 'https://github.com/chomosuke/term-edit.nvim' 9 | on_event = ['TermOpen'] 10 | lua_source = ''' 11 | require("term-edit").setup { 12 | prompt_end = "❯ ", 13 | mapping = { n = { S = false } }, 14 | } 15 | ''' 16 | 17 | [[plugins]] 18 | repo = 'https://git.sr.ht/~whynothugo/lsp_lines.nvim' 19 | on_event = ['LspAttach'] 20 | lua_source = ''' 21 | require("lsp_lines").setup() 22 | vim.diagnostic.config { virtual_lines = false } 23 | vim.keymap.set("n", "[Toggle]d", function() 24 | local old_config = vim.diagnostic.config() 25 | vim.diagnostic.config { 26 | virtual_text = not old_config.virtual_text, 27 | virtual_lines = not old_config.virtual_lines, 28 | } 29 | local mode = old_config.virtual_lines and "virtual_text" or "virtual_lines" 30 | vim.api.nvim_echo( 31 | { { "Diagnostic Mode: " }, { mode, "Constant" } }, 32 | false, 33 | {} 34 | ) 35 | end) 36 | ''' 37 | 38 | [[plugins]] 39 | repo = 'https://github.com/j-hui/fidget.nvim' 40 | on_event = ['LspAttach'] 41 | on_lua = ['fidget'] 42 | lua_source = ''' 43 | require("fidget").setup { 44 | progress = { 45 | display = { 46 | progress_icon = { "dots_pulse" }, 47 | }, 48 | }, 49 | } 50 | ''' 51 | 52 | [[plugins]] 53 | repo = 'https://github.com/kevinhwang91/nvim-hlslens' 54 | on_lua = ['hlslens'] 55 | on_event = ['CmdlineEnter'] 56 | hook_add = ''' 57 | autocmd vimrc User SearchxEnter,SearchxInputChanged,VimrcSearchPost lua require("hlslens").start() 58 | autocmd vimrc User SearchxCancel lua require("hlslens").stop() 59 | ''' 60 | lua_source = ''' 61 | require("hlslens").setup { 62 | enable_incsearch = false, 63 | nearest_only = true, 64 | } 65 | ''' 66 | 67 | [[plugins]] 68 | repo = 'https://github.com/neovim/nvim-lspconfig' 69 | on_event = ['BufRead'] 70 | lua_source = ''' 71 | require "vimrc.plugins.lsp" 72 | ''' 73 | 74 | [[plugins]] 75 | repo = 'https://github.com/nvim-lua/plenary.nvim' 76 | on_lua = ['plenary'] 77 | 78 | [[plugins]] 79 | repo = 'https://github.com/nvim-treesitter/nvim-treesitter' 80 | on_event = ['BufRead'] 81 | hook_post_update = 'TSUpdate' 82 | lua_source = ''' 83 | require "vimrc.plugins.treesitter" 84 | ''' 85 | 86 | [[plugins]] 87 | repo = 'https://github.com/nvim-zh/colorful-winsep.nvim' 88 | on_event = ['WinNew'] 89 | lua_source = ''' 90 | require("colorful-winsep").setup { 91 | hi --[[NvimSeparator]] = { 92 | link = "Identifier", 93 | default = true, 94 | }, 95 | no_exec_files = { "ddu-ff" }, 96 | symbols = { "─", "│", "┌", "┐", "└", "┘" }, 97 | } 98 | ''' 99 | 100 | [[plugins]] 101 | repo = 'https://github.com/rcarriga/nvim-notify' 102 | on_lua = ['notify'] 103 | lua_add = ''' 104 | ---@diagnostic disable-next-line: duplicate-set-field 105 | vim.notify = function(...) 106 | require("notify").setup { 107 | stages = "slide", 108 | background_color = "NormalFloat", 109 | minimum_width = 30, 110 | icons = { 111 | ERROR = "✗", 112 | WARN = "‼", 113 | INFO = "i", 114 | DEBUG = "D", 115 | TRACE = "T", 116 | }, 117 | } 118 | vim.notify = require "notify" 119 | vim.notify(...) 120 | end 121 | ''' 122 | 123 | [[plugins]] 124 | repo = 'https://github.com/uga-rosa/ddc-source-lsp-setup' 125 | -------------------------------------------------------------------------------- /config/nvim/dpp/vim.toml: -------------------------------------------------------------------------------- 1 | [[plugins]] 2 | repo = 'https://github.com/cocopon/colorswatch.vim' 3 | on_cmd = ['ColorSwatchGenerate'] 4 | 5 | [[plugins]] 6 | repo = 'https://github.com/cocopon/inspecthi.vim' 7 | depends = ['colorswatch.vim'] 8 | on_cmd = ['Inspecthi'] 9 | 10 | [[plugins]] 11 | repo = 'https://github.com/machakann/vim-highlightedyank' 12 | on_event = ['TextYankPost'] 13 | hook_add = ''' 14 | let g:highlightedyank_highlight_duration = 100 15 | ''' 16 | 17 | [[plugins]] 18 | repo = 'https://github.com/markonm/traces.vim' 19 | on_event = ['CmdlineEnter'] 20 | hook_add = ''' 21 | let g:traces_normal_preview = v:true 22 | ''' 23 | 24 | [[plugins]] 25 | repo = 'https://github.com/mattn/vim-lsp-settings' 26 | depends = ['vim-lsp'] 27 | on_event = ['BufRead'] 28 | hook_add = ''' 29 | vim9cmd user#plugins#lsp#HookAdd() 30 | ''' 31 | hook_source = ''' 32 | if v:vim_did_enter 33 | call timer_start(0, { -> lsp#enable() }) 34 | else 35 | autocmd vimrc VimEnter * call timer_start(0, { -> lsp#enable() }) 36 | endif 37 | ''' 38 | 39 | [[plugins]] 40 | repo = 'https://github.com/mattn/vim-notification' 41 | on_func = ['notification#'] 42 | 43 | [[plugins]] 44 | repo = 'https://github.com/obcat/vim-hitspop' 45 | on_event = ['CmdlineLeave'] 46 | on_func = ['hitspop#main'] 47 | hook_add = ''' 48 | let g:hitspop_line = 'winbot' 49 | let g:hitspop_column = 'winleft' 50 | let g:hitspop_timeout = 2000 51 | autocmd vimrc ColorScheme * hi link hitspopErrormsg ErrorMsg 52 | autocmd vimrc User SearchxInputChanged call hitspop#main() 53 | ''' 54 | 55 | [[plugins]] 56 | repo = 'https://github.com/obcat/vim-sclow' 57 | lazy = true 58 | hook_add = ''' 59 | autocmd vimrc VimEnter * ++once call timer_start(0, { -> dpp#source('vim-sclow') }) 60 | let g:sclow_hide_full_length = v:true 61 | ''' 62 | 63 | [[plugins]] 64 | repo = 'https://github.com/ojroques/vim-oscyank' 65 | on_func = ['OSCYankRegister'] 66 | hook_add = ''' 67 | autocmd vimrc TextYankPost * 68 | \ : if stridx('*+', v:event.regname) > -1 69 | \ | call OSCYankRegister(v:event.regname) 70 | \ | endif 71 | ''' 72 | 73 | [[plugins]] 74 | repo = 'https://github.com/prabirshrestha/vim-lsp' 75 | on_source = ['vim-lsp-settings'] 76 | 77 | [[plugins]] 78 | repo = 'https://github.com/rbtnn/vim-coloredit' 79 | on_cmd = ['ColorEdit'] 80 | -------------------------------------------------------------------------------- /config/nvim/ftdetect/vimrc.vim: -------------------------------------------------------------------------------- 1 | autocmd BufRead,BufNewFile https://scrapbox.io/api/pages/*/*/text setfiletype scrapbox 2 | autocmd BufRead,BufNewFile queries/*/*.scm setfiletype query 3 | -------------------------------------------------------------------------------- /config/nvim/init.vim: -------------------------------------------------------------------------------- 1 | let s:config_home = $XDG_CONFIG_HOME .. '/nvim' 2 | set runtimepath& 3 | let &runtimepath = [s:config_home, &runtimepath, s:config_home .. '/after']->join(',') 4 | let $MYVIMRC = expand(':p') 5 | let $MYVIMDIR = expand(':p:h') 6 | 7 | function! s:source_vimrc(vimrc) abort 8 | execute $'source {s:config_home}/rc/{a:vimrc}.rc.vim' 9 | endfunction 10 | call s:source_vimrc('init') 11 | call s:source_vimrc('dpp') 12 | 13 | set secure 14 | -------------------------------------------------------------------------------- /config/nvim/lua/vimrc/autocmd.lua: -------------------------------------------------------------------------------- 1 | ---@diagnostic disable: duplicate-doc-field 2 | local M = {} 3 | 4 | ---@type integer 5 | M.group = vim.api.nvim_create_augroup("nvim_vimrc", { clear = true }) 6 | 7 | ---Options for vim.api.nvim_create_autocmd() 8 | ---@class AutocmdOptions 9 | ---@field group? string|integer 10 | ---@field pattern? string|string[] 11 | ---@field buffer? integer 12 | ---@field desc? string 13 | ---@field callback? fun(ctx: AutocmdContext)|string 14 | ---@field command? string 15 | ---@field once? boolean 16 | ---@field nested? boolean 17 | 18 | ---@class AutocmdContext 19 | ---@field id integer autocommand id 20 | ---@field event string name of the triggered event |autocmd-event| 21 | ---@field group integer|nil autocommand group id, if any 22 | ---@field match string expanded value of 23 | ---@field buf integer expanded value of 24 | ---@field file string expanded value of 25 | ---@field data any arbitary data passed from |nvim_exec_autocmds()| 26 | 27 | ---@param event string|string[] 28 | ---@return fun(opts: AutocmdOptions): integer 29 | function M.autocmd(event) 30 | ---@param opts AutocmdOptions 31 | ---@return integer 32 | return function(opts) 33 | ---@type string|string[]|nil 34 | local pattern = opts.pattern or "*" 35 | if opts.buffer then 36 | pattern = nil 37 | end 38 | return vim.api.nvim_create_autocmd( 39 | event, 40 | vim.tbl_extend("force", { group = M.group, pattern = pattern }, opts) 41 | ) 42 | end 43 | end 44 | 45 | M.autocmd "TermOpen" { 46 | callback = function() 47 | -- NOTE: check lazily to handle opening in background 48 | vim.fn.timer_start(0, function() 49 | if vim.bo.buftype == "terminal" then 50 | vim.cmd.startinsert {} 51 | vim.opt_local.number = false 52 | vim.opt_local.relativenumber = false 53 | vim.opt_local.signcolumn = "no" 54 | vim.opt_local.cursorline = false 55 | end 56 | end) 57 | end, 58 | } 59 | 60 | M.autocmd "BufLeave" { 61 | pattern = "term://*", 62 | command = "checktime", 63 | desc = "Check files changes in terminal buffers", 64 | } 65 | 66 | M.autocmd "TextYankPost" { 67 | callback = function() 68 | vim.hl.on_yank { timeout = 100, on_macro = true } 69 | end, 70 | desc = "Highlight yanked text", 71 | } 72 | 73 | M.autocmd "ColorScheme" { 74 | callback = function() 75 | if vim.opt.laststatus:get() == 3 then 76 | vim.api.nvim_set_hl(0, "VertSplit", {}) 77 | end 78 | end, 79 | desc = "Clear VertSplit highlight", 80 | } 81 | 82 | return setmetatable(M, { 83 | __call = function(_, event) return M.autocmd(event) end, 84 | }) 85 | -------------------------------------------------------------------------------- /config/nvim/lua/vimrc/clipboard.lua: -------------------------------------------------------------------------------- 1 | ---@type table 2 | local providers = { 3 | pbcopy = { { "pbcopy" }, { "pbpaste" } }, 4 | tmux = { 5 | { "tmux", "load-buffer", "-w", "-" }, 6 | { "tmux", "save-buffer", "-" }, 7 | }, 8 | xsel = { 9 | { "xsel", "--nodetach", "-i", "-b" }, 10 | { "xsel", "-o", "-b" }, 11 | }, 12 | osc52 = { 13 | require("vim.ui.clipboard.osc52").copy "+", 14 | require("vim.ui.clipboard.osc52").paste "+", 15 | }, 16 | } 17 | 18 | ---@param name string 19 | local function set_provider(name) 20 | vim.g.clipboard = { 21 | name = name, 22 | copy = { 23 | ["+"] = providers[name][1], 24 | ["*"] = providers[name][1], 25 | }, 26 | paste = { 27 | ["+"] = providers[name][2], 28 | ["*"] = providers[name][2], 29 | }, 30 | } 31 | end 32 | 33 | if vim.fn.has "mac" == 1 then 34 | set_provider "pbcopy" 35 | elseif vim.env.TMUX and vim.env.TMUX ~= "" then 36 | set_provider "tmux" 37 | elseif vim.env.DISPLAY and vim.env.DISPLAY ~= "" then 38 | set_provider "xsel" 39 | else 40 | set_provider "osc52" 41 | end 42 | -------------------------------------------------------------------------------- /config/nvim/lua/vimrc/init.lua: -------------------------------------------------------------------------------- 1 | vim.loader.enable() 2 | require "vimrc.autocmd" 3 | require "vimrc.clipboard" 4 | require "vimrc.neovide" 5 | -------------------------------------------------------------------------------- /config/nvim/lua/vimrc/neovide.lua: -------------------------------------------------------------------------------- 1 | if not vim.g.neovide then 2 | return 3 | end 4 | 5 | local font_base, font_size = "CommitMono,HackGen35 Console NF:h%d", 12 6 | vim.opt.guifont = font_base:format(font_size) 7 | vim.opt.linespace = 2 8 | 9 | vim.g.neovide_scroll_animation_length = 0.1 10 | vim.g.neovide_cursor_vfx_mode = "pixiedust" 11 | vim.g.neovide_cursor_trail_size = 0.5 12 | vim.g.neovide_cursor_vfx_particle_density = 15 13 | vim.g.neovide_transparency = 0.8 14 | vim.g.neovide_input_macos_option_key_is_meta = "both" 15 | vim.g.neovide_input_ime = false 16 | 17 | local modifier_base = vim.fn.has "mac" == 1 and "" or "" 18 | ---@param key string 19 | ---@return string 20 | local function modifier(key) return modifier_base:format(key) end 21 | 22 | -- paste 23 | vim.keymap.set("", modifier "v", "") 24 | vim.keymap.set( 25 | { "!", "s", "t" }, 26 | modifier "v", 27 | function() vim.api.nvim_paste(vim.fn.getreg "+", false, -1) end, 28 | { desc = "Paste from clipboard" } 29 | ) 30 | 31 | -- disable mouse selecting 32 | for _, mod in pairs { "S", "C", "A", "D", "2", "3", "4" } do 33 | vim.keymap.set("", ("<%s-LeftMouse>"):format(mod), "") 34 | vim.keymap.set("", ("<%s-LeftDrag>"):format(mod), "") 35 | vim.keymap.set("", ("<%s-LeftRelease>"):format(mod), "") 36 | end 37 | vim.keymap.set("", "", "") 38 | vim.keymap.set("", "", "") 39 | 40 | vim.keymap.set( 41 | "n", 42 | modifier "p", 43 | "Ddu -name=startmenu", 44 | { desc = "Start menu" } 45 | ) 46 | 47 | vim.cmd.aunmenu { "PopUp" } 48 | 49 | -- adjust font size 50 | ---@param ctx { fargs: string[] } 51 | vim.api.nvim_create_user_command("FontSize", function(ctx) 52 | local args = ctx.fargs[1] or "12" 53 | font_size = (vim.startswith(args, "+") or vim.startswith(args, "-")) 54 | and font_size + (tonumber(args) or font_size) 55 | or (tonumber(args) or font_size) 56 | vim.opt.guifont = font_base:format(font_size) 57 | end, { nargs = "?" }) 58 | -------------------------------------------------------------------------------- /config/nvim/lua/vimrc/plugins/fidget.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | ---@type ProgressHandle|nil 3 | local handle 4 | local progress = require "fidget.progress" 5 | 6 | function M.report(message) 7 | if handle then 8 | handle:report { message = message } 9 | else 10 | handle = progress.handle.create { 11 | title = "Cache vtsls", 12 | message = message, 13 | lsp_client = { name = "cache_vtsls" }, 14 | } 15 | end 16 | end 17 | 18 | function M.done() 19 | if not handle then 20 | return 21 | end 22 | handle:finish() 23 | handle = nil 24 | end 25 | 26 | return M 27 | -------------------------------------------------------------------------------- /config/nvim/lua/vimrc/plugins/lsp/lua_help.lua: -------------------------------------------------------------------------------- 1 | -- based on https://scrapbox.io/vim-jp/better_K_for_neovim_lua 2 | 3 | ---@diagnostic disable-next-line: duplicate-doc-alias 4 | ---@alias callback fun(str: string, str2: string|nil): string 5 | 6 | ---@type callback 7 | local function convert_cmd(str) return ":" .. str end 8 | ---@type callback 9 | local function convert_opt(str) return "'" .. str .. "'" end 10 | ---@type callback 11 | local function convert_var(scope, name) return scope .. ":" .. name end 12 | 13 | local function lua_help() 14 | local current_word = vim.fn.expand "" 15 | if type(current_word) ~= "string" then 16 | return false 17 | end 18 | local cursor_col = vim.api.nvim_win_get_cursor(0)[2] + 1 19 | for _, pattern in ipairs { 20 | { "fn%.([%w_]+)" }, -- vim.fn.foo 21 | { "fn%[['\"]([%w_#]+)['\"]%]" }, -- vim.fn["foo#bar"] 22 | { "api%.([%w_]+)" }, -- vim.api.foo 23 | { "(uv%.[%w_]+)" }, -- vim.uv 24 | { "vim%.cmd%.([%w_]+)", convert_cmd }, -- vim.cmd.foo 25 | { "vim%.opt%.(%w+)", convert_opt }, -- vim.opt.foo 26 | { "vim%.opt_local%.(%w+)", convert_opt }, -- vim.opt_local.foo 27 | { "vim%.opt_global%.(%w+)", convert_opt }, -- vim.opt_global.foo 28 | { "vim%.[gbw]?o%.(%w+)", convert_opt }, -- vim.wo.foo 29 | { "vim%.([gwbtv])%.([%w_]+)", convert_var }, -- vim.g.foo, vim.v.bar 30 | { "vim%.([gwbtv])%[['\"]([%w_#]+)['\"]%]", convert_var }, -- vim.g["foo#bar"] 31 | { "(vim%.[%w_%.]+)" }, -- other vim.foo (e.g. vim.tbl_map, vim.lsp.foo, ...) 32 | } do 33 | ---@cast pattern { [1]: string, [2]: callback|nil } 34 | local s, e, m1, m2 = current_word:find(pattern[1]) 35 | if s and s <= cursor_col and cursor_col <= e then 36 | vim.cmd.help { pattern[2] and pattern[2](m1, m2) or m1 } 37 | return true 38 | end 39 | end 40 | return false 41 | end 42 | 43 | return function() 44 | if not lua_help() then 45 | vim.lsp.buf.hover() 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /config/nvim/lua/vimrc/plugins/lsp/util.lua: -------------------------------------------------------------------------------- 1 | ---@diagnostic disable-next-line: param-type-mismatch, missing-parameter 2 | local M = {} 3 | 4 | ---Helper function to replace language servers using npm with Deno. 5 | --- 6 | ---@example 7 | ---```lua 8 | ---require("lspconfig").vtsls.setup { 9 | --- cmd = deno_as_npm { "npm:@vtsls/language-server", "--stdio" }, 10 | --- cmd_env = deno_as_npm.cmd_env, 11 | ---} 12 | ---``` 13 | ---@class deno_as_npm 14 | ---@diagnostic disable-next-line: duplicate-doc-field 15 | ---@field cmd_env table The `cmd_env` option for lspconfig-setup 16 | ---@overload fun(cmd: string[]): string[] 17 | M.deno_as_npm = setmetatable({}, { 18 | __call = function(_, cmd) 19 | return vim.list_extend({ 20 | "deno", 21 | "run", 22 | "--allow-all", 23 | "--no-config", 24 | "--no-lock", 25 | "--node-modules-dir=none", 26 | }, cmd) 27 | end, 28 | }) 29 | M.deno_as_npm.cmd_env = { NO_COLOR = true } 30 | 31 | ---@return { uri: string }[] 32 | function M.get_yaml_json_schema() 33 | local client = vim.lsp.get_clients({ bufnr = 0, name = "yamlls" })[1] 34 | if not client then 35 | return {} 36 | end 37 | ---@diagnostic disable-next-line: param-type-mismatch, missing-parameter 38 | return client.request_sync("yaml/get/jsonSchema", vim.uri_from_bufnr(0)).result 39 | end 40 | 41 | ---@param client string 42 | ---@param command string 43 | ---@param arguments unknown[] 44 | function M.executeCommand(client, command, arguments) 45 | local c = vim.lsp.get_clients({ name = client })[1] 46 | if not c then 47 | return 48 | end 49 | c.request( 50 | "workspace/executeCommand", 51 | { command = command, arguments = arguments }, 52 | function(err, result) 53 | vim.cmd.redraw { bang = true } 54 | vim.api.nvim_echo({ 55 | { 56 | err and vim.inspect(err) or vim.inspect(result), 57 | err and "ErrorMsg", 58 | }, 59 | }, true, {}) 60 | end 61 | ) 62 | end 63 | 64 | return M 65 | -------------------------------------------------------------------------------- /config/nvim/lua/vimrc/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | local autocmd = require("vimrc.autocmd").autocmd 2 | ---@type table 3 | local parser_config = require("nvim-treesitter.parsers").get_parser_configs() 4 | 5 | parser_config.unifieddiff = { 6 | install_info = { 7 | url = "https://github.com/monaqa/tree-sitter-unifieddiff", 8 | files = { "src/parser.c", "src/scanner.c" }, 9 | }, 10 | filetype = "diff", 11 | maintainers = { "@monaqa" }, 12 | } 13 | parser_config.uri = { 14 | install_info = { 15 | url = "https://github.com/atusy/tree-sitter-uri", 16 | branch = "main", 17 | files = { "src/parser.c" }, 18 | }, 19 | filetype = "uri", 20 | maintainers = { "@atusy" }, 21 | } 22 | -- parser_config.vim = { 23 | -- install_info = { 24 | -- url = "~/Develops/github.com/4513ECHO/tree-sitter-vim", 25 | -- branch = "interpolated-string", 26 | -- files = { "src/parser.c", "src/scanner.c" }, 27 | -- }, 28 | -- filetype = "vim", 29 | -- } 30 | 31 | vim.treesitter.language.register("unifieddiff", "gin-diff") 32 | 33 | vim.treesitter.start = (function(wrapped) 34 | ---@param msg string 35 | local function notify(msg) 36 | vim.notify(msg, vim.log.levels.WARN, { title = "vim.treesitter.start" }) 37 | end 38 | ---@param bufnr integer|nil 39 | ---@param lang string|nil 40 | return function(bufnr, lang) 41 | bufnr = bufnr or vim.api.nvim_get_current_buf() 42 | lang = vim.treesitter.language.get_lang(lang or vim.bo.filetype) 43 | local ok, stats = pcall(vim.uv.fs_stat, vim.api.nvim_buf_get_name(bufnr)) 44 | if ok and stats and stats.size > 1024 * 1024 then -- 1MB 45 | return notify "The file is too large" 46 | elseif vim.fn.line "$" > 20000 then 47 | return notify "The buffer has too many lines" 48 | elseif vim.list_contains({ "bash", "yaml", "vimdoc" }, lang) then 49 | return -- Not supported language 50 | elseif 51 | lang == "vim" 52 | and vim.api.nvim_buf_get_lines(bufnr, 0, 1, false)[1]:match "^vim9script" 53 | then 54 | return notify "vim9script is not supported" 55 | end 56 | wrapped(bufnr, lang) 57 | end 58 | end)(vim.treesitter.start) 59 | 60 | local parser_install_dir = vim.fn.stdpath "data" .. "/parsers" 61 | vim.opt.runtimepath:append(parser_install_dir) 62 | 63 | ---@diagnostic disable-next-line: missing-fields 64 | require("nvim-treesitter.configs").setup { 65 | parser_install_dir = parser_install_dir, 66 | ensure_installed = { 67 | "bash", 68 | "go", 69 | "html", 70 | "lua", 71 | "markdown", 72 | "markdown_inline", 73 | "python", 74 | "query", 75 | "rust", 76 | "toml", 77 | "tsx", 78 | "typescript", 79 | "typst", 80 | "unifieddiff", 81 | "uri", 82 | "vim", 83 | "yaml", 84 | }, 85 | highlight = { 86 | enable = true, 87 | }, 88 | } 89 | 90 | local function link_diff_highlights() 91 | if vim.fn.empty(vim.api.nvim_get_hl(0, { name = "diffAdded" })) == 1 then 92 | vim.api.nvim_set_hl(0, "@diff.plus", { link = "DiffAdd" }) 93 | vim.api.nvim_set_hl(0, "@diff.minus", { link = "DiffDelete" }) 94 | else 95 | vim.api.nvim_set_hl(0, "@diff.plus", { link = "diffAdded" }) 96 | vim.api.nvim_set_hl(0, "@diff.minus", { link = "diffRemoved" }) 97 | end 98 | end 99 | 100 | autocmd "ColorScheme" { 101 | callback = require("treesitter-compat-highlights").apply, 102 | desc = "Apply compatible highlights for nvim-treesitter", 103 | } 104 | autocmd "ColorScheme" { 105 | callback = link_diff_highlights, 106 | desc = "Link diff highlights of nvim-treesitter", 107 | } 108 | require("treesitter-compat-highlights").apply() 109 | link_diff_highlights() 110 | -------------------------------------------------------------------------------- /config/nvim/rc/autocmd.rc.vim: -------------------------------------------------------------------------------- 1 | " restore cursor 2 | " from `:help restore-cursor` 3 | autocmd vimrc BufReadPost * 4 | \ : if line('''"') > 1 && line('''"') <= line('$') 5 | \ | execute 'normal! g`"' 6 | \ | endif 7 | 8 | " auto make directories 9 | " from https://vim-jp.org/vim-users-jp/2011/02/20/Hack-202.html 10 | autocmd vimrc BufWritePre * 11 | \ call user#auto_mkdir(expand(':p:h'), v:cmdbang) 12 | 13 | " auto disable paste mode 14 | autocmd vimrc InsertLeave * setlocal nopaste 15 | 16 | " auto quickfix opener 17 | " from https://github.com/monaqa/dotfiles/blob/424b0ab2/.config/nvim/scripts/autocmd.vim 18 | autocmd vimrc QuickFixCmdPost [^l]* cwindow 19 | autocmd vimrc QuickFixCmdPost l* lwindow 20 | 21 | " faster syntax highlight 22 | autocmd vimrc Syntax * 23 | \ : if line('$') > 1000 24 | \ | syntax sync minlines=100 25 | \ | endif 26 | 27 | autocmd vimrc BufWinEnter * 28 | \ : if empty(&buftype) && line('.') > winheight(0) / 3 * 2 29 | \ | execute 'normal! zz' .. repeat("\", winheight(0) / 6) 30 | \ | endif 31 | 32 | " from https://github.com/yuki-yano/dotfiles/blob/11bfe29f/.vimrc#L696 33 | autocmd vimrc FocusGained * checktime 34 | 35 | " from https://github.com/kuuote/dotvim/blob/46760385/conf/rc/autocmd.vim#L5 36 | function! s:chmod(file) abort 37 | let perm = getfperm(a:file) 38 | let newperm = printf('%sx%sx%sx', perm[0:1], perm[3:4], perm[6:7]) 39 | if perm !=# newperm 40 | call setfperm(a:file, newperm) 41 | endif 42 | endfunction 43 | autocmd vimrc BufWritePost * 44 | \ : if getline(1)->stridx('#!/') ==# 0 45 | \ | call s:chmod(expand('')) 46 | \ | endif 47 | 48 | autocmd vimrc BufWritePost * 49 | \ : if empty(&filetype) 50 | \ | filetype detect 51 | \ | endif 52 | 53 | " from https://github.com/aiotter/dotfiles/blob/8e759221/.vimrc#L185 54 | autocmd vimrc WinEnter * 55 | \ : if winnr('$') ==# 1 && &buftype ==# 'quickfix' 56 | \ | quit 57 | \ | endif 58 | 59 | autocmd vimrc VimResized * 60 | \ : if &equalalways 61 | \ | wincmd = 62 | \ | endif 63 | 64 | " based on https://blog.atusy.net/2023/12/17/vim-easy-to-remember-regnames/ 65 | autocmd vimrc TextYankPost * 66 | \ : if empty(v:event.regname) || stridx(v:event.regname, '*+') > -1 67 | \ | call setreg(v:event.operator, getreginfo(v:event.regname)) 68 | \ | endif 69 | 70 | if !has('nvim') 71 | autocmd vimrc TerminalWinOpen * 72 | \ setlocal nonumber norelativenumber signcolumn=no nocursorline 73 | " based on https://vim-jp.slack.com/archives/C052L238E56/p1710653038387719 74 | autocmd vimrc WinClosed * wincmd p 75 | else 76 | autocmd vimrc WinClosed * 77 | \ : if nvim_win_get_config(+expand('')).relative->empty() 78 | \ | wincmd p 79 | \ | endif 80 | endif 81 | -------------------------------------------------------------------------------- /config/nvim/rc/dpp.rc.vim: -------------------------------------------------------------------------------- 1 | let s:dpp_dir = g:cache_home .. '/dpp' 2 | let s:dpp_ts = g:config_home .. '/rc/dpp.ts' 3 | 4 | if &runtimepath->stridx(s:dpp_dir) < 0 5 | if !isdirectory(s:dpp_dir) 6 | execute printf('!deno run --allow-read --allow-run=git %s %s %s', 7 | \ s:dpp_ts, s:dpp_dir, expand('$MYVIMDIR/dpp/dpp.toml')) 8 | endif 9 | execute $'set runtimepath^={s:dpp_dir}/repos/github.com/Shougo/dpp.vim' 10 | endif 11 | 12 | if dpp#min#load_state(s:dpp_dir) 13 | for s:plugin in [ 14 | \ 'github.com/vim-denops/denops.vim', 15 | \ 'github.com/Shougo/dpp-ext-installer', 16 | \ 'github.com/Shougo/dpp-ext-lazy', 17 | \ 'github.com/Shougo/dpp-ext-toml', 18 | \ 'github.com/Shougo/dpp-protocol-git', 19 | \ ] 20 | execute $'set runtimepath^={s:dpp_dir}/repos/{s:plugin}' 21 | endfor 22 | autocmd vimrc User Dpp:makeStatePost cquit 23 | autocmd vimrc User DenopsReady call dpp#make_state(s:dpp_dir, s:dpp_ts) 24 | else 25 | function! s:check_install() abort 26 | if !empty(dpp#sync_ext_action('installer', 'getNotInstalled')) 27 | autocmd vimrc User Dpp:makeStatePost cquit 28 | call dpp#async_ext_action('installer', 'install') 29 | endif 30 | endfunction 31 | autocmd vimrc User DenopsReady call s:check_install() 32 | endif 33 | 34 | if getcwd() =~? expand('~/Develops/github.com/4513ECHO/') 35 | let s:git_root = systemlist('git rev-parse --show-toplevel')[0] 36 | execute $'set runtimepath^={s:git_root}' 37 | if isdirectory(s:git_root .. '/after') 38 | execute $'set runtimepath+={s:git_root}/after' 39 | endif 40 | endif 41 | 42 | syntax enable 43 | filetype indent plugin on 44 | -------------------------------------------------------------------------------- /config/nvim/rc/init.rc.vim: -------------------------------------------------------------------------------- 1 | augroup vimrc 2 | autocmd! 3 | augroup END 4 | 5 | let $VIM_PID = getpid() 6 | let g:cache_home = $XDG_CACHE_HOME .. '/nvim' 7 | let g:config_home = $XDG_CONFIG_HOME .. '/nvim' 8 | let g:data_home = $XDG_DATA_HOME .. '/nvim' 9 | let g:vim_data_home = $XDG_DATA_HOME .. '/vim' 10 | 11 | let g:launcher_config = g:->get('launcher_config', {}) 12 | nnoremap call user#launcher#select() 13 | let g:launcher_config.color = #{ 14 | \ char: 'r', 15 | \ run: 'RandomColorScheme', 16 | \ } 17 | let g:launcher_config.tabnew = #{ 18 | \ char: 't', 19 | \ run: 'tabnew . | tcd . | Ddu ghq', 20 | \ } 21 | 22 | autocmd vimrc VimEnter * ++nested call user#colorscheme#random() 23 | let s:state = {} 24 | autocmd vimrc DirChanged * ++nested 25 | \ : if s:state->has_key(expand('')) 26 | \ | execute 'silent colorscheme' s:state[expand('')] 27 | \ | else 28 | \ | call user#colorscheme#random() 29 | \ | let s:state[expand('')] = g:colors_name 30 | \ | endif 31 | autocmd vimrc ColorSchemePre * 32 | \ : unlet! g:terminal_color_foreground 33 | \ g:terminal_color_background 34 | \ g:terminal_ansi_colors 35 | \ | for s:i in range(16) 36 | \ | unlet! g:terminal_color_{s:i} 37 | \ | endfor 38 | autocmd vimrc ColorScheme * 39 | \ : call user#colorscheme#update_lightline() 40 | \ | call user#colorscheme#set_customize() 41 | 42 | " echo message vim start up time 43 | " based on https://github.com/lighttiger2505/.dotfiles/blob/6d0d4b83/.vimrc#L11 44 | if has('vim_starting') && (!has('nvim') || v:argv->index('--headless') < 0) 45 | let g:startuptime = reltime() 46 | autocmd vimrc VimEnter * 47 | \ : let g:startuptime = reltime(g:startuptime) 48 | \ | redraw 49 | \ | echomsg printf('startuptime: %fms', reltimefloat(g:startuptime) * 1000) 50 | endif 51 | 52 | " from https://github.com/thinca/config/blob/d92e41ce/dotfiles/dot.vim/vimrc#L1382 53 | command! -bar RTP echo &runtimepath->substitute(',', "\n", 'g') 54 | 55 | command! -bar RandomColorScheme call user#colorscheme#random() 56 | 57 | command! -nargs=? -bar -bang -complete=custom,user#colorscheme#completion 58 | \ ColorScheme call user#colorscheme#command(, 0) 59 | 60 | function! s:spark_colorscheme(interval = 500) abort 61 | if exists('s:spark_timer') 62 | call timer_stop(s:spark_timer) 63 | unlet s:spark_timer 64 | else 65 | let s:spark_timer = timer_start(a:interval, 66 | \ { -> user#colorscheme#random() }, #{ repeat: -1 }) 67 | endif 68 | endfunction 69 | command! -nargs=? -bar SparkColorScheme call s:spark_colorscheme() 70 | 71 | " from https://qiita.com/gorilla0513/items/11be5413405792337558 72 | command! -nargs=1 WWW call user#google() 73 | 74 | command! -nargs=? -bar -complete=filetype MiniNote 75 | \ : execute ( ?? 'belowright 10') 'new mininote' 76 | \ | setlocal bufhidden=wipe buftype=nofile filetype= winfixheight 77 | 78 | " from `:help :DiffOrig` 79 | command! -bar DiffOrig 80 | \ : vertical new | setlocal buftype=nofile | r ++edit # | 0d_ 81 | \ | diffthis | wincmd p | diffthis 82 | 83 | command! -bar VTerminal execute ( ?? 'topleft vertical') 84 | \ has('nvim') ? 'split +terminal' : 'terminal ++close' 85 | 86 | if filereadable(expand('~/.vimrc_secret')) 87 | source ~/.vimrc_secret 88 | endif 89 | 90 | " custom autocmd 91 | noremap (search-post) doautocmd User VimrcSearchPost 92 | noremap! (search-post) doautocmd User VimrcSearchPost 93 | autocmd vimrc User VimrcSearchPost normal! zzzv 94 | 95 | if has('nvim') 96 | lua require('vimrc') 97 | endif 98 | -------------------------------------------------------------------------------- /config/nvim/rc/keymap.rc.vim: -------------------------------------------------------------------------------- 1 | " mapleader 2 | let g:mapleader = ',' 3 | nnoremap 4 | xnoremap 5 | 6 | " disable dangerous/annoying mapping 7 | " NOTE: ZQ is useful when cmdline is broken 8 | nnoremap ZZ 9 | nnoremap q 10 | nnoremap S 11 | xnoremap q 12 | 13 | " Record/execute macro like ["x]Q (in default use "q" register) 14 | nnoremap Q 'q' .. (!empty(reg_recording()) ? '' 15 | \ : stridx('"*+', v:register) > -1 ? 'q' : v:register) 16 | xnoremap Q ':normal! @' .. 17 | \ (stridx('"*+', v:register) > -1 ? 'q' : v:register) .. '' 18 | 19 | nnoremap j gj 20 | nnoremap k gk 21 | nnoremap gj j 22 | nnoremap gk k 23 | xnoremap j gj 24 | xnoremap k gk 25 | xnoremap gj j 26 | xnoremap gk k 27 | 28 | nnoremap x "_x 29 | nnoremap s "_s 30 | nnoremap Y y$ 31 | xnoremap x "_x 32 | xnoremap s "_s 33 | xnoremap Y y$ 34 | 35 | nnoremap n n(search-post) 36 | nnoremap N N(search-post) 37 | nnoremap * *(search-post) 38 | nnoremap # #(search-post) 39 | nnoremap g* g*(search-post) 40 | nnoremap g# g#(search-post) 41 | 42 | " disable arrow keys 43 | nnoremap 44 | nnoremap 45 | nnoremap 46 | nnoremap 47 | xnoremap 48 | xnoremap 49 | xnoremap 50 | xnoremap 51 | inoremap 52 | inoremap 53 | inoremap 54 | inoremap 55 | 56 | " better aliases of / 57 | nnoremap H getline('.')[:col('.') - 2] =~# '^\s*$' ? '0' : '^' 58 | nnoremap L 59 | xnoremap H getline('.')[:col('.') - 2] =~# '^\s*$' ? '0' : '^' 60 | xnoremap L 61 | 62 | inoremap u 63 | inoremap u 64 | 65 | nmap 66 | nnoremap nohlsearchdiffupdate 67 | nnoremap w update 68 | nnoremap W write 69 | nnoremap ^ edit 70 | nnoremap f edit %:p:h 71 | nnoremap q confirm qall 72 | nnoremap gf gF 73 | nnoremap p ]p 74 | nnoremap P ]P 75 | xnoremap p P 76 | cnoremap / getcmdtype() ==# '/' ? '\/' : '/' 77 | cnoremap ? getcmdtype() ==# '?' ? '\?' : '?' 78 | " open native cmdline 79 | nnoremap g/ / 80 | " select last yanked/pasted text 81 | " from https://github.com/pesblog/dots-base/blob/a0762b8f/home/.vimrc#L140 82 | " https://github.com/ibhagwan/nvim-lua/blob/dc846e06/lua/keymaps.lua#L133 83 | nnoremap g $'`[{visualmode()}`]' 84 | " from https://vim-jp.org/vim-users-jp/2009/08/31/Hack-65.html 85 | xnoremap / /\%V 86 | " from https://github.com/nnsnico/dotfiles/blob/cf9ce83c/vim/vimrcs/basic.vim#L150-L151 87 | " center horizontally on cursor position 88 | nnoremap z. zszH 89 | " based on https://github.com/romgrk/nvim/blob/ba305c52/rc/keymap.vim#L98-L99 90 | nnoremap i getline('.') =~# '^\s*$' ? '"_cc' : 'i' 91 | " from https://github.com/monaqa/dotfiles/blob/de4bdb9f/.config/nvim/lua/rc/keymap.lua#L436 92 | nnoremap dd empty(getline('.')) && v:count1 ==# 1 93 | \ && v:register ==# '"' ? '"_dd' : 'dd' 94 | 95 | " NOTE: `g_` is almost same as `$h` 96 | xnoremap v mode() ==# 'v' ? 'g_' : 'v' 97 | xnoremap t 98 | xnoremap ) t) 99 | onoremap t 100 | onoremap ) t) 101 | 102 | inoremap zz 103 | inoremap setlocal paste! paste? 104 | inoremap 105 | 106 | " emacs-like insert/cmdline mode mapping {{{ 107 | noremap! 108 | inoremap user#is_at_end() ? '' : '' 109 | noremap! 110 | noremap! 111 | noremap! 112 | noremap! 113 | noremap! user#is_at_end() ? '' : '' 114 | inoremap user#is_at_end() ? 'gJ' : 'D' 115 | cnoremap call setcmdline( 116 | \ getcmdpos() > 1 ? getcmdline()[:getcmdpos() - 2] : '') 117 | noremap! " 118 | " }}} 119 | 120 | " Use backslash instead of ¥ 121 | map! ¥ 122 | map ¥ 123 | tmap ¥ 124 | map! 125 | map 126 | tmap 127 | 128 | " insert current file fullpath 129 | cnoremap =expand('%:p') 130 | 131 | " toggle options 132 | nnoremap [Toggle] 133 | nmap [Toggle] 134 | nnoremap [Toggle]w setlocal wrap! wrap? 135 | nnoremap [Toggle]n setlocal relativenumber! relativenumber? 136 | 137 | " buffer move 138 | nnoremap [b :bprevious 139 | nnoremap ]b :bnext 140 | nnoremap [B :bfirst 141 | nnoremap ]B :blast 142 | -------------------------------------------------------------------------------- /config/nvim/rc/option.rc.vim: -------------------------------------------------------------------------------- 1 | " ------------------ 2 | " encoding/char 3 | set encoding=utf-8 4 | if &modifiable 5 | set fileencoding=utf-8 6 | endif 7 | set fileencodings=ucs-boms,utf-8,euc-jp,cp932 8 | set fileformats=unix,dos,mac 9 | set ambiwidth=single 10 | 11 | " ------------------ 12 | " color/sequence 13 | set background=dark 14 | if !has('mac') || $COLORTERM ==# 'truecolor' 15 | set termguicolors 16 | endif 17 | if !has('gui_running') && !has('nvim') 18 | set t_Co=256 19 | let &t_Cs = "\[4:3m" 20 | let &t_Ce = "\[4:0m" 21 | let &t_8f = "\[38:2:%lu:%lu:%lum" 22 | let &t_8b = "\[48:2:%lu:%lu:%lum" 23 | let &t_SI ..= "\[6 q" 24 | let &t_EI ..= "\[2 q" 25 | let &t_SR ..= "\[4 q" 26 | endif 27 | set guicursor=n-v-c-sm:block-Cursor,i-ci-ve:ver25-Cursor,r-cr-o:hor20-Cursor 28 | 29 | " ------------------ 30 | " stausline 31 | " NOTE: Set 'laststatus' lazily in hook_source of lightline 32 | set laststatus=0 33 | set noshowmode 34 | set showcmd 35 | set noruler 36 | 37 | " ------------------ 38 | " indent 39 | set copyindent 40 | set preserveindent 41 | set expandtab 42 | set tabstop=8 43 | set softtabstop=8 44 | set autoindent 45 | set smartindent 46 | set indentkeys& indentkeys-=!^F 47 | set shiftwidth=2 48 | 49 | " ------------------ 50 | " search 51 | set incsearch 52 | set ignorecase 53 | set smartcase 54 | set hlsearch 55 | set report=0 56 | if executable('rg') 57 | " based on https://github.com/thinca/config/blob/eb27ff47/dotfiles/dot.vim/vimrc#L598 58 | let &grepprg = 'rg --json $* --sort=path | jq -r ''include "4513echo/ripgrep"; parse''' 59 | set grepformat=%f:%l:%k:%c:%m 60 | endif 61 | 62 | " ------------------ 63 | " display 64 | set number 65 | set nocursorline 66 | set list 67 | set nowrap 68 | set linebreak 69 | set display=lastline,uhex 70 | if has('nvim') 71 | set display+=msgsep 72 | endif 73 | set shortmess=aoOsTcFS 74 | set lazyredraw 75 | set nofoldenable 76 | set synmaxcol=200 77 | set redrawtime=1000 78 | set signcolumn=number 79 | set tabclose=uselast 80 | 81 | set sidescroll=1 82 | set sidescrolloff=2 83 | 84 | set belloff= 85 | set visualbell 86 | 87 | set listchars=tab:»-,trail:-,extends:»,precedes:«,eol:¬,nbsp:% 88 | let &showbreak = '» ' 89 | set fillchars& fillchars+=stl:\ ,stlnc:\ ,diff:/,eob:. 90 | if has('nvim') 91 | set fillchars+=msgsep:\| 92 | endif 93 | 94 | set pumheight=10 95 | set helpheight=12 96 | set cmdheight=2 97 | if has('nvim') 98 | set pumblend=20 99 | set winblend=20 100 | endif 101 | 102 | " ------------------ 103 | " editing 104 | set backspace=indent,eol,start 105 | set whichwrap=b,s,h,l 106 | set hidden 107 | set confirm 108 | set timeoutlen=500 109 | " NOTE: Use vim-parenmatch instead of 'showmatch' and 'matchtime' 110 | set matchpairs& matchpairs+=<:> 111 | set nrformats=hex,bin,blank 112 | set nojoinspaces 113 | set virtualedit=block 114 | 115 | set clipboard-=autoselect 116 | set mouse=nr 117 | set mousemodel=popup_setpos 118 | 119 | set completeopt=menuone,noinsert,noselect,popup 120 | set isfname& isfname-== isfname+=@-@ 121 | 122 | " ------------------ 123 | " commandline 124 | set wildmenu 125 | set wildmode=longest,full 126 | set wildoptions=pum,tagfile,fuzzy 127 | set wildignorecase 128 | set history=400 129 | set cedit= 130 | 131 | " ------------------ 132 | " backup 133 | set backup 134 | set writebackup 135 | set swapfile 136 | set updatetime=100 137 | let &backupdir = g:data_home .. '/backup//' 138 | let &directory = g:data_home .. '/swap//' 139 | call mkdir(&backupdir, 'p') 140 | call mkdir(&directory, 'p') 141 | set undofile 142 | if !has('nvim') 143 | let &undodir = g:vim_data_home .. '/undo' 144 | call mkdir(&undodir, 'p') 145 | let &viminfofile = g:vim_data_home .. '/viminfo' 146 | endif 147 | 148 | " ------------------ 149 | " title 150 | set title 151 | set titlestring=%{user#title_string()} 152 | let &titleold = getcwd()->fnamemodify(':~')->pathshorten() 153 | 154 | " ------------------ 155 | " various 156 | set helplang=ja,en 157 | set keywordprg=:help 158 | 159 | set packpath= 160 | set ttyfast 161 | set autoread 162 | set tildeop 163 | set diffopt=internal,filler,vertical,algorithm:histogram,indent-heuristic 164 | set nofsync 165 | set nolangremap 166 | -------------------------------------------------------------------------------- /config/nvim/rc/var.rc.vim: -------------------------------------------------------------------------------- 1 | let g:python_highlight_all = v:true 2 | let g:awk_is_gawk = v:true 3 | let g:is_bash = v:true 4 | let g:rust_bang_comment_leader = v:true 5 | let g:markdown_fenced_languages = ['ts=typescript'] 6 | let g:vim_indent_cont = 6 7 | let g:vimsyn_embed = 'lP' 8 | let g:vimsyn_noerror = v:true 9 | 10 | let g:loaded_2html_plugin = v:true 11 | let g:loaded_getscript = v:true 12 | let g:loaded_getscriptPlugin = v:true 13 | let g:loaded_gzip = v:true 14 | let g:loaded_gtags = v:true 15 | let g:loaded_gtags_cscope = v:true 16 | let g:loaded_logiPat = v:true 17 | let g:loaded_man = v:true 18 | let g:loaded_matchit = v:true 19 | let g:loaded_matchparen = v:true 20 | let g:loaded_netrw = v:true 21 | let g:loaded_netrwFileHandlers = v:true 22 | let g:loaded_netrwPlugin = v:true 23 | let g:loaded_netrwSettings = v:true 24 | let g:loaded_rrhelper = v:true 25 | let g:loaded_shada_plugin = v:true 26 | let g:loaded_spellfile_plugin = v:true 27 | let g:loaded_sql_completion = v:true 28 | let g:loaded_syntax_completion = v:true 29 | let g:loaded_tar = v:true 30 | let g:loaded_tarPlugin = v:true 31 | let g:loaded_tutor_mode_plugin = v:true 32 | let g:loaded_vimball = v:true 33 | let g:loaded_vimballPlugin = v:true 34 | let g:loaded_zip = v:true 35 | let g:loaded_zipPlugin = v:true 36 | -------------------------------------------------------------------------------- /config/nvim/setting/ddc.vim: -------------------------------------------------------------------------------- 1 | " hook_add {{{ 2 | nnoremap : :call ddc#enable_cmdline_completion() 3 | xnoremap : :call ddc#enable_cmdline_completion() 4 | autocmd vimrc User SearchxEnter call ddc#enable_cmdline_completion() 5 | " }}} 6 | 7 | " hook_source {{{ 8 | " based on https://github.com/kuuote/dotvim/blob/0e8dd6a4/conf/ddc.toml#L170 9 | autocmd vimrc OptionSet buftype 10 | \ : if &buftype ==# 'acwrite' || bufname() ==# 'mininote' 11 | \ | call ddc#custom#patch_buffer('specialBufferCompletion', v:true) 12 | \ | endif 13 | 14 | " key mappings 15 | inoremap pum#visible() ? 'call pum#map#select_relative(+1)' : '' 16 | inoremap pum#visible() ? 'call pum#map#select_relative(-1)' : '' 17 | cnoremap pum#visible() ? 'call pum#map#select_relative(+1)' : '' 18 | cnoremap pum#visible() ? 'call pum#map#select_relative(-1)' : '' 19 | cnoremap pum#visible() ? 'call pum#map#select_relative(+1)' : ddc#map#manual_complete() 20 | 21 | inoremap pum#visible() ? 'call pum#map#cancel()' : user#is_at_end() ? '' : '' 22 | inoremap pum#visible() ? 'call pum#map#confirm()' : '"' 23 | cnoremap pum#visible() ? 'call pum#map#cancel()' : '' 24 | cnoremap pum#visible() ? 'call pum#map#confirm()' : '"' 25 | 26 | " emulate default mappings (see `:help ins-completion`) 27 | function! s:ddc_complete(...) abort 28 | return ddc#map#manual_complete(#{ sources: a:000 }) 29 | endfunction 30 | inoremap ddc_complete('line') 31 | inoremap ddc_complete('around') 32 | inoremap ddc_complete('file') 33 | inoremap ddc_complete('lsp') 34 | inoremap ddc_complete('cmdline') 35 | inoremap ddc_complete() 36 | inoremap ddc_complete('omni') 37 | inoremap ddc_complete('mocword') 38 | inoremap ddc_complete('tmux') 39 | 40 | if bufname() =~# '^/tmp/\d\+\.md$' 41 | inoremap ddc_complete('github_issue', 'github_pull_request') 42 | endif 43 | 44 | call ddc#custom#load_config(expand('$MYVIMDIR/setting/ddc.ts')) 45 | call ddc#enable(#{ 46 | \ context_filetype: has('nvim') ? 'treesitter': 'context_filetype', 47 | \ }) 48 | " }}} 49 | 50 | " hook_post_update {{{ 51 | call ddc#set_static_import_path() 52 | echomsg '[ddc] ddc#set_static_import_path() called' 53 | " }}} 54 | -------------------------------------------------------------------------------- /config/nvim/setting/ddu.vim: -------------------------------------------------------------------------------- 1 | " hook_add {{{ 2 | let g:launcher_config.ddu = #{ 3 | \ char: 'd', 4 | \ run: { -> ddu#start(#{ sources: [#{ name: 'source' }] }) }, 5 | \ } 6 | nnoremap d Ddu -resume 7 | inoremap call ddu#start(#{ 8 | \ sources: [ 9 | \ #{ name: 'emoji', options: #{ defaultAction: 'feedkeys' } }, 10 | \ ], 11 | \ uiParams: #{ 12 | \ ff: #{ replaceCol: col('.') }, 13 | \ }, 14 | \ }) 15 | 16 | function! s:open_current_line_hunk() abort 17 | if !empty(&buftype) 18 | return 19 | endif 20 | autocmd vimrc User Ddu:uiDone ++once 21 | \ call ddu#ui#async_action('itemAction', #{ name: 'currentLine' }) 22 | call ddu#start(#{ 23 | \ name: 'git_diff_current', 24 | \ sourceOptions: #{ _: #{ path: expand('%:p') } }, 25 | \ }) 26 | endfunction 27 | nnoremap gd call open_current_line_hunk() 28 | 29 | call timer_start(10, { -> ddu#load('ui', ['ff']) }) 30 | " }}} 31 | 32 | " hook_source {{{ 33 | autocmd vimrc User Ddu:ui:ff:openFilterWindow call s:on_ddu_ff_filter() 34 | autocmd vimrc User Ddu:ui:ff:closeFilterWindow call ddu#ui#ff#restore_cmaps() 35 | function! s:on_ddu_ff_filter() abort 36 | " NOTE: lexima defines mappings on CmdlineEnter only once, so if we start Ddu from keymap, we need to define manually 37 | if empty(maparg('', 'c')) 38 | cnoremap lexima#expand('CR>', ':') 39 | endif 40 | call ddu#ui#ff#save_cmaps(['', '', '', '']) 41 | cnoremap 42 | cnoremap call ddu#ui#do_action('itemAction') 43 | cnoremap call ddu#ui#multi_actions([ 44 | \ ['cursorNext', #{ loop: v:true }], 45 | \ ['updateLightline'], 46 | \ ]) 47 | cnoremap call ddu#ui#multi_actions([ 48 | \ ['cursorPrevious', #{ loop: v:true }], 49 | \ ['updateLightline'], 50 | \ ]) 51 | if has('nvim') 52 | call cmdline#enable() 53 | endif 54 | endfunction 55 | 56 | call ddu#custom#load_config(expand('$MYVIMDIR/setting/ddu.ts')) 57 | " }}} 58 | 59 | " hook_post_update {{{ 60 | call ddu#set_static_import_path() 61 | echomsg '[ddu] ddu#set_static_import_path() called' 62 | " }}} 63 | 64 | " ddu-ff {{{ 65 | setlocal cursorline signcolumn=yes 66 | autocmd vimrc-ddu ModeChanged 67 | \ : if v:event.new_mode =~# '^[v\x16]' 68 | \ | execute 'normal! V' 69 | \ | endif 70 | nnoremap 71 | \ call ddu#ui#do_action('itemAction') 72 | nnoremap 73 | \ call ddu#ui#do_action('toggleSelectItem') 74 | xnoremap 75 | \ :call ddu#ui#do_action('toggleSelectItem') 76 | nnoremap a 77 | \ call ddu#ui#do_action('toggleAllItems') 78 | nnoremap c 79 | \ call ddu#ui#do_action('clearSelectAllItems') 80 | nnoremap i 81 | \ call ddu#ui#do_action('openFilterWindow') 82 | nnoremap 83 | \ call ddu#ui#do_action('chooseAction') 84 | nnoremap 85 | \ call ddu#ui#do_action('redraw', #{ method: 'refreshItems' })redraw 86 | nnoremap p 87 | \ call ddu#ui#do_action('togglePreview') 88 | nnoremap P 89 | \ call ddu#ui#do_action('toggleAutoAction') 90 | nnoremap q 91 | \ call ddu#ui#do_action('quit') 92 | nnoremap E 93 | \ call ddu#ui#do_action('itemAction', 94 | \ #{ params: eval(input('params: ', "#{}\Left>")) }) 95 | nnoremap d 96 | \ call ddu#ui#do_action('itemAction', #{ name: 'delete' }) 97 | nnoremap W 98 | \ call ddu#ui#do_action('itemAction', #{ params: 99 | \ #{ command: 'call snipewin#select()edit' } }) 100 | nnoremap < 101 | \ call ddu#ui#do_action('collapseItem') 102 | nnoremap > 103 | \ call ddu#ui#do_action('expandItem', #{ mode: 'toggle' }) 104 | if b:ddu_ui_name ==# 'file_tree' 105 | nnoremap 106 | \ ddu#ui#get_item().isTree 107 | \ ? "call ddu#ui#do_action('expandItem', #{ mode: 'toggle' })" 108 | \ : "call ddu#ui#do_action('itemAction', #{ name: 'open' })" 109 | elseif b:ddu_ui_name ==# 'git_diff_current' 110 | nnoremap 111 | \ call ddu#ui#do_action('itemAction', #{ name: 'currentHunk' }) 112 | endif 113 | " }}} 114 | -------------------------------------------------------------------------------- /config/nvim/setting/skkeleton.vim: -------------------------------------------------------------------------------- 1 | " hook_add {{{ 2 | noremap! (skkeleton-toggle) 3 | tnoremap (skkeleton-toggle) 4 | autocmd vimrc User DenopsPluginPost:skkeleton call skkeleton#initialize() 5 | " }}} 6 | 7 | " hook_source {{{ 8 | autocmd vimrc User skkeleton-initialize-pre call s:on_init() 9 | autocmd vimrc User skkeleton-enable-pre call s:on_enable() 10 | autocmd vimrc User skkeleton-disable-pre call s:on_disable() 11 | autocmd vimrc User skkeleton-enable-post,skkeleton-mode-changed call lightline#update() 12 | 13 | autocmd vimrc User skkeleton-handled call user#plugins#skkeleton#show_mode() 14 | autocmd vimrc User skkeleton-disable-post call user#plugins#skkeleton#hide_mode() 15 | autocmd vimrc User PumCompleteDone call user#plugins#skkeleton#hide_mode() 16 | 17 | function! s:on_init() abort 18 | let skk_dir = has('mac') ? 19 | \ expand('~/Library/Containers/net.mtgto.inputmethod.macSKK/Data/Documents/Dictionaries') 20 | \ : expand('~/.local/share/skk') 21 | let globalDictionaries = denops#request('vimrc', 'ensureSkkJisyo', [skk_dir]) 22 | 23 | call skkeleton#config(#{ 24 | \ eggLikeNewline: v:true, 25 | \ completionRankFile: skk_dir .. '/completionRankFile', 26 | \ databasePath: skk_dir .. '/skk.db', 27 | \ globalDictionaries: globalDictionaries, 28 | \ immediatelyCancel: v:false, 29 | \ keepState: v:true, 30 | \ markerHenkan: '', 31 | \ markerHenkanSelect: '', 32 | \ registerConvertResult: v:true, 33 | \ showCandidatesCount: 2, 34 | \ sources: ['deno_kv'], 35 | \ userDictionary: skk_dir .. '/skk-jisyo.utf8', 36 | \ }) 37 | 38 | call skkeleton#register_keymap('input', ';', 'henkanPoint') 39 | 40 | " NOTE: z0 is from https://github.com/yasunori-kirin0418/dotfiles/blob/c5863428/config/nvim/autoload/vimrc.vim#L122 41 | call skkeleton#register_kanatable('rom', { 42 | \ 'z0': ["\u25CB"], 43 | \ '(': ["\uFF08"], 44 | \ ')': ["\uFF09"], 45 | \ }) 46 | endfunction 47 | 48 | function! s:on_enable() abort 49 | let b:skkeleton_config = ddc#custom#get_buffer() 50 | call ddc#custom#patch_buffer(#{ 51 | \ cmdlineSources: ['skkeleton'], 52 | \ sources: ['skkeleton'], 53 | \ specialBufferCompletion: v:true, 54 | \ }) 55 | call pum#set_buffer_option(#{ auto_select: v:false }) 56 | endfunction 57 | function! s:on_disable() abort 58 | if exists('b:skkeleton_config') 59 | call ddc#custom#set_buffer(b:skkeleton_config) 60 | call pum#set_buffer_option(#{ auto_select: v:true }) 61 | unlet b:skkeleton_config 62 | endif 63 | endfunction 64 | " }}} 65 | -------------------------------------------------------------------------------- /config/nvim/snippets/_highlight_test.json: -------------------------------------------------------------------------------- 1 | { 2 | "test": { 3 | "body": [ 4 | "tabstop: $0 ${1:default value}", 5 | "\t${2:nested ${3:placeholder} $4 text}", 6 | "choice placeholder: ${5|hoge,fuga,piyo|}", 7 | "built-in variables: $TM_SELECTED_TEXT $HOGE", 8 | "vim script expression: ${VIM:1 + 2}", 9 | "uuid ${VIM:system('deno eval \"console.log(crypto.randomUUID())\"')}" 10 | ], 11 | "description": "snippet highlight test", 12 | "prefix": [ 13 | "test" 14 | ] 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /config/nvim/snippets/gitcommit.json: -------------------------------------------------------------------------------- 1 | { 2 | "coau": { 3 | "body": [ 4 | "Co-authored-by: ${1:name}" 5 | ], 6 | "description": "Co-authored-by tag", 7 | "prefix": [ 8 | "coau" 9 | ] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /config/nvim/snippets/help.json: -------------------------------------------------------------------------------- 1 | { 2 | "lastc": { 3 | "body": [ 4 | "Last change: ${VIM:strftime('%Y %b %d')}" 5 | ], 6 | "description": "last changed date", 7 | "prefix": [ 8 | "lastc" 9 | ] 10 | }, 11 | "modeline": { 12 | "body": [ 13 | "vim:tw=78:ts=8:ft=help:norl:noet:fen:" 14 | ], 15 | "description": "help modeline", 16 | "prefix": [ 17 | "modeline" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /config/nvim/snippets/json.json: -------------------------------------------------------------------------------- 1 | { 2 | "snippet": { 3 | "body": [ 4 | "\"${1:name}\": {", 5 | "\t\"body\": [", 6 | "\t\t\"$0\"", 7 | "\t],", 8 | "\t\"description\": \"${3:description}\",", 9 | "\t\"prefix\": [", 10 | "\t\t\"$1\"", 11 | "\t]", 12 | "}" 13 | ], 14 | "description": "VSCode (or vsnip) snippet", 15 | "prefix": [ 16 | "snip", 17 | "snippet" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /config/nvim/snippets/markdown.json: -------------------------------------------------------------------------------- 1 | { 2 | "details": { 3 | "body": [ 4 | "
", 5 | "", 6 | "${1:summary}", 7 | "", 8 | "$0", 9 | "", 10 | "
" 11 | ], 12 | "description": "summary/detail folding", 13 | "prefix": [ 14 | "details" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /config/nvim/snippets/sh.json: -------------------------------------------------------------------------------- 1 | { 2 | "set": { 3 | "body": [ 4 | "set -ue -o pipefail" 5 | ], 6 | "description": "bash set statement", 7 | "prefix": [ 8 | "set" 9 | ] 10 | }, 11 | "shellcheck": { 12 | "body": [ 13 | "shellcheck ${1|disable,source,shell|}=$0" 14 | ], 15 | "description": "shellcheck annotation comment", 16 | "prefix": [ 17 | "shellcheck" 18 | ] 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /config/nvim/snippets/toml.json: -------------------------------------------------------------------------------- 1 | { 2 | "colorschemes": { 3 | "body": [ 4 | "[[plugins.colorschemes]]", 5 | "name = '$1'" 6 | ], 7 | "description": "colorscheme plugin definition", 8 | "prefix": [ 9 | "colorschemes" 10 | ] 11 | }, 12 | "ftplugin": { 13 | "body": [ 14 | "[plugins.ftplugin]", 15 | "${1:filetype} = '''", 16 | "$0", 17 | "'''" 18 | ], 19 | "description": "dein ftplugin definition", 20 | "prefix": [ 21 | "ftplugin" 22 | ] 23 | }, 24 | "hook": { 25 | "body": [ 26 | "hook_${1:add} = '''", 27 | "$0", 28 | "'''" 29 | ], 30 | "description": "dein hook definition", 31 | "prefix": [ 32 | "hook" 33 | ] 34 | }, 35 | "plugins": { 36 | "body": [ 37 | "[[plugins]]", 38 | "repo = 'https://${1:github.com}/$0'" 39 | ], 40 | "description": "dein plugin definition", 41 | "prefix": [ 42 | "plugins" 43 | ] 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /config/nvim/snippets/typescript.json: -------------------------------------------------------------------------------- 1 | { 2 | "echomsg": { 3 | "body": [ 4 | "await ${1:denops}.cmd(\"unsilent echomsg val\", { val: ${2:val} });" 5 | ], 6 | "description": "denops.vim debug stuff", 7 | "prefix": [ 8 | "echomsg" 9 | ] 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /config/nvim/snippets/vim.json: -------------------------------------------------------------------------------- 1 | { 2 | "augroup": { 3 | "body": [ 4 | "augroup ${1:group}", 5 | "\tautocmd!", 6 | "\t$0", 7 | "augroup END" 8 | ], 9 | "description": "autocmd group definition", 10 | "prefix": [ 11 | "augroup" 12 | ] 13 | }, 14 | "echohl": { 15 | "body": [ 16 | "echohl ${1:ErrorMsg}", 17 | "${2:echomsg} $0", 18 | "echohl NONE" 19 | ], 20 | "description": "echohl command", 21 | "prefix": [ 22 | "echohl" 23 | ] 24 | }, 25 | "function": { 26 | "body": [ 27 | "function! ${1:name}($2) abort", 28 | "\t$0", 29 | "endfunction" 30 | ], 31 | "description": "vim function", 32 | "prefix": [ 33 | "function" 34 | ] 35 | }, 36 | "unsilent": { 37 | "body": [ 38 | "unsilent echomsg string($0)" 39 | ], 40 | "description": "debug stuff", 41 | "prefix": [ 42 | "unsilent" 43 | ] 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /config/nvim/template/help/base-help.txt: -------------------------------------------------------------------------------- 1 | *{{_expr_:expand('%:p:t')}}* {{_input_:description}} 2 | 3 | Author: {{_input_:author}} 4 | License: {{_input_:license}} 5 | URL: {{_input_:url:'https://github.com/4513ECHO/'}} 6 | Last change: {{_expr_:strftime('%Y %b %d')}} 7 | 8 | ============================================================================== 9 | CONTENTS *{{_expr_:expand('%:t:r')->substitute('_','-','g')}}-contents* 10 | 11 | Introduction |{{_expr_:user#plugins#sonictemplate#help()}}-introduction| 12 | Interface |{{_expr_:user#plugins#sonictemplate#help()}}-interface| 13 | About |{{_expr_:user#plugins#sonictemplate#help()}}-about| 14 | 15 | ============================================================================== 16 | INTRODUCTION *{{_expr_:user#plugins#sonictemplate#help()}}-introduction* 17 | 18 | *{{_expr_:user#plugins#sonictemplate#help()}}* is a plugin to 19 | 20 | ============================================================================== 21 | INTERFACE *{{_expr_:user#plugins#sonictemplate#help()}}-interface* 22 | 23 | ------------------------------------------------------------------------------ 24 | {{_cursor_}} 25 | 26 | ============================================================================== 27 | ABOUT *{{_expr_:user#plugins#sonictemplate#help()}}-about* 28 | 29 | |{{_expr_:user#plugins#sonictemplate#help()}}| is developed by {{_input_:author_without_mail}} and licensed under the 30 | {{_input_:license}}. Visit the project page for the latest version: 31 | 32 | {{_input_:url}} 33 | 34 | ============================================================================== 35 | vim:tw=78:ts=8:ft=help:norl:noet:fen: 36 | -------------------------------------------------------------------------------- /config/nvim/template/toml/base-pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "{{_input_:name}}" 3 | version = "0.0.0" 4 | description = "" 5 | authors = ["Hibiki(4513ECHO) "] 6 | license = "MIT" 7 | readme = "README.md" 8 | repository = "{{_input_:url}}" 9 | packages = [ 10 | { include = "{{_input_:name}}" }, 11 | # { include = "src" }, 12 | ] 13 | classifiers = [ 14 | "License :: OSI Approved :: MIT License", 15 | "Programming Language :: Python", 16 | "Programming Language :: Python :: 3", 17 | "Programming Language :: Python :: 3 :: Only", 18 | "Programming Language :: Python :: 3.9", 19 | "Programming Language :: Python :: 3.10", 20 | "Programming Language :: Python :: Implementation :: CPython", 21 | "Typing :: Typed", 22 | ] 23 | 24 | [tool.poetry.scripts] 25 | cli = "{{_input_:name}}.main:main" 26 | 27 | [tool.poetry.dependencies] 28 | python = "^3.9" 29 | 30 | [tool.poetry.group.dev.dependencies] 31 | black = "^23.3.0" 32 | isort = "^5.12.0" 33 | mypy = "^1.3.0" 34 | flake8 = "^6.0.0" 35 | flake8-pyproject = "^1.2.3" 36 | 37 | [build-system] 38 | requires = ["poetry-core"] 39 | build-backend = "poetry.core.masonry.api" 40 | 41 | [tool.black] 42 | line-length = 88 43 | 44 | [tool.isort] 45 | py_version = 39 46 | profile = "black" 47 | 48 | [tool.mypy] 49 | python_version = "3.9" 50 | show_error_codes = true 51 | pretty = true 52 | strict = true 53 | 54 | [tool.flake8] 55 | indent-size = 4 56 | max-line-length = 120 57 | -------------------------------------------------------------------------------- /config/nvim/template/vim/base-plugin.vim: -------------------------------------------------------------------------------- 1 | if exists('g:loaded_{{_input_:plugin}}') 2 | finish 3 | endif 4 | let g:loaded_{{_input_:plugin}} = v:true 5 | 6 | {{_cursor_}} 7 | -------------------------------------------------------------------------------- /config/pip/pip.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | require-virtualenv = true 3 | -------------------------------------------------------------------------------- /config/profile: -------------------------------------------------------------------------------- 1 | # shellcheck shell=dash 2 | 3 | set -ue 4 | 5 | # If not running interactively, don't do anything 6 | case "$-" in 7 | *i*) 8 | SHELL="$(which zsh)" 9 | export SHELL 10 | [ -z "${ZSH_VERSION:-}" ] && exec "$SHELL" -l 11 | ;; 12 | *) return ;; 13 | esac 14 | -------------------------------------------------------------------------------- /config/python/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "dotfiles" 3 | version = "0.0.0" 4 | description = "" 5 | authors = ["Hibiki "] 6 | 7 | [tool.poetry.dependencies] 8 | python = "^3.10" 9 | 10 | [tool.poetry.group.tool.dependencies] 11 | black = "^25.0.0" 12 | isort = "^6.0.0" 13 | mypy = "^1.8.0" 14 | 15 | # cli tools that has low priority 16 | [tool.poetry.group.util.dependencies] 17 | # ddgr = "^2.1" 18 | # httpie = "^3.2.1" 19 | # jc = "^1.22.2" 20 | # NOTE: pepdocs uses too old version of click 21 | # pepdocs = "^0.3.0" 22 | # pip-chill = "^1.0.1" 23 | # toml-sort = "^0.20.1" 24 | # vim-vint = "^0.3.21" 25 | # yamllint = "^1.28.0" 26 | 27 | [tool.poetry.group.flake8.dependencies] 28 | flake8 = "^7.0.0" 29 | flake8-pyproject = "^1.2.3" 30 | flake8-isort = "^6.1.1" 31 | pep8-naming = "^0.15.0" 32 | 33 | [tool.poetry.group.lsp.dependencies] 34 | python-lsp-server = { version = "^1.9.0", extras = ["all"] } 35 | python-lsp-black = "^2.0.0" 36 | pyls-isort = "^0.2.2" 37 | pylsp-mypy = "^0.7.0" 38 | 39 | [tool.poetry.group.poetry.dependencies] 40 | poetry = "^2.0.0" 41 | poetry-plugin-export = "^1.6.0" 42 | poetry-dynamic-versioning-plugin = "^0.4.0" 43 | 44 | [tool.poetry.group.game.dependencies] 45 | pycowsay = "^0.0.0.2" 46 | term2048 = "^0.2.7" 47 | 48 | [build-system] 49 | requires = ["poetry-core"] 50 | build-backend = "poetry.core.masonry.api" 51 | -------------------------------------------------------------------------------- /config/python/startup.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import inspect 3 | import readline 4 | import sys 5 | 6 | q = exit 7 | 8 | 9 | class Dev: 10 | @staticmethod 11 | def pp(obj) -> None: 12 | print(inspect.getsource(obj)) 13 | 14 | 15 | # from https://unix.stackexchange.com/questions/121377/how-can-i-disable-the-new-history-feature-in-python-3-4 16 | def register_readline_completion() -> None: 17 | # rlcompleter must be loaded for Python-specific completion 18 | try: 19 | import readline 20 | import rlcompleter 21 | except ImportError: 22 | return 23 | # Enable tab-completion 24 | readline_doc = getattr(readline, "__doc__", "") 25 | if readline_doc is not None and "libedit" in readline_doc: 26 | readline.parse_and_bind("bind ^I rl_complete") 27 | else: 28 | readline.parse_and_bind("tab: complete") 29 | 30 | 31 | sys.__interactivehook__ = register_readline_completion 32 | 33 | print(datetime.datetime.now()) 34 | -------------------------------------------------------------------------------- /config/ripgrep/config: -------------------------------------------------------------------------------- 1 | --hidden 2 | --smart-case 3 | 4 | --glob=!.git 5 | -------------------------------------------------------------------------------- /config/rofi/config.rasi: -------------------------------------------------------------------------------- 1 | configuration { 2 | modi: "combi,drun,window,i3msg:i3-msg,run"; 3 | show-icons: true; 4 | sidebar-mode: true; 5 | combi-modi: "drun,window"; 6 | kb-cancel: "Escape,Control-g,Control-bracketleft,Control-c"; 7 | timeout { 8 | action: "kb-cancel"; 9 | delay: 0; 10 | } 11 | filebrowser { 12 | directories-first: true; 13 | sorting-method: "name"; 14 | } 15 | combi { 16 | modi: "drun,window"; 17 | } 18 | kb { 19 | cancel: "Escape,Control-g,Control-bracketleft,Control-c"; 20 | } 21 | } 22 | 23 | @theme "hatsunemiku" 24 | -------------------------------------------------------------------------------- /config/rofi/hatsunemiku.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | colorFg: #fcfcdf; 3 | colorBg: #242829; 4 | colorBorder: #b7b7b7; 5 | colorLight: #4a4b4b; 6 | colorSpecial: #72d5d2; 7 | colorAccent: #df2683; 8 | 9 | background-color: @colorBg; 10 | text-color: @colorFg; 11 | border-color: @colorBorder; 12 | border-radius: 10px; 13 | vertical-align: 0.5; 14 | } 15 | 16 | window { 17 | font: "monospace 12"; 18 | height: 40%; 19 | border: 2px; 20 | } 21 | 22 | inputbar { 23 | padding: 0.5em; 24 | spacing: 0.5em; 25 | } 26 | 27 | prompt, button selected { 28 | text-color: @colorSpecial; 29 | background-color: @colorLight; 30 | padding: 0.5em; 31 | } 32 | 33 | case-indicator { 34 | text-color: @colorAccent; 35 | } 36 | 37 | entry { 38 | padding: 0.5em; 39 | border: 2px; 40 | } 41 | 42 | listview { 43 | padding: 0.5em; 44 | } 45 | 46 | element { 47 | padding: 0.2em; 48 | } 49 | 50 | element selected.normal { 51 | background-color: @colorLight; 52 | } 53 | 54 | element-text { 55 | background-color: inherit; 56 | highlight: underline #df2683; 57 | } 58 | 59 | element-icon { 60 | background-color: inherit; 61 | padding: 0.2em 0.8em 0.2em 0.4em; 62 | size: 1.1em; 63 | } 64 | 65 | button { 66 | padding: 0.5em; 67 | } 68 | -------------------------------------------------------------------------------- /config/skhd/skhdrc: -------------------------------------------------------------------------------- 1 | # kill focused window 2 | cmd + shift - q : yabai -m window --close 3 | 4 | # change focus 5 | cmd + ctrl - h : yabai -m window --focus west 6 | cmd + ctrl - j : yabai -m window --focus south 7 | cmd + ctrl - k : yabai -m window --focus north 8 | cmd + ctrl - l : yabai -m window --focus east 9 | 10 | cmd - tab : yabai -m window --focus next || yabai -m window --focus first 11 | 12 | # move focuesd window 13 | cmd + shift - h : yabai -m window --swap west 14 | cmd + shift - j : yabai -m window --swap south 15 | cmd + shift - k : yabai -m window --swap north 16 | cmd + shift - l : yabai -m window --swap east 17 | 18 | # enter fullscreen mode for the focused window 19 | cmd - f : yabai -m window --toggle zoom-fullscreen 20 | cmd + shift - f : yabai -m window --toggle native-fullscreen 21 | 22 | # switch to space 23 | cmd - 1 : yabai-util focus_space 1 24 | cmd - 2 : yabai-util focus_space 2 25 | cmd - 3 : yabai-util focus_space 3 26 | cmd - 4 : yabai-util focus_space 4 27 | cmd - 5 : yabai-util focus_space 5 28 | 29 | # move focused window to space 30 | cmd + shift - 1 : yabai -m window --space 1 31 | cmd + shift - 2 : yabai -m window --space 2 32 | cmd + shift - 3 : yabai -m window --space 3 33 | cmd + shift - 4 : yabai -m window --space 4 34 | cmd + shift - 5 : yabai -m window --space 5 35 | 36 | # restart yabai and skhd inplace 37 | cmd + shift - r : yabai --restart-service && skhd --restart-service 38 | 39 | # screenshot 40 | cmd + alt - p : yabai-util screencapture 41 | cmd + alt + shift - p : yabai-util screencapture_selected 42 | 43 | # resize window 44 | :: resize @ : osascript -e 'display notification "Enter resize mode" with title "yabai"' 45 | resize < h : yabai -m window --resize left:10:0 46 | resize < j : yabai -m window --resize bottom:0:10 47 | resize < k : yabai -m window --resize bottem:0:-10 48 | resize < l : yabai -m window --resize left:-10:0 49 | resize < 0x35 ; default 50 | resize < return ; default 51 | cmd + ctrl - r ; resize 52 | -------------------------------------------------------------------------------- /config/stylua/stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 80 2 | line_endings = 'Unix' 3 | indent_type = 'Spaces' 4 | indent_width = 2 5 | quote_style = 'AutoPreferDouble' 6 | call_parentheses = 'None' 7 | collapse_simple_statement = 'FunctionOnly' 8 | -------------------------------------------------------------------------------- /config/systemd/user/templates/docker.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Docker Application Container Engine (Rootless) 3 | Documentation=https://docs.docker.com/go/rootless/ 4 | 5 | [Service] 6 | Environment=PATH={{ .Env.PATH }} 7 | Environment=AQUA_GLOBAL_CONFIG={{ .Env.AQUA_GLOBAL_CONFIG }} 8 | Environment=AQUA_ROOT_DIR={{ .Env.AQUA_ROOT_DIR }} 9 | Environment=AQUA_EXPERIMENTAL_X_SYS_EXEC=true 10 | ExecStart={{ .Env.AQUA_ROOT_DIR }}/bin/aqua exec -- dockerd-rootless.sh 11 | ExecReload=/bin/kill -s HUP $MAINPID 12 | TimeoutSec=0 13 | RestartSec=2 14 | Restart=always 15 | StartLimitBurst=3 16 | StartLimitInterval=60s 17 | LimitNOFILE=infinity 18 | LimitNPROC=infinity 19 | LimitCORE=infinity 20 | TasksMax=infinity 21 | Delegate=yes 22 | Type=simple 23 | KillMode=mixed 24 | 25 | [Install] 26 | WantedBy=default.target 27 | -------------------------------------------------------------------------------- /config/systemd/user/templates/nightlock.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Lock Screen Automatically at Night 3 | 4 | [Service] 5 | Type=oneshot 6 | ExecStart=/usr/bin/xautolock -locknow 7 | -------------------------------------------------------------------------------- /config/systemd/user/templates/nightlock.timer: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Lock Screen Automatically at Night 3 | 4 | [Timer] 5 | OnCalendar=*-*-* 0:20:00 6 | 7 | [Install] 8 | WantedBy=timers.target 9 | -------------------------------------------------------------------------------- /config/tmux/colors.tmux: -------------------------------------------------------------------------------- 1 | # vim:ft=tmux 2 | 3 | # status line 4 | set -g status-interval 1 5 | set -g status-position top 6 | set -g status-justify centre 7 | set -g status-style fg=colour246,bg=colour235 8 | 9 | set -g status-left-length 40 10 | set -g status-left "\ 11 | #[bright,reverse]#{?client_prefix,[PREFIX],}#[default]\ 12 | #[bright,reverse]#{?window_zoomed_flag,[ZOOMED],}#[default]\ 13 | #[bright,reverse]#{?pane_synchronized,[SYNCHRONIZED],}#[default]\ 14 | Session: #{session_name}" 15 | 16 | set -g status-right \ 17 | "#[dim]#(cut -d' ' -f1 /proc/loadavg) [%m/%d(%a) %H:%M:%S]#[default]" 18 | 19 | # window status 20 | setw -g window-status-format '#{window_index}: #{window_name}' 21 | setw -g window-status-current-format '#{window_index}: #{window_name}#[default]' 22 | setw -g window-status-current-style bright 23 | setw -g window-status-style dim 24 | setw -g window-status-separator '|' 25 | 26 | # message 27 | set -g message-style fg=colour235,bg=colour246 28 | set -g message-command-style fg=colour246,bg=colour235 29 | set -g mode-style fg=colour235,bg=colour246 30 | 31 | # pane border 32 | set -g pane-border-style fg=colour239 33 | set -g pane-border-format ' #{pane_index}: #{pane_title} (#{pane_tty}) ' 34 | set -g pane-border-status top 35 | set -g pane-active-border-style fg=colour246 36 | 37 | # clock 38 | set -g display-panes-active-colour colour246 39 | set -g display-panes-colour colour239 40 | setw -g clock-mode-colour colour246 41 | 42 | # search 43 | setw -g copy-mode-match-style bg=colour235,fg=colour239,bold 44 | setw -g copy-mode-current-match-style bg=colour246,fg=colour239,bold 45 | -------------------------------------------------------------------------------- /config/tmux/flowers.txt: -------------------------------------------------------------------------------- 1 | Anemone 2 | Bindweed 3 | Cattleya 4 | Dandelion 5 | Edelweiss 6 | Freesia 7 | Gerbera 8 | Hyacinth 9 | Iris 10 | Jasmine 11 | Kochia 12 | Lily 13 | Marigold 14 | Narcissus 15 | Orchid 16 | Pansy 17 | Quince 18 | Rose 19 | Sunflower 20 | Tulip 21 | Ursinia 22 | Violet 23 | Wisteria 24 | Xeranthemum 25 | Yucca 26 | Zenobia 27 | -------------------------------------------------------------------------------- /config/tmux/keymaps.tmux: -------------------------------------------------------------------------------- 1 | # vim:ft=tmux 2 | 3 | # prefix key 4 | set -g prefix C-q 5 | unbind C-b 6 | unbind q 7 | bind C-q send-prefix 8 | 9 | bind c new-window -c '#{pane_current_path}' 10 | bind v split-window -h -c '#{pane_current_path}' 11 | bind s split-window -v -c '#{pane_current_path}' 12 | 13 | bind o select-pane -t :.+ 14 | 15 | bind h select-pane -L 16 | bind j select-pane -D 17 | bind k select-pane -U 18 | bind l select-pane -R 19 | 20 | bind -r H resize-pane -L 5 21 | bind -r J resize-pane -D 5 22 | bind -r K resize-pane -U 5 23 | bind -r L resize-pane -R 5 24 | 25 | bind -r N swap-pane -D 26 | bind -r P swap-pane -U 27 | 28 | bind x kill-pane 29 | bind X confirm-before -p 'kill window "#{window_name}"? (y/n)' kill-window 30 | bind r { 31 | source-file $XDG_CONFIG_HOME/tmux/tmux.conf 32 | refresh-client 33 | display-message 'tmux.conf is reloaded' 34 | } 35 | bind w choose-tree -Z 36 | bind '=' select-layout tiled 37 | bind y setw synchronize-panes 38 | bind i run-shell -b '~/dotfiles/bin/tmux-input' 39 | 40 | # copy mode 41 | bind C-v copy-mode 42 | setw -g mode-keys vi 43 | bind -T copy-mode-vi v send-keys -X begin-selection 44 | # Do not cancel selection 45 | unbind -T copy-mode-vi MouseDragEnd1Pane 46 | # Search incrementally 47 | bind-key -T copy-mode-vi / command-prompt -iI '#{pane_search_string}' -p '(search down)' { send-keys -X search-forward-incremental '%%%' } 48 | bind-key -T copy-mode-vi ? command-prompt -iI '#{pane_search_string}' -p '(search up)' { send-keys -X search-backward-incremental '%%%' } 49 | -------------------------------------------------------------------------------- /config/tmux/navigator.tmux: -------------------------------------------------------------------------------- 1 | # vim:ft=tmux 2 | 3 | # Smart pane switching with awareness of Vim splits. 4 | # See: https://github.com/christoomey/vim-tmux-navigator 5 | %hidden is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ 6 | | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|l?n?vim?x?)(diff)?$'" 7 | 8 | bind -n M-h if-shell "$is_vim" { send-keys M-h } { select-pane -L } 9 | bind -n M-j if-shell "$is_vim" { send-keys M-j } { select-pane -D } 10 | bind -n M-k if-shell "$is_vim" { send-keys M-k } { select-pane -U } 11 | bind -n M-l if-shell "$is_vim" { send-keys M-l } { select-pane -R } 12 | -------------------------------------------------------------------------------- /config/tmux/options.tmux: -------------------------------------------------------------------------------- 1 | # vim:ft=tmux 2 | set -g default-shell "$SHELL" 3 | 4 | set -s default-terminal 'tmux-256color' 5 | set -sa terminal-features 'xterm*:RGB' 6 | set -sa terminal-features 'xterm*:usstyle' 7 | set -s focus-events on 8 | set -s set-clipboard on 9 | if-shell -b 'command -v xsel && [ -n "$DISPLAY" ]' { 10 | set -s copy-command 'xsel -b' 11 | bind ] run-shell 'tmux set-buffer -- "$(xsel -b)"; tmux paste-buffer' 12 | } 13 | 14 | set -s escape-time 1 15 | set -g repeat-time 1000 16 | set -g display-time 2000 17 | set -g display-panes-time 2000 18 | 19 | set -g history-limit 10000 20 | setw -g monitor-activity on 21 | set -g history-limit 5000 22 | setw -g automatic-rename on 23 | setw -g automatic-rename-format '#{pane_title}' 24 | set -g renumber-windows on 25 | set -g base-index 1 26 | set -g pane-base-index 1 27 | set -g status-keys emacs 28 | set -g mouse on 29 | 30 | # hooks 31 | # set-hook -g cilent-resized 'select-layout tiled' 32 | # set-hook -g pane-exited 'select-layout tiled' 33 | # set-hook -wg pane-set-clipborad { 34 | # display-message '#[bold]Copied!#[default]' 35 | # } 36 | -------------------------------------------------------------------------------- /config/tmux/plugins.tmux: -------------------------------------------------------------------------------- 1 | # vim:ft=tmux 2 | 3 | set -g @thumbs-position off_left 4 | set -g @thumbs-contrast 1 5 | set -g @thumbs-osc52 1 6 | 7 | %hidden TMUX_THUMBS_PATH="$XDG_CACHE_HOME/tmux-thumbs" 8 | if-shell -b "[ -x $TMUX_THUMBS_PATH/tmux-thumbs.tmux ]" { 9 | run-shell -b "$TMUX_THUMBS_PATH/tmux-thumbs.tmux" 10 | } { 11 | run-shell -b "git clone --filter=blob:none https://github.com/fcsonline/tmux-thumbs $TMUX_THUMBS_PATH" 12 | } 13 | -------------------------------------------------------------------------------- /config/tmux/tmux.conf: -------------------------------------------------------------------------------- 1 | # vim:ft=tmux 2 | 3 | source-file "$XDG_CONFIG_HOME/tmux/colors.tmux" 4 | source-file "$XDG_CONFIG_HOME/tmux/keymaps.tmux" 5 | source-file "$XDG_CONFIG_HOME/tmux/navigator.tmux" 6 | source-file "$XDG_CONFIG_HOME/tmux/options.tmux" 7 | source-file "$XDG_CONFIG_HOME/tmux/plugins.tmux" 8 | -------------------------------------------------------------------------------- /config/vimrc: -------------------------------------------------------------------------------- 1 | " for vim-tiny and vim-small 2 | if !1 | finish | endif 3 | if &compatible 4 | set nocompatible 5 | endif 6 | execute 'source' $XDG_CONFIG_HOME .. '/nvim/init.vim' 7 | -------------------------------------------------------------------------------- /config/wezterm/wezterm.lua: -------------------------------------------------------------------------------- 1 | local wezterm = require "wezterm" 2 | local is_mac = wezterm.target_triple:find "apple%-darwin" ~= nil 3 | 4 | wezterm.on( 5 | "format-window-title", 6 | function(tab, pane) 7 | return ("[%d] %s | WezTerm"):format(tab.tab_index, pane.title) 8 | end 9 | ) 10 | 11 | local OpenLinkSelectedOrAtMouseCursor = wezterm.action_callback( 12 | function(window, pane) 13 | local url = window:get_selection_text_for_pane(pane) 14 | if url == "" then 15 | return window:perform_action(wezterm.action.OpenLinkAtMouseCursor, pane) 16 | elseif not url:find "^https?://" then 17 | url = "https://" .. url 18 | end 19 | wezterm.open_with(url) 20 | end 21 | ) 22 | 23 | return { 24 | adjust_window_size_when_changing_font_size = false, 25 | colors = { 26 | cursor_bg = "rgba(88%, 88%, 88%, 0.5)", 27 | cursor_border = "rgba(88%, 88%, 88%, 0.5)", 28 | }, 29 | cursor_thickness = "1pt", 30 | enable_scroll_bar = true, 31 | font_size = 12, 32 | font = wezterm.font_with_fallback { 33 | "CommitMono", 34 | "HackGen35 Console NF", 35 | table.unpack( 36 | is_mac and { "Apple Color Emoji" } 37 | or { "Noto Sans Mono CJK JP", "Noto Color Emoji" } 38 | ), 39 | }, 40 | front_end = "WebGpu", 41 | hide_tab_bar_if_only_one_tab = true, 42 | keys = { 43 | { 44 | key = "¥", 45 | mods = "CTRL", 46 | action = wezterm.action.SendKey { key = "\\", mods = "CTRL" }, 47 | }, 48 | }, 49 | mouse_bindings = { 50 | { 51 | event = { Up = { streak = 1, button = "Left" } }, 52 | mods = "CTRL", 53 | action = OpenLinkSelectedOrAtMouseCursor, 54 | }, 55 | }, 56 | use_ime = false, 57 | window_frame = { 58 | font = wezterm.font { 59 | family = "CommitMono", 60 | scale = 0.8, 61 | }, 62 | }, 63 | } 64 | -------------------------------------------------------------------------------- /config/xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # shellcheck source=/dev/null 3 | 4 | has() { command -v "$1" > /dev/null; } 5 | 6 | export XAUTHORITY="$XDG_RUNTIME_DIR/Xauthority" 7 | 8 | # Run ssh-agent 9 | if [ -z "$SSH_AUTH_SOCK" ] && has ssh-agent; then 10 | exec ssh-agent "$0" "$@" || exit 11 | fi 12 | 13 | # Prepare D-Bus 14 | if [ -n "$DBUS_SESSION_BUS_ADDRESS" ]; then 15 | dbus-update-activation-environment --systemd DISPLAY XAUTHORITY 16 | elif has dbus-run-session; then 17 | exec dbus-run-session "$0" "$@" || exit 18 | elif has dbus-launch; then 19 | exec dbus-launch --exit-with-session "$0" "$@" || exit 20 | fi 21 | 22 | # define variables for GUI 23 | # IME settings 24 | export GTK_IM_MODULE=fcitx5 25 | export QT_IM_MODULE=fcitx5 26 | export XMODIFIERS=@im=fcitx5 27 | has chromium-browser && export BROWSER=chromium-browser-wrapper 28 | # has wezterm && export TERMINAL=wezterm 29 | [ -n "$LOADED_ZSHRC" ] && unset LOADED_ZSHRC 30 | 31 | fcitx5 & 32 | # xremap "$XDG_CONFIG_HOME"/xremap/config.yml & 33 | xkbcomp -I"$XDG_CONFIG_HOME"/X11/xkb "$XDG_CONFIG_HOME"/X11/xkb/keymap/mine "$DISPLAY" 34 | 35 | # load system configuration 36 | if [ -d /etc/X11/xinit/xinitrc.d ]; then 37 | for f in /etc/X11/xinit/xinitrc.d/?*.sh; do 38 | [ -f "$f" ] && . "$f" 39 | done 40 | unset f 41 | fi 42 | [ -f /etc/xprofile ] && . /etc/xprofile 43 | [ -f ~/.xprofile ] && . ~/.xprofile 44 | 45 | # start desktop 46 | exec i3 47 | -------------------------------------------------------------------------------- /config/xremap/config.yml: -------------------------------------------------------------------------------- 1 | keymap: 2 | - name: Emacs like bindings 3 | application: 4 | not: 5 | - Gnome-terminal 6 | - org.wezfurlong.wezterm 7 | remap: 8 | Ctrl-b: { with_mark: Left } 9 | Ctrl-f: { with_mark: Right } 10 | Ctrl-p: { with_mark: Up } 11 | Ctrl-n: { with_mark: Down } 12 | Ctrl-a: { with_mark: Home } 13 | Ctrl-e: { with_mark: End } 14 | Ctrl-k: [Shift-End, Backspace, { set_mark: false }] 15 | Ctrl-h: [Backspace, { set_mark: false }] 16 | Ctrl-d: [Delete, { set_mark: false }] 17 | - name: Chromium 18 | application: 19 | only: Chromium 20 | remap: 21 | # Copy/Paste as same as gnome-terminal 22 | Ctrl-Shift-c: Ctrl-c 23 | Ctrl-Shift-v: Ctrl-v 24 | # Select All 25 | Alt-a: Ctrl-a 26 | # History 27 | Alt-h: Ctrl-h 28 | -------------------------------------------------------------------------------- /config/yabai/yabairc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | yabai -m signal --add event=dock_did_restart action='sudo yabai --load-sa' 4 | sudo yabai --load-sa 5 | 6 | # bsp or float (default: float) 7 | yabai -m config layout bsp 8 | yabai -m config auto_balance on 9 | 10 | # Set all padding and gaps to 12pt (default: 0) 11 | yabai -m config top_padding 12 12 | yabai -m config bottom_padding 12 13 | yabai -m config left_padding 12 14 | yabai -m config right_padding 12 15 | yabai -m config window_gap 12 16 | 17 | # float system preferences and system infomation 18 | yabai -m rule --add app='^(System Preferences|システム設定)$' manage=off 19 | yabai -m rule --add app='^(System Information|システム情報)$' manage=off 20 | 21 | yabai -m rule --add app='^LINE$' manage=off 22 | -------------------------------------------------------------------------------- /config/zsh/.zshenv: -------------------------------------------------------------------------------- 1 | # zmodload zsh/zprof && zprof 2 | export XDG_CONFIG_HOME="$HOME/.config" 3 | export XDG_CACHE_HOME="$HOME/.cache" 4 | export XDG_DATA_HOME="$HOME/.local/share" 5 | export XDG_STATE_HOME="$HOME/.local/state" 6 | [[ $(uname) == 'Linux' ]] && export XDG_RUNTIME_DIR="/run/user/$UID" 7 | 8 | ## zsh ## 9 | export ZDOTDIR="$XDG_CONFIG_HOME/zsh" 10 | 11 | ## docker ## 12 | export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker" 13 | export DOCKER_HOST="unix://$XDG_RUNTIME_DIR/docker.sock" 14 | 15 | ## go ## 16 | export GOPATH="$XDG_DATA_HOME/go" 17 | 18 | ## deno ## 19 | export DENO_INSTALL="$XDG_CACHE_HOME/deno" 20 | export DENO_INSTALL_ROOT="$DENO_INSTALL" 21 | 22 | ## rust ## 23 | export CARGO_HOME="$XDG_DATA_HOME/cargo" 24 | export RUSTUP_HOME="$XDG_DATA_HOME/rustup" 25 | export CARGO_NET_GIT_FETCH_WITH_CLI=true 26 | 27 | ## aqua ## 28 | export AQUA_GLOBAL_CONFIG="$XDG_CONFIG_HOME/aqua/aqua.yaml" 29 | export AQUA_ROOT_DIR="$XDG_DATA_HOME/aquaproj-aqua" 30 | # export AQUA_POLICY_CONFIG="$XDG_CONFIG_HOME/aqua/aqua-policy.yaml" 31 | export AQUA_DISABLE_POLICY=true 32 | 33 | ## afx ## 34 | export AFX_COMMAND_PATH="$HOME/.local/share/afx/bin" 35 | 36 | ## python ## 37 | export PIPX_HOME="$XDG_DATA_HOME/pipx" 38 | export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/startup.py" 39 | 40 | ## ripgrep ## 41 | export RIPGREP_CONFIG_PATH="$XDG_CONFIG_HOME/ripgrep/config" 42 | 43 | ## wget ## 44 | # export WGETRC="$XDG_CONFIG_HOME/wgetrc" 45 | 46 | ## npm ## 47 | export NPM_CACHE_DIR="$XDG_CACHE_HOME/npm" 48 | export NPM_CONFIG_DIR="$XDG_CONFIG_HOME/npm" 49 | export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/npm/npmrc" 50 | export NPM_DATA_DIR="$XDG_DATA_HOME/npm" 51 | 52 | ## less ## 53 | export LESS='--hilite-search --ignore-case --LONG-PROMPT --RAW-CONTROL-CHARS --HILITE-UNREAD --window=4 --tabs=4 --mouse' 54 | export LESSCHARSET='UTF-8' 55 | 56 | typeset -Ux path fpath manpath cdpath 57 | path=( 58 | $CARGO_HOME/bin(N-/) 59 | $GOPATH/bin(N-/) 60 | $DENO_INSTALL/bin(N-/) 61 | $HOME/.local/bin(N-/) 62 | $AQUA_ROOT_DIR/bin(N-/) 63 | $AFX_COMMAND_PATH(N-/) 64 | /opt/homebrew/bin(N-/) 65 | /opt/homebrew/sbin(N-/) 66 | $path[@] 67 | ) 68 | path=(${(R)path%/}) 69 | fpath=( 70 | $ZDOTDIR/completions(N-/) 71 | $fpath[@] 72 | ) 73 | fpath=(${(R)fpath%/}) 74 | 75 | export EDITOR="${(Q@s: :)EDITOR:-$(command -v nvim > /dev/null && echo nvim || echo vim)}" 76 | export PAGER='less' 77 | export MANPAGER='less +Gg' 78 | 79 | export LANG='ja_JP.UTF-8' 80 | export LC_TIME='en_US.UTF-8' 81 | export TZ='Asia/Tokyo' 82 | -------------------------------------------------------------------------------- /config/zsh/.zshrc: -------------------------------------------------------------------------------- 1 | bindkey -e 2 | autoload -Uz add-zsh-hook 3 | 4 | if [[ -f ~/.minimum_dotfiles ]]; then 5 | export MINIMUM_DOTFILES=true 6 | fi 7 | 8 | HISTFILE="$XDG_DATA_HOME/zsh/history" 9 | HISTSIZE=10000 10 | SAVEHIST=10000 11 | WORDCHARS='*?_-.[]~=&;!#$%^(){}<>' 12 | 13 | () { 14 | for rc in $ZDOTDIR/*.zsh; do 15 | source "$rc" 16 | done 17 | } 18 | 19 | () { 20 | autoload -Uz compinit 21 | : ${ZSH_COMPDUMP:=$XDG_CACHE_HOME/zsh/compdump-$(hostname)-$ZSH_VERSION} 22 | local dump=$ZSH_COMPDUMP 23 | local dumpc=${dump}.zwc 24 | # re-check dump file that are older than 24 hours 25 | if [[ -n $dump(#qN.mh+24) ]]; then 26 | compinit -i -d "$dump" 27 | { rm -rf "$dumpc" && zcompile "$dump" } &! 28 | else 29 | mkdir -p "$(dirname "$dump")" 30 | compinit -C -d "$dump" 31 | { [[ ! -s $dumpc || $dump -nt $dumpc ]] && rm -rf "$dumpc" && zcompile "$dump" } &! 32 | fi 33 | for f in $(find $ZDOTDIR/ -type f -name '*.zsh') $ZDOTDIR/.zshrc $HOME/.zshenv; do 34 | if [[ ! -f "$f.zwc" ]] || [[ "$f" -nt "$f.zwc" ]]; then 35 | { zcompile "$f" } &! 36 | fi 37 | done 38 | } 39 | 40 | if [[ -n "$TMUX" ]]; then 41 | hook::venv 42 | hook-set-title 43 | export GPG_TTY=$(tty) 44 | fi 45 | [[ -f '~/.ssh/id_git_ed25519' ]] && enable-agent-forward '~/.ssh/id_git_ed25519' 46 | [[ -z "$MINIMUM_DOTFILES" ]] && agent-symlink 47 | [[ ! -f "$HISTFILE" ]] && { mkdir -p "$(dirname "$HISTFILE")" && touch "$HISTFILE"; } 48 | [[ ! -d "$XDG_RUNTIME_DIR" ]] && { mkdir -p "$XDG_RUNTIME_DIR" 2> /dev/null && chmod 0700 "$XDG_RUNTIME_DIR"; } 49 | 50 | type dircolors > /dev/null && source <(dircolors -b "$ZDOTDIR/dircolors") 51 | type afx > /dev/null && source <(afx init) 52 | type zoxide > /dev/null && source <(zoxide init zsh) 53 | 54 | export FZF_DEFAULT_OPTS="--height=40% --layout=reverse --marker='*'" 55 | if type fd > /dev/null; then 56 | export FZF_DEFAULT_COMMAND="fd --type f --follow --hidden --exclude '.git'" 57 | export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" 58 | export FZF_ALT_C_COMMAND="fd --type d --follow --hidden --exclude '.git'" 59 | fi 60 | 61 | if type zprof > /dev/null; then 62 | zprof | less 63 | elif [[ "$TERM" = 'linux' ]]; then 64 | echo -n 'You are using virtual console directly. Start X server? [y/N] ' 65 | read -q && xinit 66 | elif type tmux > /dev/null && [[ $SHLVL -eq 1 ]] && [[ -z "$MINIMUM_DOTFILES" ]] && [[ -z "$LOADED_ZSHRC" ]]; then 67 | widget::tmux::session 68 | fi 69 | export LOADED_ZSHRC=true 70 | -------------------------------------------------------------------------------- /config/zsh/aliases.zsh: -------------------------------------------------------------------------------- 1 | alias ...='cd ../..' 2 | alias ....='cd ../../..' 3 | alias .....='cd ../../../..' 4 | alias -- -='cd -' 5 | 6 | alias dot='cd ~/dotfiles' 7 | 8 | if command -v eza > /dev/null; then 9 | alias ls='eza -a' 10 | alias ll='eza -al' 11 | alias eza='eza -a' 12 | alias tree='eza --tree --group-directories-first --git-ignore --ignore-glob .git' 13 | else 14 | alias ls='ls -a --color=auto' 15 | alias ll='ls -l' 16 | alias tree="tree -I '\.git|venv|node_modules|__pycache__'" 17 | fi 18 | if command -v rg > /dev/null; then 19 | alias grep='rg' 20 | else 21 | alias grep='grep --color=auto' 22 | alias rg='grep --color=auto' 23 | fi 24 | 25 | alias a='aqua' 26 | alias d='docker' 27 | alias g='git' 28 | alias sys='systemctl --user' 29 | alias brwe='brew' 30 | alias carog='cargo' # for typo 31 | alias globalip='curl -q globalip.me' 32 | alias reload='exec $SHELL -l && rehash' 33 | alias cp='cp -i' 34 | alias rm='rm -i' 35 | alias mkdir='mkdir -p' 36 | alias q=' exit' 37 | -------------------------------------------------------------------------------- /config/zsh/completion.zsh: -------------------------------------------------------------------------------- 1 | # from https://github.com/yutkat/dotfiles/blob/0ea6fa3a54/.config/zsh/rc/completion.zsh 2 | 3 | #==============================================================# 4 | ## Completion ## 5 | #==============================================================# 6 | 7 | setopt prompt_subst # プロンプトに escape sequence (環境変数) を通す 8 | 9 | # see http://zsh.sourceforge.net/Doc/Release/Completion-System.html 10 | 11 | # :completion:function:completer:command:argument:tag 12 | 13 | # オプション補完で解説部分を表示 14 | zstyle ':completion:*' verbose yes 15 | # 補完方法の設定。指定した順番に実行する。 16 | ## _oldlist 前回の補完結果を再利用する。 17 | ## _complete: 普通の補完関数 18 | ## _ignored: 補完候補にださないと指定したものも補完候補とする。 19 | ## _match: *などのグロブによってコマンドを補完できる 20 | ## _prefix: カーソル以降を無視してカーソル位置までで補完する。 21 | ## _approximate: 似ている補完候補も補完候補とする。 22 | ## _expand: グロブや変数の展開を行う。もともとあった展開と比べて、細かい制御が可能 23 | ## _history: 履歴から補完を行う。_history_complete_wordから使われる 24 | ## _correct: ミススペルを訂正した上で補完を行う。 25 | zstyle ':completion:*' completer _oldlist _complete _ignored 26 | zstyle ':completion:*:messages' format '%F{yellow}%d' 27 | zstyle ':completion:*:warnings' format '%B%F{red}No matches for:''%F{white}%d%b' 28 | zstyle ':completion:*:descriptions' format '%B%F{white}--- %d ---%f%b' 29 | zstyle ':completion:*:corrections' format ' %F{green}%d (errors: %e) %f' 30 | zstyle ':completion:*:options' description 'yes' 31 | zstyle ':completion:*' group-name '' 32 | zstyle ':completion:*' keep-prefix 33 | zstyle ':completion:*' recent-dirs-insert both 34 | # 補完候補を色分け (GNU ls の色定義を流用) 35 | zstyle ':completion:*' list-colors "${LS_COLORS}" 36 | zstyle ':completion:*' special-dirs true 37 | # 補完の時に大文字小文字を区別しない (但し、大文字を打った場合は小文字に変換しない) 38 | #zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 39 | zstyle ':completion:*' matcher-list '' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' '+l:|=* r:|=*' 40 | # 一部のコマンドライン定義は、展開時に時間のかかる処理を行う -- apt-get, dpkg (Debian), rpm (Redhat), urpmi (Mandrake), perlの-Mオプション, bogofilter (zsh 4.2.1以降), fink, mac_apps (MacOS X)(zsh 4.2.2以降) 41 | zstyle ':completion:*' use-cache true 42 | # 補完候補を ←↓↑→ で選択 (補完候補が色分け表示される) 43 | # zstyle show completion menu if 1 or more items to select 44 | zstyle ':completion:*:default' menu select=1 45 | # カレントディレクトリに候補がない場合のみ cdpath 上のディレクトリを候補 46 | zstyle ':completion:*:cd:*' tag-order local-directories path-directories 47 | # 補完リストの順番指定 48 | zstyle ':completion:*:cd:*' group-order local-directories path-directories 49 | # psコマンドを補完する 50 | zstyle ':completion:*:processes' command 'ps x -o pid,s,args' 51 | # sudoコマンドを補完する 52 | zstyle ':completion:*:sudo:*' command-path /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin 53 | # 変数の添字を補完する 54 | zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters 55 | # manの補完をセクション番号別に表示させる 56 | zstyle ':completion:*:manuals' separate-sections true 57 | # 更新日順に表示する 58 | zstyle ':completion:*' file-sort 'modification' 59 | 60 | # make completion is slow 61 | zstyle ':completion:*:make:*:targets' call-command true 62 | zstyle ':completion:*:make::' tag-order targets: 63 | zstyle ':completion:*:*:*make:*:targets' command awk \''/^[a-zA-Z0-9][^\/\t=]+:/ {print $1}'\' \$file 64 | #zstyle ':completion:*:*:make:*:targets' ignored-patterns '*.o' 65 | #zstyle ':completion:*:*:*make:*:*' tag-order '!targets !functions !file-patterns' 66 | #zstyle ':completion:*:*:*make:*:*' avoid-completer '_files' 67 | -------------------------------------------------------------------------------- /config/zsh/completions/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/4513ECHO/dotfiles/5bac78e148b7dcbf0ba6b61696d398054c4f13e6/config/zsh/completions/.gitkeep -------------------------------------------------------------------------------- /config/zsh/dircolors: -------------------------------------------------------------------------------- 1 | # vim:ft=dircolors 2 | # Configuration file for dircolors, a utility to help you set the 3 | # LS_COLORS environment variable used by GNU ls with the --color option. 4 | # Copyright (C) 1996-2020 Free Software Foundation, Inc. 5 | # Copying and distribution of this file, with or without modification, 6 | # are permitted provided the copyright notice and this notice are preserved. 7 | # The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the 8 | # slackware version of dircolors) are recognized but ignored. 9 | # Below are TERM entries, which can be a glob patterns, to match 10 | # against the TERM environment variable to determine if it is colorizable. 11 | TERM Eterm 12 | TERM ansi 13 | TERM *color* 14 | TERM con[0-9]*x[0-9]* 15 | TERM cons25 16 | TERM console 17 | TERM cygwin 18 | TERM dtterm 19 | TERM gnome 20 | TERM hurd 21 | TERM jfbterm 22 | TERM konsole 23 | TERM kterm 24 | TERM linux 25 | TERM linux-c 26 | TERM mlterm 27 | TERM putty 28 | TERM rxvt* 29 | TERM screen* 30 | TERM st 31 | TERM terminator 32 | TERM tmux* 33 | TERM vt100 34 | TERM xterm* 35 | # Below are the color init strings for the basic file types. 36 | # One can use codes for 256 or more colors supported by modern terminals. 37 | # The default color codes use the capabilities of an 8 color terminal 38 | # with some additional attributes as per the following codes: 39 | # Attribute codes: 40 | # 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed 41 | # Text color codes: 42 | # 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white 43 | # Background color codes: 44 | # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white 45 | NORMAL 00 # no color code at all 46 | FILE 00 # regular file: use no color at all 47 | RESET 0 # reset to "normal" color 48 | # DIR 01;34 # directory 49 | DIR 01;38;5;75 # directory 50 | LINK 01;36 # symbolic link. (If you set this to 'target' instead of a 51 | # numerical value, the color is as for the file pointed to.) 52 | MULTIHARDLINK 00 # regular file with more than one link 53 | FIFO 40;33 # pipe 54 | SOCK 01;35 # socket 55 | DOOR 01;35 # door 56 | BLK 40;33;01 # block device driver 57 | CHR 40;33;01 # character device driver 58 | ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file ... 59 | MISSING 00 # ... and the files they point to 60 | SETUID 37;41 # file that is setuid (u+s) 61 | SETGID 30;43 # file that is setgid (g+s) 62 | CAPABILITY 30;41 # file with capability 63 | STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w) 64 | OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky 65 | STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable 66 | # This is for files with execute permission: 67 | # EXEC 01;32 68 | EXEC 01;38;5;82 69 | # List any file extensions like '.gz' or '.tar' that you would like ls 70 | # to colorize below. Put the extension, a space, and the color init string. 71 | # (and any comments you want to add after a '#') 72 | # If you use DOS-style suffixes, you may want to uncomment the following: 73 | #.cmd 01;32 # executables (bright green) 74 | #.exe 01;32 75 | #.com 01;32 76 | #.btm 01;32 77 | #.bat 01;32 78 | # Or if you want to colorize scripts even if they do not have the 79 | # executable bit actually set. 80 | #.sh 01;32 81 | #.csh 01;32 82 | # archives or compressed (bright red) 83 | .tar 01;31 84 | .tgz 01;31 85 | .arc 01;31 86 | .arj 01;31 87 | .taz 01;31 88 | .lha 01;31 89 | .lz4 01;31 90 | .lzh 01;31 91 | .lzma 01;31 92 | .tlz 01;31 93 | .txz 01;31 94 | .tzo 01;31 95 | .t7z 01;31 96 | .zip 01;31 97 | .z 01;31 98 | .dz 01;31 99 | .gz 01;31 100 | .lrz 01;31 101 | .lz 01;31 102 | .lzo 01;31 103 | .xz 01;31 104 | .zst 01;31 105 | .tzst 01;31 106 | .bz2 01;31 107 | .bz 01;31 108 | .tbz 01;31 109 | .tbz2 01;31 110 | .tz 01;31 111 | .deb 01;31 112 | .rpm 01;31 113 | .jar 01;31 114 | .war 01;31 115 | .ear 01;31 116 | .sar 01;31 117 | .rar 01;31 118 | .alz 01;31 119 | .ace 01;31 120 | .zoo 01;31 121 | .cpio 01;31 122 | .7z 01;31 123 | .rz 01;31 124 | .cab 01;31 125 | .wim 01;31 126 | .swm 01;31 127 | .dwm 01;31 128 | .esd 01;31 129 | # image formats 130 | .jpg 01;35 131 | .jpeg 01;35 132 | .mjpg 01;35 133 | .mjpeg 01;35 134 | .gif 01;35 135 | .bmp 01;35 136 | .pbm 01;35 137 | .pgm 01;35 138 | .ppm 01;35 139 | .tga 01;35 140 | .xbm 01;35 141 | .xpm 01;35 142 | .tif 01;35 143 | .tiff 01;35 144 | .png 01;35 145 | .svg 01;35 146 | .svgz 01;35 147 | .mng 01;35 148 | .pcx 01;35 149 | .mov 01;35 150 | .mpg 01;35 151 | .mpeg 01;35 152 | .m2v 01;35 153 | .mkv 01;35 154 | .webm 01;35 155 | .webp 01;35 156 | .ogm 01;35 157 | .mp4 01;35 158 | .m4v 01;35 159 | .mp4v 01;35 160 | .vob 01;35 161 | .qt 01;35 162 | .nuv 01;35 163 | .wmv 01;35 164 | .asf 01;35 165 | .rm 01;35 166 | .rmvb 01;35 167 | .flc 01;35 168 | .avi 01;35 169 | .fli 01;35 170 | .flv 01;35 171 | .gl 01;35 172 | .dl 01;35 173 | .xcf 01;35 174 | .xwd 01;35 175 | .yuv 01;35 176 | .cgm 01;35 177 | .emf 01;35 178 | # https://wiki.xiph.org/MIME_Types_and_File_Extensions 179 | .ogv 01;35 180 | .ogx 01;35 181 | # audio formats 182 | .aac 00;36 183 | .au 00;36 184 | .flac 00;36 185 | .m4a 00;36 186 | .mid 00;36 187 | .midi 00;36 188 | .mka 00;36 189 | .mp3 00;36 190 | .mpc 00;36 191 | .ogg 00;36 192 | .ra 00;36 193 | .wav 00;36 194 | # https://wiki.xiph.org/MIME_Types_and_File_Extensions 195 | .oga 00;36 196 | .opus 00;36 197 | .spx 00;36 198 | .xspf 00;36 199 | -------------------------------------------------------------------------------- /config/zsh/plugins.zsh: -------------------------------------------------------------------------------- 1 | [[ -n "$MINIMUM_DOTFILES" ]] && return 2 | 3 | exists() { 4 | if (( $+commands[$@] )); then 5 | return 0 6 | else 7 | return 1 8 | fi 9 | } 10 | 11 | if [[ ! -f "$XDG_CACHE_HOME/zpm/zpm.zsh" ]]; then 12 | git clone --recursive --filter=blob:none 'https://github.com/zpm-zsh/zpm' \ 13 | "$XDG_CACHE_HOME/zpm" 14 | fi 15 | source "$XDG_CACHE_HOME/zpm/zpm.zsh" 16 | 17 | zpm load zsh-users/zsh-autosuggestions,source:/zsh-autosuggestions.zsh,async 18 | zpm load zdharma-continuum/fast-syntax-highlighting,async 19 | zpm load zsh-users/zsh-completions,apply:fpath,fpath:/src,async 20 | # zpm load 4513ECHO/zsh-sticky-shift,async; STICKY_TABLE='jis' 21 | # zpm load junegunn/fzf,source:/shell/key-bindings.zsh,source:/shell/completion.zsh,async 22 | # zpm load junegunn/fzf,source:/shell/completion.zsh,async 23 | zpm load junegunn/fzf,source:/shell/key-bindings.zsh,async 24 | # zpm load junegunn/fzf,source:/shell/*.zsh,async 25 | # zpm load iwata/git-now,apply:path,hook:"make prefix=./ install" 26 | exists deno && zpm load @exec/deno,destination:completion,origin:'deno completions zsh' 27 | exists rustup && zpm load @exec/rustup,destination:completion,origin:'rustup completions zsh' 28 | exists cargo && zpm load @exec/cargo,destination:completion,origin:'rustup completions zsh cargo' 29 | exists npm && zpm load @exec/npm,destination:completion,origin:'npm completion' 30 | exists gh && zpm load @exec/gh,destination:completion,origin:'gh completion -s zsh' 31 | exists pip && zpm load @exec/pip,origin:'pip completion --zsh' 32 | exists poetry && zpm load @exec/poetry,destination:completion,origin:'poetry completions zsh' 33 | exists sbx && zpm load @exec/sbx,destination:completion,origin:'sbx completion zsh' 34 | exists hgrep && zpm load @exec/hgrep,destination:completion,origin:'hgrep --generate-completion-script zsh' 35 | exists afx && zpm load @exec/afx,destination:completion,origin:'afx completion zsh' 36 | exists yq && zpm load @exec/yq,destination:completion,origin:'yq shell-completion zsh' 37 | exists aqua && zpm load @exec/aqua,origin:'aqua completion zsh' 38 | exists aqua-registry && zpm load @exec/aqua-registry,origin:'aqua-registry completion zsh' 39 | zpm load @exec/git,destination:completion,origin:'curl -qfsSL https://pax.deno.dev/git/git/contrib/completion/git-completion.zsh' 40 | zpm load @exec/fd,destination:completion,origin:'curl -qfsSL https://pax.deno.dev/sharkdp/fd/contrib/completion/_fd' 41 | zpm load @exec/rg,destination:completion,origin:'curl -qfsSL https://pax.deno.dev/BurntSushi/ripgrep/complete/_rg' 42 | zpm load @exec/exa,destination:completion,origin:'curl -qfsSL https://pax.deno.dev/ogham/exa/completions/zsh/_exa' 43 | zpm load @exec/ghq,destination:completion,origin:'curl -qfsSL https://pax.deno.dev/x-motemen/ghq/misc/zsh/_ghq' 44 | zpm load @exec/gojq,destination:completion,origin:'curl -qfsSL https://pax.deno.dev/itchyny/gojq/_gojq' 45 | zpm load @exec/bat,destination:completion,origin:'curl -qfsSL https://pax.deno.dev/sharkdp/bat/assets/completions/bat.zsh.in | sed -e "s/{{PROJECT_EXECUTABLE}}/bat/g"' 46 | zpm load @exec/docker,destination:completion,origin:'curl -qfsSL https://pax.deno.dev/docker/cli/contrib/completion/zsh/_docker' 47 | -------------------------------------------------------------------------------- /config/zsh/prompt.zsh: -------------------------------------------------------------------------------- 1 | autoload -Uz vcs_info 2 | 3 | export VIRTUAL_ENV_DISABLE_PROMPT=1 4 | function venv-prompt () { 5 | if [ -n "$VIRTUAL_ENV" ]; then 6 | echo "($(basename "$VIRTUAL_ENV"))" 7 | else 8 | echo '' 9 | fi 10 | } 11 | 12 | typeset -gA prompt_colors 13 | prompt_colors[red]=001 14 | prompt_colors[green]=002 15 | prompt_colors[yellow]=003 16 | prompt_colors[cyan]=006 17 | 18 | # use vcs_info 19 | zstyle ':vcs_info:git:*' check-for-changes true 20 | zstyle ':vcs_info:git:*' unstagedstr "%F{${prompt_colors[cyan]}}!" 21 | zstyle ':vcs_info:git:*' stagedstr "%F{${prompt_colors[red]}}+" 22 | zstyle ':vcs_info:git+set-message:*' hooks \ 23 | git-hook-begin \ 24 | git-untracked \ 25 | git-unpushed 26 | zstyle ':vcs_info:*' formats "%F{${prompt_colors[green]}}%u%c(%b)%m%f" 27 | zstyle ':vcs_info:*' actionformats '%c%y<%a>(%b)%m%f' 28 | 29 | # extra vcs_info hooks 30 | function +vi-git-hook-begin () { 31 | if [[ "$(command git rev-parse --is-inside-work-tree 2> /dev/null)" \ 32 | != "true" ]]; then 33 | return 1 34 | fi 35 | return 0 36 | } 37 | 38 | function +vi-git-untracked () { 39 | if command git status --porcelain 2> /dev/null | command grep -q '^??'; then 40 | hook_com[staged]="%F{${prompt_colors[yellow]}}?${hook_com[staged]}" 41 | fi 42 | } 43 | 44 | function +vi-git-unpushed () { 45 | local branch remote 46 | branch="$(command git symbolic-ref --short HEAD 2> /dev/null)" 47 | remote="$(command git config branch.$branch.remote 2> /dev/null)" 48 | if [[ -n "$remote" ]]; then 49 | if [[ -n "$(command git log $remote/$branch.. --)" ]]; then 50 | hook_com[misc]+="%F{${prompt_colors[red]}}[up]" 51 | else 52 | hook_com[misc]+="%F{${prompt_colors[green]}}[up]" 53 | fi 54 | fi 55 | } 56 | 57 | # add hook redrawing prompt 58 | function redraw-prompt () { 59 | PROMPT="$(venv-prompt)%F{${prompt_colors[green]}}%n%B@%b%U%m%u%f%B:%b%F{${prompt_colors[cyan]}}%~%f 60 | %B%#❯%b " 61 | RPROMPT="${vcs_info_msg_0_}" 62 | } 63 | 64 | function redraw-prompt-with-vcs_info () { 65 | vcs_info 66 | redraw-prompt 67 | } 68 | 69 | if vcs_info 2> /dev/null; then 70 | add-zsh-hook precmd redraw-prompt-with-vcs_info 71 | else 72 | add-zsh-hook precmd redraw-prompt 73 | fi 74 | -------------------------------------------------------------------------------- /manifest.tsv: -------------------------------------------------------------------------------- 1 | afx/afx.yaml $XDG_CONFIG_HOME/afx/afx.yaml 2 | applications $XDG_DATA_HOME 3 | aqua $XDG_CONFIG_HOME 4 | bat $XDG_CONFIG_HOME 5 | btop $XDG_CONFIG_HOME 6 | ciw $XDG_CONFIG_HOME 7 | curlrc $HOME/.curlrc 8 | dunst $XDG_CONFIG_HOME 9 | efm-langserver $XDG_CONFIG_HOME 10 | fcitx5 $XDG_CONFIG_HOME 11 | fcitx5/dictionary_list $XDG_DATA_HOME/fcitx5/skk/dictionary_list 12 | fontconfig $XDG_CONFIG_HOME 13 | gh $XDG_CONFIG_HOME 14 | git $XDG_CONFIG_HOME 15 | gtk-3.0 $XDG_CONFIG_HOME 16 | i3 $XDG_CONFIG_HOME 17 | jq $HOME/.jq 18 | libskk $XDG_CONFIG_HOME 19 | nvim $XDG_CONFIG_HOME 20 | pip $XDG_CONFIG_HOME 21 | profile $HOME/.profile 22 | python $XDG_CONFIG_HOME 23 | ripgrep $XDG_CONFIG_HOME 24 | rofi $XDG_CONFIG_HOME 25 | skhd $XDG_CONFIG_HOME 26 | stylua $XDG_CONFIG_HOME 27 | systemd $XDG_CONFIG_HOME 28 | tmux $XDG_CONFIG_HOME 29 | vimrc $HOME/.vimrc 30 | wezterm $XDG_CONFIG_HOME 31 | X11 $XDG_CONFIG_HOME 32 | xinitrc $HOME/.xinitrc 33 | xremap $XDG_CONFIG_HOME 34 | yabai $XDG_CONFIG_HOME 35 | zsh $XDG_CONFIG_HOME 36 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "automerge": true, 3 | "branchConcurrentLimit": 0, 4 | "dependencyDashboard": true, 5 | "extends": [ 6 | "config:base", 7 | "github>aquaproj/aqua-renovate-config#2.8.1", 8 | "github>aquaproj/aqua-renovate-config:file#2.8.1(config/aqua/aqua\\.yaml)", 9 | "github>aquaproj/aqua-renovate-config:installer-script#2.8.1(Makefile)" 10 | ], 11 | "labels": [ 12 | "dependencies" 13 | ], 14 | "platformAutomerge": true, 15 | "prConcurrentLimit": 0, 16 | "prHourlyLimit": 0, 17 | "customManagers": [ 18 | { 19 | "customType": "regex", 20 | "datasourceTemplate": "github-releases", 21 | "depNameTemplate": "actions/go-versions", 22 | "fileMatch": [ 23 | "\\.github/workflows/aqua\\.yaml" 24 | ], 25 | "matchStrings": [ 26 | "go-version: \"(?.*?)\"" 27 | ] 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /scripts/Brewfile: -------------------------------------------------------------------------------- 1 | tap "homebrew/bundle" 2 | tap "homebrew/cask-fonts" 3 | tap "homebrew/services" 4 | tap "ikanago/tap" 5 | tap "koekeishiya/formulae" 6 | tap "yammerjp/tap" 7 | brew "bash" 8 | brew "coreutils" 9 | brew "gawk" 10 | brew "gnu-sed" 11 | brew "gnupg" 12 | brew "lpeg" 13 | brew "neovim", args: ["HEAD"] 14 | brew "neovide" 15 | brew "pinentry-mac" 16 | brew "python@3.11" 17 | brew "python-tk@3.11" 18 | brew "qrencode" 19 | brew "skktools" 20 | brew "tailscale", restart_service: true 21 | brew "vim", args: ["HEAD"] 22 | brew "ikanago/tap/omekasy" 23 | brew "koekeishiya/formulae/skhd" 24 | brew "koekeishiya/formulae/yabai" 25 | brew "yammerjp/tap/pdef" 26 | cask "alacritty" 27 | cask "aquaskk" 28 | cask "bitwarden" 29 | cask "discord" 30 | cask "fedistar" 31 | cask "font-hackgen-nerd" 32 | cask "iterm2" 33 | cask "kap" 34 | cask "keycastr" 35 | -------------------------------------------------------------------------------- /scripts/gen_stat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ue 3 | 4 | abort() { 5 | echo "error: $*" >&2 6 | exit 1 7 | } 8 | 9 | src="${1:-README.md}" 10 | 11 | insert_command() { 12 | ts="" 13 | te="" 14 | shift 15 | ext=".orig" 16 | tmp="$(mktemp)" 17 | if ! grep -Fxq "$ts" "$src" && grep -Fxq "$te" "$src"; then 18 | abort "You don't have $ts or $te in your file" 19 | fi 20 | # http://fahdshariff.blogspot.ru/2012/12/sed-mutli-line-replacement-between-two.html 21 | # clear old result 22 | sed -i"$ext" "/$ts/,/$te/{//!d;}" "$src" 23 | # create result file 24 | { 25 | echo '```' 26 | "$@" 27 | echo '```' 28 | } | tee -a "$tmp" 29 | # insert result file 30 | sed -i "/$ts/r $tmp" "$src" 31 | rm -f "$tmp" "$src$ext" 32 | } 33 | 34 | vim_plugins() { 35 | vim_plugins_tempfile="$(mktemp)" 36 | for toml in config/nvim/dein/*.toml; do 37 | printf '%-20s %3d\n' "$(basename "$toml")" \ 38 | "$(dasel -r toml -w json -f "$toml" | jq -r '.plugins|length')" 39 | done | tee "$vim_plugins_tempfile" 40 | awk -f"$(dirname "$0")/vim_plugins.awk" < "$vim_plugins_tempfile" 41 | } 42 | 43 | # shellcheck disable=SC2046 44 | insert_command 'tokei' tokei --hidden -- $(git ls-files) 45 | insert_command 'vim-plugins' vim_plugins 46 | 47 | # shellcheck disable=SC2016 48 | updated_at=$(printf 'Statistics are updated at [`%s`](%s/commit/%s),' \ 49 | "$(git rev-parse --short HEAD)" "$(git remote get-url origin)" "$(git rev-parse HEAD)") 50 | echo "$updated_at" 51 | sed -i "s@^Statistics are updated at .*\$@$updated_at@" "$src" 52 | -------------------------------------------------------------------------------- /scripts/link.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -ue 3 | 4 | TYPE='' 5 | case $1 in 6 | link) TYPE='link' ;; 7 | unlink) TYPE='unlink' ;; 8 | debug) TYPE='debug' ;; 9 | esac 10 | 11 | root="$(git rev-parse --show-toplevel)" 12 | 13 | expand_env() { 14 | eval echo "$*" 15 | } 16 | __link() { 17 | [ -L "$2" ] && rm -f "$2" 18 | [ -d "$(dirname "$2")" ] || mkdir -vp "$(dirname "$2")" 19 | ln -sf "$1" "$2" && printf '\e[38;5;141;1mLink\e[m %s \e[1m->\e[m %s...\n' "$2" "$1" 20 | } 21 | __rm() { 22 | rm -f "$1" && printf '\e[1;38;5;213mDelete\e[m %s...\n' "$1" 23 | } 24 | 25 | # shellcheck disable=SC2002 26 | cat ./manifest.tsv | while read -r target link; do 27 | link="$(expand_env "$link")" 28 | case "$TYPE" in 29 | debug) echo __link "$root/config/$target" "$link" ;; 30 | link) __link "$root/config/$target" "$link" ;; 31 | unlink) __rm "$link/$target" ;; 32 | esac 33 | done 34 | for bin in "$root"/bin/*; do 35 | case "$TYPE" in 36 | debug) echo __link "$bin" ~/.local/bin ;; 37 | link) __link "$bin" ~/.local/bin ;; 38 | unlink) __rm ~/.local/bin/"$(basename "$bin")" ;; 39 | esac 40 | done 41 | case "$TYPE" in 42 | debug) echo __link "$root/config/zsh/.zshenv" "$HOME" ;; 43 | link) __link "$root/config/zsh/.zshenv" "$HOME" ;; 44 | unlink) __rm ~/.zshenv ;; 45 | esac 46 | -------------------------------------------------------------------------------- /scripts/mac_defaults.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | defaults write -g AppleAccentColor -int 1 4 | defaults write -g AppleHighlightColor -string '1.000000 0.874510 0.701961 Orange' 5 | defaults write -g AppleInterfaceStyle -string 'Dark' 6 | defaults write -g NSAutomaticCapitalizationEnabled -bool false 7 | defaults write -g NSAutomaticDashSubstitutionEnabled -bool false 8 | defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false 9 | defaults write com.apple.universalaccess stickyKey -bool true 10 | defaults write com.apple.LaunchServices LSQuarantine -bool false 11 | 12 | defaults write com.apple.screencapture location -string ~/Pictures 13 | 14 | defaults write com.googlecode.iterm2 AllowClipboardAccess -bool true 15 | 16 | defaults write jp.sourceforge.inputmethod.aquaskk direct_clients -array 'com.googlecode.iterm2' 17 | defaults write jp.sourceforge.inputmethod.aquaskk max_count_of_inline_candidates -int 2 18 | defaults write jp.sourceforge.inputmethod.aquaskk candidate_window_font_size -int 14 19 | defaults write jp.sourceforge.inputmethod.aquaskk user_dictionary_path -string ~/.local/share/skk/SKK-JISYO.user 20 | 21 | printf 'StickyKey\t\t;' >> ~/Library/Application\ Support/AquaSKK/keymap.conf 22 | # NOTE: rule file must be EUC-JP 23 | touch ~/Library/Application\ Support/AquaSKK/punctuation.rule 24 | 25 | DictionarySet=~/Library/Application\ Support/AquaSKK/DictionarySet.plist 26 | plutil -replace 0.location -string 'SKK-JISYO.L' "$DictionarySet" 27 | plutil -replace 0.type -integer 1 "$DictionarySet" 28 | plutil -replace 1.location -string ~/.local/share/skk/SKK-JISYO.4513echo "$DictionarySet" 29 | plutil -replace 1.type -integer 5 "$DictionarySet" 30 | -------------------------------------------------------------------------------- /scripts/vim_plugins.awk: -------------------------------------------------------------------------------- 1 | BEGIN { 2 | total_vim = 0 3 | total_nvim = 0 4 | } 5 | 6 | { 7 | switch ($1) { 8 | case "vim.toml": 9 | total_vim += $2 10 | break 11 | case "neovim.toml": 12 | total_nvim += $2 13 | break 14 | case "unused.toml": 15 | break 16 | default: 17 | total_vim += $2 18 | total_nvim += $2 19 | } 20 | } 21 | 22 | END { 23 | print "------------------------" 24 | printf "%-20s %3d\n", "total(vim)", total_vim 25 | printf "%-20s %3d\n", "total(neovim)", total_nvim 26 | } 27 | -------------------------------------------------------------------------------- /up: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -eu 3 | DOTPATH="${DOTPATH:-$HOME/dotfiles}" 4 | URL="${URL:-https://github.com/4513ECHO/dotfiles}" 5 | error() { 6 | printf '\e[1;38;5;1mError\e[m: %s\n' "$*" 1>&2 7 | exit 1 8 | } 9 | [ -d "$DOTPATH" ] && error "$DOTPATH has already existed." 10 | printf '\e[1m' 11 | cat << 'EOF' 12 | .------------------------------------------------------------------------------. 13 | : : 14 | : d88 d88 .d888 d8b d88 : 15 | : 888 888 d88P" Y8P 888 : 16 | : 888 888 888 888 : 17 | : .d88888 .d88b. d888888 d888888 888 888 .d88b. .d8888b : 18 | : d88" 888 d88""88b 888 888 888 888 d8P Y8b 88K : 19 | : 888 888 888 888 888 888 888 888 88888888 "Y8888b. : 20 | : Y88b 888 Y88..88P Y88b. 888 888 888 Y8b. X88 : 21 | : "Y8888P "Y88P" "Y888 88P 88P 88P "Y888P 88888P" : 22 | : : 23 | : https://github.com/4513ECHO/dotfiles : 24 | : : 25 | '------------------------------------------------------------------------------' 26 | EOF 27 | printf '\e[m' 28 | git clone --filter=blob:none "$URL" "$DOTPATH" 29 | cd "$DOTPATH" || error "Could not change directory to $DOTPATH" 30 | make install 31 | exec "$SHELL" -l 32 | --------------------------------------------------------------------------------