├── .zshenv ├── .zshrc ├── .config ├── bat │ ├── syntaxes │ │ └── .gitkeep │ └── config ├── nvim │ ├── after │ │ ├── lsp │ │ │ ├── bashls.lua │ │ │ ├── eslint.lua │ │ │ ├── gopls.lua │ │ │ ├── jdtls.lua │ │ │ ├── dockerls.lua │ │ │ ├── tailwindcss.lua │ │ │ ├── terraformls.lua │ │ │ ├── stylelint_lsp.lua │ │ │ ├── kotlin_language_server.lua │ │ │ ├── clangd.lua │ │ │ ├── solargraph.lua │ │ │ ├── ts_ls.lua │ │ │ ├── lua_ls.lua │ │ │ └── jsonls.lua │ │ ├── queries │ │ │ ├── ecma │ │ │ │ └── injections.scm │ │ │ └── markdown │ │ │ │ └── highlights.scm │ │ └── ftplugin │ │ │ └── markdown.lua │ ├── lua │ │ ├── plugins │ │ │ ├── conf │ │ │ │ ├── flatten.lua │ │ │ │ ├── nvim-lsp-operations.lua │ │ │ │ ├── mini_misc.lua │ │ │ │ ├── copilot.lua │ │ │ │ ├── kensaku-search.lua │ │ │ │ ├── Comment.lua │ │ │ │ ├── mini_splitjoin.lua │ │ │ │ ├── mini_bufremove.lua │ │ │ │ ├── mini_files.lua │ │ │ │ ├── dap-vscode-js.lua │ │ │ │ ├── nvim-config-local.lua │ │ │ │ ├── nvim-colorizer.lua │ │ │ │ ├── noice.lua │ │ │ │ ├── statuscol.lua │ │ │ │ ├── mini_operators.lua │ │ │ │ ├── hover.lua │ │ │ │ ├── toggleterm.lua │ │ │ │ ├── nvim-lint.lua │ │ │ │ ├── mini_bracketed.lua │ │ │ │ ├── git-messenger.lua │ │ │ │ ├── nvim-scrollbar.lua │ │ │ │ ├── render-markdown.lua │ │ │ │ ├── gitlinker.lua │ │ │ │ ├── hop.lua │ │ │ │ ├── navic.lua │ │ │ │ ├── git.lua │ │ │ │ ├── gx.lua │ │ │ │ ├── dial.lua │ │ │ │ ├── telekasten.lua │ │ │ │ ├── mini_ai.lua │ │ │ │ ├── colorscheme.lua │ │ │ │ ├── conform.lua │ │ │ │ ├── gitsigns.lua │ │ │ │ ├── treesitter.lua │ │ │ │ ├── markdown.lua │ │ │ │ └── dap.lua │ │ │ ├── init │ │ │ │ ├── vim-ambiwidth.lua │ │ │ │ ├── winresizer.lua │ │ │ │ ├── git-messenger.lua │ │ │ │ ├── toggleterm.lua │ │ │ │ ├── Comment.lua │ │ │ │ ├── markdown-preview.lua │ │ │ │ └── telekasten.lua │ │ │ ├── nui.lua │ │ │ ├── lspkind.lua │ │ │ ├── plenary.lua │ │ │ ├── editorconfig.lua │ │ │ ├── mini.lua │ │ │ ├── vimdoc-ja.lua │ │ │ ├── mkdir.lua │ │ │ ├── vim-repeat.lua │ │ │ ├── vim-slim.lua │ │ │ ├── screenkey.lua │ │ │ ├── vim-maketable.lua │ │ │ ├── marks.lua │ │ │ ├── mini_align.lua │ │ │ ├── nvim-web-devicons.lua │ │ │ ├── hover.lua │ │ │ ├── flatten.lua │ │ │ ├── mini_cursorword.lua │ │ │ ├── smear-cursor.lua │ │ │ ├── mini_indentscope.lua │ │ │ ├── colorscheme.lua │ │ │ ├── vim-ambiwidth.lua │ │ │ ├── hop.lua │ │ │ ├── vim-sandwich.lua │ │ │ ├── conform.lua │ │ │ ├── mini_ai.lua │ │ │ ├── mini_misc.lua │ │ │ ├── mini_files.lua │ │ │ ├── statuscol.lua │ │ │ ├── nvim-lint.lua │ │ │ ├── nvim-config-local.lua │ │ │ ├── mini_bracketed.lua │ │ │ ├── mini_bufremove.lua │ │ │ ├── mini_operators.lua │ │ │ ├── mini_splitjoin.lua │ │ │ ├── vim-colorizer.lua │ │ │ ├── context_vt.lua │ │ │ ├── presenting.lua │ │ │ ├── trace-pr.lua │ │ │ ├── winresizer.lua │ │ │ ├── gx.lua │ │ │ ├── plantuml.lua │ │ │ ├── lualine.lua │ │ │ ├── nvim-scrollbar.lua │ │ │ ├── mini_move.lua │ │ │ ├── kensaku-search.lua │ │ │ ├── toggleterm.lua │ │ │ ├── noice.lua │ │ │ ├── lsp.lua │ │ │ ├── img-clip.lua │ │ │ ├── dial.lua │ │ │ ├── neogen.lua │ │ │ ├── telescope.lua │ │ │ ├── markdown.lua │ │ │ ├── git.lua │ │ │ ├── todo-comments.lua │ │ │ ├── trouble.lua │ │ │ ├── jaq.lua │ │ │ ├── treesitter.lua │ │ │ ├── copilot.lua │ │ │ ├── dap.lua │ │ │ └── nvim-lint │ │ │ │ └── cspell.lua │ │ ├── misc │ │ │ ├── init.lua │ │ │ ├── gh.lua │ │ │ ├── todo.lua │ │ │ ├── age.lua │ │ │ ├── silicon.lua │ │ │ └── markdown.lua │ │ ├── config │ │ │ ├── init.lua │ │ │ ├── filetype.lua │ │ │ ├── lazy.lua │ │ │ ├── _.lua │ │ │ ├── options.lua │ │ │ └── commands.lua │ │ └── utils.lua │ ├── ftplugin │ │ ├── plantuml.lua │ │ └── ruby.lua │ ├── .gitignore │ ├── snippets │ │ ├── react.json │ │ ├── component-diagrams.json │ │ ├── package.json │ │ └── gitcommit.json │ └── init.lua ├── hadolint.yaml ├── ripgrep │ └── ripgreprc ├── hub │ └── config.tmpl ├── karabiner │ └── .editorconfig ├── markdownlint │ └── .markdownlint.json ├── tmux │ ├── linux.tmux │ ├── wezterm.tmux │ ├── ghostty.tmux │ ├── darwin.tmux │ ├── copy.tmux │ ├── theme.tmux │ └── tmux.conf ├── git │ ├── hooks │ │ ├── update │ │ ├── commit-msg │ │ ├── post-update │ │ ├── pre-commit │ │ ├── pre-push │ │ ├── pre-rebase │ │ ├── pre-receive │ │ ├── applypatch-msg │ │ ├── prepare-commit-msg │ │ └── scripts │ │ │ ├── _lefthook │ │ │ ├── prepare-commit-msg │ │ │ └── pre-push │ ├── ignore │ └── config ├── zsh │ ├── .gitignore │ ├── tmpl │ │ ├── local-bin.zsh │ │ ├── r.zsh │ │ ├── dotdot.zsh │ │ ├── check-envrc-exist.zsh │ │ ├── check-local-git-config.zsh │ │ ├── ghq.zsh │ │ ├── navi.zsh │ │ ├── complete-ssh-host.zsh │ │ ├── prompt.zsh │ │ ├── git-add.zsh │ │ ├── init.zsh │ │ ├── key-bindings.zsh │ │ ├── git-branch.zsh │ │ ├── fzf.zsh │ │ └── completion.zsh │ ├── functions │ │ └── _bk │ └── .zshenv ├── mise │ └── config.toml ├── silicon │ └── config ├── rubocop │ └── config.yml ├── wezterm │ ├── mouse_bindings.lua │ ├── utils.lua │ ├── color.lua │ └── wezterm.lua ├── lazygit │ └── config.yml ├── textlint │ ├── prh-rules.yaml │ └── textlintrc.json ├── .gitignore ├── starship.toml ├── starship2.toml ├── sheldon │ └── plugins.toml ├── ghostty │ └── config ├── pry │ └── pryrc ├── mise.toml └── cspell │ ├── cspell.json │ └── dotfiles.txt ├── .textlintrc.json ├── .default-cargo-crates ├── .tmux.conf ├── .cargo ├── .gitignore └── config ├── scripts ├── sheldon ├── passage ├── term-definition ├── navi ├── brew_init ├── gen-zshrc └── defaults ├── .curlrc ├── .bashrc ├── .prettierignore ├── etc ├── brew │ ├── .gitignore │ ├── Brewfile.mas │ ├── Brewfile.cask │ └── Brewfile ├── raycast │ ├── README.md │ ├── Raycast.rayconfig │ ├── script-commands │ │ ├── images │ │ │ ├── bookmark-logo.png │ │ │ └── translate-logo.png │ │ ├── archive.sh │ │ ├── megalodon.sh │ │ ├── github.sh │ │ ├── utils │ │ │ └── _fetch_url_and_page_title │ │ ├── jorudan.sh │ │ ├── hatena-bookmark.sh │ │ ├── ghe.sh │ │ ├── amazon-url-shortener.sh │ │ ├── delete-query.sh │ │ ├── delete-hash.sh │ │ ├── google-translate.sh │ │ ├── cj.sh │ │ ├── ch.sh │ │ ├── cm.sh │ │ ├── cp.sh │ │ ├── ct.sh │ │ ├── add-bookmark.sh │ │ ├── reopen.sh │ │ └── cr.sh │ └── Snippets.json ├── plantuml │ └── compose.yaml ├── surfingkeys │ └── .eslintrc ├── vimari │ ├── vimari.css │ └── userSettings.json ├── vivaldi │ └── style.css └── vimium │ └── vimium-options.json ├── .default-gems ├── .bin ├── activate-ghostty ├── profile-zsh ├── todo ├── startuptime-nvim ├── memo ├── reinstall-mise ├── bookmark-loop ├── wp ├── schedule ├── gitpager ├── bookmark-wrapper ├── kensaku ├── o ├── Kill ├── abbr-current-dir ├── git-edit ├── pc ├── aws-login ├── _select-wezterm-tab ├── scrapbook_path ├── current_dir ├── dinit ├── re ├── startuptime-zsh ├── navi-init ├── bk ├── bt ├── lefthook ├── dc ├── _call_git_hook ├── bookmark ├── totp ├── git-fzf └── git-review ├── .default-go-packages ├── .default-python-packages ├── .editrc ├── .direnvrc ├── .default-npm-packages ├── .editorconfig ├── .luarc.json ├── README.md ├── LICENSE └── Makefile /.zshenv: -------------------------------------------------------------------------------- 1 | .config/zsh/.zshenv -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | .config/zsh/.zshrc -------------------------------------------------------------------------------- /.config/bat/syntaxes/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/bashls.lua: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/eslint.lua: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/gopls.lua: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/jdtls.lua: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/dockerls.lua: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/tailwindcss.lua: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/terraformls.lua: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/stylelint_lsp.lua: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.textlintrc.json: -------------------------------------------------------------------------------- 1 | .config/textlint/textlintrc.json -------------------------------------------------------------------------------- /.config/hadolint.yaml: -------------------------------------------------------------------------------- 1 | ignored: 2 | - DL3008 3 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/kotlin_language_server.lua: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.default-cargo-crates: -------------------------------------------------------------------------------- 1 | cargo-update 2 | hyperfine 3 | -------------------------------------------------------------------------------- /.tmux.conf: -------------------------------------------------------------------------------- 1 | source $XDG_CONFIG_HOME/tmux/tmux.conf 2 | -------------------------------------------------------------------------------- /.cargo/.gitignore: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | !/.gitignore 4 | !/config 5 | -------------------------------------------------------------------------------- /scripts/sheldon: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | sheldon lock --update 4 | -------------------------------------------------------------------------------- /.curlrc: -------------------------------------------------------------------------------- 1 | insecure 2 | location 3 | noproxy = 127.0.0.1,localhost 4 | -------------------------------------------------------------------------------- /.config/ripgrep/ripgreprc: -------------------------------------------------------------------------------- 1 | --glob=!.git 2 | --glob=!spec/cassettes 3 | -------------------------------------------------------------------------------- /.bashrc: -------------------------------------------------------------------------------- 1 | if type -a vim >/dev/null 2>&1; then 2 | alias vim=vi 3 | fi 4 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/flatten.lua: -------------------------------------------------------------------------------- 1 | require("flatten").setup({}) 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | package.json 2 | package-lock.json 3 | 4 | karabiner.json 5 | -------------------------------------------------------------------------------- /.config/hub/config.tmpl: -------------------------------------------------------------------------------- 1 | github.com: 2 | - user: xxx 3 | oauth_token: xxxxxxx 4 | -------------------------------------------------------------------------------- /.config/karabiner/.editorconfig: -------------------------------------------------------------------------------- 1 | [karabiner.json] 2 | insert_final_newline = false 3 | -------------------------------------------------------------------------------- /.config/markdownlint/.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "no-missing-space-atx": false 3 | } 4 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/init/vim-ambiwidth.lua: -------------------------------------------------------------------------------- 1 | vim.g.ambiwidth_cica_enabled = false 2 | -------------------------------------------------------------------------------- /.config/tmux/linux.tmux: -------------------------------------------------------------------------------- 1 | # vim: ft=tmux 2 | source $XDG_CONFIG_HOME/tmux/copy.conf 3 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/init/winresizer.lua: -------------------------------------------------------------------------------- 1 | vim.g.winresizer_start_key = "" 2 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/nvim-lsp-operations.lua: -------------------------------------------------------------------------------- 1 | require("lsp-file-operations").setup() 2 | -------------------------------------------------------------------------------- /etc/brew/.gitignore: -------------------------------------------------------------------------------- 1 | Brewfile.lock.json 2 | Brewfile.cask.lock.json 3 | Brewfile.mas.lock.json 4 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/nui.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "MunifTanjim/nui.nvim", 3 | version = "*", 4 | } 5 | -------------------------------------------------------------------------------- /.default-gems: -------------------------------------------------------------------------------- 1 | repl_type_completor 2 | 3 | standard 4 | rubocop-performance 5 | 6 | pry 7 | rails 8 | -------------------------------------------------------------------------------- /.config/git/hooks/update: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sh "$(dirname "$0")/scripts/_lefthook" "$(basename "$0")" $@ 4 | -------------------------------------------------------------------------------- /.config/nvim/ftplugin/plantuml.lua: -------------------------------------------------------------------------------- 1 | vim.opt_local.foldmethod = "marker" 2 | vim.opt_local.foldlevel = 0 3 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/lspkind.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "onsails/lspkind.nvim", 3 | version = "*", 4 | } 5 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/plenary.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-lua/plenary.nvim", 3 | version = "*", 4 | } 5 | -------------------------------------------------------------------------------- /.bin/activate-ghostty: -------------------------------------------------------------------------------- 1 | #!/usr/bin/osascript 2 | 3 | tell application "Ghostty" 4 | activate 5 | end tell 6 | -------------------------------------------------------------------------------- /.config/git/hooks/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sh "$(dirname "$0")/scripts/_lefthook" "$(basename "$0")" $@ 4 | -------------------------------------------------------------------------------- /.config/git/hooks/post-update: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sh "$(dirname "$0")/scripts/_lefthook" "$(basename "$0")" $@ 4 | -------------------------------------------------------------------------------- /.config/git/hooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sh "$(dirname "$0")/scripts/_lefthook" "$(basename "$0")" $@ 4 | -------------------------------------------------------------------------------- /.config/git/hooks/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sh "$(dirname "$0")/scripts/_lefthook" "$(basename "$0")" $@ 4 | -------------------------------------------------------------------------------- /.config/git/hooks/pre-rebase: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sh "$(dirname "$0")/scripts/_lefthook" "$(basename "$0")" $@ 4 | -------------------------------------------------------------------------------- /.config/git/hooks/pre-receive: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sh "$(dirname "$0")/scripts/_lefthook" "$(basename "$0")" $@ 4 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/clangd.lua: -------------------------------------------------------------------------------- 1 | return { 2 | filetypes = { "c", "cpp", "objc", "objcpp", "cuda" }, 3 | } 4 | -------------------------------------------------------------------------------- /.config/zsh/.gitignore: -------------------------------------------------------------------------------- 1 | .zhistory 2 | .zsh_history 3 | .zcompdump 4 | .zcompcache 5 | 6 | .zshrc 7 | *.zwc 8 | -------------------------------------------------------------------------------- /etc/raycast/README.md: -------------------------------------------------------------------------------- 1 | # Raycast 2 | 3 | ## Export対象 4 | 5 | 下記に絞る。 6 | 7 | - Settings 8 | - Quicklinks 9 | -------------------------------------------------------------------------------- /etc/raycast/Raycast.rayconfig: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masa0x80/dotfiles/HEAD/etc/raycast/Raycast.rayconfig -------------------------------------------------------------------------------- /.config/git/hooks/applypatch-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sh "$(dirname "$0")/scripts/_lefthook" "$(basename "$0")" $@ 4 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/mini_misc.lua: -------------------------------------------------------------------------------- 1 | require("mini.misc").setup() 2 | 3 | MiniMisc.setup_restore_cursor() 4 | -------------------------------------------------------------------------------- /.config/tmux/wezterm.tmux: -------------------------------------------------------------------------------- 1 | set -g default-terminal "wezterm" 2 | set -as terminal-features ",xterm-256color:RGB" 3 | -------------------------------------------------------------------------------- /.config/git/hooks/prepare-commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | sh "$(dirname "$0")/scripts/_lefthook" "$(basename "$0")" $@ 4 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/editorconfig.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "gpanders/editorconfig.nvim", 3 | event = "VeryLazy", 4 | } 5 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mini.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-mini/mini.nvim", 3 | version = "*", 4 | lazy = false, 5 | } 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/vimdoc-ja.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "vim-jp/vimdoc-ja", 3 | version = "*", 4 | lazy = false, 5 | } 6 | -------------------------------------------------------------------------------- /.bin/profile-zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | profile-zsh() { 4 | ZSHRC_PROFILE=1 zsh -i -c zprof 5 | } 6 | profile-zsh 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mkdir.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "jghauser/mkdir.nvim", 3 | version = "*", 4 | event = "VeryLazy", 5 | } 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/vim-repeat.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "tpope/vim-repeat", 3 | version = "*", 4 | event = "VeryLazy", 5 | } 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/vim-slim.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "slim-template/vim-slim", 3 | version = "*", 4 | ft = "slim", 5 | } 6 | -------------------------------------------------------------------------------- /.bin/todo: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | todo() { 4 | eval "$EDITOR '$(scrapbook_path $(current_dir)/todo.md)'" 5 | } 6 | todo 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/screenkey.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "NStefan002/screenkey.nvim", 3 | version = "*", 4 | lazy = false, 5 | } 6 | -------------------------------------------------------------------------------- /.bin/startuptime-nvim: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | startuptime-nvim() { 4 | vim-startuptime -vimpath nvim 5 | } 6 | startuptime-nvim 7 | -------------------------------------------------------------------------------- /.config/mise/config.toml: -------------------------------------------------------------------------------- 1 | [settings] 2 | idiomatic_version_file_enable_tools = ["node"] 3 | 4 | [settings.node] 5 | gpg_verify = false 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/vim-maketable.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "mattn/vim-maketable", 3 | version = "*", 4 | ft = { "markdown" }, 5 | } 6 | -------------------------------------------------------------------------------- /.bin/memo: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | memo() { 4 | eval "$EDITOR '$(scrapbook_path $(current_dir)/$(date +%Y-%m-%d).md)'" 5 | } 6 | memo 7 | -------------------------------------------------------------------------------- /.bin/reinstall-mise: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | str=$(mise current | fzf +m) 4 | eval mise uninstall "$str" 5 | eval mise install "$str" 6 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/solargraph.lua: -------------------------------------------------------------------------------- 1 | return { 2 | settings = { 3 | solargraph = { 4 | diagnostics = false, 5 | }, 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/marks.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "chentoast/marks.nvim", 3 | version = "*", 4 | event = "VeryLazy", 5 | opts = {}, 6 | } 7 | -------------------------------------------------------------------------------- /.default-go-packages: -------------------------------------------------------------------------------- 1 | github.com/rhysd/vim-startuptime@latest 2 | github.com/sotarok/gw@latest 3 | honnef.co/go/tools/cmd/staticcheck@latest 4 | -------------------------------------------------------------------------------- /.bin/bookmark-loop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | set -euo pipefail 4 | 5 | () { 6 | while true; do 7 | bookmark 8 | done 9 | } 10 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mini_align.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-mini/mini.align", 3 | version = "*", 4 | event = "VeryLazy", 5 | opts = {}, 6 | } 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/nvim-web-devicons.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "kyazdani42/nvim-web-devicons", 3 | version = "*", 4 | event = "VeryLazy", 5 | } 6 | -------------------------------------------------------------------------------- /.config/nvim/.gitignore: -------------------------------------------------------------------------------- 1 | /* 2 | /.* 3 | !/.gitignore 4 | !/init.lua 5 | !/lua 6 | !/after 7 | !/ftplugin 8 | !/lazy-lock.json 9 | !/snippets 10 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/copilot.lua: -------------------------------------------------------------------------------- 1 | require("copilot").setup({ 2 | suggestion = { enabled = false }, 3 | panel = { enabled = false }, 4 | }) 5 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/hover.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "lewis6991/hover.nvim", 3 | version = "*", 4 | config = require("utils").load("conf/hover"), 5 | } 6 | -------------------------------------------------------------------------------- /etc/plantuml/compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | plantuml-server: 3 | image: plantuml/plantuml-server:v1.2024.8 4 | ports: 5 | - "8765:8080" 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/kensaku-search.lua: -------------------------------------------------------------------------------- 1 | local map = vim.keymap.set 2 | map("c", "", "(kensaku-search-replace)", { noremap = true }) 3 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/flatten.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "willothy/flatten.nvim", 3 | lazy = false, 4 | config = require("utils").load("conf/flatten"), 5 | } 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mini_cursorword.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-mini/mini.cursorword", 3 | version = "*", 4 | event = "VeryLazy", 5 | opts = {}, 6 | } 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/smear-cursor.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "sphamba/smear-cursor.nvim", 3 | version = "*", 4 | event = "VeryLazy", 5 | opts = {}, 6 | } 7 | -------------------------------------------------------------------------------- /.config/nvim/snippets/react.json: -------------------------------------------------------------------------------- 1 | { 2 | "return JSX": { 3 | "prefix": "return", 4 | "body": ["return (", " <$1>", " ", ")"] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/images/bookmark-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masa0x80/dotfiles/HEAD/etc/raycast/script-commands/images/bookmark-logo.png -------------------------------------------------------------------------------- /.config/nvim/lua/misc/init.lua: -------------------------------------------------------------------------------- 1 | require("misc.age") 2 | require("misc.gh") 3 | require("misc.markdown") 4 | require("misc.silicon") 5 | require("misc.todo") 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mini_indentscope.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-mini/mini.indentscope", 3 | version = "*", 4 | event = "VeryLazy", 5 | opts = {}, 6 | } 7 | -------------------------------------------------------------------------------- /.config/silicon/config: -------------------------------------------------------------------------------- 1 | --background '#292C33' 2 | --no-window-controls 3 | --font 'UDEV Gothic NFLG' 4 | --pad-horiz 0 5 | --pad-vert 0 6 | --theme OneDark 7 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/images/translate-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/masa0x80/dotfiles/HEAD/etc/raycast/script-commands/images/translate-logo.png -------------------------------------------------------------------------------- /.bin/wp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | wp() { 4 | watch -n 0.5 "ps -ef | grep $(echo "$1" | sed -e 's/\(.\)\(.*\)/\[\1\]\2/') | grep -v 'wp $1'" 5 | } 6 | wp "$@" 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/colorscheme.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "neanias/everforest-nvim", 3 | lazy = false, 4 | config = require("utils").load("conf/colorscheme"), 5 | } 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/vim-ambiwidth.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "rbtnn/vim-ambiwidth", 3 | lazy = false, 4 | init = require("utils").load("init/vim-ambiwidth"), 5 | } 6 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/ts_ls.lua: -------------------------------------------------------------------------------- 1 | return { 2 | init_options = { 3 | preferences = { 4 | importModuleSpecifierPreference = "non-relative", 5 | }, 6 | }, 7 | } 8 | -------------------------------------------------------------------------------- /.config/nvim/after/queries/ecma/injections.scm: -------------------------------------------------------------------------------- 1 | ; extends 2 | 3 | ((comment) @gql_comment 4 | (#eq? @gql_comment "/* GraphQL */") 5 | (template_string) @graphql) 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/hop.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "smoka7/hop.nvim", 3 | version = "*", 4 | event = "VeryLazy", 5 | config = require("utils").load("conf/hop"), 6 | } 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/vim-sandwich.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "machakann/vim-sandwich", 3 | version = "*", 4 | event = { "CursorHold", "CursorMoved", "ModeChanged" }, 5 | } 6 | -------------------------------------------------------------------------------- /.config/tmux/ghostty.tmux: -------------------------------------------------------------------------------- 1 | set -g default-terminal "tmux-256color" 2 | set -as terminal-features ",xterm-ghostty:RGB" 3 | 4 | # ^i は Tab 5 | bind Tab select-pane -t :.+ 6 | -------------------------------------------------------------------------------- /.bin/schedule: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | set -euo pipefail 4 | 5 | icalBuddy --bullet "- [ ] " --noCalendarNames --excludeEventProps '*' --excludeAllDayEvents eventsToday 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/Comment.lua: -------------------------------------------------------------------------------- 1 | require("Comment").setup({ 2 | pre_hook = require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook(), 3 | }) 4 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/mini_splitjoin.lua: -------------------------------------------------------------------------------- 1 | require("mini.splitjoin").setup({ 2 | mappings = { 3 | toggle = "ms", 4 | split = "ss", 5 | join = "sj", 6 | }, 7 | }) 8 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conform.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "stevearc/conform.nvim", 3 | version = "*", 4 | event = "VeryLazy", 5 | config = require("utils").load("conf/conform"), 6 | } 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mini_ai.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-mini/mini.ai", 3 | version = "*", 4 | event = "VeryLazy", 5 | config = require("utils").load("conf/mini_ai"), 6 | } 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mini_misc.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-mini/mini.misc", 3 | version = "*", 4 | lazy = false, 5 | config = require("utils").load("conf/mini_misc"), 6 | } 7 | -------------------------------------------------------------------------------- /.config/zsh/tmpl/local-bin.zsh: -------------------------------------------------------------------------------- 1 | # NOTE: must place before loading `$HOME/.config.local/zsh/zshrc` 2 | path=( 3 | $HOME/.bin.local(N-/) 4 | $HOME/.bin(N-/) 5 | $path 6 | ) 7 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/lua_ls.lua: -------------------------------------------------------------------------------- 1 | return { 2 | settings = { 3 | Lua = { 4 | workspace = { checkThirdParty = false }, 5 | telemetry = { enable = false }, 6 | }, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mini_files.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-mini/mini.files", 3 | version = "*", 4 | event = "VeryLazy", 5 | config = require("utils").load("conf/mini_files"), 6 | } 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/statuscol.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "luukvbaal/statuscol.nvim", 3 | version = "*", 4 | lazy = false, 5 | config = require("utils").load("conf/statuscol"), 6 | } 7 | -------------------------------------------------------------------------------- /.bin/gitpager: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | LESS='-RIXc' 4 | if (( ${+commands[delta]} )); then 5 | delta --diff-so-fancy --keep-plus-minus-markers | less $@ 6 | else 7 | less $@ 8 | fi 9 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/nvim-lint.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "mfussenegger/nvim-lint", 3 | version = "*", 4 | event = "BufReadPre", 5 | config = require("utils").load("conf/nvim-lint"), 6 | } 7 | -------------------------------------------------------------------------------- /.default-python-packages: -------------------------------------------------------------------------------- 1 | diagrams 2 | neovim 3 | 4 | # https://github.com/jellydn/CopilotChat.nvim requires the follow packages 5 | python-dotenv 6 | requests 7 | pynvim 8 | prompt-toolkit 9 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/jsonls.lua: -------------------------------------------------------------------------------- 1 | return { 2 | settings = { 3 | json = { 4 | schemas = require("schemastore").json.schemas(), 5 | validate = { enable = true }, 6 | }, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/nvim-config-local.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "klen/nvim-config-local", 3 | version = "*", 4 | lazy = false, 5 | config = require("utils").load("conf/nvim-config-local"), 6 | } 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mini_bracketed.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-mini/mini.bracketed", 3 | version = "*", 4 | event = "VeryLazy", 5 | config = require("utils").load("conf/mini_bracketed"), 6 | } 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mini_bufremove.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-mini/mini.bufremove", 3 | version = "*", 4 | event = "VeryLazy", 5 | config = require("utils").load("conf/mini_bufremove"), 6 | } 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mini_operators.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-mini/mini.operators", 3 | version = "*", 4 | event = "VeryLazy", 5 | config = require("utils").load("conf/mini_operators"), 6 | } 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mini_splitjoin.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-mini/mini.splitjoin", 3 | version = "*", 4 | event = "VeryLazy", 5 | config = require("utils").load("conf/mini_splitjoin"), 6 | } 7 | -------------------------------------------------------------------------------- /.bin/bookmark-wrapper: -------------------------------------------------------------------------------- 1 | #!/usr/bin/osascript 2 | 3 | tell application "Wezterm" 4 | activate 5 | tell application "System Events" 6 | keystroke "j" using {command down} 7 | end tell 8 | end tell 9 | -------------------------------------------------------------------------------- /.bin/kensaku: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | set -euo pipefail 4 | 5 | WORD=$(mise exec node -- jsmigemo -w "$*") 6 | rg --column --line-number --no-heading --color=always --smart-case -e "${WORD//\)\(/|}" 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/config/init.lua: -------------------------------------------------------------------------------- 1 | require("config._") 2 | require("config.filetype") 3 | require("config.options") 4 | require("config.keymaps") 5 | require("config.commands") 6 | require("config.lazy") 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/mini_bufremove.lua: -------------------------------------------------------------------------------- 1 | require("mini.bufremove").setup() 2 | 3 | vim.keymap.set("n", "dd", function() 4 | MiniBufremove.delete() 5 | end, { desc = "Remove buffer" }) 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/mini_files.lua: -------------------------------------------------------------------------------- 1 | require("mini.files").setup() 2 | 3 | vim.api.nvim_create_user_command("Files", function() 4 | MiniFiles.open() 5 | end, { desc = "Open file exproler" }) 6 | -------------------------------------------------------------------------------- /.editrc: -------------------------------------------------------------------------------- 1 | mysql:bind '^w' ed-delete-prev-word # enable word delete 2 | mysql:bind '^u' vi-kill-line-prev # enable line delete 3 | mysql:bind "^r" em-inc-search-prev # enable incremental backward search 4 | -------------------------------------------------------------------------------- /etc/brew/Brewfile.mas: -------------------------------------------------------------------------------- 1 | mas "Hand Mirror", id: 1502839586 2 | mas "Onedrive", id: 823766827 3 | mas "Screen Cursor", id: 1577211880 4 | mas "ScreenPointer", id: 1368204906 5 | mas "Xcode", id: 497799835 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/vim-colorizer.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "norcalli/nvim-colorizer.lua", 3 | version = "*", 4 | event = { "BufNewFile", "BufReadPre" }, 5 | config = require("utils").load("conf/nvim-colorizer"), 6 | } 7 | -------------------------------------------------------------------------------- /.bin/o: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | o() { 4 | if (( ${+commands[open]} )); then 5 | if [ -n "$1" ]; then 6 | command open "$@" 7 | else 8 | command open . 9 | fi 10 | fi 11 | } 12 | o "$@" 13 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/context_vt.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "haringsrob/nvim_context_vt", 3 | version = "*", 4 | event = { "BufNewFile", "BufRead" }, 5 | opts = { 6 | disable_virtual_lines_ft = { "python", "yaml" }, 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/presenting.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "sotte/presenting.nvim", 3 | version = "*", 4 | opts = { 5 | options = { 6 | width = vim.o.columns - 8, 7 | }, 8 | }, 9 | cmd = { "Presenting" }, 10 | } 11 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/trace-pr.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "h3pei/trace-pr.nvim", 3 | config = true, 4 | cmd = { "TracePR" }, 5 | keys = { 6 | { 7 | "gp", 8 | "TracePR", 9 | }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/winresizer.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "simeji/winresizer", 3 | version = "*", 4 | keys = { 5 | { "", nil, desc = "WinResizer" }, 6 | }, 7 | init = require("utils").load("init/winresizer"), 8 | } 9 | -------------------------------------------------------------------------------- /.config/tmux/darwin.tmux: -------------------------------------------------------------------------------- 1 | # vim: ft=tmux 2 | source $XDG_CONFIG_HOME/tmux/copy.tmux 3 | 4 | bind -T copy-mode-vi Enter send -X copy-pipe-and-cancel 'pbcopy' 5 | bind -T copy-mode-vi y send -X copy-pipe-and-cancel 'pbcopy' 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/misc/gh.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_user_command("GhOpenPR", function() 2 | vim.fn.system("gh pr view --web") 3 | end, {}) 4 | 5 | local keymap = vim.keymap.set 6 | keymap("n", "ogp", "GhOpenPR", {}) 7 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/gx.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "chrishrb/gx.nvim", 3 | version = "*", 4 | keys = { { "gx", "Browse", mode = { "n", "x" } } }, 5 | cmd = { "Browse" }, 6 | config = require("utils").load("conf/gx"), 7 | } 8 | -------------------------------------------------------------------------------- /.bin/Kill: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | Kill() { 4 | local pids=$(ps -e -o pid,command | fzf --query="$@" | awk '{print $1}') 5 | 6 | [ -z "$pids" ] && return 0 7 | kill -9 $(echo $pids | tr "\n" ' ') 8 | } 9 | Kill "$@" 10 | -------------------------------------------------------------------------------- /.config/zsh/tmpl/r.zsh: -------------------------------------------------------------------------------- 1 | r() { 2 | local repo=$(ghq list -p | sed -n "s|$HOME/\(.*\)|\1|p" | fzf +m --query="$@" --preview 'bat --color=always ~/{}/README.md') 3 | 4 | if test -n "$repo"; then 5 | cd "$HOME/$repo" 6 | fi 7 | } 8 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/dap-vscode-js.lua: -------------------------------------------------------------------------------- 1 | require("dap-vscode-js").setup({ 2 | debugger_path = vim.fn.resolve(vim.fn.stdpath("data") .. "/lazy/vscode-js-debug"), 3 | 4 | adapters = { 5 | "pwa-node", 6 | "pwa-chrome", 7 | }, 8 | }) 9 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/init/git-messenger.lua: -------------------------------------------------------------------------------- 1 | vim.g.git_messenger_always_into_popup = true 2 | vim.g.git_messenger_include_diff = "current" 3 | vim.g.git_messenger_date_format = "%F %T" 4 | vim.g.git_messenger_floating_win_opts = { border = "rounded" } 5 | -------------------------------------------------------------------------------- /.config/zsh/tmpl/dotdot.zsh: -------------------------------------------------------------------------------- 1 | function dotdot() { 2 | local dots=$LBUFFER[-3,-1] 3 | if [[ $dots =~ "^[ //\"']?\.\.$" ]]; then 4 | LBUFFER=$LBUFFER[1,-3]'../.' 5 | fi 6 | zle self-insert 7 | } 8 | zle -N dotdot 9 | bindkey "." dotdot 10 | -------------------------------------------------------------------------------- /.config/nvim/after/queries/markdown/highlights.scm: -------------------------------------------------------------------------------- 1 | ; extends 2 | 3 | (atx_heading [ 4 | (atx_h1_marker) 5 | (atx_h2_marker) 6 | (atx_h3_marker) 7 | (atx_h4_marker) 8 | (atx_h5_marker) 9 | (atx_h6_marker) 10 | ] @comment) 11 | -------------------------------------------------------------------------------- /scripts/passage: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | ghq get https://github.com/FiloSottile/passage.git 4 | cd "$(ghq root)/github.com/FiloSottile/passage" 5 | make install PREFIX="$(brew --cellar)/passage/$(git describe --tags)" 6 | brew unlink passage 7 | brew link passage 8 | -------------------------------------------------------------------------------- /.config/rubocop/config.yml: -------------------------------------------------------------------------------- 1 | require: 2 | - standard 3 | - rubocop-performance 4 | 5 | inherit_gem: 6 | standard: config/base.yml 7 | standard-performance: config/base.yml 8 | 9 | AllCops: 10 | SuggestExtensions: false 11 | NewCops: disable 12 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/nvim-config-local.lua: -------------------------------------------------------------------------------- 1 | require("config-local").setup({ 2 | config_files = { ".nvim/local.lua" }, 3 | hashfile = vim.fn.stdpath("data") .. "/config-local", 4 | autocommands_create = true, 5 | commands_create = true, 6 | silent = true, 7 | }) 8 | -------------------------------------------------------------------------------- /.config/nvim/ftplugin/ruby.lua: -------------------------------------------------------------------------------- 1 | vim.cmd([[ 2 | iabbrev bb binding.pry 3 | iabbrev bB require 'pry'; binding.pry 4 | iabbrev BB require 'byebug'; byebug 5 | iabbrev Bb binding.irb 6 | iabbrev reqb require 'bundler'Bundler.require 7 | ]]) 8 | -------------------------------------------------------------------------------- /.cargo/config: -------------------------------------------------------------------------------- 1 | [target.x86_64-apple-darwin] 2 | rustflags = [ 3 | "-C", "link-arg=-undefined", 4 | "-C", "link-arg=dynamic_lookup", 5 | ] 6 | 7 | [target.aarch64-apple-darwin] 8 | rustflags = [ 9 | "-C", "link-arg=-undefined", 10 | "-C", "link-arg=dynamic_lookup", 11 | ] 12 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/nvim-colorizer.lua: -------------------------------------------------------------------------------- 1 | require("colorizer").setup({ "*" }, { 2 | RGB = true, 3 | RRGGBB = true, 4 | names = true, 5 | RRGGBBAA = true, 6 | rgb_fn = true, 7 | hsl_fn = true, 8 | css = true, 9 | css_fn = true, 10 | mode = "background", 11 | }) 12 | -------------------------------------------------------------------------------- /etc/surfingkeys/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "eslint:recommended", 3 | "env": { 4 | "browser": true, 5 | "es2021": true 6 | }, 7 | "parserOptions": { 8 | "ecmaVersion": 12 9 | }, 10 | "globals": { 11 | "api": true, 12 | "settings": true 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.bin/abbr-current-dir: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | abbr-current-dir() { 4 | local current_dir=${(%):-%~} 5 | if [[ "${current_dir}" != '~' ]]; then 6 | current_dir="${${(@j:/:M)${(@s:/:)current_dir:h}#?}%/}/${current_dir:t}" 7 | fi 8 | echo $current_dir 9 | } 10 | abbr-current-dir 11 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/noice.lua: -------------------------------------------------------------------------------- 1 | require("noice").setup({ 2 | messages = { 3 | view = "mini", 4 | view_error = "mini", 5 | view_warn = "mini", 6 | view_search = false, 7 | }, 8 | }) 9 | 10 | vim.keymap.set("n", "m", "NoiceAll", { desc = "Show All Messages" }) 11 | -------------------------------------------------------------------------------- /.config/tmux/copy.tmux: -------------------------------------------------------------------------------- 1 | # vim: ft=tmux 2 | bind ^f copy-mode \; display 'Copy mode' 3 | bind ^[ copy-mode \; display 'Copy mode' 4 | 5 | # コピーモードでのカーソル移動を vim 風に 6 | set-window-option -g mode-keys vi 7 | bind p paste-buffer 8 | 9 | # 矩形選択 10 | bind -T copy-mode-vi C-v send -X rectangle-toggle 11 | -------------------------------------------------------------------------------- /scripts/term-definition: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | if ! find ~/.terminfo | grep -q wezterm; then 4 | tempfile=$(mktemp) \ 5 | && curl -o $tempfile https://raw.githubusercontent.com/wez/wezterm/main/termwiz/data/wezterm.terminfo \ 6 | && tic -x -o ~/.terminfo $tempfile \ 7 | && rm $tempfile 8 | fi 9 | -------------------------------------------------------------------------------- /.config/bat/config: -------------------------------------------------------------------------------- 1 | # Set the theme 2 | --theme='Everforest Dark' 3 | 4 | # Show line numbers, Git modifications and file header (but no grid) 5 | --style='changes' 6 | 7 | # Use italic text on the terminal (not supported on all terminals) 8 | --italic-text=always 9 | 10 | --pager='less -RFIX' 11 | -------------------------------------------------------------------------------- /.config/nvim/lua/config/filetype.lua: -------------------------------------------------------------------------------- 1 | vim.filetype.add({ 2 | extension = { 3 | zsh = "bash", 4 | shell = "bash", 5 | age = "age", 6 | }, 7 | pattern = { 8 | [".*/%.github/workflows/.*%.ya?ml"] = "yaml.ghaction", 9 | ["Brewfile.*"] = "ruby", 10 | ["zinitrc"] = "zsh", 11 | }, 12 | }) 13 | -------------------------------------------------------------------------------- /.config/zsh/tmpl/check-envrc-exist.zsh: -------------------------------------------------------------------------------- 1 | check-envrc-exist() { 2 | if [ -f "${PWD:q}/.envrc" -a -f mise.toml -a ! $(grep -q '\[env\]' mise.toml >/dev/null 2>&1) ]; then 3 | echo -e '\n\033[7;36m[WARN] [env] is not found in mise.toml.\033[0;39m' 4 | fi 5 | } 6 | add-zsh-hook precmd check-envrc-exist 7 | -------------------------------------------------------------------------------- /.bin/git-edit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | git_edit() { 4 | if test -z "$1"; then 5 | echo 'Usage: git edit [hash]' 6 | return 1 7 | fi 8 | 9 | GIT_SEQUENCE_EDITOR="sed -i -e '1,1s/pick/edit/'" git rebase -i "$1"~ 10 | } 11 | git_edit $(git fzf) 12 | git reset --soft HEAD^ 13 | -------------------------------------------------------------------------------- /.config/zsh/tmpl/check-local-git-config.zsh: -------------------------------------------------------------------------------- 1 | check-local-git-config() { 2 | if [ ! -f $HOME/.config.local/git/config ]; then 3 | echo -e '\n\033[7;36m[WARN] Local git config file is not found. Create ~/.config.local/git/config file.\033[0;39m' 4 | fi 5 | } 6 | add-zsh-hook precmd check-local-git-config 7 | -------------------------------------------------------------------------------- /.bin/pc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | pc() { 4 | PREFIX="${PASSAGE_DIR:-$HOME/.passage/store}" 5 | name="$(find "$PREFIX" -type f -name '*.age' | \ 6 | sed -e "s|$PREFIX/||" -e 's|\.age$||' | \ 7 | fzf +m)" 8 | if [ "$name" != "" ]; then 9 | passage --clip "$name" 10 | fi 11 | } 12 | pc 13 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/plantuml.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "aklt/plantuml-syntax", 4 | version = "*", 5 | ft = "plantuml", 6 | }, 7 | { 8 | "weirongxu/plantuml-previewer.vim", 9 | version = "*", 10 | ft = "plantuml", 11 | dependencies = { 12 | "tyru/open-browser.vim", 13 | }, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /.config/zsh/functions/_bk: -------------------------------------------------------------------------------- 1 | #compdef bk 2 | 3 | _bk() { 4 | _arguments \ 5 | {-a,--add}'[Add an extention to the specified files]' \ 6 | {-d,--del}'[Delete an extention from the specified files]' \ 7 | {-e,--ext}'[Specify an extention adding to files (default: bk)]' \ 8 | '*: :_files ./' 9 | } 10 | -------------------------------------------------------------------------------- /etc/vimari/vimari.css: -------------------------------------------------------------------------------- 1 | div#vimiumHintMarkerContainer div.internalVimiumHintMarker { 2 | font-size: 18px !important; 3 | background-color: gray !important; 4 | box-shadow: none !important; 5 | } 6 | 7 | div#vimiumHintMarkerContainer div.internalVimiumHintMarker span { 8 | color: white !important; 9 | } 10 | -------------------------------------------------------------------------------- /.config/wezterm/mouse_bindings.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | local wezterm = require("wezterm") 4 | local act = wezterm.action 5 | 6 | M.mouse_bindings = { 7 | { 8 | event = { Down = { streak = 1, button = "Left" } }, 9 | mods = "SUPER", 10 | action = act.OpenLinkAtMouseCursor, 11 | }, 12 | } 13 | 14 | return M 15 | -------------------------------------------------------------------------------- /.config/git/ignore: -------------------------------------------------------------------------------- 1 | # Mac 2 | .DS_Store 3 | 4 | # Windows 5 | Thumbs.db 6 | 7 | # zsh 8 | *.zwc 9 | 10 | # Vim swap files 11 | *~ 12 | *.swp 13 | 14 | # Ruby 15 | .bundle 16 | /vendor/bundle 17 | /vendor/bin 18 | 19 | git-worktrees/* 20 | 21 | .solargraph.yml 22 | 23 | .cheats.d 24 | 25 | .jj 26 | 27 | aicontext 28 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/lualine.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-lualine/lualine.nvim", 4 | version = "*", 5 | event = "VeryLazy", 6 | config = require("utils").load("conf/lualine"), 7 | }, 8 | { 9 | "SmiteshP/nvim-navic", 10 | version = "*", 11 | config = require("utils").load("conf/navic"), 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /.direnvrc: -------------------------------------------------------------------------------- 1 | # Usage: `echo 'use aws_profile ' >> .envrc` 2 | use_aws_profile() { 3 | PROFILE=$1 4 | if test "$PROFILE" = ''; then 5 | printf "\033[31mMissing argument error: \`use aws_profile\`\n" 6 | return 7 | fi 8 | export $(aws-vault exec $PROFILE -- env | grep AWS_ | grep -v AWS_VAULT) 9 | } 10 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/init/toggleterm.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_user_command("TermFloat", function(opts) 2 | vim.fn.execute(opts.args .. "ToggleTerm direction=float") 3 | end, { nargs = "?" }) 4 | 5 | vim.api.nvim_create_user_command("TermBottom", function(opts) 6 | vim.fn.execute(opts.args .. "ToggleTerm direction=horizontal") 7 | end, { nargs = "?" }) 8 | -------------------------------------------------------------------------------- /.bin/aws-login: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | aws-login() { 4 | local profile=$(aws-vault list --profiles | fzf +m) 5 | 6 | if test -n "$profile"; then 7 | local url=$(aws-vault login $profile --stdout) 8 | echo "aws-vault login $profile" 9 | open $url 10 | else 11 | echo 'usage: aws-login ' 12 | fi 13 | } 14 | aws-login 15 | -------------------------------------------------------------------------------- /.config/zsh/tmpl/ghq.zsh: -------------------------------------------------------------------------------- 1 | # NOTE: must place before loading `$HOME/.config.local/zsh/zshrc 2 | export GHQ_ROOT="$HOME/.ghq" 3 | if (( ${+commands[ghq]} )); then 4 | if [[ -d "$GHQ_ROOT/github.com/masa0x80/dotfiles" ]]; then 5 | export DOTFILE="$GHQ_ROOT/github.com/masa0x80/dotfiles" 6 | else 7 | export DOTFILE="${DOTFILE:-$HOME/.dotfiles}" 8 | fi 9 | fi 10 | -------------------------------------------------------------------------------- /.bin/_select-wezterm-tab: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | SELECTED_TAB_ID=$(wezterm cli list --format json | jq -rc ".[] | if .pane_id != $WEZTERM_PANE then [.tab_id, .title, (.cwd | gsub(\"file://$HOME/\"; \"\"))] else empty end | join(\" \")" | fzf +m --with-nth 2,3 | cut -d " " -f 1) 4 | wezterm cli activate-tab --tab-index $1 5 | wezterm cli activate-tab --tab-id $SELECTED_TAB_ID 6 | -------------------------------------------------------------------------------- /.config/lazygit/config.yml: -------------------------------------------------------------------------------- 1 | git: 2 | paging: 3 | colorArg: always 4 | pager: delta --dark --paging=never 5 | gui: 6 | sidePanelWidth: 0.15 7 | theme: 8 | selectedLineBgColor: 9 | - underline 10 | selectedRangeBgColor: 11 | - underline 12 | refresher: 13 | refreshInterval: 3 14 | os: 15 | editPreset: "nvim-remote" 16 | editCommand: "nvim" 17 | -------------------------------------------------------------------------------- /.config/zsh/tmpl/navi.zsh: -------------------------------------------------------------------------------- 1 | __call_navi() { 2 | navi --path .cheats.d/:"$(navi info cheats-path)" --fzf-overrides --no-exact --print --query="$@" 3 | } 4 | 5 | navi-widget() { 6 | local result="$(__call_navi "$BUFFER" | perl -pe 'chomp if eof')" 7 | BUFFER="$result" 8 | zle end-of-line 9 | zle redisplay 10 | } 11 | zle -N navi-widget 12 | bindkey "^g^i" navi-widget 13 | -------------------------------------------------------------------------------- /.config/git/hooks/scripts/_lefthook: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if type lefthook > /dev/null 2>&1; then 4 | pj_root=$(git rev-parse --show-toplevel) 5 | [ ! -e "${pj_root}/lefthook.yml" ] && [ ! -e "${pj_root}/lefthook-local.yml" ] && exit 0 6 | 7 | lefthook run $@ 8 | lefthook_status=$? 9 | if test $lefthook_status -ne 0; then 10 | exit $lefthook_status 11 | fi 12 | fi 13 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/nvim-scrollbar.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "petertriho/nvim-scrollbar", 4 | version = "*", 5 | event = { "BufNewFile", "BufRead" }, 6 | config = require("utils").load("conf/nvim-scrollbar"), 7 | }, 8 | { 9 | "rapan931/lasterisk.nvim", 10 | version = "*", 11 | }, 12 | { 13 | "kevinhwang91/nvim-hlslens", 14 | version = "*", 15 | }, 16 | } 17 | -------------------------------------------------------------------------------- /.default-npm-packages: -------------------------------------------------------------------------------- 1 | yarn 2 | prettier 3 | textlint 4 | textlint-filter-rule-allowlist 5 | textlint-rule-preset-ja-spacing 6 | textlint-rule-doubled-spaces 7 | textlint-rule-no-zero-width-spaces 8 | textlint-rule-prh 9 | textlint-rule-terminology 10 | @textlint-rule/textlint-rule-no-invalid-control-character 11 | tsx 12 | markdown-table-formatter 13 | @nestjs/cli 14 | jsmigemo 15 | -------------------------------------------------------------------------------- /.bin/scrapbook_path: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # .config/nvim/lua/misc/todo.lua で使用するために `bin` 配下に置く 4 | scrapbook_path() { 5 | : "${SCRAPBOOK_DIR:=$HOME/.scrapbook}" 6 | local file_path="$SCRAPBOOK_DIR" 7 | test "$1" = '' || file_path+="/$1" 8 | local dir_path=$(dirname $file_path) 9 | test -d "$dir_path" || mkdir -p "$dir_path" 10 | echo "$file_path" 11 | } 12 | scrapbook_path "$1" 13 | -------------------------------------------------------------------------------- /.config/nvim/init.lua: -------------------------------------------------------------------------------- 1 | require("utils") 2 | 3 | require("config") 4 | require("misc") 5 | 6 | local load_if_exists = function(path) 7 | local p = string.format(vim.fn.expand("$HOME") .. "/.config.local/nvim/lua/%s", path) 8 | if vim.fn.filereadable(p) == 1 then 9 | vim.fn.execute("luafile " .. p) 10 | end 11 | end 12 | load_if_exists("config/local.lua") 13 | load_if_exists("misc/local.lua") 14 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/statuscol.lua: -------------------------------------------------------------------------------- 1 | local builtin = require("statuscol.builtin") 2 | require("statuscol").setup({ 3 | setopt = true, 4 | relculright = true, 5 | segments = { 6 | { text = { "%s" }, click = "v:lua.ScSa" }, 7 | { text = { builtin.foldfunc, " " }, click = "v:lua.ScFa", hl = "Comment" }, 8 | { text = { builtin.lnumfunc, " " }, click = "v:lua.ScLa" }, 9 | }, 10 | }) 11 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/mini_move.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-mini/mini.move", 3 | version = "*", 4 | event = "VeryLazy", 5 | opts = { 6 | mappings = { 7 | left = "H", 8 | right = "L", 9 | down = "J", 10 | up = "K", 11 | 12 | line_left = "", 13 | line_right = "", 14 | line_down = "", 15 | line_up = "", 16 | }, 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/init/Comment.lua: -------------------------------------------------------------------------------- 1 | local map = vim.api.nvim_set_keymap 2 | 3 | -- line-comment 4 | map("n", "", "gcc", { desc = "Toggle line-comment" }) 5 | map("v", "", "gc", { desc = "Toggle line-comment" }) 6 | 7 | -- block-comment 8 | map("n", "", "gbc", { desc = "Toggle block-comment" }) 9 | map("v", "", "gb", { desc = "Toggle block-comment" }) 10 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_style = space 8 | indent_size = 2 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [{Makefile,*.in,*.go,*.lua}] 15 | indent_style = tab 16 | indent_size = 4 17 | 18 | [{*.py,*.fish}] 19 | indent_style = space 20 | indent_size = 4 21 | -------------------------------------------------------------------------------- /.bin/current_dir: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # .config/nvim/lua/misc/todo.lua で使用するために `bin` 配下に置く 4 | current_dir() { 5 | local delimiter="${1:-/}" 6 | if test "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = 'true'; then 7 | local pwd=$(git rev-parse --show-toplevel) 8 | echo "$pwd:h:t$delimiter$pwd:t" 9 | else 10 | echo "$PWD:h:t$delimiter$PWD:t" 11 | fi 12 | } 13 | current_dir "$1" 14 | -------------------------------------------------------------------------------- /.bin/dinit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | dinit() { 4 | test -e .envrc && return 1 5 | 6 | echo >.envrc 7 | test -d vendor/bin && echo 'PATH_add vendor/bin' >>.envrc 8 | test -d node_modules/.bin && echo 'PATH_add node_modules/.bin' >>.envrc 9 | test -d bin && echo 'PATH_add bin' >>.envrc 10 | echo >>.envrc 11 | echo 'source_env_if_exists .envrc.local' >>.envrc 12 | direnv allow 13 | } 14 | dinit 15 | -------------------------------------------------------------------------------- /.config/git/hooks/scripts/prepare-commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -z "$2" ]; then 4 | mv "$1" "$1".tmp 5 | ISSUE_ID=$(git issue-id) 6 | if test -n "$ISSUE_ID"; then 7 | echo '' >"$1" 8 | echo '' >>"$1" 9 | if echo "$ISSUE_ID" | grep -q '-'; then 10 | echo "$ISSUE_ID" >>"$1" 11 | else 12 | echo "ref. #$ISSUE_ID" >>"$1" 13 | fi 14 | fi 15 | cat "$1.tmp" >>"$1" 16 | fi 17 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/kensaku-search.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "lambdalisue/kensaku-search.vim", 4 | version = "*", 5 | event = "VeryLazy", 6 | config = require("utils").load("conf/kensaku-search"), 7 | }, 8 | { 9 | "lambdalisue/kensaku.vim", 10 | version = "*", 11 | event = "VeryLazy", 12 | }, 13 | { 14 | "vim-denops/denops.vim", 15 | version = "*", 16 | event = "VeryLazy", 17 | }, 18 | } 19 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/markdown.lua: -------------------------------------------------------------------------------- 1 | vim.opt_local.comments = { "nb:>" } 2 | vim.opt_local.comments:append("nb:- [ ],nb:- [x],nb:- [-],nb:-") 3 | vim.opt_local.comments:append("nb:+ [ ],nb:+ [x],nb:+ [-],nb:+") 4 | vim.opt_local.comments:append("nb:* [ ],nb:* [x],nb:* [-],nb:*") 5 | vim.opt_local.comments:append("nb:1. [ ],nb:1. [x],nb:1.") 6 | vim.opt_local.comments:append("nb:1) [ ],nb:1) [x],nb:1)") 7 | vim.opt_local.formatoptions = "tqjro" 8 | -------------------------------------------------------------------------------- /scripts/navi: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | dir="$(navi info cheats-path)" 4 | mkdir -p "$dir" 5 | cd "$dir" || exit 1 6 | dir_name="masa0x80__cheats" 7 | test -d "$dir_name" || git clone https://github.com/masa0x80/cheats $dir_name 8 | 9 | while read -r d; do 10 | pushd "$d" || exit 1 11 | if test "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = 'true'; then 12 | git pull 13 | fi 14 | popd || exit 1 15 | done < <(fd --type d -d 1) 16 | -------------------------------------------------------------------------------- /scripts/brew_init: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # NOTE: NONINTERACTIVE=1 4 | # Suppress "Press RETURN to continue or any other key to abort" 5 | if ! type brew >/dev/null; then 6 | HOMEBREW_PREFIX='/opt/homebrew' NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 7 | eval "$(/opt/homebrew/bin/brew shellenv)" 8 | fi 9 | export HOMEBREW_NO_ANALYTICS=1 10 | brew update 11 | brew upgrade 12 | -------------------------------------------------------------------------------- /.config/nvim/snippets/component-diagrams.json: -------------------------------------------------------------------------------- 1 | { 2 | "startcomponent": { 3 | "prefix": "startcomponent", 4 | "body": [ 5 | "@startuml", 6 | "", 7 | "!theme mars", 8 | "top to bottom direction", 9 | "skinparam componentStyle rectangle", 10 | "remove @unlinked", 11 | "' skinparam linetype ortho", 12 | "' skinparam linetype polyline", 13 | "", 14 | "@enduml" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.config/zsh/tmpl/complete-ssh-host.zsh: -------------------------------------------------------------------------------- 1 | # ref: http://qiita.com/d6rkaiz/items/46e9c61c412c89e84c38 2 | complete-ssh-host() { 3 | local host="$(command grep -E -i '^Host\s+.+' $HOME/.ssh/config $(find $HOME/.ssh/conf.d -type f 2>/dev/null) | command grep -E -v '[*?]' | awk '{print $2}' | sort | fzf)" 4 | 5 | if [ ! -z "$host" ]; then 6 | LBUFFER+="$host" 7 | fi 8 | zle reset-prompt 9 | } 10 | zle -N complete-ssh-host 11 | bindkey '^gs' complete-ssh-host 12 | -------------------------------------------------------------------------------- /etc/vivaldi/style.css: -------------------------------------------------------------------------------- 1 | .UrlBar.toolbar.toolbar-mainbar { 2 | position: absolute; 3 | bottom: 0; 4 | width: 100%; 5 | } 6 | 7 | .UrlBar.toolbar.toolbar-droptarget.toolbar-mainbar { 8 | width: 155px; 9 | } 10 | 11 | .button-toolbar.newtab, 12 | .sync-and-trash-container { 13 | display: none; 14 | } 15 | 16 | #tabs-container, 17 | #webview-container { 18 | padding-bottom: 32px; 19 | } 20 | 21 | #webview-container ~ .StatusInfo { 22 | bottom: 38px; 23 | } 24 | -------------------------------------------------------------------------------- /.config/zsh/tmpl/prompt.zsh: -------------------------------------------------------------------------------- 1 | export STARSHIP_CONFIG1="$HOME/.config/starship.toml" 2 | export STARSHIP_CONFIG2="$HOME/.config/starship2.toml" 3 | 4 | _switch_starship_config() { 5 | echo -ne "\033]2;$(current_dir)\007" 6 | if [ "$STARSHIP_CONFIG" = "$STARSHIP_CONFIG1" ]; then 7 | STARSHIP_CONFIG="$STARSHIP_CONFIG2" 8 | else 9 | STARSHIP_CONFIG="$STARSHIP_CONFIG1" 10 | fi 11 | export STARSHIP_CONFIG 12 | } 13 | add-zsh-hook precmd _switch_starship_config 14 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/archive.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title Web Archive 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName 魚拓 10 | # @raycast.icon 📜 11 | # 12 | # @raycast.author KIMURA Masayuki 13 | 14 | CURRENT_DIR=$( 15 | cd "$(dirname "$0")" || exit 16 | pwd 17 | ) 18 | source "$CURRENT_DIR/utils/_fetch_url_and_page_title" 19 | 20 | open "https://archive.is/$url" 21 | -------------------------------------------------------------------------------- /.config/textlint/prh-rules.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | rules: 3 | - expected: " " 4 | pattern: "/[ ]/" 5 | 6 | - expected: ": " 7 | pattern: "/:\\s?/" 8 | 9 | - expected: "$1か$2" 10 | pattern: "/([\\d0-9一-十百千万億兆京])[ヶケ箇]([月所])/" 11 | 12 | - expected: "$1on$2" 13 | pattern: "/([\\dA-Z])-on-([\\dA-Z])/" 14 | 15 | - expected: "1on1" 16 | pattern: "/1 on 1/" 17 | 18 | - expected: "$1" 19 | pattern: "/([\\(()[  ]/" 20 | - expected: "$1" 21 | pattern: "/[  ]([\\))])/" 22 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/megalodon.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title Gyotaku [megalodon] 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName 魚拓 10 | # @raycast.icon 📜 11 | # 12 | # @raycast.author KIMURA Masayuki 13 | 14 | CURRENT_DIR=$( 15 | cd "$(dirname "$0")" || exit 16 | pwd 17 | ) 18 | source "$CURRENT_DIR/utils/_fetch_url_and_page_title" 19 | 20 | open "https://megalodon.jp/?url=$url" 21 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/mini_operators.lua: -------------------------------------------------------------------------------- 1 | require("mini.operators").setup({ 2 | evaluate = { 3 | prefix = "=", 4 | }, 5 | 6 | -- Exchange text regions 7 | exchange = { 8 | prefix = "x", 9 | reindent_linewise = true, 10 | }, 11 | 12 | -- Multiply (duplicate) text 13 | multiply = { 14 | prefix = "m", 15 | }, 16 | 17 | -- Replace text with register 18 | replace = { 19 | prefix = "r", 20 | }, 21 | 22 | -- Sort text 23 | sort = { 24 | prefix = "s", 25 | }, 26 | }) 27 | -------------------------------------------------------------------------------- /.bin/re: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | re() { 4 | local option="$(echo -e "--staged\n--worktree" | fzf +m --query="$@")" 5 | git -c color.status=always status -s -uno | fzf --preview 'F=$(echo {2..} | sed "s|\"\(.*\)\"|\1|"); \ 6 | [[ {} =~ "^M. " ]] && git diff --color=always --staged -- "$F" || \ 7 | [[ {} =~ "^D. " ]] && git diff --color=always --cached -- "$F" || \ 8 | git diff --color=always -- "$F"' --prompt="\$ git restore $option (git status -s -uno)> " | cut -c4- | xargs -I% git restore $option % 9 | } 10 | re "$@" 11 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/hover.lua: -------------------------------------------------------------------------------- 1 | require("hover").setup({ 2 | init = function() 3 | -- Require providers 4 | require("hover.providers.lsp") 5 | require("hover.providers.fold_preview") 6 | -- require('hover.providers.gh') 7 | -- require('hover.providers.gh_user') 8 | -- require('hover.providers.jira') 9 | -- require('hover.providers.dap') 10 | -- require('hover.providers.man') 11 | -- require('hover.providers.dictionary') 12 | end, 13 | preview_opts = { 14 | border = "rounded", 15 | }, 16 | preview_window = false, 17 | }) 18 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/toggleterm.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "akinsho/toggleterm.nvim", 3 | version = "*", 4 | cmd = { "ToggleTerm", "TermExec" }, 5 | keys = { 6 | { "" }, 7 | { 8 | "tf", 9 | "TermFloat", 10 | desc = "ToggleTerm direction=float", 11 | }, 12 | { 13 | "tb", 14 | "TermBottom", 15 | desc = "ToggleTerm direction=horizontal", 16 | }, 17 | }, 18 | init = require("utils").load("init/toggleterm"), 19 | config = require("utils").load("conf/toggleterm"), 20 | } 21 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/noice.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "folke/noice.nvim", 4 | version = "*", 5 | event = "VeryLazy", 6 | config = require("utils").load("conf/noice"), 7 | dependencies = { 8 | "rcarriga/nvim-notify", 9 | version = "*", 10 | keys = { 11 | { 12 | "un", 13 | function() 14 | require("notify").dismiss({ silent = true, pending = true }) 15 | end, 16 | desc = "Dismiss all Notifications", 17 | }, 18 | }, 19 | opts = { 20 | timeout = 10000, 21 | }, 22 | }, 23 | }, 24 | } 25 | -------------------------------------------------------------------------------- /.config/nvim/lua/misc/todo.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_user_command("Todo", function() 2 | vim.fn.execute(":e " .. vim.fn.trim(vim.fn.system("scrapbook_path $(current_dir)/todo.md"))) 3 | end, {}) 4 | vim.api.nvim_create_user_command("T", function() 5 | vim.fn.execute(":Todo") 6 | end, {}) 7 | 8 | vim.api.nvim_create_user_command("Memo", function() 9 | vim.fn.execute(":e " .. vim.fn.trim(vim.fn.system("scrapbook_path $(current_dir)/$(date +%Y-%m-%d).md"))) 10 | end, {}) 11 | vim.api.nvim_create_user_command("M", function() 12 | vim.fn.execute(":Memo") 13 | end, {}) 14 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/lsp.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "neovim/nvim-lspconfig", 4 | version = "*", 5 | event = { "VeryLazy", "BufReadPre" }, 6 | config = require("utils").load("conf/lsp"), 7 | }, 8 | { 9 | "williamboman/mason.nvim", 10 | version = "*", 11 | }, 12 | { 13 | "williamboman/mason-lspconfig.nvim", 14 | version = "*", 15 | }, 16 | { 17 | "folke/neodev.nvim", 18 | version = "*", 19 | }, 20 | { 21 | "nvimdev/lspsaga.nvim", 22 | version = "*", 23 | }, 24 | { 25 | "b0o/schemastore.nvim", 26 | version = "*", 27 | }, 28 | } 29 | -------------------------------------------------------------------------------- /.bin/startuptime-zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # ref. https://zenn.dev/yutakatay/articles/zsh-neovim-speedcheck 4 | startuptime-zsh() { 5 | local total_msec=0 6 | local msec 7 | local i 8 | for i in $(seq 1 10); do 9 | msec=$((TIMEFMT='%mE'; time zsh -i -c exit) 2>/dev/stdout >/dev/null) 10 | msec=$(echo $msec | tr -d "ms") 11 | echo "${(l:2:)i}: ${msec} [ms]" 12 | total_msec=$(( $total_msec + $msec )) 13 | done 14 | local average_msec 15 | average_msec=$(( ${total_msec} / 10 )) 16 | echo "\naverage: ${average_msec} [ms]" 17 | } 18 | startuptime-zsh 19 | -------------------------------------------------------------------------------- /.config/git/hooks/scripts/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PJ_ROOT=$(git rev-parse --show-cdup) 4 | 5 | if test -z "$DISABLE_RUBOCOP"; then 6 | if test -e "${PJ_ROOT}.rubocop.yml"; then 7 | bundle exec rubocop --parallel 8 | rubocop_status=$? 9 | if test $rubocop_status -ne 0; then 10 | exit $rubocop_status 11 | fi 12 | fi 13 | fi 14 | 15 | if test -z "$DISABLE_RSPEC"; then 16 | if test -d "${PJ_ROOT}spec/"; then 17 | bundle exec rspec 18 | rspec_status=$? 19 | if test $rspec_status -ne 0; then 20 | exit $rspec_status 21 | fi 22 | fi 23 | fi 24 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/github.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title GitHub 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName GitHub 10 | # @raycast.icon 🚀 11 | # 12 | # @raycast.description Open GitHub Org/Repository page 13 | # @raycast.author KIMURA Masayuki 14 | # 15 | # @raycast.argument1 { "type": "text", "placeholder": "Org", "optional": false } 16 | # @raycast.argument2 { "type": "text", "placeholder": "Repository", "optional": true } 17 | 18 | open "https://github.com/${1}/${2}" 19 | -------------------------------------------------------------------------------- /.bin/navi-init: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | navi-init() { 4 | test -d .cheats.d && return 1 5 | 6 | mkdir -p .cheats.d 7 | echo '% Local' >.cheats.d/_.cheat 8 | echo >>.cheats.d/_.cheat 9 | echo '# sample' >>.cheats.d/_.cheat 10 | echo 'echo ' >>.cheats.d/_.cheat 11 | echo >>.cheats.d/_.cheat 12 | echo '$ msg: echo -e "yes\\nno"' >>.cheats.d/_.cheat 13 | 14 | echo >>.cheats.d/_.cheat 15 | echo '# Create branch' >>.cheats.d/_.cheat 16 | echo 'git switch -c feature/XXX-_' >>.cheats.d/_.cheat 17 | 18 | echo 'CREATE .cheats.d/_.cheat' 19 | } 20 | navi-init 21 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/utils/_fetch_url_and_page_title: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | export LANG="ja_JP.UTF-8" 4 | url=$(osascript -e "tell application \"$TARGET_BROWSER\" to get URL of active tab of front window") 5 | title=$(osascript -e "tell application \"$TARGET_BROWSER\" to get title of active tab of front window") 6 | trimmedTitle="${title/GitHub - /}" 7 | trimmedTitle="${trimmedTitle#Amazon.[^: ]*: }" 8 | trimmedTitle="${trimmedTitle/: / : }" 9 | trimmedTitle="${trimmedTitle%% [-:||]*}" 10 | test "$trimmedTitle" = '' && trimmedTitle="$title" 11 | # 末尾スペースを削除 12 | trimmedTitle="${trimmedTitle% }" 13 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/toggleterm.lua: -------------------------------------------------------------------------------- 1 | require("toggleterm").setup({ 2 | open_mapping = [[]], 3 | direction = "horizontal", 4 | float_opts = { 5 | border = "curved", 6 | }, 7 | close_on_exit = true, 8 | }) 9 | 10 | local map = vim.keymap.set 11 | function _G.set_terminal_keymaps() 12 | local opts = { buffer = 0 } 13 | map("t", "", [[]], opts) 14 | end 15 | 16 | -- if you only want these mappings for toggle term use term://*toggleterm#* instead 17 | require("utils").create_autocmd({ "TermOpen" }, { 18 | pattern = "term://*", 19 | command = "lua set_terminal_keymaps()", 20 | }) 21 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/jorudan.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title Transfer norikae 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName Jorudan 10 | # @raycast.icon 🚂 11 | # 12 | # @raycast.description Open transfer guide 13 | # @raycast.author KIMURA Masayuki 14 | # 15 | # @raycast.argument1 { "type": "text", "placeholder": "駅1", "optional": true } 16 | # @raycast.argument2 { "type": "text", "placeholder": "駅2", "optional": true } 17 | 18 | open "https://www.jorudan.co.jp/norikae/cgi/nori.cgi?eki1=$1&eki2=$2" 19 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/hatena-bookmark.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title B! entry page 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName Hatena Bookmark 10 | # @raycast.icon images/bookmark-logo.png 11 | # 12 | # @raycast.description Jump to B! entry page about current page. 13 | # @raycast.author KIMURA Masayuki 14 | 15 | CURRENT_DIR=$( 16 | cd "$(dirname "$0")" || exit 17 | pwd 18 | ) 19 | source "$CURRENT_DIR/utils/_fetch_url_and_page_title" 20 | 21 | open "https://b.hatena.ne.jp/entry/s/${url//*:\/\//}" 22 | -------------------------------------------------------------------------------- /.bin/bk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | bk() { 4 | zparseopts -D -E -A optHash -- a -add d -del e:: -ext:: 5 | ext=${optHash[-e]:-$optHash[--ext]} 6 | 7 | if [[ -n "${optHash[(i)-d]}" ]] || [[ -n "${optHash[(i)--del]}" ]] ; then 8 | for v ($@); do 9 | mv "$v" "${v%.*}" 10 | done 11 | else 12 | if [ "$ext" = '' ]; then 13 | ext='bk' 14 | fi 15 | for v ($@); do 16 | new_name="${v}.${ext}" 17 | if [ -e "$new_name" ]; then 18 | echo "Error: $new_name exists" 19 | else 20 | mv "$v" "$new_name" 21 | fi 22 | done 23 | fi 24 | return 0 25 | } 26 | bk "$@" 27 | -------------------------------------------------------------------------------- /.config/nvim/lua/config/lazy.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 | if not vim.loop.fs_stat(lazypath) then 3 | vim.fn.system({ 4 | "git", 5 | "clone", 6 | "--filter=blob:none", 7 | "https://github.com/folke/lazy.nvim.git", 8 | "--branch=stable", -- latest stable release 9 | lazypath, 10 | }) 11 | end 12 | vim.opt.rtp:prepend(lazypath) 13 | 14 | require("lazy").setup("plugins", { 15 | defaults = { 16 | lazy = true, 17 | }, 18 | performance = { 19 | rtp = { 20 | disabled_plugins = { 21 | "netrwPlugin", 22 | "tohtml", 23 | "tutor", 24 | }, 25 | }, 26 | }, 27 | }) 28 | -------------------------------------------------------------------------------- /.config/wezterm/utils.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | function M.basename(s) 4 | return string.gsub(s, "(.*[/\\])(.*)", "%2") 5 | end 6 | 7 | function M.merge_tables(t1, t2) 8 | for k, v in pairs(t2) do 9 | if (type(v) == "table") and (type(t1[k] or false) == "table") then 10 | M.merge_tables(t1[k], t2[k]) 11 | else 12 | t1[k] = v 13 | end 14 | end 15 | return t1 16 | end 17 | 18 | function M.merge_lists(t1, t2) 19 | local result = {} 20 | for _, v in pairs(t1) do 21 | table.insert(result, v) 22 | end 23 | for _, v in pairs(t2) do 24 | table.insert(result, v) 25 | end 26 | return result 27 | end 28 | 29 | return M 30 | -------------------------------------------------------------------------------- /.bin/bt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | bt() { 4 | installed blueutil || return 1 5 | installed fzf || return 1 6 | 7 | local op=$(echo -e "connect\ndisconnect" | fzf +m) 8 | test -z "$op" && return 0 9 | if [ "$op" = "connect" ]; then 10 | local selected_mac=$(blueutil --paired --format json | jq -r '.[] | [.address, .name] | join(" ")' | fzf +m --with-nth=2.. | cut -d' ' -f1) 11 | else 12 | local selected_mac=$(blueutil --connected --format json | jq -r '.[] | [.address, .name] | join(" ")' | fzf +m --with-nth=2.. | cut -d' ' -f1) 13 | fi 14 | test -z "$selected_mac" && return 0 15 | blueutil --$op $selected_mac 16 | } 17 | bt 18 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/nvim-lint.lua: -------------------------------------------------------------------------------- 1 | local cspell = require("lint").linters.cspell 2 | cspell.args = { 3 | "lint", 4 | "--no-color", 5 | "--no-progress", 6 | "--no-summary", 7 | "--config", 8 | vim.fn.expand("$XDG_CONFIG_HOME" .. "/cspell/cspell.json"), 9 | } 10 | 11 | require("lint").linters_by_ft = { 12 | ["yaml.ghaction"] = { "actionlint" }, 13 | dockerfile = { "hadolint" }, 14 | zsh = { "shellcheck" }, 15 | } 16 | 17 | require("utils").create_autocmd({ "BufWritePost" }, { 18 | callback = function() 19 | require("lint").try_lint() 20 | require("lint").try_lint({ "cspell" }) 21 | end, 22 | }) 23 | 24 | require("plugins.nvim-lint.cspell") 25 | -------------------------------------------------------------------------------- /.config/.gitignore: -------------------------------------------------------------------------------- 1 | /* 2 | /.* 3 | 4 | !/.gitignore 5 | !/asdf 6 | !/bat 7 | !/cspell 8 | !/git 9 | !/ghostty 10 | !/lazygit 11 | !/markdownlint 12 | !/markdown-preview 13 | !/mise 14 | !/nvim 15 | !/pry 16 | !/ripgrep 17 | !/rubocop 18 | !/sheldon 19 | !/silicon 20 | !/textlint 21 | !/tmux 22 | !/wezterm 23 | !/zsh 24 | !/zabrze 25 | 26 | !/direnv 27 | /direnv/* 28 | !/direnv/direnvrc 29 | 30 | !/hub 31 | /hub/* 32 | !/hub/config.tmpl 33 | 34 | !/pgcli 35 | /pgcli/* 36 | !/pgcli/config 37 | 38 | !/karabiner 39 | /karabiner/* 40 | !/karabiner/karabiner.json 41 | !/karabiner/.editorconfig 42 | 43 | !/hadolint.yaml 44 | !/mise.toml 45 | !/starship.toml 46 | !/starship2.toml 47 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/ghe.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title GHE 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName GHE 10 | # @raycast.icon 🚀 11 | # 12 | # @raycast.description Open GHE Org/Repository page 13 | # @raycast.author KIMURA Masayuki 14 | # 15 | # @raycast.argument1 { "type": "text", "placeholder": "Org", "optional": false } 16 | # @raycast.argument2 { "type": "text", "placeholder": "Repository", "optional": true } 17 | 18 | if [ -z "$GHE_BASE_URL" ]; then 19 | echo "Error: GHE_BASE_URL not set." 20 | exit 1 21 | fi 22 | 23 | open "$GHE_BASE_URL/${1}/${2}" 24 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/img-clip.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "HakonHarnes/img-clip.nvim", 3 | version = "*", 4 | event = "VeryLazy", 5 | opts = { 6 | default = { 7 | relative_to_current_file = true, 8 | drag_and_drop = { 9 | enabled = true, 10 | insert_mode = true, 11 | }, 12 | }, 13 | filetypes = { 14 | markdown = { 15 | url_encode_path = false, 16 | template = function(context) 17 | local path = string.gsub(context.file_path, "/ ", "%%20") 18 | return "![" .. context.cursor .. "](" .. path .. ")" 19 | end, 20 | }, 21 | }, 22 | }, 23 | keys = { 24 | { "p", "PasteImage", desc = "Paste image from system clipboard" }, 25 | }, 26 | } 27 | -------------------------------------------------------------------------------- /.config/zsh/tmpl/git-add.zsh: -------------------------------------------------------------------------------- 1 | git-add() { 2 | IFS=$'\n' 3 | for f in $(git -c color.status=always status -s | fzf -m --query="$@" \ 4 | --preview 'F=$(echo {2..} | sed "s|\"\(.*\)\"|\1|"); 5 | [[ {1} = "??" ]] && bat --color=always "$F" || \ 6 | [[ {} =~ "^D. " ]] && git diff --color=always --cached -- "$F" || \ 7 | [[ {} =~ "^[MA]. " ]] && git diff --color=always --staged -- "$F" || \ 8 | git diff --color=always -- "$F"' | cut -c4-); do 9 | if [ "$BUFFER" = "" ]; then 10 | BUFFER="git add" 11 | fi 12 | f="./${f:Q}" 13 | BUFFER+=" ${f:q}" 14 | zle end-of-line 15 | zle accept-line 16 | done 17 | } 18 | zle -N git-add 19 | bindkey "^g^a" git-add 20 | -------------------------------------------------------------------------------- /.bin/lefthook: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$LEFTHOOK" = "0" ]; then 4 | exit 0 5 | fi 6 | 7 | # Disable lefthook install 8 | if [ "$1" = 'install' ]; then 9 | echo "** DISABLED **" 10 | exit 0 11 | fi 12 | 13 | if [ -t 1 ] ; then 14 | exec < /dev/tty ; # <- enables interactive shell 15 | fi 16 | 17 | lefthook_bin=$(brew --prefix lefthook)/bin/lefthook 18 | 19 | call_lefthook() { 20 | if $lefthook_bin -h >/dev/null 2>&1 21 | then 22 | $lefthook_bin $@ 23 | lefthook_status=$? 24 | if test $lefthook_status -ne 0; then 25 | exit $lefthook_status 26 | fi 27 | else 28 | echo "Can't find lefthook in PATH" 29 | fi 30 | } 31 | 32 | call_lefthook $@ 33 | _call_git_hook $@ 34 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/dial.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "monaqa/dial.nvim", 3 | version = "*", 4 | keys = { 5 | { "", "(dial-increment)", noremap = true }, 6 | { "", "(dial-decrement)", noremap = true }, 7 | { "g", "g(dial-increment)", noremap = true }, 8 | { "g", "g(dial-decrement)", noremap = true }, 9 | { "", "(dial-increment)", noremap = true, mode = "v" }, 10 | { "", "(dial-decrement)", noremap = true, mode = "v" }, 11 | { "g", "g(dial-increment)", noremap = true, mode = "v" }, 12 | { "g", "g(dial-decrement)", noremap = true, mode = "v" }, 13 | }, 14 | config = require("utils").load("conf/dial"), 15 | } 16 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/mini_bracketed.lua: -------------------------------------------------------------------------------- 1 | require("mini.bracketed").setup({ 2 | file = { suffix = "f", options = { wrap = false } }, 3 | oldfile = { suffix = "e", options = {} }, 4 | treesitter = { suffix = "n", options = {} }, 5 | }) 6 | 7 | local map = function(modes, lhs, rhs, opts) 8 | vim.keymap.set( 9 | modes, 10 | lhs, 11 | rhs, 12 | vim.tbl_extend("force", { 13 | noremap = true, 14 | silent = true, 15 | }, opts or {}) 16 | ) 17 | end 18 | map("n", "[t", "tabprevious", { desc = ":tabprev" }) 19 | map("n", "]t", "tabnext", { desc = ":tabnext" }) 20 | map("n", "[T", "tabfirst", { desc = ":tabfirst" }) 21 | map("n", "]T", "tablast", { desc = ":tablast" }) 22 | -------------------------------------------------------------------------------- /.bin/dc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | dc() { 4 | local project_name=$(current_dir -) 5 | local services='' 6 | if test "$1" = up; then 7 | local services=$(command ls | rg '(docker-)?compose(.local)?.ya?ml' | xargs yq eval -N '.services[] | path | .[-1] | select(. != "app")' *.y*ml | sort -u | fzf | tr '\n' ' ') 8 | test "$services" = '' && return 9 | fi 10 | 11 | local cmd="COMPOSE_PROJECT_NAME='$project_name' docker compose" 12 | for f in $(command ls | rg '(docker-)?compose.ya?ml'); do 13 | cmd+=" -f $f" 14 | done 15 | for f in $(command ls | rg '(docker-)?compose.local.ya?ml'); do 16 | cmd+=" -f $f" 17 | done 18 | echo "RUN: $cmd $@ $services" 19 | eval "$cmd $@ $services" 20 | } 21 | dc "$@" 22 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/neogen.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "danymat/neogen", 3 | version = "*", 4 | opts = {}, 5 | keys = { 6 | { 7 | "dF", 8 | "lua require('neogen').generate({ type = 'file' })", 9 | desc = "neogen: file", 10 | }, 11 | { 12 | "df", 13 | "lua require('neogen').generate({ type = 'func' })", 14 | desc = "neogen: func", 15 | }, 16 | { 17 | "dc", 18 | "lua require('neogen').generate({ type = 'class' })", 19 | desc = "neogen: class", 20 | }, 21 | { 22 | "dt", 23 | "lua require('neogen').generate({ type = 'type' })", 24 | desc = "neogen: type", 25 | }, 26 | }, 27 | config = require("utils").load("conf/neogen"), 28 | } 29 | -------------------------------------------------------------------------------- /.bin/_call_git_hook: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | hook_name="$2" 4 | 5 | script_root="${GIT_HOOK_DIR:-$(git config --get core.hookspath)}" 6 | 7 | if [ -n "$hook_name" ]; then 8 | # NOTE: DISABLEDフラグが落ちている場合は $script_root 配下のスクリプトを実行する 9 | DISABLED="$(echo "DISABLE_${hook_name}" | tr '[:lower:]' '[:upper:]' | tr '-' '_')" 10 | if [ "$(eval echo \$"$DISABLED")" = '' ]; then 11 | # Expand '~' 12 | script_root=$(bash -c "echo $script_root") 13 | hook_script="${script_root}/scripts/${hook_name}" 14 | if test -x "$hook_script"; then 15 | sh "$hook_script" $(echo $@ | cut -d" " -f3-) 16 | hook_status=$? 17 | if test $hook_status -ne 0; then 18 | exit $hook_status 19 | fi 20 | fi 21 | fi 22 | fi 23 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/git-messenger.lua: -------------------------------------------------------------------------------- 1 | local map = vim.keymap.set 2 | map("n", "", "(git-messenger)", { desc = "Show Git Log" }) 3 | 4 | require("utils").create_autocmd({ "FileType" }, { 5 | pattern = "gitmessengerpopup", 6 | callback = function() 7 | map("n", "", "o", { remap = true, buffer = true, desc = "GitMessenger: Back to older commit at the line" }) 8 | map( 9 | "n", 10 | "", 11 | "O", 12 | { remap = true, buffer = true, desc = "GitMessenger: Forward to newer commit at the line" } 13 | ) 14 | map("n", "", "", { remap = true, buffer = true, desc = "GitMessenger: Scroll Up" }) 15 | map("n", "", "", { remap = true, buffer = true, desc = "GitMessenger: Scroll Down" }) 16 | end, 17 | }) 18 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/nvim-scrollbar.lua: -------------------------------------------------------------------------------- 1 | local map = vim.keymap.set 2 | map("n", "*", function() 3 | require("lasterisk").search() 4 | require("hlslens").start() 5 | end) 6 | 7 | map({ "n", "x" }, "g*", function() 8 | require("lasterisk").search({ is_whole = false, silent = true }) 9 | require("hlslens").start() 10 | end) 11 | 12 | require("scrollbar").setup({ 13 | hide_if_all_visible = true, 14 | marks = { 15 | Search = { 16 | highlight = "Orange", 17 | }, 18 | }, 19 | excluded_filetypes = { 20 | "", 21 | "cmp_docs", 22 | "cmp_menu", 23 | "noice", 24 | "prompt", 25 | "TelescopePrompt", 26 | }, 27 | handlers = { 28 | search = true, -- Requires hlslens to be loaded, will run require("scrollbar.handlers.search").setup() for you 29 | }, 30 | }) 31 | -------------------------------------------------------------------------------- /.config/nvim/snippets/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "snippets", 3 | "contributes": { 4 | "snippets": [ 5 | { 6 | "language": [ 7 | "javascript", 8 | "javascriptreact", 9 | "typescript", 10 | "typescriptreact" 11 | ], 12 | "path": "react.json" 13 | }, 14 | { 15 | "language": [ 16 | "gitcommit", 17 | "jjdescription" 18 | ], 19 | "path": "gitcommit.json" 20 | }, 21 | { 22 | "language": [ 23 | "plantuml" 24 | ], 25 | "path": "gantt.json" 26 | }, 27 | { 28 | "language": [ 29 | "plantuml" 30 | ], 31 | "path": "component-diagrams.json" 32 | } 33 | ] 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/amazon-url-shortener.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title Amazon URL shortener [==] 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName Amazon 10 | # @raycast.icon ✂️ 11 | # 12 | # @raycast.description Amazon URL shortener 13 | # @raycast.author KIMURA Masayuki 14 | 15 | CURRENT_DIR=$( 16 | cd "$(dirname "$0")" || exit 17 | pwd 18 | ) 19 | source "$CURRENT_DIR/utils/_fetch_url_and_page_title" 20 | 21 | url="$(echo "$url" | sed 's|.*/\(dp/[^/?#]*\).*|https://www.amazon.co.jp/\1|')" 22 | osascript -e "tell application \"$TARGET_BROWSER\" to set URL of active tab of front window to \"$url\"" 23 | osascript -e "tell application \"$TARGET_BROWSER\" to activate" 24 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/delete-query.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title Delete query string [=?] 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName Browser 10 | # @raycast.icon ✂️ 11 | # 12 | # @raycast.description Delete query string 13 | # @raycast.author KIMURA Masayuki 14 | 15 | CURRENT_DIR=$( 16 | cd "$(dirname "$0")" || exit 17 | pwd 18 | ) 19 | source "$CURRENT_DIR/utils/_fetch_url_and_page_title" 20 | 21 | url=$(osascript -e "tell application \"$TARGET_BROWSER\" to get URL of active tab of front window") 22 | osascript -e "tell application \"$TARGET_BROWSER\" to set URL of active tab of front window to \"${url//\?*/}\"" 23 | osascript -e "tell application \"$TARGET_BROWSER\" to activate" 24 | -------------------------------------------------------------------------------- /.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", 3 | "Lua.diagnostics.disable": ["close-non-object", "missing-return"], 4 | "Lua.workspace.checkThirdParty": false, 5 | "color": { 6 | "mode": "SemanticEnhanced" 7 | }, 8 | "diagnostics": { 9 | "globals": ["vim"], 10 | "disable": ["close-non-object"], 11 | "ignoredFiles": "Opened", 12 | "libraryFiles": "Opened", 13 | "neededFileStatus": { 14 | "await-in-sync": "Any", 15 | "discard-returns": "Any", 16 | "not-yieldable": "Any", 17 | "undefined-field": "Any" 18 | } 19 | }, 20 | "format.enable": false, 21 | "hint": { 22 | "enable": true 23 | }, 24 | "workspace": { 25 | "maxPreload": 3600, 26 | "preloadFileSize": 3000 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/delete-hash.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title Delete url hash [=#] 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName Browser 10 | # @raycast.icon ✂️ 11 | # 12 | # Documentation: 13 | # @raycast.description Delete url hash 14 | # @raycast.author KIMURA Masayuki 15 | 16 | CURRENT_DIR=$( 17 | cd "$(dirname "$0")" || exit 18 | pwd 19 | ) 20 | source "$CURRENT_DIR/utils/_fetch_url_and_page_title" 21 | 22 | url=$(osascript -e "tell application \"$TARGET_BROWSER\" to get URL of active tab of front window") 23 | osascript -e "tell application \"$TARGET_BROWSER\" to set URL of active tab of front window to \"${url//\#*/}\"" 24 | osascript -e "tell application \"$TARGET_BROWSER\" to activate" 25 | -------------------------------------------------------------------------------- /.bin/bookmark: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | set -euo pipefail 4 | 5 | () { 6 | : ${BOOKMARKS_DIR:=$SCRAPBOOK_DIR/bookmarks} 7 | cd $BOOKMARKS_DIR 8 | rg_prefix='rg -i --files-with-matches' 9 | selected="$( 10 | FZF_DEFAULT_COMMAND="$rg_prefix ''" \ 11 | fzf --sort --preview="[[ ! -z {} ]] && rg --pretty --ignore-case -N --context 5 {q} {}" \ 12 | --bind=ctrl-u:page-up,ctrl-d:page-down,ctrl-j:preview-down,ctrl-k:preview-up,ctrl-g:toggle-all,ctrl-/:deselect-all,ctrl-q:deselect-all \ 13 | --phony -q "" \ 14 | --bind "change:reload:$rg_prefix {q}" \ 15 | --preview-window="90%:wrap" 16 | )" 17 | 18 | test -z "$selected" && return 19 | 20 | for f in $(echo $selected); do 21 | open $(head -n1 $(echo "$f" | cut -d: -f1) | sed -e 's|^# \[.*\](\(.*\)).*|\1|') 22 | done 23 | } 24 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/init/markdown-preview.lua: -------------------------------------------------------------------------------- 1 | vim.g.mkdp_filetypes = { "markdown", "mermaid", "plantuml" } 2 | vim.g.mkdp_theme = "light" 3 | vim.g.mkdp_markdown_css = vim.fn.expand("~/.config/markdown-preview/markdown.css") 4 | local default_options = { 5 | disable_sync_scroll = true, 6 | uml = { 7 | server = "http://127.0.0.1:8765", 8 | imageFormat = "svg", 9 | }, 10 | } 11 | vim.g.mkdp_preview_options = default_options 12 | 13 | vim.api.nvim_create_user_command("EnableMDPScroll", function() 14 | vim.g.mkdp_preview_options = vim.tbl_deep_extend("force", default_options, { disable_sync_scroll = false }) 15 | end, {}) 16 | vim.api.nvim_create_user_command("DisableMDPScroll", function() 17 | vim.g.mkdp_preview_options = vim.tbl_deep_extend("force", default_options, { disable_sync_scroll = true }) 18 | end, {}) 19 | -------------------------------------------------------------------------------- /.config/nvim/lua/config/_.lua: -------------------------------------------------------------------------------- 1 | vim.cmd([[ 2 | filetype plugin indent on 3 | syntax on 4 | ]]) 5 | 6 | vim.g.formatter_enabled = true 7 | vim.api.nvim_create_user_command("ToggleFormatter", function() 8 | vim.g.formatter_enabled = not vim.g.formatter_enabled 9 | if vim.g.formatter_enabled then 10 | vim.notify("Formatter enabled") 11 | else 12 | vim.notify("Formatter disabled") 13 | end 14 | end, { desc = "Toggle auto format enabled / disabled" }) 15 | vim.api.nvim_create_user_command("DisableFormatter", function() 16 | vim.g.formatter_enabled = false 17 | vim.notify("Formatter disabled") 18 | end, { desc = "Disalbe auto format" }) 19 | vim.api.nvim_create_user_command("EnableFormatter", function() 20 | vim.g.formatter_enabled = true 21 | vim.notify("Formatter enabled") 22 | end, { desc = "Enable auto format" }) 23 | -------------------------------------------------------------------------------- /.config/wezterm/color.lua: -------------------------------------------------------------------------------- 1 | -- https://github.com/navarasu/onedark.nvim/blob/master/lua/onedark/palette.lua 2 | 3 | local c = { 4 | fg = "#d3c6aa", 5 | red = "#e67e80", 6 | orange = "#e69875", 7 | yellow = "#dbbc7f", 8 | green = "#a7c080", 9 | aqua = "#83c092", 10 | blue = "#7fbbb3", 11 | purple = "#d699b6", 12 | grey0 = "#7a8478", 13 | grey1 = "#859289", 14 | grey2 = "#9da9a0", 15 | statusline1 = "#a7c080", 16 | statusline2 = "#d3c6aa", 17 | statusline3 = "#e67e80", 18 | none = "NONE", 19 | 20 | bg_dim = "#1e2326", 21 | bg0 = "#272e33", 22 | bg1 = "#2e383c", 23 | bg2 = "#374145", 24 | bg3 = "#414b50", 25 | bg4 = "#495156", 26 | bg5 = "#4f5b58", 27 | bg_visual = "#4c3743", 28 | bg_red = "#493b40", 29 | bg_green = "#3c4841", 30 | bg_blue = "#384b55", 31 | bg_yellow = "#45443c", 32 | } 33 | 34 | return c 35 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/google-translate.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title Translate entire page 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName Google Translate 10 | # @raycast.icon images/translate-logo.png 11 | # 12 | # @raycast.description Translates entire page 13 | # @raycast.author KIMURA Masayuki 14 | # 15 | # @raycast.argument1 { "type": "text", "placeholder": "Source (auto)", "optional": true } 16 | # @raycast.argument2 { "type": "text", "placeholder": "Target (ja)", "optional": true } 17 | 18 | CURRENT_DIR=$( 19 | cd "$(dirname "$0")" || exit 20 | pwd 21 | ) 22 | source "$CURRENT_DIR/utils/_fetch_url_and_page_title" 23 | 24 | open "https://translate.google.com/translate?js=n&sl=${1:-auto}&tl=${2:-ja}&u=$url" 25 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/telescope.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-telescope/telescope.nvim", 4 | version = "*", 5 | keys = { 6 | { "k", "Telescope kensaku", desc = "Search by [K]ensaku" }, 7 | 8 | { 9 | "E", 10 | "lua require('telescope._extensions.ghq_builtin').list()", 11 | desc = "Telescope ghq list", 12 | }, 13 | }, 14 | cmd = { "Telescope" }, 15 | config = require("utils").load("conf/telescope"), 16 | }, 17 | { 18 | "nvim-telescope/telescope-fzf-native.nvim", 19 | version = "*", 20 | build = "make", 21 | }, 22 | { 23 | "nvim-telescope/telescope-ghq.nvim", 24 | version = "*", 25 | }, 26 | { 27 | "nvim-telescope/telescope-dap.nvim", 28 | version = "*", 29 | }, 30 | { 31 | "Allianaab2m/telescope-kensaku.nvim", 32 | version = "*", 33 | }, 34 | } 35 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/markdown.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "tadmccorkle/markdown.nvim", 4 | version = "*", 5 | ft = { "markdown" }, 6 | config = require("utils").load("conf/markdown"), 7 | }, 8 | { 9 | "MeanderingProgrammer/render-markdown.nvim", 10 | version = "*", 11 | ft = { "markdown" }, 12 | config = require("utils").load("conf/render-markdown"), 13 | }, 14 | { 15 | "iamcco/markdown-preview.nvim", 16 | version = "*", 17 | build = function(plugin) 18 | if vim.fn.executable("npx") then 19 | vim.cmd("!cd " .. plugin.dir .. " && cd app && npx --yes yarn install") 20 | else 21 | vim.cmd([[Lazy load markdown-preview.nvim]]) 22 | vim.fn["mkdp#util#install"]() 23 | end 24 | end, 25 | ft = { "markdown", "mermaid", "plantuml" }, 26 | init = require("utils").load("init/markdown-preview"), 27 | }, 28 | } 29 | -------------------------------------------------------------------------------- /.config/zsh/tmpl/init.zsh: -------------------------------------------------------------------------------- 1 | setopt auto_cd 2 | setopt auto_pushd 3 | setopt auto_param_slash 4 | setopt auto_menu 5 | setopt cd_silent 6 | setopt pushd_ignore_dups 7 | setopt list_packed 8 | setopt list_types 9 | setopt auto_list 10 | setopt magic_equal_subst 11 | setopt brace_ccl 12 | setopt nolistbeep 13 | setopt extended_glob 14 | setopt interactive_comments 15 | setopt long_list_jobs 16 | setopt no_bg_nice 17 | setopt no_check_jobs 18 | setopt no_hup 19 | 20 | setopt correct 21 | 22 | bindkey -e 23 | 24 | if (( ! ${+HISTFILE} )) typeset -g HISTFILE=${ZDOTDIR:-${HOME}}/.zhistory 25 | HISTSIZE=30000 26 | SAVEHIST=30000 27 | 28 | setopt hist_ignore_all_dups 29 | setopt hist_expire_dups_first 30 | setopt hist_ignore_space 31 | setopt hist_verify 32 | setopt share_history 33 | 34 | autoload -Uz url-quote-magic 35 | 36 | ZSH_AUTOSUGGEST_STRATEGY=(history completion) 37 | -------------------------------------------------------------------------------- /.bin/totp: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | totp() { 4 | ns="${TOTP_NAMESPACE:-ns}" 5 | pass=$(passage master/password) 6 | if [ "$1" = "add" ]; then 7 | account="$2" 8 | TOTP_PASS="$pass" totp-cli add $ns $accont 9 | elif [ "$1" = "delete" ]; then 10 | selected=$2 11 | if [ "$selected" = "" ]; then 12 | selected=$(TOTP_PASS="$pass" totp-cli list $ns 2>/dev/null | cut -d. -f2 | fzf +m) 13 | fi 14 | if [ ! "$selected" = "" ]; then 15 | TOTP_PASS="$pass" totp-cli delete $ns $selected 16 | fi 17 | else 18 | selected=$1 19 | if [ "$selected" = "" ]; then 20 | selected=$(TOTP_PASS="$pass" totp-cli list $ns 2>/dev/null | cut -d. -f2 | fzf +m) 21 | fi 22 | if [ ! "$selected" = "" ]; then 23 | TOTP_PASS="$pass" totp-cli generate $ns $selected 2>/dev/null | tee >(pbcopy) 24 | fi 25 | fi 26 | } 27 | totp "$@" 28 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/init/telekasten.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_user_command("DeleteTodoMark", function(o) 2 | if o.range == 0 then 3 | pcall(function() 4 | vim.fn.execute("%s/- \\[[x -]\\] [0-9][0-9]:[0-9][0-9]–[0-9][0-9]:[0-9][0-9] /- /g") 5 | end) 6 | pcall(function() 7 | vim.fn.execute("%s/- \\[[x -]\\] <.*> /- /g") 8 | end) 9 | pcall(function() 10 | vim.fn.execute("%s/- \\[[x -]\\] /- /g") 11 | end) 12 | else 13 | pcall(function() 14 | vim.fn.execute( 15 | o.line1 .. "," .. o.line2 .. "s/- \\[[x -]\\] [0-9][0-9]:[0-9][0-9]–[0-9][0-9]:[0-9][0-9] /- /g" 16 | ) 17 | end) 18 | pcall(function() 19 | vim.fn.execute(o.line1 .. "," .. o.line2 .. "s/- \\[[x -]\\] <.*> /- /g") 20 | end) 21 | pcall(function() 22 | vim.fn.execute(o.line1 .. "," .. o.line2 .. "s/- \\[[x -]\\] /- /g") 23 | end) 24 | end 25 | vim.fn.execute("nohlsearch") 26 | end, { 27 | range = 2, 28 | }) 29 | -------------------------------------------------------------------------------- /.config/starship.toml: -------------------------------------------------------------------------------- 1 | continuation_prompt = '[❯❯ ](purple)' 2 | 3 | format = """ 4 | $username\ 5 | $hostname\ 6 | $directory\ 7 | $git_branch\ 8 | $git_state\ 9 | $git_status\ 10 | $cmd_duration\ 11 | $line_break\ 12 | $python\ 13 | $character""" 14 | 15 | [directory] 16 | style = "blue" 17 | 18 | [character] 19 | success_symbol = "[ミ:匚>](purple)" 20 | error_symbol = "[ミX匚>](red)" 21 | 22 | [git_branch] 23 | format = "[$branch]($style)" 24 | style = "green" 25 | 26 | [git_status] 27 | format = "[[($conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)" 28 | style = "cyan" 29 | stashed = "≡" 30 | 31 | [git_state] 32 | format = '\([$state( $progress_current/$progress_total)]($style)\) ' 33 | style = "green" 34 | 35 | [cmd_duration] 36 | format = "[$duration]($style) " 37 | style = "yellow" 38 | 39 | [python] 40 | format = "[$virtualenv]($style) " 41 | style = "bright-black" 42 | -------------------------------------------------------------------------------- /.config/starship2.toml: -------------------------------------------------------------------------------- 1 | continuation_prompt = '[❯❯ ](purple)' 2 | 3 | format = """ 4 | $username\ 5 | $hostname\ 6 | $directory\ 7 | $git_branch\ 8 | $git_state\ 9 | $git_status\ 10 | $cmd_duration\ 11 | $line_break\ 12 | $python\ 13 | $character""" 14 | 15 | [directory] 16 | style = "blue" 17 | 18 | [character] 19 | success_symbol = "[彡:匚>](purple)" 20 | error_symbol = "[彡X匚>](red)" 21 | 22 | [git_branch] 23 | format = "[$branch]($style)" 24 | style = "green" 25 | 26 | [git_status] 27 | format = "[[($conflicted$untracked$modified$staged$renamed$deleted)](218) ($ahead_behind$stashed)]($style)" 28 | style = "cyan" 29 | stashed = "≡" 30 | 31 | [git_state] 32 | format = '\([$state( $progress_current/$progress_total)]($style)\) ' 33 | style = "green" 34 | 35 | [cmd_duration] 36 | format = "[$duration]($style) " 37 | style = "yellow" 38 | 39 | [python] 40 | format = "[$virtualenv]($style) " 41 | style = "bright-black" 42 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/cj.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title Copy Current Page URL (JIRA) ;cj 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName Clipboard 10 | # @raycast.icon 📋 11 | # 12 | # @raycast.description This script copies URL of currently opened page into clipboard. 13 | # @raycast.author KIMURA Masayuki 14 | # 15 | # @raycast.argument1 { "type": "dropdown", "data": [{"title": "trimmedTitle", "value": "trim"}, {"title": "rawTitle", "value": "raw"}], "placeholder": "trimmedTitle", "optional": true } 16 | 17 | CURRENT_DIR=$( 18 | cd "$(dirname "$0")" || exit 19 | pwd 20 | ) 21 | source "$CURRENT_DIR/utils/_fetch_url_and_page_title" 22 | 23 | if [ "$1" = "raw" ]; then 24 | echo "[$title|$url]" | pbcopy 25 | else 26 | echo "[$trimmedTitle|$url]" | pbcopy 27 | fi 28 | echo "Copy Current Page URL (JIRA)" 29 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/ch.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title Copy Current Page URL (Human-readable) ;ch 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName Clipboard 10 | # @raycast.icon 📋 11 | # 12 | # @raycast.description This script copies URL of currently opened page clipboard. 13 | # @raycast.author KIMURA Masayuki 14 | # 15 | # @raycast.argument1 { "type": "dropdown", "data": [{"title": "trimmedTitle", "value": "trim"}, {"title": "rawTitle", "value": "raw"}], "placeholder": "trimmedTitle", "optional": true } 16 | 17 | CURRENT_DIR=$( 18 | cd "$(dirname "$0")" || exit 19 | pwd 20 | ) 21 | source "$CURRENT_DIR/utils/_fetch_url_and_page_title" 22 | 23 | if [ "$1" = "raw" ]; then 24 | echo "$title $url" | pbcopy 25 | else 26 | echo "$trimmedTitle $url" | pbcopy 27 | fi 28 | echo "Copy Current Page URL (Human-readable)" 29 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/cm.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title Copy Current Page URL (Markdown) ;cm 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName Clipboard 10 | # @raycast.icon 📋 11 | # 12 | # @raycast.description This script copies URL of currently opened page into clipboard. 13 | # @raycast.author KIMURA Masayuki 14 | # 15 | # @raycast.argument1 { "type": "dropdown", "data": [{"title": "trimmedTitle", "value": "trim"}, {"title": "rawTitle", "value": "raw"}], "placeholder": "trimmedTitle", "optional": true } 16 | 17 | CURRENT_DIR=$( 18 | cd "$(dirname "$0")" || exit 19 | pwd 20 | ) 21 | source "$CURRENT_DIR/utils/_fetch_url_and_page_title" 22 | 23 | if [ "$1" = "raw" ]; then 24 | echo "[$title]($url)" | pbcopy 25 | else 26 | echo "[$trimmedTitle]($url)" | pbcopy 27 | fi 28 | echo "Copy Current Page URL (Markdown)" 29 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/cp.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title Copy Current Page URL (PlantUML) ;cp 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName Clipboard 10 | # @raycast.icon 📋 11 | # 12 | # @raycast.description This script copies URL of currently opened page into clipboard. 13 | # @raycast.author KIMURA Masayuki 14 | # 15 | # @raycast.argument1 { "type": "dropdown", "data": [{"title": "trimmedTitle", "value": "trim"}, {"title": "rawTitle", "value": "raw"}], "placeholder": "trimmedTitle", "optional": true } 16 | 17 | CURRENT_DIR=$( 18 | cd "$(dirname "$0")" || exit 19 | pwd 20 | ) 21 | source "$CURRENT_DIR/utils/_fetch_url_and_page_title" 22 | 23 | if [ "$1" = "raw" ]; then 24 | echo "[[$url $title]]" | pbcopy 25 | else 26 | echo "[[$url $trimmedTitle]]" | pbcopy 27 | fi 28 | echo "Copy Current Page URL (PlantUML)" 29 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/ct.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title Copy Current Page URL (Textile) ;ct 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName Clipboard 10 | # @raycast.icon 📋 11 | # 12 | # @raycast.description This script copies URL of currently opened page into clipboard. 13 | # @raycast.author KIMURA Masayuki 14 | # 15 | # @raycast.argument1 { "type": "dropdown", "data": [{"title": "trimmedTitle", "value": "trim"}, {"title": "rawTitle", "value": "raw"}], "placeholder": "trimmedTitle", "optional": true } 16 | 17 | CURRENT_DIR=$( 18 | cd "$(dirname "$0")" || exit 19 | pwd 20 | ) 21 | source "$CURRENT_DIR/utils/_fetch_url_and_page_title" 22 | 23 | if [ "$1" = "raw" ]; then 24 | echo "\"$title\":$url" | pbcopy 25 | else 26 | echo "\"$trimmedTitle\":$url" | pbcopy 27 | fi 28 | echo "Copy Current Page URL (Textile)" 29 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/render-markdown.lua: -------------------------------------------------------------------------------- 1 | require("render-markdown").setup({ 2 | render_modes = { "n" }, 3 | heading = { 4 | position = "inline", 5 | icons = { "# ", "## ", "### ", "#### ", "##### ", "###### " }, 6 | signs = { "󰉴" }, 7 | }, 8 | code = { 9 | border = "thick", 10 | }, 11 | bullet = { 12 | icons = { "󱠦" }, 13 | highlight = "MarkdownBullet", 14 | }, 15 | checkbox = { 16 | unchecked = { 17 | icon = "󰄱", 18 | }, 19 | checked = { 20 | icon = "󰄵", 21 | }, 22 | custom = { 23 | todo = { 24 | raw = "[-]", 25 | rendered = "󰡖", 26 | highlight = "@markup.list.in_progress", 27 | }, 28 | }, 29 | }, 30 | pipe_table = { 31 | style = "normal", 32 | }, 33 | html = { 34 | comment = { 35 | text = "…snip…", 36 | }, 37 | }, 38 | win_options = { 39 | concealcursor = { 40 | default = vim.api.nvim_get_option_value("concealcursor", {}), 41 | rendered = "", 42 | }, 43 | }, 44 | }) 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dotfiles 2 | 3 | [![MIT LICENSE](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE) 4 | [![macOS](https://img.shields.io/badge/platform-macOS%20)](#installation) 5 | 6 | ## Overview 7 | 8 | ## Installation 9 | 10 | 好きなところにCloneして `make` を実行すると、 `$HOME` 配下にシンボリックリンクを張り、`brew` などを使って各種ツールのインストールを行います。 11 | 12 | ```sh 13 | git clone https://github.com/masa0x80/dotfiles.git ~/.dotfiles 14 | cd ~/.dotfiles 15 | make 16 | ``` 17 | 18 | ## After Installation 19 | 20 | ### Git Config 21 | 22 | デフォルトではGitの設定が行われません。 23 | 下記要領でファイルを準備して名前やメールアドレスの設定を行ってください。 24 | 25 | ```sh 26 | $ mkdir -p $HOME/.config.local/git 27 | $ cat < $HOME/.config.local/git/config 28 | [user] 29 | name = YOUR_NAME 30 | email = YOUR_EMAIL 31 | [core] 32 | hooksPath = ~/.config.local/git/hooks 33 | [url "git@github.com:"] 34 | insteadOf = https://github.com/ 35 | EOF 36 | ``` 37 | 38 | ref. 39 | -------------------------------------------------------------------------------- /.config/sheldon/plugins.toml: -------------------------------------------------------------------------------- 1 | shell = "zsh" 2 | 3 | [templates] 4 | defer = "{{ hooks?.pre | nl }}{% for file in files %}zsh-defer source \"{{ file }}\"\n{% endfor %}{{ hooks?.post | nl }}" 5 | 6 | [plugins.zsh-defer] 7 | github = "romkatv/zsh-defer" 8 | apply = ["source"] 9 | 10 | [plugins.fast-syntax-highlighting] 11 | github = "zdharma-continuum/fast-syntax-highlighting" 12 | apply = ["defer"] 13 | 14 | [plugins.zsh-autosuggestions] 15 | github = "zsh-users/zsh-autosuggestions" 16 | use = ["{{ name }}.zsh"] 17 | apply = ["defer"] 18 | 19 | [plugins.zsh-history-substring-search] 20 | github = "zsh-users/zsh-history-substring-search" 21 | apply = ["defer"] 22 | 23 | [plugins.jq-zsh-plugin] 24 | github = "reegnz/jq-zsh-plugin" 25 | apply = ["defer"] 26 | 27 | [plugins.zsh-completions] 28 | github = "zsh-users/zsh-completions" 29 | apply = ["defer"] 30 | 31 | [plugins.zsh-better-npm-completion] 32 | github = "masa0x80/zsh-better-npm-completion" 33 | apply = ["defer"] 34 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/add-bookmark.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title Add bookmark ;ab 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName Obsidian Bookmarks 10 | # @raycast.icon 🔖 11 | # 12 | # @raycast.description Save the web page as a bookmark in Obsidian 13 | # @raycast.author KIMURA Masayuki 14 | 15 | CURRENT_DIR=$( 16 | cd "$(dirname "$0")" || exit 17 | pwd 18 | ) 19 | source "$CURRENT_DIR/utils/_fetch_url_and_page_title" 20 | 21 | : ${BOOKMARKS_DIR:=$SCRAPBOOK_DIR/bookmarks} 22 | FILENAME=$(rg -l "^# \[.*\]\(${url:q}\)" $BOOKMARKS_DIR) 23 | if [ "$?" -eq 0 ]; then 24 | echo "ブックマーク済みです" 25 | else 26 | DATE=$(date +%Y-%m-%d) 27 | TIME=$(date +%H%M%S) 28 | FILENAME="${BOOKMARKS_DIR}/${DATE//-}${TIME}.md" 29 | 30 | echo "# [$title]($url) #bookmark" > $FILENAME 31 | fi 32 | 33 | open "obsidian://open?vault=${SCRAPBOOK_DIR:t}&file=${FILENAME:t:r}" 34 | -------------------------------------------------------------------------------- /.config/ghostty/config: -------------------------------------------------------------------------------- 1 | theme = Everforest Dark Hard 2 | 3 | font-family = "" 4 | font-family = Pending Mono HWNF 5 | font-size = 14 6 | alpha-blending = linear 7 | 8 | term = xterm-ghostty 9 | 10 | # custom-shader = ./shaders/cursor.glsl 11 | 12 | mouse-hide-while-typing 13 | 14 | window-theme = ghostty 15 | background-opacity = 0.85 16 | background-blur-radius = 18 17 | macos-non-native-fullscreen = true 18 | macos-option-as-alt = false 19 | macos-window-buttons = hidden 20 | macos-titlebar-style = hidden 21 | 22 | # quick-terminal 23 | quick-terminal-position = top 24 | quick-terminal-screen = mouse 25 | quick-terminal-animation-duration = 0 26 | 27 | keybind = cmd+enter=toggle_maximize 28 | 29 | keybind = shift+up=adjust_selection:up 30 | keybind = shift+down=adjust_selection:down 31 | keybind = shift+left=adjust_selection:left 32 | keybind = shift+right=adjust_selection:right 33 | 34 | keybind = ctrl+i=text:\x09 35 | 36 | keybind = global:ctrl+cmd+p=toggle_quick_terminal 37 | -------------------------------------------------------------------------------- /.config/nvim/lua/misc/age.lua: -------------------------------------------------------------------------------- 1 | local recipient = vim.fn.getenv("AGE_RECIPIENT") 2 | local identity = vim.fn.getenv("AGE_IDENTITY") 3 | 4 | if recipient ~= nil and identity ~= nil then 5 | require("utils").create_autocmd({ "BufReadPost", "FileReadPost" }, { 6 | pattern = "*.age", 7 | callback = function() 8 | vim.cmd(string.format("silent '[,']!rage --decrypt -i %s", identity)) 9 | vim.cmd("F") 10 | end, 11 | }) 12 | 13 | require("utils").create_autocmd({ "BufWritePre", "FileWritePre" }, { 14 | pattern = "*.age", 15 | callback = function() 16 | vim.cmd("normal! mz") 17 | vim.cmd(string.format("silent '[,']!rage --encrypt -r %s -a", recipient)) 18 | end, 19 | }) 20 | 21 | require("utils").create_autocmd({ "BufWritePost", "FileWritePost" }, { 22 | pattern = "*.age", 23 | callback = function() 24 | vim.cmd("silent undo") 25 | require("conform").format({ async = false, lsp_format = "fallback", range = nil }) 26 | vim.cmd("normal! `z") 27 | end, 28 | }) 29 | end 30 | -------------------------------------------------------------------------------- /.config/nvim/lua/misc/silicon.lua: -------------------------------------------------------------------------------- 1 | vim.api.nvim_create_user_command("Silicon", function(opts) 2 | local filetype = vim.api.nvim_eval("&filetype") 3 | if filetype == "" then 4 | filetype = "zsh" 5 | end 6 | local cmd = "silicon --to-clipboard -l " .. filetype .. " " 7 | if opts.range == 0 then 8 | cmd = cmd .. vim.fn.expand("%") 9 | else 10 | vim.fn.execute(opts.line1 .. "," .. opts.line2 .. "yank") 11 | cmd = cmd .. "--from-clipboard" 12 | end 13 | vim.fn.jobstart(cmd) 14 | print(cmd) 15 | end, { 16 | range = 2, 17 | }) 18 | 19 | vim.api.nvim_create_user_command("SiliconHighlight", function(opts) 20 | local filetype = vim.api.nvim_eval("&filetype") 21 | if filetype == "" then 22 | filetype = "zsh" 23 | end 24 | local cmd = "silicon --to-clipboard -l " .. filetype .. " " .. vim.fn.expand("%") 25 | if opts.range == 2 then 26 | cmd = cmd .. " --highlight-lines " .. opts.line1 .. "-" .. opts.line2 27 | end 28 | vim.fn.jobstart(cmd) 29 | print(cmd) 30 | end, { 31 | range = 2, 32 | }) 33 | -------------------------------------------------------------------------------- /etc/vimari/userSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "excludedUrls": "mail.google.com,calendar.google.com,outlook.office365.com", 3 | "linkHintCharacters": "fjdkslaghturieowpqpbnvmcxz", 4 | "detectByCursorStyle": false, 5 | "scrollSize": 150, 6 | "openTabUrl": "", 7 | "modifier": "", 8 | "smoothScroll": true, 9 | "scrollDuration": 25, 10 | "transparentBindings": true, 11 | "bindings": { 12 | "hintToggle": "f", 13 | "newTabHintToggle": "shift+f", 14 | "scrollUp": "k", 15 | "scrollDown": "j", 16 | "scrollLeft": "h", 17 | "scrollRight": "l", 18 | "scrollUpHalfPage": ["u", "ctrl+u", "ctrl+b"], 19 | "scrollDownHalfPage": ["d", "ctrl+d", "ctrl+f"], 20 | "goToPageTop": "g g", 21 | "goToPageBottom": "shift+g", 22 | "goToFirstInput": "g i", 23 | "goBack": "shift+h", 24 | "goForward": "shift+l", 25 | "reload": "r", 26 | "tabForward": ["w", "ctrl+n"], 27 | "tabBack": ["q", "ctrl+p"], 28 | "closeTab": ["x", "shift+d"], 29 | "openTab": "t" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/gitlinker.lua: -------------------------------------------------------------------------------- 1 | local map = vim.keymap.set 2 | map( 3 | "n", 4 | "ogY", 5 | 'lua require"gitlinker".get_buf_range_url("n", {action_callback = require"gitlinker.actions".open_in_browser})', 6 | { silent = true } 7 | ) 8 | map( 9 | "v", 10 | "ogY", 11 | 'lua require"gitlinker".get_buf_range_url("v", {action_callback = require"gitlinker.actions".open_in_browser})', 12 | { silent = true } 13 | ) 14 | map( 15 | "n", 16 | "ogr", 17 | 'lua require"gitlinker".get_repo_url({action_callback = require"gitlinker.actions".open_in_browser})', 18 | { silent = true } 19 | ) 20 | vim.api.nvim_create_user_command("GhOpenRepo", function() 21 | require("gitlinker").get_repo_url({ action_callback = require("gitlinker.actions").open_in_browser }) 22 | end, {}) 23 | vim.api.nvim_create_user_command("GhOpenFile", function() 24 | require("gitlinker").get_buf_range_url("n", { action_callback = require("gitlinker.actions").open_in_browser }) 25 | end, {}) 26 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/hop.lua: -------------------------------------------------------------------------------- 1 | local hop = require("hop") 2 | hop.setup({}) 3 | 4 | local map = require("utils").map 5 | map("", "", function() 6 | hop.hint_vertical() 7 | end, {}) 8 | 9 | local directions = require("hop.hint").HintDirection 10 | map("", "", "f", { remap = false }) 11 | map("", "", "F", { remap = false }) 12 | map("", "", "t", { remap = false }) 13 | map("", "", "T", { remap = false }) 14 | map("", "f", function() 15 | hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true }) 16 | end, { remap = true }) 17 | map("", "F", function() 18 | hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true }) 19 | end, { remap = true }) 20 | map("", "t", function() 21 | hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true, hint_offset = -1 }) 22 | end, { remap = true }) 23 | map("", "T", function() 24 | hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 }) 25 | end, { remap = true }) 26 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/navic.lua: -------------------------------------------------------------------------------- 1 | local lspkind = require("lspkind") 2 | local navic = require("nvim-navic") 3 | navic.setup({ 4 | icons = { 5 | File = lspkind.symbolic("File") .. " ", 6 | Module = lspkind.symbolic("Module") .. " ", 7 | Class = lspkind.symbolic("Class") .. " ", 8 | Method = lspkind.symbolic("Method") .. " ", 9 | Property = lspkind.symbolic("Property") .. " ", 10 | Field = lspkind.symbolic("Field") .. " ", 11 | Constructor = lspkind.symbolic("Constructor") .. " ", 12 | Enum = lspkind.symbolic("Enum") .. " ", 13 | Interface = lspkind.symbolic("Interface") .. " ", 14 | Function = lspkind.symbolic("Function") .. " ", 15 | Variable = lspkind.symbolic("Variable") .. " ", 16 | Constant = lspkind.symbolic("Constant") .. " ", 17 | EnumMember = lspkind.symbolic("EnumMember") .. " ", 18 | Struct = lspkind.symbolic("Struct") .. " ", 19 | Event = lspkind.symbolic("Event") .. " ", 20 | Operator = lspkind.symbolic("Operator") .. " ", 21 | }, 22 | lsp = { 23 | auto_attach = true, 24 | }, 25 | }) 26 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/git.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "dinhhuy258/git.nvim", 4 | version = "*", 5 | event = "VeryLazy", 6 | config = require("utils").load("conf/git"), 7 | }, 8 | { 9 | "akinsho/git-conflict.nvim", 10 | version = "*", 11 | opts = { 12 | highlights = { -- They must have background color, otherwise the default color will be used 13 | incoming = "NormalFloat", 14 | current = "NormalFloat", 15 | }, 16 | }, 17 | event = { "BufNewFile", "BufRead" }, 18 | }, 19 | { 20 | "rhysd/git-messenger.vim", 21 | version = "*", 22 | keys = { 23 | { "", desc = "Show Git Log" }, 24 | }, 25 | config = require("utils").load("conf/git-messenger"), 26 | init = require("utils").load("init/git-messenger"), 27 | }, 28 | { 29 | "ruifm/gitlinker.nvim", 30 | version = "*", 31 | event = "VeryLazy", 32 | config = require("utils").load("conf/gitlinker"), 33 | }, 34 | { 35 | "lewis6991/gitsigns.nvim", 36 | version = "*", 37 | event = { "BufNewFile", "BufRead" }, 38 | config = require("utils").load("conf/gitsigns"), 39 | }, 40 | } 41 | -------------------------------------------------------------------------------- /etc/brew/Brewfile.cask: -------------------------------------------------------------------------------- 1 | cask "1password" 2 | cask "alt-tab" 3 | cask "altair-graphql-client" 4 | cask "audacity" 5 | cask "box-drive" 6 | cask "chromedriver" 7 | cask "claude-code" 8 | cask "cleanshot" 9 | cask "deskpad" 10 | cask "devtoys" 11 | cask "docker" 12 | cask "figma" 13 | cask "finicky" 14 | cask 'google-earth-pro' 15 | cask "google-cloud-sdk" 16 | cask "ghostty" 17 | cask "itsycal" 18 | cask "jordanbaird-ice" 19 | cask "joplin" 20 | cask "karabiner-elements" 21 | cask "keycastr" 22 | cask "licecap" 23 | cask "logseq" 24 | cask "neovide" 25 | cask "obsidian" 26 | cask "slack" 27 | cask "raycast" 28 | cask "rectangle" 29 | cask "session-manager-plugin" 30 | cask "shortcat" 31 | cask "wezterm" 32 | cask "visual-studio-code" 33 | cask "vlc" 34 | 35 | cask "google-chrome" 36 | cask "vivaldi" 37 | cask "microsoft-edge" 38 | 39 | cask "font-biz-udpgothic" 40 | cask "font-udev-gothic-nf" 41 | 42 | cask "font-0xproto-nerd-font" 43 | 44 | cask "font-monaspace" 45 | tap "hanasuke/moralerspace" 46 | cask "font-moralerspace" 47 | 48 | tap "masa0x80/tap" 49 | cask "font-pending-mono-hwnf" 50 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/reopen.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title Reopen Current Page URL ;re 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName Browser 10 | # @raycast.icon 🔄 11 | # 12 | # @raycast.description This script reopen URL of currently opened page. 13 | # @raycast.author KIMURA Masayuki 14 | # 15 | # @raycast.argument1 { "type": "text", "placeholder": "Browser", "optional": true } 16 | 17 | CURRENT_DIR=$( 18 | cd "$(dirname "$0")" || exit 19 | pwd 20 | ) 21 | source "$CURRENT_DIR/utils/_fetch_url_and_page_title" 22 | 23 | if [ "$1" = "" ]; then 24 | open "$url" 25 | else 26 | case "$1" in 27 | "v" | "vivaldi" | "Vivaldi") 28 | browser="Vivaldi" 29 | ;; 30 | "e" | "edge" | "Edge" | "Microsoft Edge") 31 | browser="Microsoft Edge" 32 | ;; 33 | "c" | "chrome" | "Chrome" | "Google Chrome") 34 | browser="Google Chrome" 35 | ;; 36 | "s" | "safari" | "Safari") 37 | browser="Safari" 38 | ;; 39 | esac 40 | open -a "$browser" "$url" 41 | fi 42 | -------------------------------------------------------------------------------- /.config/pry/pryrc: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | Pry.config.prompt = Pry::Prompt.new( 4 | 'custom', 5 | 'my custom prompt', 6 | [ 7 | ->(_context, _nesting, _pry_instance) { "\e[33mpry>\e[0m " }, 8 | ->(_context, _nesting, _pry_instance) { " \e[33m| \e[0m" } 9 | ] 10 | ) 11 | 12 | Pry.commands.alias_command 'E', 'edit -m' 13 | if defined?(PryByebug) 14 | Pry.commands.alias_command 'fin', 'finish' 15 | Pry.commands.alias_command 'c', 'continue' 16 | Pry.commands.alias_command 's', 'step' 17 | Pry.commands.alias_command 'n', 'next' 18 | Pry.commands.alias_command 'u', 'up' 19 | Pry.commands.alias_command 'd', 'down' 20 | Pry.commands.alias_command 'f', 'frame' 21 | Pry.commands.alias_command 'w', 'whereami' 22 | end 23 | if defined?(PryRails) 24 | reload = Pry::CommandSet.new do 25 | command 'r', 'reload!' do 26 | TOPLEVEL_BINDING.eval('reload!') 27 | end 28 | end 29 | Pry.config.commands.import reload 30 | end 31 | 32 | ActiveRecord::Base.logger = Logger.new($stdout) if defined?(ActiveRecord) 33 | 34 | AwesomePrint.pry! if defined?(AwesomePrint) 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 KIMURA Masayuki 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 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/todo-comments.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/todo-comments.nvim", 3 | version = "*", 4 | opts = { 5 | highlight = { 6 | pattern = [[.*<(KEYWORDS):?\s]], 7 | }, 8 | search = { 9 | command = "rg", 10 | args = { 11 | "--color=never", 12 | "--no-heading", 13 | "--with-filename", 14 | "--line-number", 15 | "--column", 16 | "--hidden", 17 | }, 18 | pattern = [[\b(KEYWORDS):]], 19 | }, 20 | }, 21 | keys = { 22 | { 23 | "]c", 24 | function() 25 | require("todo-comments").jump_next() 26 | end, 27 | desc = "Next Todo Comment", 28 | }, 29 | { 30 | "[c", 31 | function() 32 | require("todo-comments").jump_prev() 33 | end, 34 | desc = "Previous Todo Comment", 35 | }, 36 | { 37 | "st", 38 | function() 39 | Snacks.picker.todo_comments({ hidden = true }) 40 | end, 41 | desc = "Todo", 42 | }, 43 | { 44 | "sT", 45 | function() 46 | Snacks.picker.todo_comments({ 47 | keywords = { "TODO", "FIX", "FIXME", "XXX" }, 48 | hidden = true, 49 | }) 50 | end, 51 | desc = "Todo/Fix/Fixme", 52 | }, 53 | }, 54 | } 55 | -------------------------------------------------------------------------------- /.config/mise.toml: -------------------------------------------------------------------------------- 1 | [tools] 2 | # https://github.com/rhysd/actionlint/tags 3 | actionlint = "latest" 4 | # https://github.com/aws/aws-sam-cli/releases 5 | aws-sam-cli = "latest" 6 | # https://github.com/99designs/aws-vault/tags 7 | aws-vault = "latest" 8 | # https://github.com/getsops/sops/tags 9 | sops = "v3.10.2" 10 | # https://github.com/neovim/neovim/releases 11 | neovim = "latest" 12 | 13 | # https://go.dev/dl/ 14 | go = "latest" 15 | 16 | # https://github.com/corretto/corretto-21/tags 17 | java = "corretto-21.0.4.7.1" 18 | # https://gradle.org/install/ 19 | gradle = "latest" 20 | # https://groovy.apache.org/download.html 21 | groovy = "latest" 22 | 23 | # https://nodejs.org/en/download 24 | node = "latest" 25 | # https://github.com/denoland/deno/tags 26 | deno = "latest" 27 | 28 | # https://www.python.org/downloads/ 29 | python = "latest" 30 | 31 | # https://www.ruby-lang.org/en/downloads/releases/ 32 | ruby = "latest" 33 | 34 | # https://github.com/rust-lang/rust/tags 35 | rust = "latest" 36 | 37 | # https://github.com/hashicorp/terraform/tags 38 | terraform = "latest" 39 | # https://github.com/terraform-docs/terraform-docs/tags 40 | terraform-docs = "latest" 41 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/git.lua: -------------------------------------------------------------------------------- 1 | require("git").setup({ 2 | default_mappings = false, -- NOTE: `quit_blame` and `blame_commit` are still merged to the keymaps even if `default_mappings = false` 3 | 4 | keymaps = { 5 | -- Open blame window 6 | blame = "gb", 7 | -- Close blame window 8 | quit_blame = "q", 9 | -- Open blame commit 10 | blame_commit = "", 11 | -- Quit blame commit 12 | quit_blame_commit = "q", 13 | -- Open file/folder in git repository 14 | browse = "go", 15 | -- Open pull request of the current branch 16 | open_pull_request = "gP", 17 | -- Create a pull request with the target branch is set in the `target_branch` option 18 | create_pull_request = "gn", 19 | -- Opens a new diff that compares against the current index 20 | diff = "gd", 21 | -- Close git diff 22 | diff_close = "gD", 23 | -- Revert to the specific commit 24 | revert = "gr", 25 | -- Revert the current file to the specific commit 26 | revert_file = "gR", 27 | }, 28 | -- Default target branch when create a pull request 29 | target_branch = "main", 30 | -- Enable winbar in all windows created by this plugin 31 | winbar = false, 32 | }) 33 | -------------------------------------------------------------------------------- /.bin/git-fzf: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | if [ "$1" = 'show' ]; then 4 | # fshow - git commit browser 5 | # ref: https://github.com/junegunn/fzf/wiki/Examples 6 | git log --color=always --graph \ 7 | --format="%C(auto)%h%d %s %C(blue)%cr %C(green)%cN" | \ 8 | fzf --no-sort --tiebreak=index +m \ 9 | --header 'Press CTRL-y to copy commit-hash into clipboard' \ 10 | --preview 'echo {} | rg -o \[a-f0-9\]\{7\} | head -1 | xargs -I % sh -c "git show --color=always %"' \ 11 | --bind "ctrl-y:execute-silent: (echo {} | rg -o \[a-f0-9\]\{7\} | head -1 | tr -d '\n' | pbcopy)" \ 12 | --bind "ctrl-m:execute: (echo {} | rg -o \[a-f0-9\]\{7\} | head -1 | xargs -I % sh -c 'git show --color=always %')" 13 | else 14 | git log --color=always --graph \ 15 | --format="%C(auto)%h%d %s %C(blue)%cr %C(green)%cN" | \ 16 | fzf --no-sort --tiebreak=index +m \ 17 | --header 'Press CTRL-y to copy commit-hash into clipboard' \ 18 | --preview 'echo {} | rg -o \[a-f0-9\]\{7\} | head -1 | xargs -I % sh -c "git show --color=always %"' \ 19 | --bind "ctrl-y:execute-silent: (echo {} | rg -o \[a-f0-9\]\{7\} | head -1 | tr -d '\n' | pbcopy)" \ 20 | | rg -o \[a-f0-9\]\{7\} 21 | fi 22 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/gx.lua: -------------------------------------------------------------------------------- 1 | ---@diagnostic disable-next-line: missing-fields 2 | require("gx").setup({ 3 | handlers = { 4 | plugin = true, 5 | github = true, 6 | brewfile = true, 7 | package_json = true, 8 | search = true, 9 | go = true, 10 | jira = { 11 | name = "jira", 12 | handle = function(mode, line, _) 13 | local ticket = require("gx.helper").find(line, mode, "(%u[%u%d]+-%d+)") 14 | local url_base = vim.env.JIRA_BASE_URL 15 | if url_base ~= nil and ticket and #ticket < 20 then 16 | return url_base .. ticket 17 | end 18 | end, 19 | }, 20 | rust = { 21 | name = "rust", 22 | filetype = { "toml" }, 23 | filename = "Cargo.toml", 24 | handle = function(mode, line, _) 25 | local crate = require("gx.helper").find(line, mode, "(%w+)%s-=%s") 26 | 27 | if crate then 28 | return "https://crates.io/crates/" .. crate 29 | end 30 | end, 31 | }, 32 | markdown_link = { 33 | name = "markdown_link", 34 | filetype = { "markdown" }, 35 | handle = function(mode, line, _) 36 | local url = 37 | require("gx.helper").find(line, mode, "%[[%w%W]+%]%((https?://[a-zA-Z%d_/%%%-%.~@\\+#=?&:]+)%)") 38 | 39 | if url then 40 | return url 41 | end 42 | end, 43 | }, 44 | }, 45 | }) 46 | -------------------------------------------------------------------------------- /.config/zsh/tmpl/key-bindings.zsh: -------------------------------------------------------------------------------- 1 | # Key bindings 2 | autoload -Uz smart-insert-last-word 3 | zle -N insert-last-word smart-insert-last-word 4 | # include words that is at least two characters long 5 | zstyle :insert-last-word match '*([[:alpha:]/\\]?|?[[:alpha:]/\\])*' 6 | bindkey "^]" insert-last-word 7 | 8 | # Shift-Tabで補完候補を逆順で選択する 9 | bindkey '^[[Z' reverse-menu-complete 10 | # Ctrl-oで補完候補を逆順で選択する 11 | bindkey '^O' reverse-menu-complete 12 | 13 | bindkey '^G^U' undo 14 | bindkey '^G^R' redo 15 | 16 | bindkey '^G^H' backward-word 17 | bindkey '^G^L' forward-word 18 | 19 | # reegnz/jq-zsh-plugin 20 | bindkey '^G^J' jq-complete 21 | 22 | bindkey '^G^P' history-substring-search-up 23 | bindkey '^G^N' history-substring-search-down 24 | 25 | # ref. [最近のzshrcとその解説](https://mollifier.hatenablog.com/entry/20090502/p1) 26 | # quote previous word in single or double quote 27 | autoload -U modify-current-argument 28 | _quote-previous-word-in-single() { 29 | modify-current-argument '${(qq)${(Q)ARG}}' 30 | zle vi-forward-blank-word 31 | } 32 | zle -N _quote-previous-word-in-single 33 | bindkey '^[s' _quote-previous-word-in-single 34 | 35 | _quote-previous-word-in-double() { 36 | modify-current-argument '${(qqq)${(Q)ARG}}' 37 | zle vi-forward-blank-word 38 | } 39 | zle -N _quote-previous-word-in-double 40 | bindkey '^[d' _quote-previous-word-in-double 41 | -------------------------------------------------------------------------------- /.config/zsh/tmpl/git-branch.zsh: -------------------------------------------------------------------------------- 1 | git-switch-local-branch() { 2 | local branch=$(git branch --color=always --format='%(refname:short)' --sort=-committerdate -l | fzf +m +s --preview 'git log --color=always --graph {1} --format="%C(auto)%h%d %s %C(blue)%cr %C(green)%cN"') 3 | if test -n "$branch"; then 4 | if test "$BUFFER" = ''; then 5 | BUFFER="git switch $branch" 6 | zle end-of-line 7 | zle accept-line 8 | else 9 | BUFFER="${LBUFFER}${branch}${RBUFFER}" 10 | CURSOR+=${#branch} 11 | zle redisplay 12 | fi 13 | fi 14 | } 15 | zle -N git-switch-local-branch 16 | bindkey "^g^b" git-switch-local-branch 17 | 18 | git-switch-remote-branch() { 19 | git fetch 20 | local branch=$(git branch --color=always --format='%(refname:short)' --sort=-committerdate -r | grep -Ev '^origin$' | fzf +m +s --query="$BUFFER" --preview 'git log --color=always --graph {1} --format="%C(auto)%h%d %s %C(blue)%cr %C(green)%cN"' | sed -e 's|origin/||') 21 | if test -n "$branch"; then 22 | git branch --format='%(refname:short)' --sort=-committerdate -l | grep -E -q "^${branch}$" 23 | if [ "$?" = 1 ]; then 24 | BUFFER="git switch -t origin/$branch" 25 | else 26 | BUFFER="git switch $branch" 27 | fi 28 | zle end-of-line 29 | zle accept-line 30 | fi 31 | } 32 | zle -N git-switch-remote-branch 33 | bindkey "^g^g^b" git-switch-remote-branch 34 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/dial.lua: -------------------------------------------------------------------------------- 1 | local augend = require("dial.augend") 2 | require("dial.config").augends:register_group({ 3 | default = { 4 | augend.integer.alias.decimal, 5 | augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.) 6 | augend.integer.alias.octal, 7 | augend.integer.alias.binary, 8 | augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.) 9 | augend.date.alias["%Y-%m-%d"], -- date (2022-02-19, etc.) 10 | augend.date.alias["%-m/%-d"], -- date (2/1, etc.) 11 | augend.date.alias["%H:%M"], -- date (01:28, etc.) 12 | augend.constant.alias.ja_weekday, 13 | augend.constant.alias.bool, 14 | augend.constant.new({ elements = { "let", "const" } }), 15 | augend.hexcolor.new({ 16 | case = "lower", 17 | }), 18 | augend.semver.alias.semver, 19 | augend.misc.alias.markdown_header, 20 | augend.date.new({ 21 | pattern = "%Y-%m", 22 | default_kind = "day", 23 | -- if true, it does not match dates which does not exist, such as 2022/05/32 24 | only_valid = true, 25 | -- if true, it only matches dates with word boundary 26 | word = false, 27 | }), 28 | augend.date.new({ 29 | pattern = "%Y/%m", 30 | default_kind = "day", 31 | -- if true, it does not match dates which does not exist, such as 2022/05/32 32 | only_valid = true, 33 | -- if true, it only matches dates with word boundary 34 | word = false, 35 | }), 36 | }, 37 | }) 38 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/telekasten.lua: -------------------------------------------------------------------------------- 1 | local home = vim.fn.expand("$SCRAPBOOK_DIR") 2 | require("telekasten").setup({ 3 | home = home, 4 | 5 | auto_set_filetype = false, 6 | 7 | dailies = ("%s/daily/%s"):format(home, os.date("%Y")), 8 | weeklies = ("%s/weekly/%s"):format(home, os.date("%Y")), 9 | templates = ("%s/templates"):format(home), 10 | 11 | template_new_note = ("%s/templates/new_note.md"):format(home), 12 | template_new_daily = ("%s/templates/daily.md"):format(home), 13 | template_new_weekly = ("%s/templates/weekly.md"):format(home), 14 | 15 | journal_auto_open = true, 16 | 17 | calendar_opts = { 18 | -- calendar week display mode: 1 .. 'WK01', 2 .. 'WK 1', 3 .. 'KW01', 4 .. 'KW 1', 5 .. '1' 19 | weeknm = 1, 20 | -- use monday as first day of week: 1 .. true, 0 .. false 21 | calendar_monday = 0, 22 | -- calendar mark: where to put mark for marked days: 'left', 'right', 'left-fit' 23 | calendar_mark = "left-fit", 24 | }, 25 | 26 | image_link_style = "markdown", 27 | image_subdir = "assets", 28 | extension = ".md", 29 | 30 | uuid_type = "%Y%m%d%H%M%S", 31 | uuid_sep = "-", 32 | 33 | tag_notation = "#tag", 34 | subdirs_in_links = true, 35 | 36 | follow_creates_nonexisting = true, 37 | dailies_create_nonexisting = true, 38 | weeklies_create_nonexisting = true, 39 | 40 | sort = "filename", 41 | new_note_location = "prefer_home", 42 | 43 | rename_update_links = true, 44 | 45 | find_command = { "rg", "--files", "--sortr", "created", "--glob=!**/*.age" }, 46 | }) 47 | -------------------------------------------------------------------------------- /etc/raycast/Snippets.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "name": "slackfont", "text": "/slackfont Pending Mono HWNF" }, 3 | { "name": "cm-feat", "text": "🎸 feat: " }, 4 | { "name": "cm-bug", "text": "🐛 bug: " }, 5 | { "name": "cm-fix", "text": "✏️ fix " }, 6 | { "name": "cm-shell", "text": "🐚 $ " }, 7 | { "name": "cm-docs", "text": "📚 docs: " }, 8 | { "name": "cm-style", "text": "💄 style: " }, 9 | { "name": "cm-refactor", "text": "💡 refactor: " }, 10 | { "name": "cm-perf", "text": "⚡ perf: " }, 11 | { "name": "cm-test", "text": "✅ test: " }, 12 | { "name": "cm-chore", "text": "🤖 chore: " }, 13 | { "name": "cm-move-rename", "text": "🚚 move " }, 14 | { "name": "cm-remove", "text": "🔥 remove: " }, 15 | { "name": "cm-ci", "text": "🎡 ci: " }, 16 | { "name": "cm-merge", "text": "💚 merge: " }, 17 | { "name": "cm-config", "text": "🔧 config: " }, 18 | { "name": "cm-tweaks", "text": "🩹 Tweaks" }, 19 | { "name": "cm-security", "text": "👮 security: " }, 20 | { "name": "cm-version", "text": "🔖 version: " }, 21 | { "name": "cm-wip", "text": "🚧 WIP" }, 22 | { "name": "cm-breaking-change", "text": "💥 BREAKING CHANGE: " }, 23 | { "name": "cm-hotfix", "text": "🚑️ Hotfix" }, 24 | { "name": "cm-pin", "text": "📌 Fix version" }, 25 | { "name": "cm-add", "text": "➕ Add dependencies" }, 26 | { "name": "cm-remove", "text": "➖ Remove dependencies" }, 27 | { "name": "cm-upgrade", "text": "⬆️ Upgrade dependencies" }, 28 | { "name": "cm-downgrade", "text": "⬇️ Downgrade dependencies" }, 29 | { "name": "cm-init", "text": "🌱 Initial commit" } 30 | ] 31 | -------------------------------------------------------------------------------- /.bin/git-review: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | () { 4 | local issue_id=${1:-$(git issue-id)} 5 | if test -n "$issue_id"; then 6 | git log --color=always --graph --grep $issue_id \ 7 | --format="%C(auto)%h%d %s %C(blue)%cr %C(green)%cN" | \ 8 | fzf --tac --no-sort --tiebreak=index +m \ 9 | --header 'Press CTRL-y to copy commit-hash into clipboard' \ 10 | --preview 'echo {} | rg -o \[a-f0-9\]\{7\} | head -1 | xargs -I % sh -c "git show --color=always %"' \ 11 | --bind "ctrl-y:execute-silent: (echo {} | rg -o \[a-f0-9\]\{7\} | head -1 | tr -d '\n' | pbcopy)" \ 12 | --bind "ctrl-m:execute: (echo {} | rg -o \[a-f0-9\]\{7\} | head -1 | xargs -I % sh -c 'git show --color=always %')" 13 | else 14 | commit_hash=$(git log --color=always --format="%C(auto)%h%d %s %C(blue)%cr %C(green)%cN" | fzf --no-sort --tiebreak=index +m --preview 'git show --color=always {1}' --bind "ctrl-y:execute-silent: (printf {1} | pbcopy)" | rg -o \[a-f0-9\]\{7\}) 15 | test -z "$commit_hash" && return 16 | 17 | num=$(git log --pretty="%h" | rg -n "$commit_hash" | cut -d : -f 1) 18 | git log --color=always --reverse -$num \ 19 | --format="%C(auto)%h%d %s %C(blue)%cr %C(green)%cN" | \ 20 | fzf --no-sort --tiebreak=index +m \ 21 | --header 'Press CTRL-y to copy commit-hash into clipboard' \ 22 | --preview 'git show --color=always {1}' \ 23 | --bind "ctrl-y:execute-silent: (printf {1} | pbcopy)" \ 24 | --bind "ctrl-m:execute: (echo {1} | xargs -I % sh -c 'git show --color=always %')" 25 | fi 26 | } "$1" 27 | -------------------------------------------------------------------------------- /.config/git/config: -------------------------------------------------------------------------------- 1 | [core] 2 | autocrlf = false 3 | excludesfile = ~/.config/git/ignore 4 | pager = gitpager 5 | hooksPath = ~/.config/git/hooks 6 | quotepath = false 7 | [init] 8 | defaultBranch = main 9 | [include] 10 | path = ~/.config.local/git/config 11 | [push] 12 | default = current 13 | [commit] 14 | verbose = true 15 | [merge] 16 | ff = false 17 | [fetch] 18 | prune = true 19 | [pull] 20 | rebase = true 21 | [rebase] 22 | autosquash = true 23 | [credential] 24 | helper = osxkeychain 25 | [pager] 26 | show = "gitpager --pattern='^(commit|added|deleted|modified):? '" 27 | log = "gitpager --pattern='^(commit|added|deleted|modified):? '" 28 | branch = cat 29 | difftool = true 30 | [color] 31 | diff = auto 32 | status = auto 33 | branch = auto 34 | interactive = auto 35 | [alias] 36 | initial-commit = commit --allow-empty -m 'Initial commit' 37 | issue-id = !git rev-parse --abbrev-ref @ | grep -Eo '([A-Z0-9_]+-[0-9]+|[0-9]*)' | head -n1 38 | current-branch = rev-parse --abbrev-ref HEAD 39 | default-branch = !git symbolic-ref refs/remotes/origin/HEAD | grep -oP 'refs/remotes/origin/\\K.*' 40 | fixup = !git commit --fixup $(git fzf) --no-verify 41 | delete-merged-branches = !git branch --no-color --merged | grep -E -v '^\\*|\\s(main|develop|master)$' | xargs git branch -d 42 | [ghq] 43 | root = ~/go/src 44 | root = ~/.ghq 45 | [harrow] 46 | disabled = true 47 | [diff] 48 | tool = difftastic 49 | [diff "sopsdiffer"] 50 | textconv = sops -d 51 | [difftool] 52 | prompt = false 53 | [difftool "difftastic"] 54 | cmd = difft "$LOCAL" "$REMOTE" 55 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/trouble.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/trouble.nvim", 3 | version = "*", 4 | cmd = { "Trouble" }, 5 | opts = { 6 | modes = { 7 | lsp = { 8 | win = { position = "right" }, 9 | }, 10 | }, 11 | }, 12 | keys = { 13 | { "vv", "Trouble diagnostics toggle", desc = "Diagnostics (Trouble)" }, 14 | { "vV", "Trouble diagnostics toggle filter.buf=0", desc = "Buffer Diagnostics (Trouble)" }, 15 | { "vs", "Trouble symbols toggle", desc = "Symbols (Trouble)" }, 16 | { "vS", "Trouble lsp toggle", desc = "LSP references/definitions/... (Trouble)" }, 17 | { "vL", "Trouble loclist toggle", desc = "Location List (Trouble)" }, 18 | { "vQ", "Trouble qflist toggle", desc = "Quickfix List (Trouble)" }, 19 | { 20 | "[v", 21 | function() 22 | if require("trouble").is_open() then 23 | require("trouble").prev({ skip_groups = true, jump = true }) 24 | else 25 | local ok, err = pcall(vim.cmd.cprev) 26 | if not ok then 27 | vim.notify(err, vim.log.levels.ERROR) 28 | end 29 | end 30 | end, 31 | desc = "Previous Trouble/Quickfix Item", 32 | }, 33 | { 34 | "]v", 35 | function() 36 | if require("trouble").is_open() then 37 | require("trouble").next({ skip_groups = true, jump = true }) 38 | else 39 | local ok, err = pcall(vim.cmd.cnext) 40 | if not ok then 41 | vim.notify(err, vim.log.levels.ERROR) 42 | end 43 | end 44 | end, 45 | desc = "Next Trouble/Quickfix Item", 46 | }, 47 | }, 48 | } 49 | -------------------------------------------------------------------------------- /.config/textlint/textlintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "preset-ja-spacing": { 4 | "ja-space-between-half-and-full-width": { 5 | "space": "never", 6 | "lintStyledNode": true 7 | }, 8 | "ja-no-space-around-parentheses": true, 9 | "ja-space-around-code": { 10 | "before": true, 11 | "after": true 12 | }, 13 | "ja-space-after-exclamation": false, 14 | "ja-space-after-question": false 15 | }, 16 | "doubled-spaces": true, 17 | "no-zero-width-spaces": true, 18 | "terminology": { 19 | "exclude": ["e2e"] 20 | }, 21 | "prh": { 22 | "rulePaths": ["~/.config/textlint/prh-rules.yaml"] 23 | }, 24 | "@textlint-rule/no-invalid-control-character": true 25 | }, 26 | "filters": { 27 | "allowlist": { 28 | "allow": [ 29 | "/\\[.*\\] /", 30 | "/ \\[.*\\]/", 31 | " of ", 32 | " at ", 33 | " to ", 34 | " on ", 35 | " in ", 36 | " for ", 37 | " by ", 38 | " from ", 39 | " with ", 40 | " w/ ", 41 | " without ", 42 | " w/o ", 43 | " as ", 44 | " vs ", 45 | " or ", 46 | " and ", 47 | " via ", 48 | "/!\\[\\](data:image.*)/", 49 | "/ x /", 50 | "/ x[0-9]+/", 51 | "/ ref\\. /", 52 | "/[a-zA-Z0-9]+-[0-9]+ /", 53 | "/ [-:][0-9],2}/", 54 | "/[-:][0-9]{2} /", 55 | "/ [/][0-9]{1,2}/", 56 | "/[/][0-9]{1,2} /", 57 | "/#.+ /", 58 | "/.+\\. /" 59 | ] 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /.config/cspell/cspell.json: -------------------------------------------------------------------------------- 1 | { 2 | "allowCompoundWords": true, 3 | "dictionaries": ["dotfiles", "dotfiles_local", "user", "vim", "ruby", "lua"], 4 | "dictionaryDefinitions": [ 5 | { 6 | "name": "dotfiles", 7 | "path": "~/.config/cspell/dotfiles.txt", 8 | "description": "dotfiles dictionary" 9 | }, 10 | { 11 | "name": "dotfiles_local", 12 | "path": "~/.config.local/cspell/local.txt", 13 | "description": "dotfiles.local dictionary" 14 | }, 15 | { 16 | "name": "user", 17 | "path": "~/.local/share/cspell/user.txt", 18 | "description": "User local dictionary" 19 | }, 20 | { 21 | "name": "lua", 22 | "path": "~/.local/share/cspell/lua.txt", 23 | "description": "Lua dictionary" 24 | }, 25 | { 26 | "name": "ruby", 27 | "path": "~/.local/share/cspell/ruby.txt", 28 | "description": "Ruby and RoR dictionary" 29 | }, 30 | { 31 | "name": "vim", 32 | "path": "~/.local/share/cspell/vim.txt", 33 | "description": "Vim Script dictionary" 34 | } 35 | ], 36 | "languageSettings": [ 37 | { 38 | "languageId": "*", 39 | "locale": "*", 40 | "ignoreRegExpList": ["/(?:tap|brew|cask) .*/", "/.*\\/.*/"] 41 | }, 42 | { 43 | "languageId": "lua", 44 | "locale": "*", 45 | "ignoreRegExpList": ["/require.*/", "/.*/", "/\\(.*\\)/"], 46 | "dictionaries": ["lua", "vim"] 47 | }, 48 | { 49 | "languageId": "vim", 50 | "locale": "*", 51 | "ignoreRegExpList": [], 52 | "dictionaries": ["vim"] 53 | } 54 | ] 55 | } 56 | -------------------------------------------------------------------------------- /scripts/gen-zshrc: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | tmpl_dir="$ZDOTDIR/tmpl" 4 | zsh_cache="$XDG_CACHE_HOME/zsh-cache.zsh" 5 | zshrc="$ZDOTDIR/.zshrc" 6 | 7 | echo -n > $zsh_cache 8 | 9 | # homebrew 10 | brew shellenv >> $zsh_cache 11 | source $zsh_cache 12 | 13 | # misc 14 | (( ${+commands[mise]} )) && mise activate zsh >> $zsh_cache 15 | (( ${+commands[fzf]} )) && fzf --zsh >> $zsh_cache 16 | (( ${+commands[direnv]} )) && direnv hook zsh >> $zsh_cache 17 | (( ${+commands[starship]} )) && starship init zsh >> $zsh_cache 18 | 19 | echo -n > $zshrc 20 | 21 | cat $tmpl_dir/init.zsh >> $zshrc 22 | 23 | # sheldon 24 | sheldon source >> $zshrc 25 | 26 | for file ( 27 | $tmpl_dir/check-envrc-exist.zsh(N) 28 | $tmpl_dir/check-local-git-config.zsh(N) 29 | $tmpl_dir/complete-ssh-host.zsh(N) 30 | $tmpl_dir/completion.zsh(N) 31 | $tmpl_dir/dotdot.zsh(N) 32 | $tmpl_dir/fzf.zsh(N) 33 | $tmpl_dir/ghq.zsh(N) 34 | $tmpl_dir/git-add.zsh(N) 35 | $tmpl_dir/git-branch.zsh(N) 36 | $tmpl_dir/key-bindings.zsh(N) 37 | $tmpl_dir/navi.zsh(N) 38 | $tmpl_dir/prompt.zsh(N) 39 | $tmpl_dir/r.zsh(N) 40 | 41 | # Load gcloud 42 | $HOMEBREW_PREFIX/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc(N) 43 | $HOMEBREW_PREFIX/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc(N) 44 | ) cat $file >> $zshrc 45 | 46 | # zabrze 47 | zabrze init --bind-keys >> $zshrc 48 | 49 | for file ( 50 | # Load local configurations 51 | $HOME/.config.local/zsh/zshrc(N) 52 | $HOME/.zshrc.local(N) 53 | ) cat $file >> $zshrc 54 | 55 | cat $tmpl_dir/local-bin.zsh >> $zshrc 56 | 57 | # zcompile 58 | for file ( 59 | $zshrc 60 | $HOME/.zshenv(N) 61 | $HOME/.config.local/zsh/zshenv(N) 62 | $HOME/.zshenv.local(N) 63 | ) zcompile $file 64 | -------------------------------------------------------------------------------- /etc/raycast/script-commands/cr.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # Required parameters: 4 | # @raycast.schemaVersion 1 5 | # @raycast.title Copy Current Page URL (Rich Text) ;cr 6 | # @raycast.mode silent 7 | # 8 | # Optional parameters: 9 | # @raycast.packageName Clipboard 10 | # @raycast.icon 📋 11 | # 12 | # @raycast.description This script copies URL of currently opened page into clipboard. 13 | # @raycast.author KIMURA Masayuki 14 | # 15 | # @raycast.argument1 { "type": "dropdown", "data": [{"title": "trimmedTitle", "value": "trim"}, {"title": "rawTitle", "value": "raw"}], "placeholder": "trimmedTitle", "optional": true } 16 | 17 | CURRENT_DIR=$( 18 | cd "$(dirname "$0")" || exit 19 | pwd 20 | ) 21 | source "$CURRENT_DIR/utils/_fetch_url_and_page_title" 22 | 23 | if [ "$1" = "raw" ]; then 24 | url="javascript:(()=>{const clipNode=document.createElement('a');const range=document.createRange();const sel=window.getSelection();clipNode.setAttribute('href',location.href);clipNode.innerText='$title';document.body.appendChild(clipNode);range.selectNode(clipNode);sel.removeAllRanges();sel.addRange(range);document.execCommand('copy',false,null);document.body.removeChild(clipNode);})();" 25 | else 26 | url="javascript:(()=>{const clipNode=document.createElement('a');const range=document.createRange();const sel=window.getSelection();clipNode.setAttribute('href',location.href);clipNode.innerText='$trimmedTitle';document.body.appendChild(clipNode);range.selectNode(clipNode);sel.removeAllRanges();sel.addRange(range);document.execCommand('copy',false,null);document.body.removeChild(clipNode);})();" 27 | fi 28 | osascript -e "tell application \"$TARGET_BROWSER\" to set URL of active tab of front window to \"$url\"" 29 | echo "Copy Current Page URL (Rich Text)" 30 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/mini_ai.lua: -------------------------------------------------------------------------------- 1 | local gen_ai_spec = require("mini.extra").gen_ai_spec 2 | require("mini.ai").setup({ 3 | custom_textobjects = { 4 | B = gen_ai_spec.buffer(), 5 | D = gen_ai_spec.diagnostic(), 6 | I = gen_ai_spec.indent(), 7 | L = gen_ai_spec.line(), 8 | N = gen_ai_spec.number(), 9 | }, 10 | }) 11 | 12 | local function mode_nx(keys) 13 | return { mode = "n", keys = keys }, { mode = "x", keys = keys } 14 | end 15 | local clue = require("mini.clue") 16 | clue.setup({ 17 | triggers = { 18 | -- Leader triggers 19 | mode_nx(""), 20 | 21 | -- Built-in completion 22 | { mode = "i", keys = "" }, 23 | 24 | -- `g` key 25 | mode_nx("g"), 26 | 27 | mode_nx(""), 28 | mode_nx(""), 29 | mode_nx(""), 30 | 31 | -- Marks 32 | mode_nx("'"), 33 | mode_nx("`"), 34 | 35 | -- Registers 36 | mode_nx('"'), 37 | { mode = "i", keys = "" }, 38 | { mode = "c", keys = "" }, 39 | 40 | -- Window commands 41 | { mode = "n", keys = "" }, 42 | 43 | -- bracketed commands 44 | { mode = "n", keys = "[" }, 45 | { mode = "n", keys = "]" }, 46 | 47 | -- `z` key 48 | mode_nx("z"), 49 | 50 | -- surround 51 | mode_nx("s"), 52 | 53 | -- text object 54 | { mode = "x", keys = "i" }, 55 | { mode = "x", keys = "a" }, 56 | { mode = "o", keys = "i" }, 57 | { mode = "o", keys = "a" }, 58 | 59 | -- option toggle (mini.basics) 60 | { mode = "n", keys = "m" }, 61 | }, 62 | 63 | clues = { 64 | -- Enhance this by adding descriptions for mapping groups 65 | clue.gen_clues.builtin_completion(), 66 | clue.gen_clues.g(), 67 | clue.gen_clues.marks(), 68 | clue.gen_clues.registers({ show_contents = true }), 69 | clue.gen_clues.z(), 70 | }, 71 | }) 72 | -------------------------------------------------------------------------------- /.config/wezterm/wezterm.lua: -------------------------------------------------------------------------------- 1 | local wezterm = require("wezterm") 2 | local utils = require("utils") 3 | local keys = require("keys") 4 | local mouse_bindings = require("mouse_bindings") 5 | require("on") 6 | 7 | local config = {} 8 | 9 | if wezterm.config_builder then 10 | config = wezterm.config_builder() 11 | end 12 | 13 | config.font = wezterm.font_with_fallback({ "Pending Mono HWNF", "Apple Color Emoji" }) 14 | -- config.harfbuzz_features = { "calt=1", "cv01=2", "cv02=1", "cv31=1", "liga=0" } 15 | config.text_background_opacity = 0.85 16 | config.font_size = 13.0 17 | config.adjust_window_size_when_changing_font_size = true 18 | -- config.cell_width = 0.9 19 | -- config.line_height = 1.0 20 | config.use_cap_height_to_scale_fallback_fonts = true 21 | 22 | config.color_scheme = "Everforest Dark (Gogh)" 23 | config.window_decorations = "RESIZE" 24 | config.use_fancy_tab_bar = false 25 | config.hide_tab_bar_if_only_one_tab = true 26 | config.show_new_tab_button_in_tab_bar = false 27 | config.tab_max_width = 64 28 | config.scrollback_lines = 10000 29 | config.macos_forward_to_ime_modifier_mask = "SHIFT|CTRL" 30 | config.switch_to_last_active_tab_when_closing_tab = true 31 | config.disable_default_key_bindings = true 32 | config.front_end = "WebGpu" 33 | config.status_update_interval = 1000 34 | config.initial_rows = 64 35 | config.initial_cols = 256 36 | config.window_padding = { 37 | left = 10, 38 | right = 5, 39 | top = 0, 40 | bottom = 0, 41 | } 42 | config.inactive_pane_hsb = { 43 | saturation = 0.9, 44 | brightness = 0.8, 45 | } 46 | config.default_cursor_style = "BlinkingBlock" 47 | config.enable_csi_u_key_encoding = true 48 | config.term = "wezterm" 49 | 50 | utils.merge_tables(config, keys) 51 | utils.merge_tables(config, mouse_bindings) 52 | 53 | return config 54 | -------------------------------------------------------------------------------- /.config/cspell/dotfiles.txt: -------------------------------------------------------------------------------- 1 | alexa 2 | atinit 3 | atload 4 | autocrlf 5 | awscli 6 | bashls 7 | blockf 8 | catimg 9 | cmdline 10 | coreutils 11 | corretto 12 | cword 13 | dbname 14 | deno 15 | devtoys 16 | direnvrc 17 | divx 18 | dont 19 | dosini 20 | dups 21 | easc 22 | endgantt 23 | enduml 24 | endwbs 25 | envrc 26 | epub 27 | fpath 28 | freee 29 | fuga 30 | gantt 31 | gdbm 32 | gibo 33 | gltd 34 | goimports 35 | gopath 36 | gopls 37 | grex 38 | gsub 39 | gyotaku 40 | hadolint 41 | hatena 42 | hhkb 43 | hoge 44 | honnef 45 | horiz 46 | httpie 47 | hygen 48 | iabbr 49 | ideco 50 | imgcat 51 | intellij 52 | iterm2 53 | itsycal 54 | jdtls 55 | jorudan 56 | jsdoc 57 | jsonls 58 | karabiner 59 | keycastr 60 | kimura 61 | klass 62 | lamy 63 | ldflags 64 | libuv 65 | linehl 66 | lspkind 67 | luarc 68 | luasnip 69 | masa 70 | masa0x80 71 | masayuki 72 | mdutil 73 | megalodon 74 | mycli 75 | nand 76 | navi 77 | neodev 78 | nestjs 79 | nisa 80 | nopaste 81 | noproxy 82 | norikae 83 | nvim 84 | oidc 85 | osascript 86 | osxkeychain 87 | pbcopy 88 | petertriho 89 | pgcli 90 | piyo 91 | plantuml 92 | plemol 93 | popd 94 | popen 95 | precmd 96 | protobuf 97 | pushd 98 | ripgreprc 99 | rubocop 100 | shfmt 101 | siri 102 | skinparam 103 | splatoon 104 | sprompt 105 | startgantt 106 | startuml 107 | startwbs 108 | stringio 109 | strs 110 | struct 111 | stylua 112 | tada 113 | terraformls 114 | textconv 115 | texthl 116 | tflint 117 | tldr 118 | tmpl 119 | udemy 120 | venv 121 | vimium 122 | virt_text 123 | wantedly 124 | webm 125 | wezterm 126 | zcompile 127 | zdotdir 128 | zhistory 129 | zicdreplay 130 | zicompinit 131 | zimfw 132 | zimrc 133 | zinit 134 | zinitrc 135 | zmodload 136 | zmodule 137 | zprof 138 | zstyle 139 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/colorscheme.lua: -------------------------------------------------------------------------------- 1 | require("everforest").setup({ 2 | transparent_background_level = 2, 3 | on_highlights = function(hl, palette) 4 | hl.ExtraWhiteSpace = { fg = palette.none, bg = palette.bg_blue } 5 | hl.MarkdownBullet = { fg = palette.grey1, bg = palette.none } 6 | hl.SnacksPickerDir = { fg = palette.grey1 } 7 | hl.SnacksPickerPathHidden = { fg = palette.grey1 } 8 | hl.SnacksPickerGitStatusUntracked = { fg = palette.purple } 9 | hl["@markup.strong.markdown_inline"] = { sp = palette.red, bold = true, underdouble = true } 10 | hl["@markup.strikethrough"] = { fg = palette.grey1, strikethrough = true } 11 | hl.FlashMatch = { fg = palette.grey1, underline = true } 12 | hl.FlashCurrent = { fg = palette.purple } 13 | hl.FlashLabel = { fg = palette.orange } 14 | hl.FlashBackdrop = { fg = palette.grey1 } 15 | hl.GitSignsCurrentLineBlame = { fg = palette.bg5 } 16 | hl.RenderMarkdownH1Bg = { bg = palette.bg1 } 17 | hl.RenderMarkdownH4Bg = { bg = palette.bg3 } 18 | hl.RenderMarkdownH5Bg = { bg = palette.bg2 } 19 | hl.CurrentWord = { underdotted = true } 20 | end, 21 | }) 22 | require("everforest").load() 23 | 24 | require("utils").create_autocmd({ "VimEnter", "WinEnter" }, { 25 | -- u00A0 ' ' no-break space 26 | -- u2000 ' ' en quad 27 | -- u2001 ' ' em quad 28 | -- u2002 ' ' en space 29 | -- u2003 ' ' em space 30 | -- u2004 ' ' three-per em space 31 | -- u2005 ' ' four-per em space 32 | -- u2006 ' ' six-per em space 33 | -- u2007 ' ' figure space 34 | -- u2008 ' ' punctuation space 35 | -- u2009 ' ' thin space 36 | -- u200A ' ' hair space 37 | -- u200B '​' zero-width space 38 | -- u202F ' ' narrow no-break space 39 | -- u3000 ' ' ideographic (zenkaku) space 40 | command = [[call matchadd('ExtraWhiteSpace', "[\u00A0\u2000-\u200B\u202F\u3000]")]], 41 | }) 42 | -------------------------------------------------------------------------------- /.config/tmux/theme.tmux: -------------------------------------------------------------------------------- 1 | # vim: ft=tmux 2 | 3 | # black #282c34 4 | # blue #7fbbb3 5 | # yellow #e69875 6 | # red #e67e80 7 | # white #d3c6aa 8 | # green #a7c080 9 | # visual_grey #343f44 10 | # comment_grey #475258 11 | 12 | set -g mode-style "fg=#d3c6aa,bg=#475258" 13 | 14 | set -g message-style "fg=#282c34,bg=#e69875" 15 | set -g message-command-style "fg=#282c34,bg=#e69875" 16 | 17 | set -g pane-border-style "fg=#343f44" 18 | set -g pane-active-border-style "fg=#475258" 19 | 20 | set -g status "on" 21 | set -g status-justify "left" 22 | 23 | set -g status-style "fg=#475258,bg=#282c34" 24 | 25 | set -g status-left-length "100" 26 | set -g status-right-length "100" 27 | 28 | set -g status-left-style NONE 29 | set -g status-right-style NONE 30 | 31 | set -g status-left "#[fg=#282c34,bg=#282c34,nobold,nounderscore,noitalics]" 32 | set -g status-right "#[fg=#282c34,bg=#282c34,nobold,nounderscore,noitalics]#[fg=#3e4452,bg=#282c34,nobold,nounderscore,noitalics]#[fg=#d3c6aa,bg=#3e4452] #(cd #{pane_current_path}; test \"$(git rev-parse --is-inside-work-tree 2>/dev/null)\" = 'true' && echo \" $(git branch --show-current) | \")%Y-%m-%d | %H:%M #[fg=#3e4452,bg=#282c34,nobold,nounderscore,noitalics]" 33 | 34 | setw -g window-status-activity-style "underscore,fg=#e69875,bg=#282c34" 35 | setw -g window-status-separator "" 36 | setw -g window-status-style "NONE,fg=#475258,bg=#282c34" 37 | setw -g window-status-format "#[fg=#343f44,bg=#282c34,nobold,nounderscore,noitalics]#[fg=#859289,bg=#343f44,bold]###I #W #F#[fg=#343f44,bg=#282c34,nobold,nounderscore,noitalics]" 38 | setw -g window-status-current-format "#[fg=#a7c080,bg=#282c34,nobold,nounderscore,noitalics]#[fg=#232a2e,bg=#a7c080,bold]###I #W #F#[fg=#a7c080,bg=#282c34,nobold,nounderscore,noitalics]" 39 | 40 | set -g status-position top 41 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/jaq.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "is0n/jaq-nvim", 4 | version = "*", 5 | opts = { 6 | cmds = { 7 | internal = { 8 | lua = "luafile %", 9 | vim = "source %", 10 | javascript = "TermExec cmd='node %'", 11 | python = "TermExec cmd='python %'", 12 | rust = "TermExec cmd='rustc % && $fileBase && rm $fileBase'", 13 | cpp = "TermExec cmd='g++ % -o $fileBase && $fileBase'", 14 | go = "TermExec cmd='go run %'", 15 | sh = "TermExec cmd='sh %'", 16 | markdown = "MarkdownPreviewWrapper", 17 | plantuml = "PlantUMLPreview", 18 | mermaid = "MarkdownPreview", 19 | }, 20 | }, 21 | }, 22 | keys = { 23 | { 24 | "x", 25 | function() 26 | if string.find(vim.fn.expand("%"), "_spec.rb$") ~= nil then 27 | require("jaq-nvim").setup({ 28 | cmds = { 29 | internal = { 30 | ruby = "TermExec cmd='rspec -f p %" .. ":" .. vim.fn.line(".") .. "'", 31 | }, 32 | }, 33 | }) 34 | elseif 35 | string.find(vim.fn.expand("%"), ".+spec.tsx?$") ~= nil 36 | or string.find(vim.fn.expand("%"), ".+test.tsx?$") ~= nil 37 | then 38 | local test_name = vim.fn.system( 39 | "head -n " 40 | .. vim.fn.line(".") 41 | .. " " 42 | .. vim.fn.expand("%") 43 | .. ' | tac | rg -o "(it|test|describe)\\(.(.*).," --replace "\\$2" | head -n1 | sed -e "s/\\\'\\"\\`/./g" | tr -d "\n"' 44 | ) 45 | require("jaq-nvim").setup({ 46 | cmds = { 47 | internal = { 48 | typescript = 'TermExec cmd="npm run test % --testNamePattern=' .. test_name .. '"', 49 | }, 50 | }, 51 | }) 52 | else 53 | require("jaq-nvim").setup({ 54 | cmds = { 55 | internal = { 56 | ruby = "TermExec cmd='ruby %'", 57 | typescript = "TermExec cmd='npx tsx %'", 58 | }, 59 | }, 60 | }) 61 | end 62 | vim.cmd("Jaq") 63 | end, 64 | desc = "QuickRun", 65 | }, 66 | }, 67 | }, 68 | } 69 | -------------------------------------------------------------------------------- /etc/brew/Brewfile: -------------------------------------------------------------------------------- 1 | tap "homebrew/services" 2 | 3 | brew "autoconf" 4 | brew "automake" 5 | brew "boost" 6 | brew "cmake" 7 | brew "coreutils" 8 | brew "curl" 9 | brew "gdbm" 10 | brew "gettext" 11 | brew "gnu-sed" 12 | brew "gnu-tar" 13 | brew "grep" 14 | brew "less" 15 | brew "llvm" 16 | brew "libgit2" 17 | brew "libsodium" 18 | brew "libyaml" 19 | brew "openssl" 20 | 21 | brew "blueutil" 22 | brew "fzf" 23 | brew "gibo" 24 | brew "git" 25 | brew "jo" 26 | brew "jq" 27 | brew "lsof" 28 | brew "mas" 29 | brew "tldr" 30 | brew "pass" 31 | brew "rsync" 32 | brew "watch" 33 | 34 | # NOTE diagrams 35 | # ref. https://diagrams.mingrammer.com/docs/getting-started/installation 36 | brew "graphviz" 37 | 38 | # NOTE: 3rd/images.nvim 39 | brew "imagemagick" 40 | # https://github.com/3rd/image.nvim/issues/91#issuecomment-2417623824 41 | brew "pkgconfig" 42 | 43 | # NOTE: HakonHarnes/img-clip.nvim 44 | brew "pngpaste" 45 | 46 | brew "mise" 47 | brew "direnv" 48 | 49 | brew "navi" 50 | 51 | brew "mysql-client" 52 | brew "postgresql" 53 | brew "redis" 54 | 55 | brew "neovim" 56 | 57 | brew "awscli" 58 | 59 | brew "bat" 60 | brew "dog" 61 | brew "eza" 62 | brew "fd" 63 | brew "git-delta" 64 | brew "difftastic" 65 | brew "ripgrep" 66 | brew "sd" 67 | brew "silicon" 68 | brew "grex" 69 | brew "rm-improved" 70 | 71 | brew "hub" 72 | brew "gh" 73 | brew "ghq" 74 | 75 | brew "csvq" 76 | 77 | brew "lazydocker" 78 | brew "dive" 79 | 80 | brew "pinentry-mac" 81 | 82 | brew "xh" 83 | brew "yq" 84 | 85 | brew "protobuf" 86 | 87 | tap "arkweid/lefthook" 88 | brew "lefthook" 89 | 90 | brew "markdownlint-cli2" 91 | 92 | # for telescope / telekasten 93 | brew "catimg" 94 | 95 | tap "ryooooooga/tap" 96 | brew "zabrze" 97 | 98 | tap "daipeihust/tap" 99 | brew "im-select" 100 | 101 | brew "mycli" 102 | brew "pgcli" 103 | 104 | brew "ical-buddy" 105 | brew "totp-cli" 106 | 107 | brew "lazygit" 108 | 109 | brew "rage" 110 | 111 | brew "starship" 112 | brew "sheldon" 113 | 114 | brew "vhs" 115 | brew "jj" 116 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-treesitter/nvim-treesitter", 4 | version = "*", 5 | event = "VeryLazy", 6 | build = ":TSUpdate", 7 | config = require("utils").load("conf/treesitter"), 8 | }, 9 | { 10 | "nvim-treesitter/nvim-treesitter-textobjects", 11 | version = "*", 12 | }, 13 | { 14 | "windwp/nvim-ts-autotag", 15 | version = "*", 16 | }, 17 | { 18 | "David-Kunz/treesitter-unit", 19 | version = "*", 20 | keys = { 21 | { "iu", ':lua require"treesitter-unit".select()', mode = "x" }, 22 | { "au", ':lua require"treesitter-unit".select(true)', mode = "x" }, 23 | { "iu", ':lua require"treesitter-unit".select()', mode = "o" }, 24 | { "au", ':lua require"treesitter-unit".select(true)', mode = "o" }, 25 | }, 26 | }, 27 | { 28 | "kiyoon/treesitter-indent-object.nvim", 29 | version = "*", 30 | keys = { 31 | { 32 | "ai", 33 | "lua require'treesitter_indent_object.textobj'.select_indent_outer()", 34 | mode = { "x", "o" }, 35 | desc = "Select context-aware indent (outer)", 36 | }, 37 | { 38 | "aI", 39 | "lua require'treesitter_indent_object.textobj'.select_indent_outer(true)", 40 | mode = { "x", "o" }, 41 | desc = "Select context-aware indent (outer, line-wise)", 42 | }, 43 | { 44 | "ii", 45 | "lua require'treesitter_indent_object.textobj'.select_indent_inner()", 46 | mode = { "x", "o" }, 47 | desc = "Select context-aware indent (inner, partial range)", 48 | }, 49 | { 50 | "iI", 51 | "lua require'treesitter_indent_object.textobj'.select_indent_inner(true)", 52 | mode = { "x", "o" }, 53 | desc = "Select context-aware indent (inner, entire range)", 54 | }, 55 | }, 56 | }, 57 | { 58 | "numToStr/Comment.nvim", 59 | version = "*", 60 | event = { "CursorHold", "CursorMoved", "ModeChanged" }, 61 | init = require("utils").load("init/Comment"), 62 | config = require("utils").load("conf/Comment"), 63 | }, 64 | { 65 | "JoosepAlviste/nvim-ts-context-commentstring", 66 | version = "*", 67 | }, 68 | } 69 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/copilot.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "zbirenbaum/copilot.lua", 4 | version = "*", 5 | cmd = "Copilot", 6 | event = "InsertEnter", 7 | config = require("utils").load("conf/copilot"), 8 | }, 9 | { 10 | "CopilotC-Nvim/CopilotChat.nvim", 11 | version = "*", 12 | opts = { 13 | system_prompt = [[ 14 | あなたはプロのソフトウェアエンジニアであり、以下のルールに従ってください: 15 | - コードの説明は簡潔かつ技術的に正確にしてください 16 | - 常に実践的なアドバイスを提供してください 17 | - バグの可能性やエッジケースを指摘してください 18 | - 質問に直接答え、余計な説明は避けてください 19 | ]], 20 | prompts = { 21 | Explain = "このコードを詳細に説明してください。 #buffer", 22 | Review = [[ 23 | このコードをレビューしてください。以下の点に注目してください: 24 | 1. パフォーマンスの問題 25 | 2. 脆弱性 26 | 3. コードの可読性とベストプラクティス 27 | 4. エラーハンドリング 28 | 5. リファクタリングの提案 29 | #buffer 30 | ]], 31 | Tests = "このコードの動作について簡潔に説明し、単体テストを作成してください。 #buffer", 32 | Refactor = "このコードをより明確で読みやすいものに改善してください。 #buffer", 33 | Fix = "このコードのエラーや問題を修正してください。 #buffer", 34 | }, 35 | window = { 36 | layout = "float", 37 | width = 0.8, 38 | height = 0.8, 39 | border = "rounded", 40 | }, 41 | show_help = true, 42 | }, 43 | build = "make tiktoken", 44 | event = "VeryLazy", 45 | keys = { 46 | { 47 | "cc", 48 | function() 49 | vim.ui.input({ 50 | prompt = "CopilotChat: ", 51 | default = "", 52 | }, function(text) 53 | if text == nil or text == "" then 54 | return 55 | else 56 | vim.cmd("CopilotChat " .. text) 57 | end 58 | end) 59 | end, 60 | desc = "CopilotChat", 61 | mode = { "n", "v" }, 62 | }, 63 | { "ce", "CopilotChatExplain", desc = "CopilotChat - Explain code", mode = { "n", "v" } }, 64 | { "cf", "CopilotChatFix", desc = "CopilotChat - Fix code", mode = { "n", "v" } }, 65 | { "ct", "CopilotChatTests", desc = "CopilotChat - Generate tests", mode = { "n", "v" } }, 66 | { "cr", "CopilotChatReview", desc = "CopilotChat - Review code", mode = { "n", "v" } }, 67 | { "cR", "CopilotChatRefactor", desc = "CopilotChat - Refactor code", mode = { "n", "v" } }, 68 | }, 69 | }, 70 | } 71 | -------------------------------------------------------------------------------- /.config/nvim/lua/utils.lua: -------------------------------------------------------------------------------- 1 | local M = {} 2 | 3 | -- augroup for this config file 4 | local augroup = vim.api.nvim_create_augroup("_", {}) 5 | 6 | -- wrapper function to use internal augroup 7 | M.create_autocmd = function(event, opts) 8 | vim.api.nvim_create_autocmd( 9 | event, 10 | vim.tbl_extend("force", { 11 | group = augroup, 12 | }, opts) 13 | ) 14 | end 15 | 16 | M.map = function(modes, lhs, rhs, opts) 17 | vim.keymap.set( 18 | modes, 19 | lhs, 20 | rhs, 21 | vim.tbl_extend("force", { 22 | noremap = true, 23 | silent = true, 24 | }, opts or {}) 25 | ) 26 | end 27 | 28 | M.preview = function(path) 29 | vim.fn.execute(string.format("!open '%s'", path)) 30 | end 31 | 32 | M.load = function(name) 33 | return function() 34 | local path = string.format(vim.fn.expand("$HOME") .. "/.config.local/nvim/lua/plugins/%s.lua", name) 35 | if vim.fn.filereadable(path) == 1 then 36 | vim.fn.execute("luafile " .. path) 37 | else 38 | require(string.format("plugins.%s", name)) 39 | end 40 | end 41 | end 42 | 43 | M.js_based_languages = { 44 | "typescript", 45 | "javascript", 46 | "typescriptreact", 47 | "javascriptreact", 48 | "vue", 49 | } 50 | 51 | M.hidden_formatters = { 52 | delete_single_space_before_marks = { 53 | command = "sed", 54 | args = { "s|\\(\\S\\) \\([。、)}]\\)|\\1\\2|g" }, 55 | }, 56 | delete_single_space_after_marks = { 57 | command = "sed", 58 | args = { "s|\\([。、({]\\) \\(\\S\\)|\\1\\2|g" }, 59 | }, 60 | delete_jira_status_icon = { 61 | command = "sed", 62 | args = { 63 | ("s|\\[!\\[\\](%s.*)\\(.*\\)\\](\\(\\S*\\)) - \\([^ ]*\\) [^ ]* \\?|[\\1 \\3](\\2)|g"):format( 64 | vim.fn.expand("$JIRA_BASE_URL"):gsub("/browse", "") 65 | ), 66 | }, 67 | }, 68 | format_jira_link = { 69 | command = "sed", 70 | args = { "s|\\[\\[\\(.*\\)\\] \\(.*\\)\\](\\(\\S*\\))|[\\1 \\2](\\3)|g" }, 71 | }, 72 | markdown_todo_format = { 73 | command = "sed", 74 | args = { "s|\\([-*+.)]\\) \\[\\]|\\1 [ ]|g" }, 75 | }, 76 | replace_ordered_list = { 77 | command = "sed", 78 | args = { "s|^\\(\\s*\\)[0-9]\\+[\\.)] |\\11. |g" }, 79 | }, 80 | markdown_table_formatter = { 81 | command = "markdown-table-formatter", 82 | args = { "$FILENAME" }, 83 | exit_codes = { 0, 1 }, 84 | stdin = false, 85 | }, 86 | injected = {}, 87 | } 88 | 89 | return M 90 | -------------------------------------------------------------------------------- /etc/vimium/vimium-options.json: -------------------------------------------------------------------------------- 1 | { 2 | "keyMappings": "unmap K\nunmap J\nunmap \n\nmap d removeTab\nmap u restoreTab\n\nmap R reload hard\n\nmap t Vomnibar.activateInNewTab\nmap O Vomnibar.activateEditUrl\nmap T Vomnibar.activateEditUrlInNewTab\nmap Vomnibar.activateTabSelection\n\nmap scrollPageUp\nmap scrollPageDown\nmap scrollFullPageUp\nmap scrollFullPageDown\nmap previousTab\nmap nextTab\nmap previousTab\nmap nextTab\nmap visitPreviousTab\nmap visitPreviousTab\n\nmap gp togglePinTab\n\nmap passNextKey\nmap \\ passNextKey count=999999", 3 | "linkHintCharacters": "fjdksla;ghtyrueiwoqpvncmx/z", 4 | "nextPatterns": "next,more,newer,>,›,→,»,≫,>>,次", 5 | "previousPatterns": "prev,previous,back,older,<,‹,←,«,≪,<<,前", 6 | "grabBackFocus": true, 7 | "searchEngines": "a: https://eow.alc.co.jp/search?q=%s ALC\ng: https://www.google.com/search?q=%s Google\ny: https://www.youtube.com/results?search_query=%s Youtube\nt: https://translate.google.co.jp/#auto/ja/%s Google Tralslation\nre: https://search.yahoo.co.jp/realtime/search?p=%s Y! リアルタイム検索\nwi: https://ja.wikipedia.org/w/index.php?search=%s Wikipedia\nmdn: https://developer.mozilla.org/ja/search?q=%s MDN\nnpm: https://www.npmjs.com/search?q=%s NPM\nam: https://www.amazon.co.jp/s?k=%s Amazon", 8 | "settingsVersion": "2.2.1", 9 | "userDefinedLinkHintCss": "div > .vimiumHintMarker {\n border: 1px solid silver !important;\n background: #333 !important;\n box-shadow: 0px 3px 7px 0px rgba(0, 0, 0, 0.3) !important;\n padding: 6px !important;\n}\n\ndiv > .vimiumHintMarker span {\n color: white !important;\n font-weight: bold !important;\n font-size: 16px !important;\n}\n\ndiv > .vimiumHintMarker > .matchingCharacter {\n color: gray !important;\n}", 10 | "exclusionRules": [ 11 | { 12 | "passKeys": "ukjopn/?d.vlxsyem!#rafzcg", 13 | "pattern": "https?://mail.google.com/*" 14 | }, 15 | { 16 | "passKeys": "njpkt1d2w3m4x5a6ycez/?", 17 | "pattern": "https?://calendar.google.com/*" 18 | }, 19 | { 20 | "passKeys": "ukjopn/?d.vlxsyem!#rafzcgUG", 21 | "pattern": "https?://outlook.office\\d{3}?.com/*" 22 | }, 23 | { 24 | "passKeys": "jklNP.,<>123456780cftim", 25 | "pattern": "https?://www.youtube.com/*" 26 | } 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/conform.lua: -------------------------------------------------------------------------------- 1 | local formatters = { 2 | textlint = { 3 | command = "textlint", 4 | args = { "--fix", "$FILENAME" }, 5 | stdin = false, 6 | }, 7 | markdownlint = { 8 | command = "markdownlint-cli2", 9 | args = { "--config", vim.fn.expand("$HOME/.config/markdownlint/.markdownlint.json"), "--fix", "$FILENAME" }, 10 | exit_codes = { 0, 1 }, 11 | stdin = false, 12 | }, 13 | } 14 | for k, v in pairs(require("utils").hidden_formatters) do 15 | formatters[k] = v 16 | end 17 | 18 | vim.api.nvim_create_user_command("Format", function(args) 19 | local range = nil 20 | if args.count ~= -1 then 21 | local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1] 22 | range = { 23 | start = { args.line1, 0 }, 24 | ["end"] = { args.line2, end_line:len() }, 25 | } 26 | end 27 | require("conform").format({ async = true, lsp_format = "fallback", range = range }) 28 | end, { range = true }) 29 | 30 | require("conform").setup({ 31 | formatters_by_ft = { 32 | ruby = { "rubocop" }, 33 | go = { "goimports" }, 34 | lua = { "stylua" }, 35 | luau = { "stylua" }, 36 | python = { "black" }, 37 | make = { "" }, 38 | markdown = { 39 | "delete_single_space_before_marks", 40 | "delete_single_space_after_marks", 41 | "delete_jira_status_icon", 42 | "format_jira_link", 43 | "markdown_todo_format", 44 | "replace_ordered_list", 45 | "textlint", 46 | "markdownlint", 47 | "markdown_table_formatter", 48 | }, 49 | sh = { "shfmt" }, 50 | text = { "textlint" }, 51 | 52 | javascript = { "prettier" }, 53 | javascriptreact = { "prettier" }, 54 | typescript = { "prettier" }, 55 | typescriptreact = { "prettier" }, 56 | vue = { "prettier" }, 57 | css = { "prettier" }, 58 | scss = { "prettier" }, 59 | less = { "prettier" }, 60 | html = { "prettier" }, 61 | json = { "prettier" }, 62 | jsonc = { "prettier" }, 63 | ["yaml.ghaction"] = { "prettier" }, 64 | yaml = { "prettier" }, 65 | graphql = { "prettier" }, 66 | ["*"] = { "injected" }, 67 | }, 68 | formatters = formatters, 69 | format_on_save = function() 70 | if not vim.g.formatter_enabled then 71 | return 72 | end 73 | return { 74 | lsp_format = "fallback", 75 | filter = function(client) 76 | return client.name ~= "ts_ls" 77 | end, 78 | } 79 | end, 80 | }) 81 | -------------------------------------------------------------------------------- /.config/nvim/lua/misc/markdown.lua: -------------------------------------------------------------------------------- 1 | local path = vim.fn.expand("$DOTFILE/etc/plantuml/compose.yaml") 2 | vim.api.nvim_create_user_command("StartPlantUmlServer", function() 3 | vim.system({ "docker", "compose", "-f", path, "up", "-d" }, { text = true }, function(obj) 4 | if obj.code ~= 0 then 5 | vim.notify(tostring(obj.code), "error", { render = "default", timeout = 10000 }) 6 | end 7 | end) 8 | end, {}) 9 | 10 | vim.api.nvim_create_user_command("StopPlantUmlServer", function() 11 | vim.system({ "docker", "compose", "-f", path, "down" }) 12 | end, {}) 13 | 14 | vim.api.nvim_create_user_command("MarkdownPreviewWrapper", function() 15 | vim.fn.execute("StartPlantUmlServer") 16 | vim.fn.execute("MarkdownPreview") 17 | end, {}) 18 | 19 | local tmp_dir = "/tmp/plantuml-viewer/" 20 | local port = "8766" 21 | local function writeSvg() 22 | local filename = vim.fn.expand("%:t") 23 | vim.fn.jobstart( 24 | "curl -H 'Content-Type: application/text; charset=UTF-8' --data-binary @" 25 | .. vim.fn.expand("%") 26 | .. " 'http://127.0.0.1:8765/svg/' > " 27 | .. tmp_dir 28 | .. "out.svg", 29 | { 30 | on_exit = function() 31 | vim.system({ "cp", tmp_dir .. "out.svg", tmp_dir .. filename .. ".svg" }) 32 | end, 33 | } 34 | ) 35 | end 36 | 37 | vim.api.nvim_create_user_command("PlantUMLPreview", function() 38 | vim.fn.execute("StartPlantUmlServer") 39 | local filename = vim.fn.expand("%:t") 40 | vim.system({ "mkdir", "-p", tmp_dir }) 41 | writeSvg() 42 | vim.system({ "cp", vim.fn.expand("$DOTFILE/etc/plantuml/viewer.html"), tmp_dir }) 43 | -- 前回起動したプロセスが残っていたらkill 44 | vim.system({ "pkill", "python", "-m", "http.server", port, "--directory", tmp_dir }):wait() 45 | vim.system({ "python", "-m", "http.server", port, "--directory", tmp_dir }) 46 | vim.system({ 47 | "open", 48 | "-n", 49 | "-a", 50 | vim.fn.expand("$TARGET_BROWSER"), 51 | "--args", 52 | "http://localhost:" .. port .. "/viewer.html?filename=" .. filename, 53 | }) 54 | local group = "PlantUMLPreview:" .. filename 55 | vim.api.nvim_create_augroup(group, { clear = true }) 56 | vim.api.nvim_create_autocmd({ "BufWritePost" }, { 57 | group = group, 58 | buffer = vim.fn.bufnr(), 59 | callback = writeSvg, 60 | }) 61 | end, {}) 62 | require("utils").create_autocmd({ "FileType" }, { 63 | pattern = "markdown", 64 | callback = function(args) 65 | require("editorconfig").config(args.buf) 66 | end, 67 | }) 68 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/gitsigns.lua: -------------------------------------------------------------------------------- 1 | require("gitsigns").setup({ 2 | signs = { 3 | add = { text = "+" }, 4 | change = { text = "│" }, 5 | delete = { text = "-" }, 6 | topdelete = { text = "-" }, 7 | changedelete = { text = "~" }, 8 | untracked = { text = "┆" }, 9 | }, 10 | current_line_blame = true, 11 | current_line_blame_opts = { 12 | virt_text = true, 13 | virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' 14 | delay = 0, 15 | ignore_whitespace = false, 16 | }, 17 | on_attach = function(bufnr) 18 | local gs = package.loaded.gitsigns 19 | 20 | local function map(mode, l, r, opts) 21 | opts = opts or {} 22 | opts.buffer = bufnr 23 | vim.keymap.set(mode, l, r, opts) 24 | end 25 | 26 | -- Navigation 27 | map("n", "]g", function() 28 | if vim.wo.diff then 29 | return "]g" 30 | end 31 | vim.schedule(function() 32 | gs.next_hunk() 33 | end) 34 | return "" 35 | end, { expr = true, desc = "Gitsigns: next_hunk" }) 36 | 37 | map("n", "[g", function() 38 | if vim.wo.diff then 39 | return "[g" 40 | end 41 | vim.schedule(function() 42 | gs.prev_hunk() 43 | end) 44 | return "" 45 | end, { expr = true, desc = "Gitsigns: prev_hunk" }) 46 | 47 | -- Actions 48 | map({ "n", "v" }, "gs", ":Gitsigns stage_hunk", { desc = "Gitsigns: stage_hunk" }) 49 | map({ "n", "v" }, "gr", ":Gitsigns reset_hunk", { desc = "Gitsigns: reset_hunk" }) 50 | map("n", "gu", gs.undo_stage_hunk, { desc = "Gitsigns: undo_stage_hunk" }) 51 | map("n", "gS", gs.stage_buffer, { desc = "Gitsigns: stage_buffer" }) 52 | map("n", "gR", gs.reset_buffer, { desc = "Gitsigns: reset_buffer" }) 53 | map("n", "gp", gs.preview_hunk, { desc = "Gitsigns: preview_hunk" }) 54 | map("n", "gd", gs.diffthis, { desc = "Gitsigns: diffthis" }) 55 | map("n", "gD", function() 56 | gs.diffthis("~") 57 | end, { desc = "Gitsigns: diffthis('~')" }) 58 | map("n", "gtd", gs.toggle_deleted, { desc = "Gitsigns: toggle_deleted" }) 59 | map("n", "gtb", gs.toggle_current_line_blame, { desc = "Gitsigns: toggle_current_line_blame" }) 60 | map("n", "gb", function() 61 | gs.blame_line({ full = true }) 62 | end, { desc = "Gitsigns: blame_line" }) 63 | 64 | -- Text object 65 | map({ "o", "x" }, "ih", ":Gitsigns select_hunk", { desc = "Gitsigns: select_hunk" }) 66 | end, 67 | }) 68 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/dap.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "mfussenegger/nvim-dap", 4 | version = "*", 5 | keys = { 6 | { 7 | "b", 8 | function() 9 | require("dap").toggle_breakpoint() 10 | end, 11 | noremap = true, 12 | desc = "DAP: Toggle Breakpoint", 13 | }, 14 | { 15 | "c", 16 | function() 17 | require("dap").continue() 18 | end, 19 | noremap = true, 20 | desc = "DAP: Continue", 21 | }, 22 | { 23 | "s", 24 | function() 25 | require("dap").step_into() 26 | end, 27 | noremap = true, 28 | desc = "DAP: Step Into", 29 | }, 30 | { 31 | "n", 32 | function() 33 | require("dap").step_over() 34 | end, 35 | noremap = true, 36 | desc = "DAP: Step Over", 37 | }, 38 | { 39 | "f", 40 | function() 41 | require("dap").step_out() 42 | end, 43 | noremap = true, 44 | desc = "DAP: Step Out", 45 | }, 46 | 47 | { 48 | "du", 49 | function() 50 | require("dapui").toggle() 51 | end, 52 | noremap = true, 53 | desc = "DAP: UI Open", 54 | }, 55 | }, 56 | config = require("utils").load("conf/dap"), 57 | }, 58 | { 59 | "nvim-neotest/nvim-nio", 60 | }, 61 | { 62 | "rcarriga/nvim-dap-ui", 63 | opts = { 64 | layouts = { 65 | { 66 | elements = { 67 | { 68 | id = "scopes", 69 | size = 0.25, 70 | }, 71 | { 72 | id = "breakpoints", 73 | size = 0.25, 74 | }, 75 | { 76 | id = "stacks", 77 | size = 0.25, 78 | }, 79 | { 80 | id = "watches", 81 | size = 0.25, 82 | }, 83 | }, 84 | position = "left", 85 | size = 48, 86 | }, 87 | { 88 | elements = { 89 | { 90 | id = "repl", 91 | size = 1, 92 | }, 93 | }, 94 | position = "bottom", 95 | size = 8, 96 | }, 97 | }, 98 | }, 99 | }, 100 | { 101 | "theHamsta/nvim-dap-virtual-text", 102 | opts = {}, 103 | }, 104 | { 105 | "microsoft/vscode-js-debug", 106 | build = "npm install --legacy-peer-deps --no-save && npx gulp vsDebugServerBundle && mv dist out", 107 | commit = "bc551bf4f87a6ef9330b28514bf7447cbbdb2a9e", 108 | }, 109 | { 110 | "mxsdev/nvim-dap-vscode-js", 111 | config = require("utils").load("conf/dap-vscode-js"), 112 | }, 113 | } 114 | -------------------------------------------------------------------------------- /.config/zsh/tmpl/fzf.zsh: -------------------------------------------------------------------------------- 1 | # 2 | # fzf 3 | # 4 | 5 | if (( ${+commands[fzf]} )); then 6 | export FZF_DEFAULT_OPTS='--ansi --reverse --extended --multi --cycle --bind=ctrl-u:page-up,ctrl-d:page-down,ctrl-j:preview-down,ctrl-k:preview-up,ctrl-g:toggle-all,ctrl-/:deselect-all,ctrl-q:deselect-all' 7 | FZF_DEFAULT_OPTS=$FZF_DEFAULT_OPTS' --color=fg:#d0d0d0,bg:#333333,hl:#5f87af --color=fg+:#d0d0d0,bg+:#262626,hl+:#61afef --color=info:#afaf87,prompt:#e06c75,pointer:#e5c07b --color=marker:#98c379,spinner:#aab2bf,header:#87afaf' 8 | 9 | if (( ${+commands[fd]} )); then 10 | export FZF_DEFAULT_COMMAND='command fd -c always -H --no-ignore-vcs -E .git -tf' 11 | export FZF_ALT_C_COMMAND='command fd -c always -H --no-ignore-vcs -E .git -td' 12 | FZF_CTRL_T_COMMAND=${FZF_DEFAULT_COMMAND} 13 | fi 14 | 15 | if (( ${+commands[bat]} )); then 16 | export FZF_CTRL_T_OPTS="--preview 'command bat --color=always --line-range :500 {}'" 17 | fi 18 | 19 | # if [ -n "$TMUX" ]; then 20 | # export FZF_TMUX_OPTS="-p 80% --border none" 21 | # alias fzf="fzf-tmux ${FZF_TMUX_OPTS-}" 22 | # fi 23 | 24 | if (( ${+commands[fd]} && ${+commands[bat]} )); then 25 | # CTRL-T - Paste the selected file path(s) into the command line 26 | __fsel() { 27 | local cmd="${FZF_CTRL_T_COMMAND}" 28 | setopt localoptions pipefail no_aliases 2> /dev/null 29 | local item 30 | eval "$cmd" | FZF_DEFAULT_OPTS="${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-}" fzf -m | while read item; do 31 | echo -n "${(q)item} " 32 | done 33 | local ret=$? 34 | echo 35 | return $ret 36 | } 37 | 38 | fzf-file-widget() { 39 | LBUFFER="${LBUFFER}$(__fsel)" 40 | local ret=$? 41 | zle reset-prompt 42 | return $ret 43 | } 44 | 45 | # ALT-C - cd into the selected directory 46 | fzf-cd-widget() { 47 | local cmd="${FZF_ALT_C_COMMAND}" 48 | setopt localoptions pipefail no_aliases 2> /dev/null 49 | local dir="$(eval "$cmd" | FZF_DEFAULT_OPTS="${FZF_DEFAULT_OPTS-} ${FZF_ALT_C_OPTS-}" fzf +m)" 50 | if [[ "$dir" = '' ]]; then 51 | zle reset-prompt 52 | return 0 53 | fi 54 | LBUFFER="${LBUFFER}${(q)dir}" 55 | local ret=$? 56 | zle reset-prompt 57 | return $ret 58 | } 59 | 60 | fzf-t-widget() { 61 | if test "$LBUFFER" = "cd "; then 62 | fzf-cd-widget 63 | else 64 | fzf-file-widget 65 | fi 66 | } 67 | zle -N fzf-t-widget 68 | bindkey '^T' fzf-t-widget 69 | fi 70 | fi 71 | -------------------------------------------------------------------------------- /.config/nvim/snippets/gitcommit.json: -------------------------------------------------------------------------------- 1 | { 2 | "feat": { 3 | "prefix": "cm-feat", 4 | "body": ["🎸 feat: "] 5 | }, 6 | "bug": { 7 | "prefix": "cm-bug", 8 | "body": ["🐛 bug: "] 9 | }, 10 | "fix": { 11 | "prefix": "cm-fix", 12 | "body": ["✏️ fix "] 13 | }, 14 | "shell": { 15 | "prefix": "cm-shell", 16 | "body": ["🐚 $ "] 17 | }, 18 | "docs": { 19 | "prefix": "cm-doc", 20 | "body": ["📚 docs: "] 21 | }, 22 | "style": { 23 | "prefix": "cm-style", 24 | "body": ["💄 style: "] 25 | }, 26 | "refactor": { 27 | "prefix": "cm-refactor", 28 | "body": ["💡 refactor: "] 29 | }, 30 | "perf": { 31 | "prefix": "cm-perf", 32 | "body": ["⚡ perf: "] 33 | }, 34 | "test": { 35 | "prefix": "cm-test", 36 | "body": ["✅ test: "] 37 | }, 38 | "chore": { 39 | "prefix": "cm-chore", 40 | "body": ["🤖 chore: "] 41 | }, 42 | "move-rename-files": { 43 | "prefix": "cm-move-rename", 44 | "body": ["🚚 move "] 45 | }, 46 | "remove-files": { 47 | "prefix": "cm-remove", 48 | "body": ["🔥 remove "] 49 | }, 50 | "ci": { 51 | "prefix": "cm-ci", 52 | "body": ["🎡 ci: "] 53 | }, 54 | "merge": { 55 | "prefix": "cm-merge", 56 | "body": ["💚 merge: "] 57 | }, 58 | "config": { 59 | "prefix": "cm-config", 60 | "body": ["🔧 config: "] 61 | }, 62 | "tweak": { 63 | "prefix": "cm-tweak", 64 | "body": ["🩹 Tweaks"] 65 | }, 66 | "security": { 67 | "prefix": "cm-security", 68 | "body": ["👮 security: "] 69 | }, 70 | "version": { 71 | "prefix": "cm-version", 72 | "body": ["🔖 version: "] 73 | }, 74 | "wip": { 75 | "prefix": "cm-wip", 76 | "body": ["🚧 WIP"] 77 | }, 78 | "breaking": { 79 | "prefix": "cm-break", 80 | "body": ["💥 BREAKING CHANGE: "] 81 | }, 82 | "hotfix": { 83 | "prefix": "cm-hotfix", 84 | "body": ["🚑️ Hotfix"] 85 | }, 86 | "pin": { 87 | "prefix": "cm-pin", 88 | "body": ["📌 Fix version"] 89 | }, 90 | "add-dependencies": { 91 | "prefix": "cm-add", 92 | "body": ["➕ Add dependencies"] 93 | }, 94 | "remove-dependencies": { 95 | "prefix": "cm-remove", 96 | "body": ["➖ Remove dependencies"] 97 | }, 98 | "upgrade": { 99 | "prefix": "cm-up", 100 | "body": ["⬆️ Upgrade dependencies"] 101 | }, 102 | "downgrade": { 103 | "prefix": "cm-down", 104 | "body": ["⬇️ Downgrade dependencies"] 105 | }, 106 | "init": { 107 | "prefix": "cm-init", 108 | "body": ["🌱 Initial commit"] 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/treesitter.lua: -------------------------------------------------------------------------------- 1 | local languages = { 2 | "bash", 3 | "c", 4 | "c_sharp", 5 | "cpp", 6 | "css", 7 | "csv", 8 | "diff", 9 | "dockerfile", 10 | "git_config", 11 | "git_rebase", 12 | "gitattributes", 13 | "gitignore", 14 | "go", 15 | "graphql", 16 | "html", 17 | "java", 18 | "javascript", 19 | "jq", 20 | "jsdoc", 21 | "json", 22 | "jsonc", 23 | "kotlin", 24 | "lua", 25 | "luadoc", 26 | "luap", 27 | "make", 28 | "markdown", 29 | "markdown_inline", 30 | "python", 31 | "query", 32 | "regex", 33 | "ruby", 34 | "rust", 35 | "scss", 36 | "sql", 37 | "swift", 38 | "terraform", 39 | "toml", 40 | "tsv", 41 | "tsx", 42 | "typescript", 43 | "vim", 44 | "vimdoc", 45 | "xml", 46 | "yaml", 47 | } 48 | 49 | require("nvim-ts-autotag").setup({}) 50 | 51 | require("nvim-treesitter.configs").setup({ 52 | ensure_installed = languages, 53 | highlight = { 54 | enable = true, 55 | -- 調子悪いのでオフに 56 | additional_vim_regex_highlighting = false, 57 | }, 58 | indent = { 59 | enable = true, 60 | }, 61 | incremental_selection = { 62 | enable = true, 63 | keymaps = { 64 | node_incremental = "v", 65 | scope_incremental = "", 66 | node_decremental = "V", 67 | }, 68 | }, 69 | textobjects = { 70 | select = { 71 | enable = true, 72 | lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim 73 | keymaps = { 74 | -- You can use the capture groups defined in textobjects.scm 75 | ["aa"] = "@parameter.outer", 76 | ["ia"] = "@parameter.inner", 77 | ["af"] = "@function.outer", 78 | ["if"] = "@function.inner", 79 | ["ac"] = "@class.outer", 80 | ["ic"] = "@class.inner", 81 | }, 82 | }, 83 | move = { 84 | enable = true, 85 | set_jumps = true, -- whether to set jumps in the jumplist 86 | goto_next_start = { 87 | ["f]"] = "@function.outer", 88 | ["c]"] = "@class.outer", 89 | }, 90 | goto_next_end = { 91 | ["F]"] = "@function.outer", 92 | ["C]"] = "@class.outer", 93 | }, 94 | goto_previous_start = { 95 | ["f["] = "@function.outer", 96 | ["c["] = "@class.outer", 97 | }, 98 | goto_previous_end = { 99 | ["F["] = "@function.outer", 100 | ["C["] = "@class.outer", 101 | }, 102 | }, 103 | swap = { 104 | enable = true, 105 | swap_next = { 106 | ["sn"] = "@parameter.inner", 107 | }, 108 | swap_previous = { 109 | ["sp"] = "@parameter.inner", 110 | }, 111 | }, 112 | }, 113 | -- https://github.com/tadmccorkle/markdown.nvim 114 | markdown = { 115 | enable = true, 116 | }, 117 | }) 118 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | DOTFILE := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))) 2 | EXCLUDES := .DS_Store .git .luarc.json 3 | TARGETS := $(wildcard .??*) 4 | DOTFILES := $(filter-out $(EXCLUDES), $(TARGETS)) 5 | 6 | .PHONY: all 7 | all: deploy install 8 | 9 | .PHONY: help 10 | help: 11 | @echo "make all #=> Updating, deploying and installing" 12 | @echo "make update #=> Fetch changes" 13 | @echo "make install #=> Setup environment" 14 | @echo "make deploy #=> Create symlink" 15 | @echo "make list #=> List the files" 16 | @echo "make clean #=> Remove the dotfiles" 17 | 18 | .PHONY: update 19 | update: 20 | git pull --no-commit origin main 21 | 22 | .PHONY: install 23 | install: \ 24 | defaults \ 25 | brew-init \ 26 | brew \ 27 | mise \ 28 | python \ 29 | navi \ 30 | bat \ 31 | silicon \ 32 | sheldon \ 33 | passage \ 34 | term-definition \ 35 | gen-zshrc \ 36 | 37 | .PHONY: deploy 38 | deploy: 39 | @echo 'Deploy dotfiles.' 40 | @echo '' 41 | @$(foreach val, $(DOTFILES), ln -sfnv $(abspath $(val)) $(HOME)/$(val);) 42 | 43 | .PHONY: list 44 | list: 45 | @$(foreach val, $(DOTFILES), ls -dF $(val);) 46 | 47 | .PHONY: clean 48 | clean: 49 | @echo 'Remove dot files in your home directory...' 50 | @-$(foreach val, $(DOTFILES), rm -vrf $(HOME)/$(val);) 51 | -rm -rf$(DOTFILE) 52 | 53 | # brew {{{ 54 | 55 | .PHONY: brew-init 56 | brew-init: 57 | xcode-select --install 2>/dev/null || : 58 | ./scripts/brew_init 59 | 60 | .PHONY: brew 61 | brew: 62 | brew bundle --file=etc/brew/Brewfile 63 | 64 | .PHONY: brew-cask 65 | brew-cask: 66 | brew bundle --file=etc/brew/Brewfile.cask 67 | 68 | .PHONY: brew-mas 69 | brew-mas: 70 | brew bundle --file=etc/brew/Brewfile.mas 71 | 72 | # }}} 73 | 74 | # defaults {{{ 75 | 76 | .PHONY: defaults 77 | defaults: 78 | ./scripts/defaults 79 | 80 | # }}} 81 | 82 | # mise {{{ 83 | 84 | .PHONY: mise 85 | mise: 86 | mise plugin upgrade 87 | mise install -y 88 | mise up 89 | 90 | .PHONY: python 91 | python: mise 92 | mise x -- pip install --upgrade pip 93 | 94 | # rust {{{ 95 | 96 | .PHONY: rust-update 97 | rust-update: mise 98 | cargo install-update -a 99 | 100 | # }}} 101 | 102 | # }}} 103 | 104 | .PHONY: bat 105 | bat: brew 106 | cd ~/.config/bat && bat cache --build 107 | 108 | .PHONY: silicon 109 | silicon: brew 110 | cd ~/.config/bat && silicon --build-cache 111 | 112 | .PHONY: navi 113 | navi: brew 114 | ./scripts/navi 115 | 116 | .PHONY: sheldon 117 | sheldon: 118 | ./scripts/sheldon 119 | 120 | .PHONY: passage 121 | passage: 122 | ./scripts/passage 123 | 124 | .PHONY: term-definition 125 | term-definition: 126 | ./scripts/term-definition 127 | 128 | .PHONY: gen-zshrc 129 | gen-zshrc: 130 | ./scripts/gen-zshrc 131 | -------------------------------------------------------------------------------- /scripts/defaults: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Hide Dock automatically 4 | defaults write com.apple.dock autohide -bool true 5 | 6 | # Dock delay 7 | defaults write com.apple.dock autohide-delay -float 0 8 | 9 | # Dock animation 10 | defaults write com.apple.dock autohide-time-modifier -float 0.7 11 | 12 | # Fix battery indicator 13 | defaults write com.apple.menuextra.battery ShowPercent -string "YES" 14 | 15 | # Changer OS language 16 | defaults write -g AppleLanguages -array en ja 17 | 18 | # Change the directory that saves screen shots 19 | dir=${SS_DIR:-$HOME/Pictures/ScreenShots/} 20 | mkdir -p "$dir" 21 | defaults write com.apple.screencapture location -string "$dir" 22 | defaults write com.apple.screencapture name -string 'ScreenShot' 23 | defaults write com.apple.screencapture show-thumbnail -bool false 24 | 25 | # Show hidden files 26 | defaults write com.apple.finder AppleShowAllFiles -bool true 27 | 28 | # Show file ext 29 | defaults write NSGlobalDomain AppleShowAllExtensions -bool true 30 | 31 | # Show directory first 32 | defaults write com.apple.finder _FXSortFoldersFirst -bool true 33 | 34 | # Do not make .DS_Store 35 | defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true 36 | defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true 37 | 38 | # Key Repeat 39 | # Set delay until key repeat (15 * n [ms]) 40 | defaults write NSGlobalDomain InitialKeyRepeat -int 12 41 | # Set key repeat speed (15 * n [ms]) 42 | defaults write NSGlobalDomain KeyRepeat -int 1 43 | 44 | # Fix tap behavior 45 | defaults write -g com.apple.mouse.tapBehavior -int 1 46 | 47 | # Disable spotlight 48 | # mdutil -s / | grep enabled && sudo mdutil -a -i off / 49 | 50 | # VSCode 51 | defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false 52 | 53 | # Keyboard Shortcuts 54 | defaults write com.microsoft.Outlook NSUserKeyEquivalents -dict-add "Clear Formatting" -string "@l" 55 | 56 | # Disable Shortcuts for spotlight 57 | # ref. https://qiita.com/ry0f/items/f2c75f0a77b1012182d6 58 | defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 64 "enabledvalueparameters32491048576typestandard" 59 | defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 65 "enabledvalueparameters65535491572864typestandard" 60 | 61 | # Change "Move focus to next window" shortcut 62 | defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 27 "enabledvalueparameters6553548524288typestandard" 63 | 64 | # Move window by Drag with Comamnd + Control 65 | defaults write -g NSWindowShouldDragOnGesture -bool true 66 | 67 | killall Dock 68 | killall Finder 69 | killall SystemUIServer 70 | -------------------------------------------------------------------------------- /.config/nvim/lua/config/options.lua: -------------------------------------------------------------------------------- 1 | local options = { 2 | backup = false, -- creates a backup file 3 | clipboard = "unnamedplus", -- allows neovim to access the system clipboard 4 | conceallevel = 2, -- enable conceal 5 | fileencoding = "utf-8", -- the encoding written to a file 6 | hlsearch = true, -- highlight all matches on previous search pattern 7 | ignorecase = true, -- ignore case in search patterns 8 | mouse = "a", -- allow the mouse to be used in neovim 9 | mousemoveevent = true, -- allow the mouse support 10 | pumheight = 10, -- pop up menu height 11 | smartcase = true, -- smart case 12 | smartindent = true, -- make indenting smarter again 13 | splitbelow = true, -- force all horizontal splits to go below current window 14 | splitright = true, -- force all vertical splits to go to the right of current window 15 | swapfile = false, -- swapfile creation flag 16 | undofile = true, -- enable persistent undo 17 | updatetime = 2000, -- faster completion (4000ms default) 18 | writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited 19 | expandtab = true, -- convert tabs to spaces 20 | shiftwidth = 2, -- the number of spaces inserted for each indentation 21 | shiftround = true, 22 | softtabstop = 2, 23 | tabstop = 2, -- insert 2 spaces for a tab 24 | cursorline = true, -- highlight the current line 25 | cursorcolumn = true, 26 | number = true, -- set numbered lines 27 | relativenumber = true, -- set relative numbered lines 28 | numberwidth = 4, -- set number column width to 2 {default 4} 29 | signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time 30 | wrap = false, -- display lines as one long line 31 | termguicolors = true, 32 | sidescrolloff = 3, 33 | laststatus = 3, 34 | showtabline = 0, 35 | completeopt = { 36 | "menu", 37 | "menuone", 38 | "noselect", 39 | }, 40 | list = true, 41 | listchars = { 42 | tab = "┈┈", 43 | trail = "-", 44 | extends = "»", 45 | precedes = "«", 46 | }, 47 | path = { 48 | ".", 49 | "./plugins", 50 | "/usr/include", 51 | vim.fn.fnameescape(vim.fn.expand("$DOTFILE/.config/nvim/lua")), 52 | vim.fn.fnameescape(vim.fn.expand("$DOTFILE/.config/nvim/lua/config/plugins")), 53 | vim.fn.fnameescape(vim.fn.expand("$SCRAPBOOK_DIR")), 54 | }, 55 | suffixesadd = { ".md", ".lua" }, 56 | foldmethod = "expr", 57 | foldexpr = "nvim_treesitter#foldexpr()", 58 | foldcolumn = "1", 59 | foldlevel = 99, 60 | foldlevelstart = 99, 61 | fillchars = { 62 | foldopen = "▾", 63 | foldclose = "▸", 64 | foldsep = "┊", 65 | fold = "┊", 66 | }, 67 | helplang = "ja,en", 68 | } 69 | 70 | for k, v in pairs(options) do 71 | vim.opt[k] = v 72 | end 73 | 74 | vim.opt.shortmess:append("I") 75 | vim.opt.whichwrap:append("b,s,h,l,<,>,[,],~") 76 | vim.opt.iskeyword:append("-") 77 | 78 | -- store tabpages and globals in session 79 | vim.opt.sessionoptions:append("tabpages,globals") 80 | 81 | -- disable netrw 82 | vim.g.loaded_netrw = true 83 | vim.g.loaded_netrwPlugin = true 84 | vim.g.loaded_netrwSettings = true 85 | vim.g.loaded_netrwFileHandlers = true 86 | -------------------------------------------------------------------------------- /.config/tmux/tmux.conf: -------------------------------------------------------------------------------- 1 | set-option -g prefix C-s 2 | set-option -g mouse on 3 | set-option -g focus-event on 4 | 5 | set-option -g status-interval 1 6 | set-option -g automatic-rename on 7 | set-option -g automatic-rename-format "#(echo $(basename #{d:pane_current_path})/)#{b:pane_current_path}" 8 | 9 | if-shell "echo $TERM | grep -q wezterm" "source-file $XDG_CONFIG_HOME/tmux/wezterm.tmux" "source-file $XDG_CONFIG_HOME/tmux/ghostty.tmux" 10 | 11 | set -s extended-keys on 12 | 13 | # キーストロークのDelayを減らす 14 | set -s escape-time 0 15 | 16 | set -g cursor-style 'blinking-bar' 17 | set -g base-index 1 18 | 19 | # window名変更 20 | bind A command-prompt -I '#W' 'rename-window %%' 21 | 22 | # 同一ディレクトリーで開くように 23 | bind c new-window -a -c '#{pane_current_path}' 24 | bind C new-window 25 | 26 | # next / prev window 27 | bind -r ^n next-window 28 | bind -r ^p previous-window 29 | 30 | bind 8 select-window -t '{end}'\; select-window -t :-2 31 | bind 9 select-window -t '{end}'\; select-window -t :- 32 | bind 0 select-window -t '{end}' 33 | # ^8 は BSpace 34 | bind BSpace select-window -t '{end}'\; select-window -t :-2 35 | bind ^9 select-window -t '{end}'\; select-window -t :- 36 | bind ^0 select-window -t '{end}' 37 | 38 | # Toggle Window 39 | bind ^s last-window 40 | 41 | bind * list-client 42 | 43 | # Windowの移動 44 | bind P swap-window -t :-\; select-window -t :- 45 | bind N swap-window -t :+\; select-window -t :+ 46 | bind I swap-window -t :-\; select-window -t :- 47 | bind O swap-window -t :+\; select-window -t :+ 48 | 49 | # Paneの移動 50 | bind > join-pane -t :+ 51 | bind < join-pane -t :- 52 | bind J command-prompt -1 'join-pane -ht :%%' 53 | 54 | # Pane分割 (同一ディレクトリーで開くように) 55 | bind - split-window -v -c '#{pane_current_path}' 56 | bind \\ split-window -h -c '#{pane_current_path}' 57 | bind \; split-window -h -c '#{pane_current_path}' 58 | 59 | bind r rotate-window 60 | bind i select-pane -t :.+ 61 | bind o select-pane -t :.- 62 | bind ^r rotate-window 63 | bind ^i select-pane -t :.+ 64 | bind ^o select-pane -t :.- 65 | 66 | 67 | bind Q confirm-before 'kill-window' 68 | bind q confirm-before 'kill-pane' 69 | 70 | bind ^h select-pane -L 71 | bind ^j select-pane -D 72 | bind ^k select-pane -U 73 | bind ^l select-pane -R 74 | 75 | # ペインのリサイズする 76 | bind -r H resize-pane -L 3 77 | bind -r J resize-pane -D 3 78 | bind -r K resize-pane -U 3 79 | bind -r L resize-pane -R 3 80 | 81 | bind U resize-pane -U 50 82 | bind D resize-pane -D 50 83 | 84 | bind M-h select-layout even-horizontal 85 | bind M-v select-layout even-vertical 86 | bind _ select-layout main-horizontal 87 | bind | select-layout main-vertical 88 | bind : select-layout main-vertical 89 | bind Space select-layout tiled 90 | 91 | # synchronize 92 | bind S set-window-option synchronize-panes on 93 | bind s set-window-option synchronize-panes off 94 | 95 | # source 96 | bind R source-file $XDG_CONFIG_HOME/tmux/tmux.conf \; display 'source $XDG_CONFIG_HOME/tmux/tmux.conf' 97 | 98 | source-file $XDG_CONFIG_HOME/tmux/theme.tmux 99 | if-shell "uname | grep -q Darwin" "source-file $XDG_CONFIG_HOME/tmux/darwin.tmux" "source-file $XDG_CONFIG_HOME/tmux/linux.tmux" 100 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/markdown.lua: -------------------------------------------------------------------------------- 1 | local UNORDERED_LIST_PATTERN = "^%s*[-*+][ >]*$" 2 | local ORDERED_LIST_PATTERN = "^%s*%d+[%.%)][ >]*$" 3 | local TASK_PATTERN = "^%s*[-*+] %[[x%- ]%] $" 4 | local QUOTED_PATTERN = "^%s*>[ >]+$" 5 | 6 | local function backspace() 7 | local row = vim.fn.line(".") - 1 8 | local col = vim.fn.col("$") - 1 9 | local indent = vim.fn.indent(".") 10 | local line = vim.api.nvim_buf_get_lines(0, row, row + 1, false)[1] 11 | 12 | local bs = vim.api.nvim_replace_termcodes("", true, false, true) 13 | if string.match(line, UNORDERED_LIST_PATTERN) then 14 | if col == indent + 2 then 15 | print(col .. " " .. indent) 16 | vim.api.nvim_buf_set_text(0, row, indent, row, col, { "" }) 17 | else 18 | vim.api.nvim_buf_set_text(0, row, indent, row, col, { "- " }) 19 | end 20 | elseif string.match(line, ORDERED_LIST_PATTERN) then 21 | print(col .. " " .. indent) 22 | if col == indent + 3 then 23 | vim.api.nvim_buf_set_text(0, row, indent, row, col, { "" }) 24 | else 25 | vim.api.nvim_buf_set_text(0, row, indent, row, col, { "1. " }) 26 | end 27 | elseif string.match(line, TASK_PATTERN) then 28 | vim.api.nvim_buf_set_text(0, row, indent, row, col, { "- " }) 29 | elseif string.match(line, QUOTED_PATTERN) then 30 | vim.api.nvim_buf_set_text(0, row, indent, row, col, { "" }) 31 | else 32 | vim.api.nvim_feedkeys(bs, "n", true) 33 | end 34 | end 35 | 36 | require("markdown").setup({ 37 | mappings = { 38 | inline_surround_toggle = "gs", 39 | inline_surround_toggle_line = "gss", 40 | inline_surround_delete = "ds", 41 | inline_surround_change = "cs", 42 | link_add = "gl", 43 | link_follow = false, 44 | go_curr_heading = "[s", 45 | go_parent_heading = "[S", 46 | go_next_heading = "]]", 47 | go_prev_heading = "[[", 48 | }, 49 | inline_surround = { 50 | emphasis = { 51 | key = "i", 52 | txt = "*", 53 | }, 54 | strong = { 55 | key = "b", 56 | txt = "**", 57 | }, 58 | strikethrough = { 59 | key = "s", 60 | txt = "~~", 61 | }, 62 | code = { 63 | key = "c", 64 | txt = "`", 65 | }, 66 | }, 67 | link = { 68 | paste = { 69 | enable = false, 70 | }, 71 | }, 72 | toc = { 73 | omit_heading = "toc omit heading", 74 | omit_section = "toc omit section", 75 | markers = { "-" }, 76 | }, 77 | on_attach = function(bufnr) 78 | local map = vim.keymap.set 79 | local opts = { noremap = true, buffer = bufnr } 80 | 81 | map("i", "", function() 82 | local row = vim.fn.line(".") - 1 83 | local col = vim.fn.col("$") - 1 84 | local line = vim.api.nvim_buf_get_lines(0, row, row + 1, false)[1] 85 | 86 | local cr = vim.api.nvim_replace_termcodes("", true, false, true) 87 | 88 | if 89 | string.match(line, UNORDERED_LIST_PATTERN) 90 | or string.match(line, ORDERED_LIST_PATTERN) 91 | or string.match(line, TASK_PATTERN) 92 | or string.match(line, QUOTED_PATTERN) 93 | then 94 | vim.api.nvim_buf_set_text(0, row, 0, row, col, { "" }) 95 | else 96 | vim.api.nvim_feedkeys(cr, "n", false) 97 | end 98 | end, opts) 99 | 100 | map("i", "", backspace, opts) 101 | map("i", "", backspace, opts) 102 | end, 103 | }) 104 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/conf/dap.lua: -------------------------------------------------------------------------------- 1 | local dap, dapui = require("dap"), require("dapui") 2 | 3 | dap.listeners.after.event_initialized["dapui_config"] = function() 4 | dapui.open() 5 | end 6 | dap.listeners.before.event_terminated["dapui_config"] = function() 7 | dapui.close() 8 | end 9 | dap.listeners.before.event_exited["dapui_config"] = function() 10 | dapui.close() 11 | end 12 | 13 | vim.fn.sign_define( 14 | "DapStopped", 15 | { text = "󰁕 ", texthl = "DiagnosticWarn", linehl = "DapStoppedLine", numhl = "DapStoppedLine" } 16 | ) 17 | vim.fn.sign_define("DapBreakpoint", { text = " ", texthl = "", linehl = "", numhl = "" }) 18 | vim.fn.sign_define("DapBreakpointCondition", { text = " ", texthl = "", linehl = "", numhl = "" }) 19 | vim.fn.sign_define("DapBreakpointRejected", { text = " ", texthl = "DiagnosticError", linehl = "", numhl = "" }) 20 | vim.fn.sign_define("DapLogPoint", { text = ".>", texthl = "", linehl = "", numhl = "" }) 21 | local set_hl = vim.api.nvim_set_hl 22 | set_hl(0, "DapStoppedLine", { default = true, link = "Visual" }) 23 | 24 | for _, language in ipairs(require("utils").js_based_languages) do 25 | dap.configurations[language] = { 26 | -- Debug single nodejs 27 | { 28 | type = "pwa-node", 29 | request = "launch", 30 | name = "Launch file (single nodejs)", 31 | program = "${file}", 32 | cwd = "${workspaceFolder}", 33 | sourceMaps = true, 34 | }, 35 | 36 | -- Debug nodejs server processes (make sure to add --inspect when you run the process) 37 | { 38 | type = "pwa-node", 39 | request = "attach", 40 | name = "Attach (auto pick)", 41 | processId = function() 42 | require("dap.utils").pick_process({ filter = "node" }) 43 | end, 44 | cwd = "${workspaceFolder}", 45 | }, 46 | { 47 | type = "pwa-node", 48 | request = "attach", 49 | name = "Attach (manual pick)", 50 | processId = require("dap.utils").pick_process, 51 | cwd = "${workspaceFolder}", 52 | sourceMaps = true, 53 | }, 54 | 55 | -- Debug Jest 56 | { 57 | type = "pwa-node", 58 | request = "launch", 59 | name = "Debug Jest Tests", 60 | args = { 61 | "node_modules/.bin/jest", 62 | "${fileBasename}", -- TODO: `--testNamePattern` を指定したい 63 | }, 64 | rootPath = "${workspaceFolder}", 65 | cwd = "${workspaceFolder}", 66 | }, 67 | 68 | -- Debug Web applications (client side) 69 | { 70 | type = "pwa-chrome", 71 | request = "launch", 72 | name = "Launch & Debug Chrome", 73 | url = function() 74 | local co = coroutine.running() 75 | return coroutine.create(function() 76 | vim.ui.input({ 77 | prompt = "Enter URL: ", 78 | default = "http://localhost:3000", 79 | }, function(url) 80 | if url == nil or url == "" then 81 | return 82 | else 83 | coroutine.resume(co, url) 84 | end 85 | end) 86 | end) 87 | end, 88 | webRoot = "${workspaceFolder}", 89 | protocol = "inspector", 90 | sourceMaps = true, 91 | userDataDir = false, 92 | }, 93 | 94 | -- Divider for the launch.json derived configs 95 | { 96 | name = "----- ↓ launch.json configs ↓ -----", 97 | type = "", 98 | request = "launch", 99 | }, 100 | } 101 | end 102 | -------------------------------------------------------------------------------- /.config/nvim/lua/config/commands.lua: -------------------------------------------------------------------------------- 1 | -- JSON.stringify 2 | vim.api.nvim_create_user_command("JsonStringify", function(args) 3 | local cmd 4 | if args.range == 2 then 5 | cmd = args.line1 .. "," .. args.line2 .. "!xargs -0 -I {} node -e 'console.log(JSON.stringify({}, null, 2))'" 6 | else 7 | cmd = "%!xargs -0 -I {} node -e 'console.log(JSON.stringify({}, null, 2))'" 8 | end 9 | vim.fn.execute(cmd) 10 | end, { 11 | range = 2, 12 | }) 13 | 14 | -- JSON.parse 15 | vim.api.nvim_create_user_command("JsonParse", function(args) 16 | local cmd 17 | if args.range == 2 then 18 | cmd = args.line1 .. "," .. args.line2 .. "!xargs -0 -I {} node -e 'console.log({})'" 19 | else 20 | cmd = "%!xargs -0 -I {} node -e 'console.log({})'" 21 | end 22 | vim.fn.execute(cmd) 23 | end, { 24 | range = 2, 25 | }) 26 | 27 | -- Jq 28 | vim.api.nvim_create_user_command("Jq", function(opts) 29 | local cmd 30 | if opts.range == 2 then 31 | cmd = opts.line1 .. "," .. opts.line2 .. "!jq ." 32 | else 33 | cmd = "%!jq ." 34 | end 35 | vim.fn.execute(cmd) 36 | end, { 37 | range = 2, 38 | }) 39 | vim.api.nvim_create_user_command("JqCompact", function(opts) 40 | local cmd 41 | if opts.range == 2 then 42 | cmd = opts.line1 .. "," .. opts.line2 .. "!jq -c ." 43 | else 44 | cmd = "%!jq -c ." 45 | end 46 | vim.fn.execute(cmd) 47 | end, { 48 | range = 2, 49 | }) 50 | 51 | vim.api.nvim_create_user_command("F", function(opts) 52 | local ft = opts.fargs[1] 53 | if ft ~= nil then 54 | vim.bo.filetype = ft 55 | else 56 | ft = string.match(vim.fn.expand("%:t"), "%.(%w+)%.%w+") 57 | if ft ~= nil then 58 | if ft == "md" then 59 | vim.bo.filetype = "markdown" 60 | else 61 | vim.bo.filetype = ft 62 | end 63 | vim.fn.execute("TSBufEnable " .. vim.bo.filetype) 64 | end 65 | end 66 | end, { 67 | nargs = "?", 68 | }) 69 | 70 | vim.api.nvim_create_user_command("AddAbbrComma", function(opts) 71 | local k = opts.fargs[1] 72 | local v = opts.fargs[2] 73 | local cmd = "iabbr " .. k .. " " .. v .. ":" 74 | vim.fn.execute(cmd) 75 | end, { 76 | nargs = "*", 77 | }) 78 | 79 | vim.api.nvim_create_user_command("EnableCompletion", function() 80 | vim.b.completion = true 81 | end, {}) 82 | vim.api.nvim_create_user_command("DisableCompletion", function() 83 | vim.b.completion = false 84 | end, {}) 85 | 86 | vim.api.nvim_create_user_command("ReplaceDate", function(opts) 87 | local date = opts.args 88 | if date == "" then 89 | date = os.date("%Y-%m-%d") 90 | end 91 | 92 | local date_pattern = "(%d%d%d%d)%-(%d%d)%-(%d%d)" 93 | local year, month, date = string.match(date, date_pattern) 94 | local range 95 | if opts.range == 2 then 96 | range = opts.line1 .. "," .. opts.line2 97 | else 98 | range = "%" 99 | end 100 | if year ~= nil then 101 | pcall(vim.fn.execute, range .. "s/YYYY/" .. year .. "/g") 102 | end 103 | if month ~= nil then 104 | pcall(vim.fn.execute, range .. "s/MM/" .. month .. "/g") 105 | end 106 | if date ~= nil then 107 | pcall(vim.fn.execute, range .. "s/DD/" .. date .. "/g") 108 | end 109 | end, { 110 | nargs = "?", 111 | range = 2, 112 | }) 113 | 114 | vim.api.nvim_create_user_command("RestoreCursor", function() 115 | if pcall(vim.cmd, "marks f", { silent = true }) then 116 | vim.cmd("normal! `fzt10k10j") 117 | end 118 | end, {}) 119 | -------------------------------------------------------------------------------- /.config/zsh/tmpl/completion.zsh: -------------------------------------------------------------------------------- 1 | # Move cursor to end of word if a full completion is inserted. 2 | setopt always_to_end 3 | 4 | setopt no_case_glob 5 | 6 | # Don't beep on ambiguous completions. 7 | setopt no_list_beep 8 | 9 | zstyle ':completion::complete:*' use-cache on 10 | 11 | # Group matches and describe. 12 | zstyle ':completion:*:*:*:*:*' menu select 13 | zstyle ':completion::complete:*' use-cache on 14 | 15 | # Group matches and describe. 16 | zstyle ':completion:*:*:*:*:*' menu select 17 | zstyle ':completion:*:matches' group yes 18 | zstyle ':completion:*:options' description yes 19 | zstyle ':completion:*:options' auto-description '%d' 20 | zstyle ':completion:*:corrections' format '%F{green}-- %d (errors: %e) --%f' 21 | zstyle ':completion:*:descriptions' format '%F{yellow}-- %d --%f' 22 | zstyle ':completion:*:messages' format '%F{purple}-- %d --%f' 23 | zstyle ':completion:*:warnings' format '%F{red}-- no matches found --%f' 24 | zstyle ':completion:*' format '%F{yellow}-- %d --%f' 25 | zstyle ':completion:*' group-name '' 26 | zstyle ':completion:*' verbose yes 27 | zstyle ':completion:*' matcher-list '' 'r:|?=**' 28 | 29 | # Ignore useless commands and functions 30 | zstyle ':completion:*:functions' ignored-patterns '(_*|pre(cmd|exec)|prompt_*)' 31 | # Array completion element sorting. 32 | zstyle ':completion:*:*:-subscript-:*' tag-order 'indexes' 'parameters' 33 | 34 | # Directories 35 | if (( ${+LS_COLORS} )); then 36 | zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} 37 | else 38 | # Use same LS_COLORS definition from utility module, in case it was not set 39 | zstyle ':completion:*:default' list-colors ${(s.:.):-di=1;34:ln=35:so=32:pi=33:ex=31:bd=1;36:cd=1;33:su=30;41:sg=30;46:tw=30;42:ow=30;43} 40 | fi 41 | zstyle ':completion:*:*:cd:*:directory-stack' menu yes select 42 | zstyle ':completion:*' squeeze-slashes true 43 | 44 | # History 45 | zstyle ':completion:*:history-words' stop yes 46 | zstyle ':completion:*:history-words' remove-all-dups yes 47 | zstyle ':completion:*:history-words' list false 48 | zstyle ':completion:*:history-words' menu yes 49 | 50 | # Populate hostname completion. 51 | zstyle -e ':completion:*:hosts' hosts 'reply=( 52 | ${=${=${=${${(f)"$(cat {/etc/ssh/ssh_,~/.ssh/}known_hosts{,2} 2>/dev/null)"}%%[#| ]*}//\]:[0-9]*/ }//,/ }//\[/ } 53 | ${=${(f)"$(cat /etc/hosts 2>/dev/null; ypcat hosts 2>/dev/null)"}%%(\#)*} 54 | ${=${${${${(@M)${(f)"$(cat ~/.ssh/config{,.d/*(N)} 2>/dev/null)"}:#Host *}#Host }:#*\**}:#*\?*}} 55 | )' 56 | 57 | # Don't complete uninteresting users... 58 | zstyle ':completion:*:*:*:users' ignored-patterns \ 59 | '_*' adm amanda apache avahi beaglidx bin cacti canna clamav daemon dbus \ 60 | distcache dovecot fax ftp games gdm gkrellmd gopher hacluster haldaemon \ 61 | halt hsqldb ident junkbust ldap lp mail mailman mailnull mldonkey mysql \ 62 | nagios named netdump news nfsnobody nobody nscd ntp nut nx openvpn \ 63 | operator pcap postfix postgres privoxy pulse pvm quagga radvd rpc rpcuser \ 64 | rpm shutdown squid sshd sync uucp vcsa xfs 65 | 66 | # ... unless we really want to. 67 | zstyle '*' single-ignored show 68 | 69 | # Ignore multiple entries. 70 | zstyle ':completion:*:(rm|kill|diff):*' ignore-line other 71 | zstyle ':completion:*:rm:*' file-patterns '*:all-files' 72 | 73 | # Man 74 | zstyle ':completion:*:manuals' separate-sections true 75 | zstyle ':completion:*:manuals.(^1*)' insert-sections true 76 | -------------------------------------------------------------------------------- /.config/zsh/.zshenv: -------------------------------------------------------------------------------- 1 | # プロファイル用設定 2 | # (.zshenvの一番始めに記載すること) 3 | if [ "$ZSHRC_PROFILE" != "" ]; then 4 | zmodload zsh/zprof && zprof > /dev/null 5 | fi 6 | 7 | # NOTE: Do not load global rc files 8 | setopt no_global_rcs 9 | setopt magic_equal_subst 10 | 11 | # XDG Base Directory Specification 12 | export XDG_CONFIG_HOME=$HOME/.config 13 | export XDG_CACHE_HOME=$HOME/.cache 14 | export XDG_DATA_HOME=$HOME/.local/share 15 | 16 | # zsh 17 | export ZDOTDIR=$XDG_CONFIG_HOME/zsh 18 | 19 | # Remove path separator from WORDCHARS 20 | WORDCHARS="${WORDCHARS//[\/=]}" 21 | 22 | # golang 23 | export GO111MODULE=on 24 | export GOPATH=$HOME/go 25 | 26 | # RIPGREP 27 | export RIPGREP_CONFIG_PATH=$XDG_CONFIG_HOME/ripgrep/ripgreprc 28 | 29 | # grep 30 | export GREP_COlOR='1;31' 31 | export GREP_COlORS="mt=${GREP_COLOR}" 32 | alias grep='grep --color=auto' 33 | 34 | # rails (for rails server alias) 35 | export RAILS_SERVER_PORT=3000 36 | 37 | export GIT_HOOK_DIR="$XDG_CONFIG_HOME/git/hooks" 38 | 39 | export HOMEBREW_NO_ANALYTICS=1 40 | 41 | export JIRA_BASE_URL='https://jira.atlassian.com' 42 | 43 | # https://github.com/nivekuil/rip 44 | export GRAVEYARD="$XDG_DATA_HOME/trash" 45 | 46 | for file ( 47 | # Load .config.local 48 | $HOME/.config.local/zsh/zshenv(N) 49 | # Load .zshenv.local 50 | $HOME/.zshenv.local(N) 51 | 52 | $XDG_CACHE_HOME/zsh-cache.zsh(N) 53 | ) source $file 54 | 55 | 56 | typeset -U path PATH 57 | path=( 58 | $HOMEBREW_PREFIX/opt/curl/bin(N-/) 59 | $HOMEBREW_PREFIX/opt/openssl/bin(N-/) 60 | $HOMEBREW_PREFIX/opt/sqlite/bin(N-/) 61 | $HOMEBREW_PREFIX/opt/gettext/bin(N-/) 62 | $HOMEBREW_PREFIX/opt/gnu-getopt/bin(N-/) 63 | $HOMEBREW_PREFIX/opt/grep/libexec/gnubin(N-/) 64 | $HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin(N-/) 65 | $HOMEBREW_PREFIX/opt/gnu-sed/libexec/gnubin(N-/) 66 | $HOMEBREW_PREFIX/opt/gnu-tar/libexec/gnubin(N-/) 67 | 68 | # golang 69 | $GOPATH/bin(N-/) 70 | 71 | /opt/homebrew/bin(N-/) 72 | /usr/local/bin(N-/) 73 | 74 | $path 75 | ) 76 | fpath=( 77 | $ZDOTDIR/functions(N-/) 78 | $fpath 79 | ) 80 | 81 | # EDITOR 82 | if (( ${+commands[nvim]} )); then 83 | export EDITOR=nvim 84 | alias vi=nvim 85 | # manpager 86 | export MANPAGER='nvim +Man!' 87 | elif (( ${+commands[vim]} )); then 88 | export EDITOR=vim 89 | alias vi=vim 90 | fi 91 | 92 | # ls 93 | if (( ${+commands[eza]} )); then 94 | alias ls='eza --group-directories-first --icons' 95 | fi 96 | 97 | # Pager 98 | (( ${+commands[bat]} )) && export PAGER=bat 99 | 100 | export AGE_IDENTITY="$HOME/.config/age/key.txt" 101 | export AGE_RECIPIENT=$(grep -oP '(?<=# public key: ).+(?=)' $AGE_IDENTITY) 102 | export PASSAGE_IDENTITIES_FILE="$HOME/.ssh/key" 103 | export PASSAGE_RECIPIENTS_FILE="$HOME/.ssh/key.pub" 104 | export PASSAGE_AGE="$HOMEBREW_PREFIX/bin/rage" 105 | 106 | # less 107 | export LESS='-RFIX' 108 | 109 | # Browser 110 | identifier="$(defaults read ~/Library/Preferences/com.apple.LaunchServices/com.apple.launchservices.secure | awk -F'"' '/http;/{print window[(NR)-1]}{window[NR]=$2}')" 111 | case "$identifier" in 112 | "se.johnste.finicky") 113 | TARGET_BROWSER="Vivaldi" 114 | ;; 115 | "com.vivaldi.vivaldi") 116 | TARGET_BROWSER="Vivaldi" 117 | ;; 118 | "com.microsoft.edgemac") 119 | TARGET_BROWSER="Microsoft Edge" 120 | ;; 121 | "com.google.chrome") 122 | TARGET_BROWSER="Google Chrome" 123 | ;; 124 | *) 125 | TARGET_BROWSER="Safari" 126 | ;; 127 | esac 128 | export TARGET_BROWSER 129 | -------------------------------------------------------------------------------- /.config/nvim/lua/plugins/nvim-lint/cspell.lua: -------------------------------------------------------------------------------- 1 | -- ref. 2 | -- - https://zenn.dev/kawarimidoll/articles/ad35f3dc4a5009 3 | -- - https://zenn.dev/kawarimidoll/articles/2e99432d27eda3 4 | 5 | local cspell_config_dir = vim.fn.expand("$XDG_CONFIG_HOME/cspell") 6 | local cspell_data_dir = vim.fn.expand("$XDG_DATA_HOME/cspell") 7 | local dotfiles_local_dir = vim.fn.expand("~/.config.local/cspell") 8 | local cspell_files = { 9 | config = cspell_config_dir .. "/cspell.json", 10 | dotfiles = cspell_config_dir .. "/dotfiles.txt", 11 | dotfiles_local = dotfiles_local_dir .. "/local.txt", 12 | user = cspell_data_dir .. "/user.txt", 13 | lua = cspell_data_dir .. "/lua.txt", 14 | ruby = cspell_data_dir .. "/ruby.txt", 15 | vim = cspell_data_dir .. "/vim.txt", 16 | } 17 | 18 | -- dotfiles辞書がなければ作成 19 | if vim.fn.filereadable(cspell_files.dotfiles) ~= 1 then 20 | io.popen("mkdir -p " .. cspell_data_dir) 21 | io.popen("touch " .. cspell_files.dotfiles) 22 | end 23 | 24 | -- 辞書がなければダウンロード 25 | for _, v in ipairs({ 26 | { 27 | file_path = cspell_files.vim, 28 | url = "https://raw.githubusercontent.com/streetsidesoftware/cspell-dicts/main/dictionaries/vim/dict/vim.txt", 29 | }, 30 | { 31 | file_path = cspell_files.ruby, 32 | url = "https://raw.githubusercontent.com/streetsidesoftware/cspell-dicts/main/dictionaries/ruby/dict/ruby.txt", 33 | }, 34 | { 35 | file_path = cspell_files.lua, 36 | url = "https://raw.githubusercontent.com/streetsidesoftware/cspell-dicts/main/dictionaries/lua/dict/lua.txt", 37 | }, 38 | }) do 39 | if vim.fn.filereadable(v.file_path) ~= 1 then 40 | io.popen("curl -fsSLo " .. v.file_path .. " --create-dirs " .. v.url) 41 | end 42 | end 43 | 44 | -- ユーザー辞書がなければ作成 45 | if vim.fn.filereadable(cspell_files.user) ~= 1 then 46 | io.popen("mkdir -p " .. cspell_data_dir) 47 | io.popen("touch " .. cspell_files.user) 48 | end 49 | 50 | -- dotfiles.local辞書がなければ作成 51 | if vim.fn.filereadable(cspell_files.dotfiles_local) ~= 1 then 52 | io.popen("mkdir -p " .. dotfiles_local_dir) 53 | io.popen("touch " .. cspell_files.dotfiles_local) 54 | end 55 | 56 | local cspell_append = function(opts) 57 | local target = opts.fargs[1] 58 | local dictionary_name = target == "global" and "dotfiles" or target == "local" and "local" or "user" 59 | 60 | local word = opts.fargs[2] 61 | if not word or word == "" then 62 | -- 引数がなければcwordを取得 63 | word = vim.fn.expand(""):lower() 64 | end 65 | 66 | -- shellのechoコマンドで辞書ファイルに追記 67 | io.popen("echo " .. word .. " >> " .. cspell_files[dictionary_name]) 68 | 69 | -- 追加した単語および辞書を表示 70 | vim.notify('"' .. word .. '" is appended to ' .. dictionary_name .. " dictionary.", vim.log.levels.INFO, {}) 71 | 72 | -- cspellをリロードするため、現在行を更新してすぐ戻す 73 | if vim.api.nvim_get_option_value("modifiable", {}) then 74 | vim.api.nvim_set_current_line(vim.api.nvim_get_current_line()) 75 | vim.api.nvim_command("silent! undo") 76 | end 77 | end 78 | 79 | vim.api.nvim_create_user_command("CSpellAppend", cspell_append, { nargs = "*" }) 80 | local opts = { noremap = true, silent = true } 81 | local keymap = vim.keymap.set 82 | keymap("n", "ag", "CSpellAppend dotfiles", opts) 83 | keymap("n", "al", "CSpellAppend dotfiles_local", opts) 84 | keymap("n", "au", "CSpellAppend user", opts) 85 | 86 | vim.api.nvim_create_user_command("OpenCSpellDotfile", "edit " .. cspell_files.dotfiles, {}) 87 | vim.api.nvim_create_user_command("OpenCSpellLocal", "edit " .. cspell_files.dotfiles_local, {}) 88 | vim.api.nvim_create_user_command("OpenCSpellUser", "edit " .. cspell_files.user, {}) 89 | --------------------------------------------------------------------------------