├── .agignore ├── .amethyst ├── .asdfrc ├── .bash_profile ├── .bashrc ├── .bashrc.cygwin ├── .config ├── 1Password │ └── ssh │ │ └── agent.toml ├── AquaSKK │ ├── kana-rule.conf │ └── keymap.conf ├── alacritty │ ├── alacritty.toml │ ├── nord.toml │ └── shell.toml ├── bat │ └── config ├── bpytop │ └── bpytop.conf ├── direnv │ └── direnvrc ├── efm-langserver │ └── config.yaml ├── fish │ ├── completions │ │ ├── fisher.fish │ │ ├── gcloud.fish │ │ ├── ghq.fish │ │ ├── gsutil.fish │ │ └── nb.fish │ ├── conf.d │ │ ├── fzf.fish │ │ ├── ghq_key_bindings.fish │ │ └── z.fish │ ├── config.fish │ ├── fish_plugins │ └── functions │ │ ├── __bass.py │ │ ├── __fzf_cd.fish │ │ ├── __fzf_complete.fish │ │ ├── __fzf_complete_preview.fish │ │ ├── __fzf_find_file.fish │ │ ├── __fzf_get_dir.fish │ │ ├── __fzf_open.fish │ │ ├── __fzf_parse_commandline.fish │ │ ├── __fzf_reverse_isearch.fish │ │ ├── __fzfcmd.fish │ │ ├── __ghq_repository_search.fish │ │ ├── __git_info.fish │ │ ├── __prompt_git_info.fish │ │ ├── __z.fish │ │ ├── __z_add.fish │ │ ├── __z_clean.fish │ │ ├── __z_complete.fish │ │ ├── _grc_wrap.fish │ │ ├── bass.fish │ │ ├── cvs.fish │ │ ├── df.fish │ │ ├── diff.fish │ │ ├── dig.fish │ │ ├── fish_git_prompt.fish │ │ ├── fish_mode_prompt.fish │ │ ├── fish_prompt.fish │ │ ├── fisher.fish │ │ ├── fzf_ghq.fish │ │ ├── fzf_git_status.fish │ │ ├── fzf_pe.fish │ │ ├── fzf_z.fish │ │ ├── g++.fish │ │ ├── gcc.fish │ │ ├── gcgip.fish │ │ ├── gcloud_sdk_argcomplete.fish │ │ ├── humanize_duration.fish │ │ ├── ifconfig.fish │ │ ├── make.fish │ │ ├── mount.fish │ │ ├── mtr.fish │ │ ├── netstat.fish │ │ ├── nvim.fish │ │ ├── ping.fish │ │ ├── ps.fish │ │ ├── tail.fish │ │ ├── traceroute.fish │ │ └── wdiff.fish ├── gocode │ └── config.json ├── goneovim │ └── settings.toml ├── ipython │ ├── README │ └── profile_default │ │ ├── ipython_config.py │ │ └── startup │ │ └── README ├── karabiner │ └── assets │ │ └── complex_modifications │ │ ├── 1646346652.json │ │ ├── 1692495936.json │ │ ├── diamond.json │ │ ├── edgeview.json │ │ ├── emacs.json │ │ ├── hhk.json │ │ ├── japanese.json │ │ ├── slack.json │ │ └── tmux.json ├── kitty │ └── kitty.conf ├── nvim-dev │ ├── .stylua.toml │ ├── dashboard-frecency │ │ ├── init.lua │ │ └── lazy-lock.json │ ├── dashboard │ │ ├── init.lua │ │ └── lazy-lock.json │ ├── gitsigns │ │ ├── init.lua │ │ └── lazy-lock.json │ ├── noice │ │ ├── init.lua │ │ └── lazy-lock.json │ ├── perlnavigator │ │ ├── init.lua │ │ └── lazy-lock.json │ ├── rtbrowse │ │ ├── init.lua │ │ └── lazy-lock.json │ └── telescope │ │ ├── init.lua │ │ └── lazy-lock.json ├── nvim │ ├── after │ │ ├── ftplugin │ │ │ ├── FTerm.lua │ │ │ ├── applescript.lua │ │ │ ├── c.lua │ │ │ ├── css.lua │ │ │ ├── fish.lua │ │ │ ├── floaterm.lua │ │ │ ├── git.lua │ │ │ ├── gitcommit.lua │ │ │ ├── gitmessagerpopup.lua │ │ │ ├── go.lua │ │ │ ├── go_gohtmltmpl.lua │ │ │ ├── godoc.lua │ │ │ ├── help.lua │ │ │ ├── html_javascript.lua │ │ │ ├── json.lua │ │ │ ├── lua.lua │ │ │ ├── man.lua │ │ │ ├── markdown.lua │ │ │ ├── packer.lua │ │ │ ├── perl.lua │ │ │ ├── php.lua │ │ │ ├── python.lua │ │ │ ├── qf.lua │ │ │ ├── quickfix.lua │ │ │ ├── ruby.lua │ │ │ ├── scss.lua │ │ │ ├── sh.lua │ │ │ ├── tagbar.lua │ │ │ ├── toml.lua │ │ │ ├── undotree.lua │ │ │ ├── vim.lua │ │ │ └── vue.lua │ │ ├── lsp │ │ │ ├── clangd.lua │ │ │ ├── denols.lua │ │ │ ├── gopls.lua │ │ │ ├── lua_ls.lua │ │ │ ├── pyright.lua │ │ │ └── ts_ls.lua │ │ ├── queries │ │ │ ├── markdown │ │ │ │ ├── highlights.scm │ │ │ │ └── injections.scm │ │ │ ├── terraform │ │ │ │ └── highlights.scm │ │ │ ├── toml │ │ │ │ └── injections.scm │ │ │ └── yaml │ │ │ │ └── injections.scm │ │ └── syntax │ │ │ ├── gohtmltmpl.lua │ │ │ ├── json.lua │ │ │ └── perl │ │ │ ├── carp.lua │ │ │ ├── heredoc-mysql.lua │ │ │ ├── moose.lua │ │ │ ├── test-more.lua │ │ │ ├── try-tiny.lua │ │ │ └── vim-perl.lua │ ├── autoload │ │ ├── delphinus │ │ │ ├── ale.vim │ │ │ ├── cache.vim │ │ │ ├── color_wheel.vim │ │ │ ├── datetime.vim │ │ │ ├── devicons.vim │ │ │ ├── fssh.vim │ │ │ ├── gista.vim │ │ │ ├── incsearch.vim │ │ │ ├── init │ │ │ │ ├── qfixhowm.vim │ │ │ │ ├── ref.vim │ │ │ │ ├── unite.vim │ │ │ │ ├── vimfiler.vim │ │ │ │ ├── vimproc.vim │ │ │ │ └── watchdogs.vim │ │ │ ├── perl.vim │ │ │ ├── perlpath.vim │ │ │ ├── qfixhowm.vim │ │ │ ├── ref.vim │ │ │ ├── syntax_info.vim │ │ │ ├── title.vim │ │ │ ├── tmux.vim │ │ │ └── unite.vim │ │ ├── tmuxline │ │ │ └── themes │ │ │ │ └── lightline_delphinus.vim │ │ └── unite │ │ │ └── sources │ │ │ └── rails │ │ │ └── collector │ │ │ ├── json_schema.vim │ │ │ └── typescripts.vim │ ├── dict │ │ ├── migemo │ │ │ └── utf-8 │ │ │ │ ├── han2zen.dat │ │ │ │ ├── hira2kata.dat │ │ │ │ ├── migemo-dict │ │ │ │ ├── roma2hira.dat │ │ │ │ └── zen2han.dat │ │ └── perl.dict │ ├── filetype.lua │ ├── ftdetect │ │ └── mine.lua │ ├── init.lua │ ├── lazy-lock.json │ ├── lua │ │ ├── core │ │ │ ├── init.lua │ │ │ ├── lazy │ │ │ │ ├── all.lua │ │ │ │ ├── help_tags.lua │ │ │ │ └── init.lua │ │ │ ├── options │ │ │ │ ├── commands.lua │ │ │ │ ├── init.lua │ │ │ │ ├── mapping.lua │ │ │ │ ├── set.lua │ │ │ │ └── term.lua │ │ │ ├── plugins │ │ │ │ ├── init.lua │ │ │ │ └── package.lua │ │ │ ├── telescope │ │ │ │ ├── frecency.lua │ │ │ │ ├── frecency │ │ │ │ │ └── truncator.lua │ │ │ │ └── init.lua │ │ │ ├── utils.lua │ │ │ └── utils │ │ │ │ ├── ccc.lua │ │ │ │ ├── colorwheel.lua │ │ │ │ ├── interval.lua │ │ │ │ ├── lazy.lua │ │ │ │ ├── lazy_require.lua │ │ │ │ ├── lsp.lua │ │ │ │ ├── lsp │ │ │ │ └── auto_formatting.lua │ │ │ │ ├── lualine.lua │ │ │ │ ├── lualine │ │ │ │ ├── filename.lua │ │ │ │ └── lsp_clients.lua │ │ │ │ ├── octo.lua │ │ │ │ ├── palette.lua │ │ │ │ ├── palette │ │ │ │ ├── colors.lua │ │ │ │ ├── nord.lua │ │ │ │ ├── sweetie.lua │ │ │ │ └── tokyonight.lua │ │ │ │ ├── serialize.lua │ │ │ │ └── timer.lua │ │ ├── delphinus │ │ │ └── markdown.lua │ │ └── lazies │ │ │ ├── blink.lua │ │ │ ├── cmp.lua │ │ │ ├── lsp.lua │ │ │ ├── minimal.lua │ │ │ ├── opt.lua │ │ │ ├── start.lua │ │ │ └── telescope.lua │ ├── mason │ │ └── packages │ │ │ ├── golangci-lint │ │ │ └── package.yaml │ │ │ └── perlnavigator │ │ │ └── package.yaml │ └── plugin │ │ └── fssh.vim ├── peco │ └── config.json ├── powerline │ ├── __init__.py │ ├── colors.json │ ├── colorschemes │ │ ├── default.json │ │ ├── ipython │ │ │ ├── __main__.json │ │ │ └── default.json │ │ ├── pdb │ │ │ ├── __main__.json │ │ │ ├── default.json │ │ │ └── solarized.json │ │ ├── shell │ │ │ ├── __main__.json │ │ │ ├── default.json │ │ │ └── solarized.json │ │ ├── solarized.json │ │ ├── solarizedlight.json │ │ ├── tmux │ │ │ ├── __main__.json │ │ │ ├── default.json │ │ │ ├── solarized.json │ │ │ └── solarizedlight.json │ │ ├── vim │ │ │ ├── __main__.json │ │ │ ├── custom.json │ │ │ ├── default.json │ │ │ ├── solarized.json │ │ │ └── solarizedlight.json │ │ └── wm │ │ │ └── default.json │ ├── default.json │ ├── ext │ │ ├── __init__.py │ │ ├── segments.py │ │ ├── segments │ │ │ └── __init__.py │ │ ├── tmux │ │ │ ├── __init__.py │ │ │ └── segments │ │ │ │ ├── __init__.py │ │ │ │ ├── battery.py │ │ │ │ ├── branch.py │ │ │ │ ├── cool_battery.py │ │ │ │ ├── host_info.py │ │ │ │ ├── nowplayinglastfm.py │ │ │ │ └── ps.py │ │ └── vim │ │ │ ├── __init__.py │ │ │ ├── matcher.py │ │ │ └── segments │ │ │ ├── __init__.py │ │ │ ├── custom.py │ │ │ ├── fugitive.py │ │ │ ├── iexe_mysql.py │ │ │ ├── ref_perldoc.py │ │ │ ├── repo_directory.py │ │ │ ├── table_mode.py │ │ │ ├── unite.py │ │ │ └── watchdogs.py │ └── themes │ │ ├── ascii.json │ │ ├── ipython │ │ ├── in.json │ │ ├── in2.json │ │ ├── out.json │ │ └── rewrite.json │ │ ├── pdb │ │ └── default.json │ │ ├── powerline.json │ │ ├── powerline_unicode7.json │ │ ├── shell │ │ ├── __main__.json │ │ ├── continuation.json │ │ ├── custom.json │ │ ├── default.json │ │ ├── default_leftonly.json │ │ └── select.json │ │ ├── tmux │ │ └── default.json │ │ ├── unicode.json │ │ ├── unicode_terminus.json │ │ ├── unicode_terminus_condensed.json │ │ ├── vim │ │ ├── __main__.json │ │ ├── cmdwin.json │ │ ├── custom.json │ │ ├── default.json │ │ ├── help.json │ │ ├── plugin_calc.json │ │ ├── plugin_calendar.json │ │ ├── plugin_commandt.json │ │ ├── plugin_fugitive.json │ │ ├── plugin_gitcommit.json │ │ ├── plugin_gundo-preview.json │ │ ├── plugin_gundo.json │ │ ├── plugin_iexe_mysql.json │ │ ├── plugin_nerdtree.json │ │ ├── plugin_ref_perldoc.json │ │ ├── plugin_unite.json │ │ ├── plugin_vimshell.json │ │ ├── quickfix.json │ │ └── tabline.json │ │ └── wm │ │ └── default.json ├── ranger │ ├── commands.py │ ├── commands_full.py │ ├── rc.conf │ ├── rifle.conf │ ├── scope.sh │ └── tagged ├── vifm │ ├── colors │ │ └── nord.vifm │ └── vifmrc ├── wezterm │ ├── battery.lua │ ├── colors.lua │ ├── const.lua │ ├── key_tables.lua │ ├── keys.lua │ ├── op_envs.lua │ ├── status_bar.lua │ ├── timemachine.lua │ └── wezterm.lua └── yamllint │ └── config ├── .cspell.yaml ├── .curlrc ├── .editrc ├── .eslintrc.js ├── .eslintrc.json ├── .fdignore ├── .gitattributes ├── .gitconfig ├── .gitignore ├── .gitignore-global ├── .gitmodules ├── .golangci.yml ├── .grcat ├── .hammerspoon └── init.lua ├── .inputrc ├── .iterm2 ├── imgcat ├── imgls ├── it2api ├── it2attention ├── it2check ├── it2copy ├── it2dl ├── it2getvar ├── it2git ├── it2setcolor ├── it2setkeylabel ├── it2ul └── it2universion ├── .iterm2_shell_integration.zsh ├── .jsbeautifyrc ├── .jshintrc ├── .luacheckrc ├── .luarc.json ├── .my.cnf ├── .nbrc ├── .pentadactyl ├── colors │ ├── desert.penta │ ├── solarized-dark.penta │ ├── solarized-light.penta │ └── vimplight.penta └── plugins │ ├── copy.js │ ├── copy.js.orig │ └── tab-options-dev.js ├── .pentadactylrc ├── .pre-commit-config.yaml ├── .proverc ├── .ptconfig.toml ├── .ptpython └── config.py ├── .screen.cygwin ├── .screen ├── backtick.pl ├── battery.sh ├── binds ├── cpu ├── cpu.c ├── defaults ├── defaults-inner ├── inner ├── inner.backup ├── inner.cygwin ├── inner.office ├── inner.remora-air2 ├── lastfm-json.pl ├── lastfm.pl ├── lib │ ├── ColoredString.pm │ ├── Segment.pm │ └── Segment │ │ ├── IP.pm │ │ ├── LastFM.pm │ │ ├── Location.pm │ │ └── Weather.pm ├── limechat-notify.bat ├── limechat-notify.vbs ├── memory ├── memory.c ├── outer ├── outer.backup ├── outer.cygwin ├── outer.office ├── outer.remora-air2 ├── play.pl ├── temperature.sh └── twitter.pl ├── .screenrc.office ├── .screenrc.remora ├── .screenrc.remora-air2 ├── .stylua.toml ├── .styluaignore ├── .tern-project ├── .textlintrc ├── .tmux.conf ├── .tmux.conf.office ├── .tmux ├── bash_completion_tmux.sh ├── copy-fssh.conf ├── default.conf ├── h-boetes.conf ├── n-marriott.conf ├── nord-statusline.conf ├── pane.conf ├── powerline.conf ├── prefix.conf ├── screen-keys.conf ├── statusline.conf ├── t-williams.conf ├── tmux-zoom.sh ├── tmux.vim ├── tmux_backup.sh ├── tpm.conf └── vim-keys.conf ├── .vim ├── gvimrc ├── mk_color.vim ├── rc │ ├── commands.vim │ ├── dein.vim │ ├── dein │ │ ├── default.toml │ │ ├── defx_lazy.toml │ │ ├── denite_lazy.toml │ │ ├── deoplete_lazy.toml │ │ ├── lazy.toml │ │ ├── lightline.toml │ │ └── nvim-lua.toml │ ├── map.vim │ ├── set.vim │ └── term.vim ├── syntax │ └── pentadactyl.vim ├── vimparse.pl ├── vimrc └── vimrc.simple ├── .vimrc_first.vim ├── .xvimrc ├── .zlogin ├── .zlogout ├── .zpreztorc ├── .zprofile ├── .zsh ├── basic.zshrc ├── completions │ ├── _gcsdk │ └── _ghq ├── dircolors │ ├── README.md │ ├── dircolors.base16.dark │ └── dircolors.base16.light ├── export-alias.zsh ├── git-foresta.zsh ├── iterm2.zsh ├── my-fzf.zsh ├── peco-brew-directories.zsh ├── peco-bundler.zsh ├── peco-ghq.zsh ├── peco-git.zsh ├── peco-open-pullrequest.zsh ├── peco-select-history.zsh ├── peco-view-sources.zsh ├── peco-z.zsh ├── pretty-print-array.zsh └── prezto │ ├── functions │ └── perl-info │ └── prompt_delphinus_setup ├── .zshenv ├── .zshrc ├── README ├── ansible ├── .sops.yaml ├── ansible.cfg ├── files │ ├── bash_profile │ ├── bashrc │ ├── double.json │ ├── git-core.patch │ ├── macvim-kaoriya.rb │ └── symlinked.rb.patch ├── host_vars │ ├── default │ ├── localhost │ └── remora-air3.local ├── local.yml ├── local_light.yml ├── localhost ├── mac.yml ├── tasks │ ├── aquaskk.yml │ ├── common.yml │ ├── dotfiles.yml │ ├── env.yml │ ├── git.yml │ ├── homebrew.yml │ ├── install.yml │ ├── other_homebrew.yml │ ├── pip.yml │ ├── post_homebrew.yml │ ├── secrets.yml │ └── secrets_office.yml ├── templates │ ├── 3llo.j2 │ ├── aws-config.j2 │ ├── config-local.fish.j2 │ ├── config_memo_toml.j2 │ ├── docker-config.json.j2 │ ├── git_hooks_pre-commit.j2 │ ├── git_prohibited_words.j2 │ ├── gitconfig_local.j2 │ ├── local_perl.py.j2 │ ├── local_perl.sh.j2 │ ├── my_cnf.j2 │ ├── myclirc.j2 │ ├── office-api-config-backend.json.j2 │ ├── office-api-config.json.j2 │ ├── organization_envrc.j2 │ ├── organization_envrc_go.j2 │ ├── organization_vimrc.j2 │ ├── organization_vimrc_go.j2 │ ├── pause.j2 │ ├── ptignore.j2 │ ├── ssh_config.j2 │ ├── taskrc.j2 │ ├── tm.fish.j2 │ └── work.inc └── vars │ ├── encrypted.secrets.yml │ └── main.yml ├── bin ├── 24-bit-color.sh ├── add-amethyst-setting.rb ├── ansible-vault-password ├── assert-vpn-on ├── battery.tmux ├── bench-nvim ├── brew-all-deps ├── brew-directories.rb ├── check-fetchmail.rb ├── chmod-x.pl ├── chr.pl ├── cmd_init.bat ├── color-test.sh ├── color_palette.pl ├── colors.sh ├── colorterm ├── colortrans.py ├── convert-memo ├── cron_godo.sh ├── custom_characters.rb ├── diff-highlight ├── eastw ├── edit-ansible-vault ├── findpm.sh ├── fssh.sh ├── git-alias ├── git-blame-pr ├── git-clean-remote ├── git-remote-add ├── git_prohibited_words_checker ├── git_prohibited_words_checker.rb ├── glyphs ├── google ├── imgcat ├── info-server.js ├── info-server.py ├── itunes.scpt ├── jgrep ├── kintai ├── last-line.py ├── lastfm-lover.pl ├── macos-askpass ├── make-cue ├── make-repository.sh ├── make_api_config ├── manage-repository.rb ├── manbash ├── md_to_qiita ├── merge-help-tags ├── minivim ├── modtime ├── mtime2ctime ├── mysql-cli ├── neovim_pwd.py ├── nocolor ├── norm_re ├── nview ├── path ├── pbclip ├── pbcopy.pl ├── perlbrew.sh ├── pevo ├── play-ansbile ├── private-use-area-table.rb ├── pstree-mem ├── reverse-ssh-tunnel.sh ├── run-timemachine ├── set_env_for_fssh.rb ├── set_ssh_auth_sock.rb ├── simple-pstree ├── skkdic-merge ├── tab-space-pre-commit.rb ├── tmstatus ├── tmstatus.sh ├── tmstatus.t ├── tmux-run ├── tmux-vpn ├── tmux-vpn.sh ├── tmux.sh ├── track-update.pl ├── ttc2otf ├── update-gitignore.ts ├── update-gitignore │ ├── content.test.ts │ ├── content.ts │ ├── gibo.test.ts │ ├── gibo.ts │ ├── gitignore.ts │ ├── latest.test.ts │ ├── latest.ts │ └── temp-file.ts ├── watch-pppd ├── watch-timemachine └── xterm_colour_chart ├── commit-template.txt ├── cpanfile ├── cpanfile.snapshot ├── custom.css ├── iterm2 ├── escindicator.py ├── jsonpretty.py ├── load_average.py ├── mousemode.py ├── ping.py ├── statusbar.py └── toggle_font_size.py ├── keyhac ├── MyConfig.py ├── README └── config.py ├── package-lock.json ├── package.json ├── tsconfig.json └── tslint.json /.agignore: -------------------------------------------------------------------------------- 1 | .o 2 | .exe 3 | .dll 4 | .bak 5 | .DS_Store 6 | .zwc 7 | .pyc 8 | .swp 9 | .swo 10 | .class 11 | .hg/ 12 | .git/ 13 | .bzr/ 14 | .svn/ 15 | tags 16 | -------------------------------------------------------------------------------- /.asdfrc: -------------------------------------------------------------------------------- 1 | legacy_version_file = yes 2 | -------------------------------------------------------------------------------- /.config/1Password/ssh/agent.toml: -------------------------------------------------------------------------------- 1 | # This is the 1Password SSH agent config file, which allows you to customize the 2 | # behavior of the SSH agent running on this machine. 3 | # 4 | # You can use it to: 5 | # * Enable keys from other vaults than the Private vault 6 | # * Control the order in which keys are offered to SSH servers 7 | # 8 | # EXAMPLE 9 | # 10 | # By default, all keys in your Private vault(s) are enabled: 11 | # 12 | # [[ssh-keys]] 13 | # vault = "Private" 14 | # 15 | # You can enable more keys by adding more `[[ssh-keys]]` entries. 16 | # For example, to first enable item "My SSH Key" from "My Custom Vault": 17 | # 18 | # [[ssh-keys]] 19 | # item = "My SSH Key" 20 | # vault = "My Custom Vault" 21 | # 22 | # [[ssh-keys]] 23 | # vault = "Private" 24 | # 25 | # You can test the result by running: 26 | # 27 | # SSH_AUTH_SOCK=~/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock ssh-add -l 28 | # 29 | # More examples can be found here: 30 | # https://developer.1password.com/docs/ssh/agent/config 31 | [[ssh-keys]] 32 | item = "id_ed25519" 33 | vault = "Personal" 34 | -------------------------------------------------------------------------------- /.config/AquaSKK/kana-rule.conf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphinus/dotfiles/d01324d1ceb9bb45f6ea53b918f11acdf50019c4/.config/AquaSKK/kana-rule.conf -------------------------------------------------------------------------------- /.config/alacritty/nord.toml: -------------------------------------------------------------------------------- 1 | [colors.bright] 2 | black = "#4c566a" 3 | blue = "#81a1c1" 4 | cyan = "#8fbcbb" 5 | green = "#a3be8c" 6 | magenta = "#b48ead" 7 | red = "#bf616a" 8 | white = "#eceff4" 9 | yellow = "#ebcb8b" 10 | 11 | [colors.cursor] 12 | cursor = "#d8dee9" 13 | text = "#2e3440" 14 | 15 | [colors.dim] 16 | black = "#373e4d" 17 | blue = "#68809a" 18 | cyan = "#6d96a5" 19 | green = "#809575" 20 | magenta = "#8c738c" 21 | red = "#94545d" 22 | white = "#aeb3bb" 23 | yellow = "#b29e75" 24 | 25 | [colors.normal] 26 | black = "#3b4252" 27 | blue = "#81a1c1" 28 | cyan = "#88c0d0" 29 | green = "#a3be8c" 30 | magenta = "#b48ead" 31 | red = "#bf616a" 32 | white = "#e5e9f0" 33 | yellow = "#ebcb8b" 34 | 35 | [colors.primary] 36 | background = "#2e3440" 37 | dim_foreground = "#a5abb6" 38 | foreground = "#d8dee9" 39 | 40 | # [colors.search.footer_bar] 41 | # background = "#434c5e" 42 | # foreground = "#d8dee9" 43 | 44 | [colors.search.matches] 45 | background = "#88c0d0" 46 | foreground = "CellBackground" 47 | 48 | [colors.selection] 49 | background = "#4c566a" 50 | text = "CellForeground" 51 | 52 | [colors.vi_mode_cursor] 53 | cursor = "#d8dee9" 54 | text = "#2e3440" 55 | -------------------------------------------------------------------------------- /.config/alacritty/shell.toml: -------------------------------------------------------------------------------- 1 | [shell] 2 | args = [ 3 | "OP_SERVICE_ACCOUNT_TOKEN=", 4 | "/Users/jinnouchi.yasushi/git/dotfiles/bin/tmux-run" 5 | ] 6 | program = "/usr/bin/env" 7 | -------------------------------------------------------------------------------- /.config/bat/config: -------------------------------------------------------------------------------- 1 | --theme=Nord 2 | --italic-text=always 3 | # https://github.com/sharkdp/bat/issues/1413#issuecomment-736271401 4 | --pager='less -FRX' 5 | --map-syntax='aliases:TOML' 6 | --map-syntax='cpanfile:Perl' 7 | --map-syntax='cpanfile.snapshot:YAML' 8 | --style='changes,snip' 9 | --paging=always 10 | -------------------------------------------------------------------------------- /.config/direnv/direnvrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphinus/dotfiles/d01324d1ceb9bb45f6ea53b918f11acdf50019c4/.config/direnv/direnvrc -------------------------------------------------------------------------------- /.config/fish/completions/fisher.fish: -------------------------------------------------------------------------------- 1 | complete --command fisher --exclusive --long help --description "Print help" 2 | complete --command fisher --exclusive --long version --description "Print version" 3 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins" 4 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins" 5 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins" 6 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex" 7 | complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)" 8 | -------------------------------------------------------------------------------- /.config/fish/completions/gcloud.fish: -------------------------------------------------------------------------------- 1 | 2 | complete -f -c gcloud -a '(gcloud_sdk_argcomplete)' 3 | -------------------------------------------------------------------------------- /.config/fish/completions/gsutil.fish: -------------------------------------------------------------------------------- 1 | 2 | complete -x -c gsutil -a '(gcloud_sdk_argcomplete)' 3 | -------------------------------------------------------------------------------- /.config/fish/completions/nb.fish: -------------------------------------------------------------------------------- 1 | /Users/jinnouchi.yasushi/git/github.com/xwmx/nb/etc/nb-completion.fish -------------------------------------------------------------------------------- /.config/fish/conf.d/ghq_key_bindings.fish: -------------------------------------------------------------------------------- 1 | bind \cg '__ghq_repository_search' 2 | if bind -M insert >/dev/null 2>/dev/null 3 | bind -M insert \cg '__ghq_repository_search' 4 | end 5 | -------------------------------------------------------------------------------- /.config/fish/fish_plugins: -------------------------------------------------------------------------------- 1 | jorgebucaran/fisher 2 | jethrokuan/z 3 | jethrokuan/fzf 4 | decors/fish-ghq 5 | orefalo/grc 6 | edc/bass 7 | aliz-ai/google-cloud-sdk-fish-completion 8 | delphinus/fish-git-info 9 | -------------------------------------------------------------------------------- /.config/fish/functions/__fzf_complete_preview.fish: -------------------------------------------------------------------------------- 1 | function __fzf_complete_preview -d 'generate preview for completion widget. 2 | argv[1] is the currently selected candidate in fzf 3 | argv[2] is a string containing the rest of the output produced by `complete -Ccmd` 4 | ' 5 | 6 | if test "$argv[2]" = "Redefine variable" 7 | # show environment variables current value 8 | set -l evar (echo $argv[1] | cut -d= -f1) 9 | echo $argv[1]$$evar 10 | else 11 | echo $argv[1] 12 | end 13 | 14 | set -l path (string replace "~" $HOME -- $argv[1]) 15 | 16 | # list directories on preview 17 | if test -d "$path" 18 | eval $FZF_PREVIEW_DIR_CMD (string escape $path) 19 | end 20 | 21 | # show ten lines of non-binary files preview 22 | if test -f "$path"; and grep -qI . "$path" 23 | eval $FZF_PREVIEW_FILE_CMD (string escape $path) 24 | end 25 | 26 | # if fish knows about it, let it show info 27 | type -q "$path" 2>/dev/null; and type -a "$path" 28 | 29 | # show aditional data 30 | echo $argv[2] 31 | end 32 | -------------------------------------------------------------------------------- /.config/fish/functions/__fzf_find_file.fish: -------------------------------------------------------------------------------- 1 | function __fzf_find_file -d "List files and folders" 2 | set -l commandline (__fzf_parse_commandline) 3 | set -l dir $commandline[1] 4 | set -l fzf_query $commandline[2] 5 | 6 | set -q FZF_FIND_FILE_COMMAND 7 | or set -l FZF_FIND_FILE_COMMAND " 8 | command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \ 9 | -o -type f -print \ 10 | -o -type d -print \ 11 | -o -type l -print 2> /dev/null | sed 's@^\./@@'" 12 | 13 | begin 14 | eval "$FZF_FIND_FILE_COMMAND | "(__fzfcmd) "-m $FZF_DEFAULT_OPTS $FZF_FIND_FILE_OPTS --query \"$fzf_query\"" | while read -l s; set results $results $s; end 15 | end 16 | 17 | if test -z "$results" 18 | commandline -f repaint 19 | return 20 | else 21 | commandline -t "" 22 | end 23 | 24 | for result in $results 25 | commandline -it -- (string escape $result) 26 | commandline -it -- " " 27 | end 28 | commandline -f repaint 29 | end 30 | -------------------------------------------------------------------------------- /.config/fish/functions/__fzf_get_dir.fish: -------------------------------------------------------------------------------- 1 | function __fzf_get_dir -d 'Find the longest existing filepath from input string' 2 | set dir $argv 3 | 4 | # Strip all trailing slashes. Ignore if $dir is root dir (/) 5 | if test (string length $dir) -gt 1 6 | set dir (string replace -r '/*$' '' $dir) 7 | end 8 | 9 | # Iteratively check if dir exists and strip tail end of path 10 | while test ! -d "$dir" 11 | # If path is absolute, this can keep going until ends up at / 12 | # If path is relative, this can keep going until entire input is consumed, dirname returns "." 13 | set dir (dirname "$dir") 14 | end 15 | 16 | echo $dir 17 | end 18 | -------------------------------------------------------------------------------- /.config/fish/functions/__fzf_parse_commandline.fish: -------------------------------------------------------------------------------- 1 | function __fzf_parse_commandline -d 'Parse the current command line token and return split of existing filepath and rest of token' 2 | # eval is used to do shell expansion on paths 3 | set -l commandline (eval "printf '%s' "(commandline -t)) 4 | 5 | if test -z $commandline 6 | # Default to current directory with no --query 7 | set dir '.' 8 | set fzf_query '' 9 | else 10 | set dir (__fzf_get_dir $commandline) 11 | 12 | if test "$dir" = "." -a (string sub -l 1 $commandline) != '.' 13 | # if $dir is "." but commandline is not a relative path, this means no file path found 14 | set fzf_query $commandline 15 | else 16 | # Also remove trailing slash after dir, to "split" input properly 17 | set fzf_query (string replace -r "^$dir/?" '' "$commandline") 18 | end 19 | end 20 | 21 | echo $dir 22 | echo $fzf_query 23 | end 24 | -------------------------------------------------------------------------------- /.config/fish/functions/__fzf_reverse_isearch.fish: -------------------------------------------------------------------------------- 1 | function __fzf_reverse_isearch 2 | history merge 3 | history -z | eval (__fzfcmd) --read0 --print0 --tiebreak=index --toggle-sort=ctrl-r $FZF_DEFAULT_OPTS $FZF_REVERSE_ISEARCH_OPTS -q '(commandline)' | read -lz result 4 | and commandline -- $result 5 | commandline -f repaint 6 | end 7 | -------------------------------------------------------------------------------- /.config/fish/functions/__fzfcmd.fish: -------------------------------------------------------------------------------- 1 | function __fzfcmd 2 | set -q FZF_TMUX; or set FZF_TMUX 0 3 | set -q FZF_TMUX_HEIGHT; or set FZF_TMUX_HEIGHT 40% 4 | if test $FZF_TMUX -eq 1 5 | echo "fzf-tmux -d$FZF_TMUX_HEIGHT" 6 | else 7 | echo "fzf" 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /.config/fish/functions/__ghq_repository_search.fish: -------------------------------------------------------------------------------- 1 | function __ghq_repository_search -d 'Repository search' 2 | set -l selector 3 | [ -n "$GHQ_SELECTOR" ]; and set selector $GHQ_SELECTOR; or set selector fzf 4 | set -l selector_options 5 | [ -n "$GHQ_SELECTOR_OPTS" ]; and set selector_options $GHQ_SELECTOR_OPTS 6 | 7 | if not type -qf $selector 8 | printf "\nERROR: '$selector' not found.\n" 9 | return 1 10 | end 11 | 12 | set -l query (commandline -b) 13 | [ -n "$query" ]; and set flags --query="$query"; or set flags 14 | switch "$selector" 15 | case fzf fzf-tmux peco percol fzy sk 16 | ghq list --full-path | "$selector" $selector_options $flags | read select 17 | case \* 18 | printf "\nERROR: plugin-ghq is not support '$selector'.\n" 19 | end 20 | [ -n "$select" ]; and cd "$select" 21 | commandline -f repaint 22 | end 23 | -------------------------------------------------------------------------------- /.config/fish/functions/__z_clean.fish: -------------------------------------------------------------------------------- 1 | function __z_clean -d "Clean up .z file to remove paths no longer valid" 2 | set -l tmpfile (mktemp $Z_DATA.XXXXXX) 3 | 4 | if test -f $tmpfile 5 | while read line 6 | set -l path (string split '|' $line)[1] 7 | test -d $path; and echo $line 8 | end <$Z_DATA >$tmpfile 9 | command mv -f $tmpfile $Z_DATA 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /.config/fish/functions/__z_complete.fish: -------------------------------------------------------------------------------- 1 | function __z_complete -d "add completions" 2 | complete -c $Z_CMD -a "(__z -l | string replace -r '^\\S*\\s*' '')" -f -k 3 | complete -c $ZO_CMD -a "(__z -l | string replace -r '^\\S*\\s*' '')" -f -k 4 | 5 | complete -c $Z_CMD -s c -l clean -d "Cleans out $Z_DATA" 6 | complete -c $Z_CMD -s e -l echo -d "Prints best match, no cd" 7 | complete -c $Z_CMD -s l -l list -d "List matches, no cd" 8 | complete -c $Z_CMD -s p -l purge -d "Purges $Z_DATA" 9 | complete -c $Z_CMD -s r -l rank -d "Searches by rank, cd" 10 | complete -c $Z_CMD -s t -l recent -d "Searches by recency, cd" 11 | complete -c $Z_CMD -s h -l help -d "Print help" 12 | complete -c $Z_CMD -s x -l delete -d "Removes the current directory from $Z_DATA" 13 | end 14 | -------------------------------------------------------------------------------- /.config/fish/functions/_grc_wrap.fish: -------------------------------------------------------------------------------- 1 | function _grc_wrap -a cmd 2 | if command -s grc > /dev/null 3 | if set -q grc_wrap_commands 4 | if not builtin contains -- "$cmd" $grc_wrap_commands 5 | return 6 | end 7 | end 8 | 9 | function "$cmd" -V cmd -w "$cmd" 10 | set -l options "grc_wrap_options_$cmd" 11 | command grc -es --colour=auto "$cmd" $$options $argv 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /.config/fish/functions/bass.fish: -------------------------------------------------------------------------------- 1 | function bass 2 | set -l bash_args $argv 3 | set -l bass_debug 4 | if test "$bash_args[1]_" = '-d_' 5 | set bass_debug true 6 | set -e bash_args[1] 7 | end 8 | 9 | set -l script_file (mktemp) 10 | if command -v python3 >/dev/null 2>&1 11 | command python3 -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file 12 | else 13 | command python -sS (dirname (status -f))/__bass.py $bash_args 3>$script_file 14 | end 15 | set -l bass_status $status 16 | if test $bass_status -ne 0 17 | return $bass_status 18 | end 19 | 20 | if test -n "$bass_debug" 21 | cat $script_file 22 | end 23 | source $script_file 24 | command rm $script_file 25 | end 26 | 27 | function __bass_usage 28 | echo "Usage: bass [-d] " 29 | end 30 | -------------------------------------------------------------------------------- /.config/fish/functions/cvs.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap cvs 2 | -------------------------------------------------------------------------------- /.config/fish/functions/df.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap df 2 | -------------------------------------------------------------------------------- /.config/fish/functions/diff.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap diff 2 | -------------------------------------------------------------------------------- /.config/fish/functions/dig.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap dig 2 | -------------------------------------------------------------------------------- /.config/fish/functions/fish_prompt.fish: -------------------------------------------------------------------------------- 1 | function fish_prompt --description 'My prompt' 2 | end 3 | -------------------------------------------------------------------------------- /.config/fish/functions/fzf_ghq.fish: -------------------------------------------------------------------------------- 1 | function fzf_ghq --description 'Move with FZF + ghq' 2 | set -l options 'i/insert' 3 | argparse $options -- $argv 4 | 5 | ghq list --full-path | \ 6 | perl -pe 's,$ENV{HOME},~,' | \ 7 | eval "fzf $FZF_DEFAULT_OPTS" | \ 8 | perl -pe 's/^~(\w*)/(getpwnam($1 || $ENV{USER}))[7]/e' | \ 9 | read -l select 10 | 11 | if test -n "$select" 12 | if set -q _flag_insert 13 | commandline -i "$select" 14 | else 15 | cd "$select" 16 | emit fish_prompt 17 | end 18 | end 19 | commandline -f repaint 20 | end 21 | -------------------------------------------------------------------------------- /.config/fish/functions/fzf_git_status.fish: -------------------------------------------------------------------------------- 1 | function fzf_git_status --description 'List / open files shown by `git status`' 2 | set -l options 'e/editor' 3 | argparse $options -- $argv 4 | 5 | git -c color.status=always status -s -uall | \ 6 | sort | \ 7 | eval (__fzfcmd)" --ansi $FZF_DEFAULT_OPTS" | \ 8 | cut -b4- | \ 9 | read -l select 10 | 11 | set -l st 0 12 | if test -n "$select" 13 | if set -q _flag_editor 14 | commandline $EDITOR" $select" ;and commandline -f execute 15 | set st $sattus 16 | else 17 | commandline -i "$select" 18 | end 19 | end 20 | commandline -f repaint 21 | return $st 22 | end 23 | -------------------------------------------------------------------------------- /.config/fish/functions/fzf_pe.fish: -------------------------------------------------------------------------------- 1 | function fzf_pe --description 'Extract paths from input and open / edit them' 2 | set -l options 'e/editor' 3 | argparse $options -- $argv 4 | 5 | path-extractor | \ 6 | eval (__fzfcmd)" $FZF_DEFAULT_OPTS" | \ 7 | read -l select 8 | 9 | set -l st 0 10 | if test -n "$select" 11 | if set -q _flag_editor 12 | commandline $EDITOR" $select" ;and commandline -f execute 13 | set st $status 14 | else 15 | commandline -i "$select" 16 | end 17 | end 18 | commandline -f repaint 19 | return $st 20 | end 21 | -------------------------------------------------------------------------------- /.config/fish/functions/fzf_z.fish: -------------------------------------------------------------------------------- 1 | function fzf_z --description 'Move with FZF + z' 2 | set -l options 'i/insert' 3 | argparse $options -- $argv 4 | 5 | z --list | \ 6 | perl -pe 's,$ENV{HOME},~,' | \ 7 | eval "fzf +s $FZF_DEFAULT_OPTS" | \ 8 | cut -c12- | \ 9 | perl -pe 's/^~(\w*)/(getpwnam($1 || $ENV{USER}))[7]/e' | \ 10 | read -l select 11 | 12 | if test -n "$select" 13 | if set -q _flag_insert 14 | commandline -i "$select" 15 | else 16 | cd "$select" 17 | emit fish_prompt 18 | end 19 | end 20 | commandline -f repaint 21 | end 22 | -------------------------------------------------------------------------------- /.config/fish/functions/g++.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap g++ 2 | -------------------------------------------------------------------------------- /.config/fish/functions/gcc.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap gcc 2 | -------------------------------------------------------------------------------- /.config/fish/functions/gcgip.fish: -------------------------------------------------------------------------------- 1 | function gcgip --description 'Show global IP address to access a GCE instance searched by its name' 2 | set me (basename -s .fish (status filename)) 3 | if not count $argv > /dev/null 4 | echo "Usage: $me [instance name]" >&2 5 | return 1 6 | end 7 | set result (gcloud compute instances list --filter "name:$argv[1]" --format json | tr -d '\n') 8 | if test $result = '[]' 9 | echo 'not found' >&2 10 | return 1 11 | end 12 | echo $result | jq -r '.[0].networkInterfaces[0].accessConfigs[0].natIP' 13 | end 14 | -------------------------------------------------------------------------------- /.config/fish/functions/humanize_duration.fish: -------------------------------------------------------------------------------- 1 | function humanize_duration -d "Make a time interval human readable" 2 | command awk ' 3 | function hmTime(time, stamp) { 4 | split("h:m:s:ms", units, ":") 5 | for (i = 2; i >= -1; i--) { 6 | if (t = int( i < 0 ? time % 1000 : time / (60 ^ i * 1000) % 60 )) { 7 | stamp = stamp t units[sqrt((i - 2) ^ 2) + 1] " " 8 | } 9 | } 10 | if (stamp ~ /^ *$/) { 11 | return "0ms" 12 | } 13 | return substr(stamp, 1, length(stamp) - 1) 14 | } 15 | { 16 | print hmTime($0) 17 | } 18 | ' 19 | end 20 | -------------------------------------------------------------------------------- /.config/fish/functions/ifconfig.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap ifconfig 2 | -------------------------------------------------------------------------------- /.config/fish/functions/make.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap make 2 | -------------------------------------------------------------------------------- /.config/fish/functions/mount.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap mount 2 | -------------------------------------------------------------------------------- /.config/fish/functions/mtr.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap mtr 2 | -------------------------------------------------------------------------------- /.config/fish/functions/netstat.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap netstat 2 | -------------------------------------------------------------------------------- /.config/fish/functions/nvim.fish: -------------------------------------------------------------------------------- 1 | function nvim -d 'Launch Neovim with CSI u features' 2 | printf '\033[>4;1m' 3 | command nvim $argv 4 | printf '\033[>4;m' 5 | end 6 | -------------------------------------------------------------------------------- /.config/fish/functions/ping.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap ping 2 | -------------------------------------------------------------------------------- /.config/fish/functions/ps.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap ps 2 | -------------------------------------------------------------------------------- /.config/fish/functions/tail.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap tail 2 | -------------------------------------------------------------------------------- /.config/fish/functions/traceroute.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap traceroute 2 | -------------------------------------------------------------------------------- /.config/fish/functions/wdiff.fish: -------------------------------------------------------------------------------- 1 | _grc_wrap wdiff 2 | -------------------------------------------------------------------------------- /.config/gocode/config.json: -------------------------------------------------------------------------------- 1 | {"propose-builtins":true,"lib-path":"","custom-pkg-prefix":"","custom-vendor-dir":"","autobuild":true,"force-debug-output":"","package-lookup-mode":"go","close-timeout":1800,"unimported-packages":true,"partials":true,"ignore-case":false,"class-filtering":true} -------------------------------------------------------------------------------- /.config/ipython/README: -------------------------------------------------------------------------------- 1 | This is the IPython directory. 2 | 3 | For more information on configuring IPython, do: 4 | 5 | ipython config -h 6 | -------------------------------------------------------------------------------- /.config/ipython/profile_default/startup/README: -------------------------------------------------------------------------------- 1 | This is the IPython startup directory 2 | 3 | .py and .ipy files in this directory will be run *prior* to any code or files specified 4 | via the exec_lines or exec_files configurables whenever you load this profile. 5 | 6 | Files will be run in lexicographical order, so you can control the execution order of files 7 | with a prefix, e.g.:: 8 | 9 | 00-first.py 10 | 50-middle.py 11 | 99-last.ipy 12 | -------------------------------------------------------------------------------- /.config/nvim-dev/.stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 120 2 | line_endings = "Unix" 3 | indent_type = "Spaces" 4 | indent_width = 2 5 | quote_style = "AutoPreferDouble" 6 | no_call_parentheses = true 7 | -------------------------------------------------------------------------------- /.config/nvim-dev/dashboard-frecency/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dashboard-nvim": { "branch": "feat/mru-list-fn", "commit": "b81485946fbf396c1f569f7d628465a0f14527b5" }, 3 | "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, 4 | "nvim-web-devicons": { "branch": "master", "commit": "e87554285f581047b1bf236794b0eb812b444b87" }, 5 | "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, 6 | "telescope-frecency.nvim": { "branch": "master", "commit": "8622ef42f73cf0eb76bbe049220a812ffe32354d" }, 7 | "telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" } 8 | } 9 | -------------------------------------------------------------------------------- /.config/nvim-dev/dashboard/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dashboard-nvim": { "branch": "master", "commit": "ae309606940d26d8c9df8b048a6e136b6bbec478" }, 3 | "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, 4 | "nvim-web-devicons": { "branch": "master", "commit": "0eb18da56e2ba6ba24de7130a12bcc4e31ad11cb" } 5 | } 6 | -------------------------------------------------------------------------------- /.config/nvim-dev/gitsigns/init.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" 2 | if vim.uv.fs_stat(lazypath) then 3 | vim.opt.rtp:prepend(lazypath) 4 | else 5 | load(vim.fn.system "curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua")() 6 | end 7 | 8 | require("lazy").setup { 9 | { 10 | "lewis6991/gitsigns.nvim", 11 | event = { "FocusLost", "CursorHold" }, 12 | lazy = true, 13 | opts = { current_line_blame = true }, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /.config/nvim-dev/gitsigns/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "gitsigns.nvim": { "branch": "main", "commit": "fd50977fce4d5240b910d2b816e71fb726cbbaf7" }, 3 | "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" } 4 | } 5 | -------------------------------------------------------------------------------- /.config/nvim-dev/noice/init.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" 2 | if vim.uv.fs_stat(lazypath) then 3 | vim.opt.rtp:prepend(lazypath) 4 | else 5 | load(vim.fn.system "curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua")() 6 | end 7 | 8 | require("lazy").setup { 9 | { 10 | "folke/noice.nvim", 11 | event = "VeryLazy", 12 | opts = {}, 13 | dependencies = { 14 | "MunifTanjim/nui.nvim", 15 | -- { "rcarriga/nvim-notify", opts = { render = "compact" } }, 16 | }, 17 | }, 18 | { 19 | "folke/snacks.nvim", 20 | init = function() 21 | require("snacks").setup { 22 | notifier = { enabled = true }, 23 | } 24 | vim.notify = Snacks.notifier.notify 25 | end, 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /.config/nvim-dev/noice/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "lazy.nvim": { "branch": "main", "commit": "56ead98e05bb37a4ec28930a54d836d033cf00f2" }, 3 | "noice.nvim": { "branch": "main", "commit": "c6f6fb178ebe9b4fd90383de743c3399f8c3a37c" }, 4 | "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, 5 | "nvim-notify": { "branch": "master", "commit": "22f29093eae7785773ee9d543f8750348b1a195c" }, 6 | "snacks.nvim": { "branch": "main", "commit": "bc087d36d6126ccf25f8bb3ead405ec32547d85d" } 7 | } 8 | -------------------------------------------------------------------------------- /.config/nvim-dev/perlnavigator/init.lua: -------------------------------------------------------------------------------- 1 | -- Bootstrap lazy.nvim 2 | local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" 3 | if not (vim.uv or vim.loop).fs_stat(lazypath) then 4 | local lazyrepo = "https://github.com/folke/lazy.nvim.git" 5 | local out = vim.fn.system { "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath } 6 | if vim.v.shell_error ~= 0 then 7 | vim.api.nvim_echo({ 8 | { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, 9 | { out, "WarningMsg" }, 10 | { "\nPress any key to exit..." }, 11 | }, true, {}) 12 | vim.fn.getchar() 13 | os.exit(1) 14 | end 15 | end 16 | vim.opt.rtp:prepend(lazypath) 17 | 18 | require("lazy").setup { 19 | { 20 | "neovim/nvim-lspconfig", 21 | config = function() 22 | require("lspconfig").perlnavigator.setup { 23 | settings = { 24 | perlnavigator = { 25 | -- perlPath = "carmel", 26 | -- perlParams = { "exec", "perl" }, 27 | includePaths = { "./lib" }, 28 | }, 29 | }, 30 | } 31 | end, 32 | }, 33 | { "williamboman/mason-lspconfig.nvim", opts = {} }, 34 | { "williamboman/mason.nvim", opts = {} }, 35 | } 36 | -------------------------------------------------------------------------------- /.config/nvim-dev/perlnavigator/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, 3 | "mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" }, 4 | "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, 5 | "nvim-lspconfig": { "branch": "master", "commit": "d01864641c6e43c681c3e9f6cf4745c75fdd9dcc" } 6 | } 7 | -------------------------------------------------------------------------------- /.config/nvim-dev/rtbrowse/init.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" 2 | if vim.uv.fs_stat(lazypath) then 3 | vim.opt.rtp:prepend(lazypath) 4 | else 5 | load(vim.fn.system "curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua")() 6 | end 7 | 8 | require("lazy").setup { 9 | { 10 | "nvim-telescope/telescope.nvim", 11 | dependencies = { "nvim-lua/plenary.nvim" }, 12 | cmd = { "Telescope" }, 13 | opts = {}, 14 | }, 15 | { 16 | "delphinus/rtbrowse.nvim", 17 | keys = { 18 | { 19 | "gB", 20 | function() 21 | require("rtbrowse").browse() 22 | end, 23 | mode = { "n", "x", "o" }, 24 | }, 25 | }, 26 | }, 27 | } 28 | -------------------------------------------------------------------------------- /.config/nvim-dev/rtbrowse/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, 3 | "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, 4 | "rtbrowse.nvim": { "branch": "main", "commit": "9e2c7b0ee4c8a16cf2441aeb82cf09b2d1f8174c" }, 5 | "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" } 6 | } 7 | -------------------------------------------------------------------------------- /.config/nvim-dev/telescope/init.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" 2 | if vim.uv.fs_stat(lazypath) then 3 | vim.opt.rtp:prepend(lazypath) 4 | else 5 | load(vim.fn.system "curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua")() 6 | end 7 | 8 | require("lazy").setup { 9 | { "nvim-telescope/telescope-frecency.nvim", opts = {} }, 10 | { 11 | "nvim-telescope/telescope.nvim", 12 | dependencies = { "nvim-lua/plenary.nvim" }, 13 | opts = {}, 14 | keys = { 15 | { 16 | "ff", 17 | mode = { "n" }, 18 | ':Telescope frecency workspace=CWD path_display={"smart"} ', 19 | { 20 | desc = "Telescope find files using frecency", 21 | silent = true, 22 | }, 23 | }, 24 | }, 25 | }, 26 | } 27 | -------------------------------------------------------------------------------- /.config/nvim-dev/telescope/lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" }, 3 | "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, 4 | "telescope-frecency.nvim": { "branch": "master", "commit": "0c43bc7ea4bcd3941f14974a39f2d7f6058b55a5" }, 5 | "telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" } 6 | } 7 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/FTerm.lua: -------------------------------------------------------------------------------- 1 | vim.opt.winblend = 10 2 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/applescript.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("i", "", [[¬]], { buffer = true }) 2 | vim.keymap.set("i", "", [[¬]], { buffer = true }) 3 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/c.lua: -------------------------------------------------------------------------------- 1 | vim.opt.tabstop = 8 2 | vim.opt.shiftwidth = 8 3 | vim.opt.softtabstop = 8 4 | vim.opt.expandtab = false 5 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/css.lua: -------------------------------------------------------------------------------- 1 | vim.opt.iskeyword:append "-" 2 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/fish.lua: -------------------------------------------------------------------------------- 1 | vim.opt.tabstop = 2 2 | vim.opt.shiftwidth = 2 3 | vim.opt.softtabstop = 2 4 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/floaterm.lua: -------------------------------------------------------------------------------- 1 | vim.opt.winblend = 10 2 | vim.opt.cursorline = false 3 | vim.opt.scrolloff = 0 4 | vim.b.dwm_disabled = 1 5 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/git.lua: -------------------------------------------------------------------------------- 1 | vim.opt.spell = false 2 | vim.b.dwm_disabled = true 3 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/gitcommit.lua: -------------------------------------------------------------------------------- 1 | vim.opt.colorcolumn = { 50, 72 } 2 | vim.opt.spell = true 3 | vim.b.dwm_disabled = true 4 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/gitmessagerpopup.lua: -------------------------------------------------------------------------------- 1 | vim.keymap.set("n", "", "O", { buffer = true }) 2 | vim.keymap.set("n", "", "o", { buffer = true }) 3 | vim.keymap.set("n", "", "o", { buffer = true }) 4 | vim.keymap.set("n", "", "o", { buffer = true }) 5 | vim.keymap.set("n", "", "q", { buffer = true }) 6 | vim.keymap.set("n", "", "q", { buffer = true }) 7 | vim.keymap.set("n", "", "q", { buffer = true }) 8 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/go.lua: -------------------------------------------------------------------------------- 1 | vim.opt.foldmethod = "syntax" 2 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/go_gohtmltmpl.lua: -------------------------------------------------------------------------------- 1 | vim.opt.tabstop = 4 2 | vim.opt.shiftwidth = 4 3 | vim.opt.softtabstop = 4 4 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/godoc.lua: -------------------------------------------------------------------------------- 1 | vim.opt.colorcolumn = {} 2 | vim.b.auto_cursorline_disabled = 1 3 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/help.lua: -------------------------------------------------------------------------------- 1 | vim.opt.list = false 2 | vim.opt.number = false 3 | vim.opt.relativenumber = false 4 | vim.opt.signcolumn = "no" 5 | vim.opt.wrap = true 6 | vim.opt.sidescrolloff = 0 7 | vim.b.cursorword = 0 8 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/html_javascript.lua: -------------------------------------------------------------------------------- 1 | vim.opt.tabstop = 2 2 | vim.opt.shiftwidth = 2 3 | vim.opt.softtabstop = 2 4 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/json.lua: -------------------------------------------------------------------------------- 1 | vim.opt.tabstop = 2 2 | vim.opt.shiftwidth = 2 3 | vim.opt.softtabstop = 2 4 | vim.opt.cursorcolumn = false 5 | vim.opt.foldmethod = "syntax" 6 | local f = require "f_meta" 7 | local json_fold_text = f.json_fold_text 8 | or f { 9 | "json_fold_text", 10 | function() 11 | local line = fn.getline(vim.v.foldstart) 12 | local sub = fn.substitute(line, [[\v^\s+([^"]*")?]], "", "") 13 | sub = fn.substitute(sub, [[\v("[^"]*)?\s*$]], "", "") 14 | local level = #vim.v.folddashes 15 | if level <= 12 then 16 | level = fn.nr2char(0x2170 + level - 1) .. " " 17 | end 18 | return ("%s %3d 行: %s "):format(level, vim.v.foldend - vim.v.foldstart + 1, sub) 19 | end, 20 | } 21 | vim.cmd.setlocal("foldtext=" .. json_fold_text:vim() .. "()") 22 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/lua.lua: -------------------------------------------------------------------------------- 1 | vim.opt.tabstop = 2 2 | vim.opt.softtabstop = 2 3 | vim.opt.shiftwidth = 2 4 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/man.lua: -------------------------------------------------------------------------------- 1 | vim.opt.signcolumn = "no" 2 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/markdown.lua: -------------------------------------------------------------------------------- 1 | -- TODO: mappings for VV 2 | vim.keymap.set("n", "", "MarkdownPreview", { buffer = true, remap = true }) 3 | vim.keymap.set("n", "", "StopMarkdownPreview", { buffer = true, remap = true }) 4 | 5 | vim.opt_local.foldmethod = "expr" 6 | vim.opt_local.foldexpr = [[v:lua.require'delphinus.markdown'.foldexpr()]] 7 | vim.opt_local.foldtext = [[v:lua.require'delphinus.markdown'.foldtext()]] 8 | vim.opt_local.conceallevel = 3 9 | vim.opt_local.concealcursor = "nc" 10 | vim.opt_local.wrap = true 11 | 12 | vim.treesitter.start(0, "markdown") 13 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/packer.lua: -------------------------------------------------------------------------------- 1 | vim.b.auto_cursorline_disabled = 1 2 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/php.lua: -------------------------------------------------------------------------------- 1 | vim.opt.expandtab = true 2 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/python.lua: -------------------------------------------------------------------------------- 1 | vim.opt.tabstop = 4 2 | vim.opt.shiftwidth = 4 3 | vim.opt.softtabstop = 4 4 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/qf.lua: -------------------------------------------------------------------------------- 1 | vim.b.dwm_disabled = true 2 | vim.b.cursorword = 0 3 | vim.opt.number = false 4 | vim.opt.relativenumber = false 5 | vim.opt.list = false 6 | vim.opt.cursorcolumn = false 7 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/quickfix.lua: -------------------------------------------------------------------------------- 1 | vim.b.dwm_disabled = true 2 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/ruby.lua: -------------------------------------------------------------------------------- 1 | vim.opt.tabstop = 2 2 | vim.opt.shiftwidth = 2 3 | vim.opt.softtabstop = 2 4 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/scss.lua: -------------------------------------------------------------------------------- 1 | vim.opt.iskeyword:append "-" 2 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/sh.lua: -------------------------------------------------------------------------------- 1 | vim.opt.tabstop = 2 2 | vim.opt.shiftwidth = 2 3 | vim.opt.softtabstop = 2 4 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/tagbar.lua: -------------------------------------------------------------------------------- 1 | vim.b.dwm_disabled = true 2 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/toml.lua: -------------------------------------------------------------------------------- 1 | vim.opt.tabstop = 2 2 | vim.opt.shiftwidth = 2 3 | vim.opt.softtabstop = 2 4 | vim.opt.foldmethod = "marker" 5 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/undotree.lua: -------------------------------------------------------------------------------- 1 | vim.b.dwm_disabled = true 2 | vim.cmd.resize(vim.g.undotree_SplitWidth, { vertical = true }) 3 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/vim.lua: -------------------------------------------------------------------------------- 1 | vim.opt.tabstop = 2 2 | vim.opt.shiftwidth = 2 3 | vim.opt.softtabstop = 2 4 | vim.opt.expandtab = true 5 | -------------------------------------------------------------------------------- /.config/nvim/after/ftplugin/vue.lua: -------------------------------------------------------------------------------- 1 | vim.opt.iskeyword:append { "-", "$" } 2 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/clangd.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- NOTE: do not use clangd for proto 3 | filetypes = { "c", "cpp", "objc", "objcpp", "cuda" }, 4 | } 5 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/denols.lua: -------------------------------------------------------------------------------- 1 | ---@type vim.lsp.Config 2 | return { 3 | init_options = { 4 | lint = true, 5 | unstable = true, 6 | }, 7 | deno = { 8 | inlayHints = { 9 | parameterNames = { enabled = "all" }, 10 | parameterTypes = { enabled = true }, 11 | variableTypes = { enabled = true }, 12 | propertyDeclarationTypes = { enabled = true }, 13 | functionLikeReturnTypes = { enabled = true }, 14 | enumMemberValues = { enabled = true }, 15 | }, 16 | }, 17 | root_dir = function(bufnr, cb) 18 | local bufname = vim.fs.normalize(vim.api.nvim_buf_get_name(bufnr)) 19 | local dir = vim.fs.dirname(bufname) 20 | local deno_found = vim.fs.find({ "deno.json", "deno.jsonc", "deps.ts" }, { upward = true, path = dir }) 21 | if #deno_found > 0 then 22 | return cb(vim.fs.dirname(deno_found[1])) 23 | end 24 | local git_found = vim.fs.find(".git", { upward = true, path = dir }) 25 | if #git_found > 0 then 26 | local repo = vim.fs.dirname(git_found[1]) 27 | if require("core.utils.lsp").is_deno_project(repo) then 28 | return cb(repo) 29 | end 30 | end 31 | end, 32 | workspace_required = true, 33 | } 34 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/gopls.lua: -------------------------------------------------------------------------------- 1 | return { 2 | settings = { 3 | hoverKind = "NoDocumentation", 4 | deepCompletion = true, 5 | fuzzyMatching = true, 6 | completeUnimported = true, 7 | usePlaceholders = true, 8 | gopls = { 9 | semanticTokens = true, 10 | analyses = { unusedparams = true }, 11 | hints = { 12 | assignVariableTypes = true, 13 | compositeLiteralFields = true, 14 | compositeLiteralTypes = true, 15 | constantValues = true, 16 | functionTypeParameters = true, 17 | parameterNames = true, 18 | rangeVariableTypes = true, 19 | }, 20 | }, 21 | }, 22 | } 23 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/lua_ls.lua: -------------------------------------------------------------------------------- 1 | return { 2 | settings = { 3 | Lua = { 4 | completion = { callSnippet = "Replace" }, 5 | diagnostics = { 6 | globals = { 7 | "vim", 8 | "packer_plugins", 9 | "api", 10 | "fn", 11 | "loop", 12 | 13 | -- for testing 14 | "after_each", 15 | "before_each", 16 | "describe", 17 | "it", 18 | 19 | -- hammerspoon 20 | "hs", 21 | 22 | -- wrk 23 | "wrk", 24 | "setup", 25 | "id", 26 | "init", 27 | "request", 28 | "response", 29 | "done", 30 | 31 | -- vusted 32 | "after_each", 33 | "before_each", 34 | "describe", 35 | "it", 36 | }, 37 | }, 38 | format = { enable = false }, 39 | hint = { enable = true, setType = true }, 40 | codeLens = { enable = true }, 41 | runtime = { version = "LuaJIT" }, 42 | telemetry = { enable = false }, 43 | }, 44 | }, 45 | } 46 | -------------------------------------------------------------------------------- /.config/nvim/after/lsp/pyright.lua: -------------------------------------------------------------------------------- 1 | local home_dir = function(p) 2 | return uv.os_homedir() .. (p or "") 3 | end 4 | local iterm2_dir = function(p) 5 | return home_dir "/.config/iterm2/AppSupport/iterm2env-72/versions/3.8.6/lib/" .. (p or "") 6 | end 7 | 8 | return { 9 | settings = { 10 | python = { 11 | analysis = { 12 | extraPaths = { 13 | home_dir(), 14 | iterm2_dir "python38.zip", 15 | iterm2_dir "python3.8", 16 | iterm2_dir "python3.8/lib-dynload", 17 | iterm2_dir "python3.8/site-packages", 18 | }, 19 | }, 20 | }, 21 | }, 22 | } 23 | -------------------------------------------------------------------------------- /.config/nvim/after/queries/markdown/highlights.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | 3 | (atx_heading 4 | (atx_h1_marker) @text.emphasis @text.underline 5 | (inline) @text.emphasis @text.underline 6 | ) 7 | 8 | (link_label) @attribute @string 9 | 10 | ; TODO: This makes Neovim too slow. 11 | ;(inline_link (link_text) @attribute) 12 | ;(image (image_description) @text.emphasis) 13 | 14 | (block_quote) @comment 15 | 16 | (fenced_code_block 17 | . 18 | (code_fence_content) @text.literal 19 | ) 20 | -------------------------------------------------------------------------------- /.config/nvim/after/queries/markdown/injections.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | 3 | (fenced_code_block 4 | (info_string) @lang 5 | (code_fence_content) @injection.content 6 | (#vim-match? @lang "^(sh|bash|shell)$") 7 | (#set! injection.language "bash") 8 | ) 9 | 10 | (fenced_code_block 11 | (info_string) @lang 12 | (code_fence_content) @injection.content 13 | (#vim-match? @lang "^prompt$") 14 | (#set! injection.language "bash") 15 | ) 16 | 17 | (fenced_code_block 18 | (info_string) @lang 19 | (code_fence_content) @injection.content 20 | (#vim-match? @lang "^(vim)(:.*)?$") 21 | (#set! injection.language vim) 22 | ) 23 | 24 | (fenced_code_block 25 | (info_string) @lang 26 | (code_fence_content) @injection.content 27 | (#vim-match? @lang "^(lua)(:.*)?$") 28 | (#set! injection.language lua) 29 | ) 30 | 31 | (fenced_code_block 32 | (info_string) @lang 33 | (code_fence_content) @injection.content 34 | (#vim-match? @lang "^(bash)(:.*)?$") 35 | (#set! injection.language bash) 36 | ) 37 | -------------------------------------------------------------------------------- /.config/nvim/after/queries/terraform/highlights.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | 3 | (comment) @comment 4 | (template_expr) @string 5 | -------------------------------------------------------------------------------- /.config/nvim/after/queries/toml/injections.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | 3 | ((pair 4 | (bare_key) @_key 5 | (string) @vim) 6 | (#vim-match? @_key "^hook_\w*")) 7 | ((table 8 | (bare_key) @_key 9 | (pair 10 | (string) @vim)) 11 | (#eq? @_key "ftplugin")) 12 | ((table 13 | (dotted_key) @_key 14 | (pair 15 | (string) @vim)) 16 | (#eq? @_key "plugins.ftplugin")) 17 | -------------------------------------------------------------------------------- /.config/nvim/after/queries/yaml/injections.scm: -------------------------------------------------------------------------------- 1 | ;; extends 2 | 3 | (block_scalar) @bash 4 | -------------------------------------------------------------------------------- /.config/nvim/after/syntax/gohtmltmpl.lua: -------------------------------------------------------------------------------- 1 | vim.cmd [[ 2 | syn region gotplAction start="<%" end="%>" contains=@gotplLiteral,gotplControl,gotplFunctions,gotplVariable,goTplIdentifier display 3 | syn region goTplComment start="<%\(- \)\?/\*" end="\*/\( -\)\?%>" display 4 | ]] 5 | -------------------------------------------------------------------------------- /.config/nvim/after/syntax/json.lua: -------------------------------------------------------------------------------- 1 | -- TODO: temporal workaround to un-syntax Error on comments 2 | vim.cmd [[ 3 | syntax match jsonCommentError "\/\*\(\*\(\/\)\@!\|\_[^*]\)*\*\/" 4 | highlight! def link jsonCommentError Comment 5 | ]] 6 | -------------------------------------------------------------------------------- /.config/nvim/after/syntax/perl/carp.lua: -------------------------------------------------------------------------------- 1 | -- Perl highlighting for Carp keywords 2 | -- Maintainer: vim-perl 3 | -- Installation: Put into after/syntax/perl/carp.vim 4 | 5 | vim.cmd.syntax [[match perlStatementProc "\<\%(croak\|confess\|carp\|cluck\)\>"]] 6 | -------------------------------------------------------------------------------- /.config/nvim/after/syntax/perl/moose.lua: -------------------------------------------------------------------------------- 1 | -- Perl highlighting for Moose keywords 2 | -- Maintainer: vim-perl 3 | -- Installation: Put into after/syntax/perl/moose.vim 4 | 5 | -- XXX include guard 6 | vim.cmd [[ 7 | syntax match perlFunction '\<\%(before\|after\|around\|override\|augment\)\>' 8 | syntax match perlStatementProc '\<\%(has\|inner\|is\|super\|requires\|with\|subtype\|coerce\|as\|from\|via\|message\|enum\|class_type\|role_type\|maybe_type\|duck_type\|optimize_as\|type\|where\|extends\|isa\|required\|default\|does\|trigger\|lazy\|weak_ref\|auto_deref\|lazy_build\|builder\|documentation\|clearer\|predicate\|reader\|writer\|accessor\|init_arg\|initializer\|handles\)\>' 9 | ]] 10 | 11 | -- XXX only accept attribute "keywords" in has $attr => (...)? 12 | 13 | -- XXX catch instances where you forget the semicolon after the closing brace 14 | -- (for before, after, and friends)? 15 | -------------------------------------------------------------------------------- /.config/nvim/after/syntax/perl/test-more.lua: -------------------------------------------------------------------------------- 1 | -- Perl highlighting for Test::More keywords 2 | -- Maintainer: vim-perl 3 | -- Installation: Put into after/syntax/perl/test-more.vim 4 | 5 | -- XXX include guard 6 | vim.cmd.syntax [[match perlStatementProc "\<\%(plan\|use_ok\|require_ok\|ok\|is\|isnt\|diag\|like\|unlike\|cmp_ok\|is_deeply\|skip\|can_ok\|isa_ok\|pass\|fail\|BAIL_OUT\)\>"]] 7 | -------------------------------------------------------------------------------- /.config/nvim/after/syntax/perl/try-tiny.lua: -------------------------------------------------------------------------------- 1 | -- Perl highlighting for Try::Tiny keywords 2 | -- Maintainer: vim-perl 3 | -- Installation: Put into after/syntax/perl/try-tiny.vim 4 | 5 | -- XXX include guard 6 | vim.cmd.syntax [[match perlStatementProc "\<\%(try\|catch\|finally\)\>"]] 7 | 8 | -- XXX catch instances where you forget the semicolon after the closing brace? 9 | -------------------------------------------------------------------------------- /.config/nvim/after/syntax/perl/vim-perl.lua: -------------------------------------------------------------------------------- 1 | -- added lacked Test::More keyaords 2 | vim.cmd.syntax [[match perlStatementProc "\<\%(todo\|todo_skip\|eq_array\|eq_hash\|eq_set\|$TODO\|done_testing\|note\|explain\|subtest\)\>"]] 3 | -------------------------------------------------------------------------------- /.config/nvim/autoload/delphinus/ale.vim: -------------------------------------------------------------------------------- 1 | if ! dein#is_sourced('vital.vim') | call dein#source('vital.vim') | endif 2 | 3 | let s:V = vital#vital#new() 4 | let s:FP = s:V.import('System.Filepath') 5 | let s:P = s:V.import('Prelude') 6 | 7 | function! delphinus#ale#pylint() abort 8 | if dein#tap('denite.nvim') 9 | let top_dir = s:P.path2project_directory(expand('%:p')) 10 | let hook = 'import sys;' 11 | let hook .= 'sys.path.append("' . g:dein#plugin.rtp . '/rplugin/python3");' 12 | let hook .= 'sys.path.append("' . $HOME . '/.vim/rplugin/python3");' 13 | let hook .= 'sys.path.append("' . top_dir . '/rplugin/python3");' 14 | let b:ale_python_pylint_options = '--init-hook=''' . hook . '''' 15 | endif 16 | endfunction 17 | 18 | function! delphinus#ale#set_pylintrc() abort 19 | let buffer = bufnr('%') 20 | if get(b:, 'ale_python_pylint_options') 21 | return 22 | endif 23 | if ! get(b:, 'rcfile') 24 | let top_dir = s:P.path2project_directory(expand('%:p')) 25 | let b:rcfile = s:FP.join(top_dir, '.pylintrc') 26 | endif 27 | if ! filereadable(b:rcfile) 28 | return 29 | endif 30 | let b:ale_python_pylint_options = '--rcfile=' . shellescape(b:rcfile) 31 | endfunction 32 | -------------------------------------------------------------------------------- /.config/nvim/autoload/delphinus/datetime.vim: -------------------------------------------------------------------------------- 1 | " http://stackoverflow.com/questions/12325291/parse-a-date-in-vimscript 2 | function! delphinus#datetime#adjust_date(date, offset) abort 3 | let result = '' 4 | 5 | python3 <": '(easymotion)'}, 6 | \ 'is_expr': 0, 7 | \ 'is_stay': 1 8 | \ }), get(a:, 1, {})) 9 | endfunction 10 | -------------------------------------------------------------------------------- /.config/nvim/autoload/delphinus/init/ref.vim: -------------------------------------------------------------------------------- 1 | scriptencoding utf-8 2 | 3 | function! delphinus#init#ref#hook_source() abort 4 | let g:ref_open=':vsp' 5 | let g:ref_alc_start_linenumber=42 6 | 7 | " (ref-source-perldoc-switch) を再定義 8 | augroup vimrc-plugin-ref 9 | autocmd! 10 | autocmd FileType ref nnoremap O 11 | \ b:ref_source ==# 'perldoc' ? 12 | \ ":\call delphinus#ref#perl_module_edit()\" : "\" 13 | autocmd FileType ref nnoremap o 14 | \ b:ref_source ==# 'perldoc' ? 15 | \ (b:ref_perldoc_mode ==# 'module' ? ":\Ref perldoc -m " . 16 | \ b:ref_perldoc_word . "\" : 17 | \ b:ref_perldoc_mode ==# 'source' ? ":\Ref perldoc " . 18 | \ b:ref_perldoc_word . "\" : 19 | \ 's') : 's' 20 | augroup END 21 | endfunction 22 | -------------------------------------------------------------------------------- /.config/nvim/autoload/delphinus/init/vimfiler.vim: -------------------------------------------------------------------------------- 1 | scriptencoding utf-8 2 | 3 | function! delphinus#init#vimfiler#hook_source() abort 4 | " :edit で vimfiler を起動 5 | let g:vimfiler_as_default_explorer = 1 6 | " セーフモード OFF で起動 7 | let g:vimfiler_safe_mode_by_default = 0 8 | endfunction 9 | 10 | function! delphinus#init#vimfiler#hook_post_source() abort 11 | " devicons 設定 12 | call vimfiler#custom#profile('default', 'context', {'columns': 'type:devicons:size:time'}) 13 | endfunction 14 | -------------------------------------------------------------------------------- /.config/nvim/autoload/delphinus/init/vimproc.vim: -------------------------------------------------------------------------------- 1 | function! delphinus#init#vimproc#hook_post_update() abort 2 | if dein#util#_is_windows() 3 | let cmd = 'tools\\update-dll-mingw' 4 | elseif dein#util#_is_cygwin() 5 | let cmd = 'make -f make_cygwin.mak' 6 | elseif executable('gmake') 7 | let cmd = 'gmake' 8 | else 9 | let cmd = 'make' 10 | endif 11 | let g:dein#plugin.build = cmd 12 | endfunction 13 | -------------------------------------------------------------------------------- /.config/nvim/autoload/delphinus/ref.vim: -------------------------------------------------------------------------------- 1 | if ! dein#is_sourced('vital.vim') | call dein#source('vital.vim') | endif 2 | 3 | let s:V = vital#vital#new() 4 | let s:P = s:V.import('Prelude') 5 | 6 | function! delphinus#ref#perl_module_edit(...) abort 7 | if a:0 > 0 8 | let module = a:1 9 | elseif exists('b:ref_perldoc_word') 10 | let module = b:ref_perldoc_word 11 | else 12 | echo 'No module specified' 13 | return 14 | endif 15 | 16 | let perldoc_cmd = s:P.is_string(g:ref_perldoc_cmd) ? split(g:ref_perldoc_cmd, '\s\+') : g:ref_perldoc_cmd 17 | let res = ref#system(perldoc_cmd + ['-l', module]) 18 | 19 | if res.stdout ==# '' 20 | echo printf('No module found for "%s".', module) 21 | else 22 | execute 'edit ' . res.stdout 23 | endif 24 | endfunction 25 | -------------------------------------------------------------------------------- /.config/nvim/autoload/delphinus/syntax_info.vim: -------------------------------------------------------------------------------- 1 | scriptencoding utf-8 2 | 3 | " カーソル下のシンタックスハイライト情報を得る 4 | " http://cohama.hateblo.jp/entry/2013/08/11/020849 5 | function! delphinus#syntax_info#get_syn(transparent) abort 6 | let synid = synID(line('.'), col('.'), 1) 7 | if a:transparent 8 | let synid = synIDtrans(synid) 9 | endif 10 | return { 11 | \ 'name': synIDattr(synid, 'name'), 12 | \ 'ctermfg': synIDattr(synid, 'fg', 'cterm'), 13 | \ 'ctermbg': synIDattr(synid, 'bg', 'cterm'), 14 | \ 'guifg': synIDattr(synid, 'fg', 'gui'), 15 | \ 'guibg': synIDattr(synid, 'bg', 'gui'), 16 | \ } 17 | endfunction 18 | 19 | function! delphinus#syntax_info#string(syn) abort 20 | return join( 21 | \ map(['name', 'ctermfg', 'ctermbg', 'guifg', 'guibg'], 22 | \ {_, key -> key . ': ' . a:syn[key]}), 23 | \ ' ') 24 | endfunction 25 | 26 | function! delphinus#syntax_info#get_info() abort 27 | let base_syn = delphinus#syntax_info#get_syn(0) 28 | echo delphinus#syntax_info#string(base_syn) 29 | let linked_syn = delphinus#syntax_info#get_syn(1) 30 | echo 'linked to' 31 | echo delphinus#syntax_info#string(linked_syn) 32 | endfunction 33 | -------------------------------------------------------------------------------- /.config/nvim/autoload/delphinus/tmux.vim: -------------------------------------------------------------------------------- 1 | if ! dein#is_sourced('vital.vim') | call dein#source('vital.vim') | endif 2 | 3 | let s:V = vital#vital#new() 4 | let s:FP = s:V.import('System.Filepath') 5 | 6 | function! delphinus#tmux#tmux_filetype() abort 7 | if &filetype ==# 'tmux' 8 | return 9 | endif 10 | for ele in s:FP.split(expand('%')) 11 | if ele ==# '.tmux' || ele ==# 'tmux' 12 | set filetype=tmux 13 | return 14 | endif 15 | endfor 16 | endfunction 17 | -------------------------------------------------------------------------------- /.config/nvim/autoload/tmuxline/themes/lightline_delphinus.vim: -------------------------------------------------------------------------------- 1 | function! tmuxline#themes#lightline_delphinus#get() abort 2 | if !exists('*lightline#palette') 3 | throw "tmuxline: Can't load theme from lightline, function lightline#palette() doesn't exist. Is latest lightline loaded?" 4 | endif 5 | 6 | let palette = lightline#palette() 7 | let mode = 'normal' 8 | let mode_palette = palette[mode] 9 | let theme = { 10 | \ 'a' : mode_palette.left[0][0:1], 11 | \ 'b' : mode_palette.left[1][0:1], 12 | \ 'c' : mode_palette.left[2][0:1], 13 | \ 'x' : mode_palette.middle[0][0:1], 14 | \ 'y' : mode_palette.right[1][0:1], 15 | \ 'z' : mode_palette.right[0][0:1], 16 | \ 'bg' : mode_palette.middle[0][0:1], 17 | \ 'cwin' : mode_palette.left[1][0:1], 18 | \ 'win' : mode_palette.middle[0][0:1]} 19 | call tmuxline#util#try_guess_activity_color(theme) 20 | return theme 21 | endfunc 22 | -------------------------------------------------------------------------------- /.config/nvim/autoload/unite/sources/rails/collector/json_schema.vim: -------------------------------------------------------------------------------- 1 | " 2 | " gather candidates 3 | " 4 | function! unite#sources#rails#collector#json_schema#candidates(source) 5 | let target = a:source.source__rails_root . '/schema' 6 | return unite#sources#rails#helper#gather_candidates_file(target) 7 | endfunction 8 | -------------------------------------------------------------------------------- /.config/nvim/autoload/unite/sources/rails/collector/typescripts.vim: -------------------------------------------------------------------------------- 1 | " 2 | " gather candidates 3 | " 4 | function! unite#sources#rails#collector#typescripts#candidates(source) abort 5 | let target = a:source.source__rails_root . '/frontend/typescripts' 6 | return unite#sources#rails#helper#gather_candidates_file(target) 7 | endfunction 8 | 9 | -------------------------------------------------------------------------------- /.config/nvim/dict/migemo/utf-8/hira2kata.dat: -------------------------------------------------------------------------------- 1 | # vi:set ts=8 sts=8 sw=8 tw=0: 2 | # 3 | # hira2kata.dat - 平仮名→カタカナ変換表 4 | # 5 | # Last Change: 19-Jun-2004. 6 | # Written By: MURAOKA Taro 7 | 8 | # 文字コードの違いもこの変換表で吸収する。 9 | 10 | あ ア 11 | い イ 12 | う ウ 13 | え エ 14 | お オ 15 | 16 | か カ 17 | き キ 18 | く ク 19 | け ケ 20 | こ コ 21 | 22 | さ サ 23 | し シ 24 | す ス 25 | せ セ 26 | そ ソ 27 | 28 | た タ 29 | ち チ 30 | つ ツ 31 | て テ 32 | と ト 33 | 34 | な ナ 35 | に ニ 36 | ぬ ヌ 37 | ね ネ 38 | の ノ 39 | 40 | は ハ 41 | ひ ヒ 42 | ふ フ 43 | へ ヘ 44 | ほ ホ 45 | 46 | ま マ 47 | み ミ 48 | む ム 49 | め メ 50 | も モ 51 | 52 | や ヤ 53 | ゆ ユ 54 | よ ヨ 55 | 56 | ら ラ 57 | り リ 58 | る ル 59 | れ レ 60 | ろ ロ 61 | 62 | わ ワ 63 | ゐ ヰ 64 | ゑ ヱ 65 | を ヲ 66 | 67 | が ガ 68 | ぎ ギ 69 | ぐ グ 70 | げ ゲ 71 | ご ゴ 72 | 73 | ざ ザ 74 | じ ジ 75 | ず ズ 76 | ぜ ゼ 77 | ぞ ゾ 78 | 79 | だ ダ 80 | ぢ ヂ 81 | づ ヅ 82 | で デ 83 | ど ド 84 | 85 | ば バ 86 | び ビ 87 | ぶ ブ 88 | べ ベ 89 | ぼ ボ 90 | 91 | ぱ パ 92 | ぴ ピ 93 | ぷ プ 94 | ぺ ペ 95 | ぽ ポ 96 | 97 | ぁ ァ 98 | ぃ ィ 99 | ぅ ゥ 100 | ぇ ェ 101 | ぉ ォ 102 | 103 | ゃ ャ 104 | ゅ ュ 105 | ょ ョ 106 | 107 | ん ン 108 | っ ッ 109 | ゎ ヮ 110 | -------------------------------------------------------------------------------- /.config/nvim/init.lua: -------------------------------------------------------------------------------- 1 | require "core.utils.timer"() 2 | require "core" 3 | -------------------------------------------------------------------------------- /.config/nvim/lua/core/lazy/all.lua: -------------------------------------------------------------------------------- 1 | ---@class core.lazy.all.All 2 | ---@operator call:nil 3 | ---@field loaded boolean 4 | 5 | return setmetatable({ loaded = false }, { 6 | ---@param self core.lazy.all.All 7 | __call = function(self) 8 | if self.loaded then 9 | return 10 | end 11 | local lazy = require "lazy" 12 | ---@param p LazyPlugin 13 | local to_load = vim.tbl_filter(function(p) 14 | return not not (p.lazy and not p._.loaded and not p._.dep and not p._.cond) 15 | end, lazy.plugins()) 16 | ---@param p LazyPlugin 17 | lazy.load { plugins = vim.tbl_map(function(p) 18 | return p.name 19 | end, to_load) } 20 | self.loaded = true 21 | end, 22 | }) --[[@as core.lazy.all.All]] 23 | -------------------------------------------------------------------------------- /.config/nvim/lua/core/options/init.lua: -------------------------------------------------------------------------------- 1 | require "core.options.set" 2 | require "core.options.mapping" 3 | require "core.options.term" 4 | require "core.options.commands" 5 | -------------------------------------------------------------------------------- /.config/nvim/lua/core/plugins/package.lua: -------------------------------------------------------------------------------- 1 | ---@class core.plugins.package.Package 2 | ---@field dir string 3 | ---@field name string 4 | ---@field url string 5 | ---@field opts core.plugins.package.Opts 6 | local Package = {} 7 | 8 | ---@class core.plugins.package.Opts 9 | ---@field branch string default: "main" 10 | 11 | ---@param base string 12 | ---@param name string 13 | ---@param opts core.plugins.package.Opts 14 | Package.new = function(base, name, opts) 15 | local dir = base .. "/" .. vim.fs.basename(name) 16 | return setmetatable({ 17 | dir = dir, 18 | name = name, 19 | url = "https://github.com/" .. name, 20 | opts = vim.tbl_extend("force", { branch = "main" }, opts or {}), 21 | }, { __index = Package }) 22 | end 23 | 24 | ---@return nil 25 | function Package:clone() 26 | local notify = vim.schedule_wrap(vim.notify) 27 | vim 28 | .system({ "git", "clone", self.url, self.dir, "-b", self.opts.branch }, {}, function(obj) 29 | if obj.code == 0 then 30 | notify("Cloned " .. self.name, vim.log.levels.INFO) 31 | else 32 | notify("Failed to clone " .. self.name, vim.log.levels.ERROR) 33 | end 34 | end) 35 | :wait() 36 | end 37 | 38 | return Package 39 | -------------------------------------------------------------------------------- /.config/nvim/lua/core/telescope/frecency.lua: -------------------------------------------------------------------------------- 1 | local Truncator = require "core.telescope.frecency.truncator" 2 | 3 | ---@class core.telescope.frecency.Opts 4 | ---@field __truncator core.telescope.frecency.truncator.Truncator? 5 | ---@field cwd string 6 | 7 | ---@param opts core.telescope.frecency.Opts 8 | ---@param path string 9 | ---@return string 10 | local function path_display(opts, path) 11 | if not opts.__truncator then 12 | --TODO: use constant for prefix? 13 | opts.__truncator = Truncator.new { cwd = opts.cwd, prefix = 16 } 14 | end 15 | return opts.__truncator:path_display(path) 16 | end 17 | 18 | return { 19 | path_display = { "filename_first" }, 20 | } 21 | -------------------------------------------------------------------------------- /.config/nvim/lua/core/utils/ccc.lua: -------------------------------------------------------------------------------- 1 | ---@param color_table { string: string } 2 | ---@return table 3 | return function(color_table) 4 | local parse = require "ccc.utils.parse" 5 | local names = {} 6 | local converted = {} 7 | for name, rgb in pairs(color_table) do 8 | local r, g, b = rgb:match "(%x%x)(%x%x)(%x%x)" 9 | if r then 10 | table.insert(names, name) 11 | converted[name] = { parse.hex(r), parse.hex(g), parse.hex(b) } 12 | end 13 | end 14 | table.sort(names, function(a, b) 15 | return #a > #b 16 | end) 17 | local min = #names[#names] 18 | local re = vim.regex([[\<]] .. table.concat(names, [[\|]]) .. [[\>]]) 19 | return { 20 | parse_color = function(_, s, init) 21 | init = vim.F.if_nil(init, 1) 22 | local target = s:sub(init) 23 | if #target < min then 24 | return 25 | end 26 | local start, end_ = re:match_str(target) 27 | if start then 28 | local name = target:sub(start + 1, end_) 29 | --vim.notify(vim.inspect({ start, end_, name }, { newline = "", indent = "" })) 30 | return start + init, end_ + init - 1, converted[name] 31 | end 32 | end, 33 | } 34 | end 35 | -------------------------------------------------------------------------------- /.config/nvim/lua/core/utils/lazy.lua: -------------------------------------------------------------------------------- 1 | return { 2 | has_plugin=function(name) 3 | return not not require'lazy.core.config'.plugins[name] 4 | end, 5 | } 6 | -------------------------------------------------------------------------------- /.config/nvim/lua/core/utils/lazy_require.lua: -------------------------------------------------------------------------------- 1 | local serialize = require "core.utils.serialize" 2 | 3 | local function byte_code_require(module) 4 | local f = assert(loadstring(([[return require "%s"]]):format(module))) 5 | return string.dump(f) 6 | end 7 | 8 | local function index(self, method) 9 | return function(opts) 10 | local f_str = ([[ 11 | local module = assert(loadstring(%s))() 12 | local opts = assert(loadstring(%s))() 13 | module.%s(opts) 14 | ]]):format(vim.inspect(self.load_module), vim.inspect(serialize(opts)), method) 15 | return assert(loadstring(f_str)) 16 | end 17 | end 18 | 19 | return function(module) 20 | return setmetatable({ 21 | load_module = byte_code_require(module), 22 | }, { 23 | __index = index, 24 | }) 25 | end 26 | -------------------------------------------------------------------------------- /.config/nvim/lua/core/utils/palette/colors.lua: -------------------------------------------------------------------------------- 1 | ---@class core.utils.palette.Colors 2 | ---@field name string 3 | ---@field is_dark boolean 4 | ---@field from fun(name: string): core.utils.palette.Colors 5 | ---@field [core.utils.palette.Names] string 6 | ---@field [string] string 7 | local Colors = {} 8 | 9 | ---@param name string 10 | ---@return core.utils.palette.Colors 11 | function Colors.from(name) 12 | local colors = vim.F.npcall(require, "core.utils.palette." .. name) or {} 13 | colors.name = name 14 | return setmetatable(colors, { __index = Colors }) 15 | end 16 | 17 | ---@param name string 18 | ---@return string[] 19 | function Colors.list(name) 20 | local colors = vim.F.npcall(require, "core.utils.palette." .. name) or {} 21 | return { 22 | colors.black, 23 | colors.red, 24 | colors.green, 25 | colors.yellow, 26 | colors.blue, 27 | colors.magenta, 28 | colors.cyan, 29 | colors.white, 30 | colors.white, 31 | colors.nord12, -- orange 32 | } 33 | end 34 | 35 | return Colors 36 | -------------------------------------------------------------------------------- /.config/nvim/lua/core/utils/palette/sweetie.lua: -------------------------------------------------------------------------------- 1 | ---@class core.utils.palette.sweetie.Colors 2 | ---@field is_dark boolean 3 | ---@field [string] string 4 | local colors = require("sweetie.colors").get_palette(vim.o.background) 5 | colors.is_dark = vim.o.background == "dark" 6 | colors.black = colors.is_dark and colors.bg or colors.fg 7 | colors.white = colors.is_dark and colors.fg or colors.bg 8 | return colors 9 | -------------------------------------------------------------------------------- /.config/nvim/lua/core/utils/palette/tokyonight.lua: -------------------------------------------------------------------------------- 1 | local Tokyonight = {} 2 | 3 | ---@param colors table 4 | ---@return nil 5 | Tokyonight.set = function(colors) 6 | for k, v in pairs(colors) do 7 | if k == "set" then 8 | vim.notify "Colors has `set` in key. It is renamed to `_set`." 9 | Tokyonight._set = v 10 | else 11 | Tokyonight[k] = v 12 | end 13 | end 14 | end 15 | 16 | return Tokyonight 17 | -------------------------------------------------------------------------------- /.config/nvim/lua/delphinus/markdown.lua: -------------------------------------------------------------------------------- 1 | local line_count = 5 2 | local function target_lines(here) 3 | return api.buf_get_lines(0, here, here + line_count, false) 4 | end 5 | 6 | return { 7 | foldexpr = function() 8 | local lines = target_lines(vim.v.lnum - 1) 9 | local line = #lines > 0 and lines[1] or "" 10 | return line:match "^" and "s1" or "=" 11 | end, 12 | 13 | foldtext = function() 14 | local text = "
……
" 15 | for _, line in ipairs(target_lines(vim.v.foldstart - 1)) do 16 | local m = line:match "(.*)" 17 | if m then 18 | text = m 19 | end 20 | end 21 | return ("+%s %d lines: %s"):format(vim.v.folddashes, vim.v.foldend - vim.v.foldstart, text) 22 | end, 23 | } 24 | -------------------------------------------------------------------------------- /.config/nvim/lua/lazies/blink.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "saghen/blink.cmp", 3 | event = { "InsertEnter", "CmdlineEnter" }, 4 | dependencies = { 5 | "rafamadriz/friendly-snippets", 6 | "xzbdmw/colorful-menu.nvim", 7 | }, 8 | version = "*", 9 | ---@module 'blink.cmp' 10 | ---@type blink.cmp.Config 11 | opts = { 12 | appearance = { use_nvim_cmp_as_default = true }, 13 | completion = { 14 | menu = { 15 | draw = { 16 | columns = { { "kind_icon" }, { "label", gap = 1 } }, 17 | components = { 18 | label = { 19 | text = function(ctx) 20 | return require("colorful-menu").blink_components_text(ctx) 21 | end, 22 | highlight = function(ctx) 23 | return require("colorful-menu").blink_components_highlight(ctx) 24 | end, 25 | }, 26 | }, 27 | }, 28 | }, 29 | }, 30 | }, 31 | opts_extend = { "sources.default" }, 32 | } 33 | -------------------------------------------------------------------------------- /.config/nvim/mason/packages/perlnavigator/package.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | name: perlnavigator 3 | description: Perl Language Server that includes perl critic and code navigation. 4 | homepage: https://github.com/bscan/PerlNavigator 5 | licenses: 6 | - MIT 7 | languages: 8 | - Perl 9 | categories: 10 | - LSP 11 | 12 | source: 13 | id: pkg:github/delphinus/PerlNavigator@main 14 | build: 15 | run: | 16 | npm install 17 | npm run compile 18 | 19 | schemas: 20 | lsp: vscode:https://raw.githubusercontent.com/delphinus/PerlNavigator/refs/heads/main/package.json 21 | 22 | bin: 23 | perlnavigator: node:server/out/server.js 24 | -------------------------------------------------------------------------------- /.config/nvim/plugin/fssh.vim: -------------------------------------------------------------------------------- 1 | if exists('g:loaded_delphinus_fssh') 2 | finish 3 | endif 4 | 5 | let s:save_cpo = &cpo 6 | set cpo&vim 7 | 8 | nnoremap DelphinusFsshCopy :call delphinus#fssh#copy() 9 | 10 | let g:loaded_delphinus_fssh = 1 11 | 12 | let &cpo = s:save_cpo 13 | unlet s:save_cpo 14 | -------------------------------------------------------------------------------- /.config/peco/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "Style": { 3 | "Selected": ["on_black", "white"], 4 | "Matched": ["red", "bold"] 5 | }, 6 | "KeyMap": { 7 | "C-j": "peco.SelectDown", 8 | "C-k": "peco.SelectUp" 9 | }, 10 | "Prompt": "❯❯❯", 11 | "Layout": "bottom-up" 12 | } 13 | -------------------------------------------------------------------------------- /.config/powerline/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphinus/dotfiles/d01324d1ceb9bb45f6ea53b918f11acdf50019c4/.config/powerline/__init__.py -------------------------------------------------------------------------------- /.config/powerline/colorschemes/ipython/__main__.json: -------------------------------------------------------------------------------- 1 | { 2 | "groups": { 3 | "prompt": "information:additional", 4 | "prompt_count": "information:highlighted" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.config/powerline/colorschemes/ipython/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Default color scheme for IPython prompt", 3 | "groups": { 4 | "prompt": { "fg": "gray9", "bg": "gray4", "attrs": [] }, 5 | "prompt_count": { "fg": "white", "bg": "gray4", "attrs": [] } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.config/powerline/colorschemes/pdb/__main__.json: -------------------------------------------------------------------------------- 1 | { 2 | "groups": { 3 | "current_code_name": "information:additional", 4 | "current_context": "current_code_name", 5 | "current_line": "information:regular", 6 | "current_file": "information:regular" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.config/powerline/colorschemes/pdb/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "groups": { 3 | "stack_depth": { "fg": "gray1", "bg": "gray10", "attrs": ["bold"] } 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /.config/powerline/colorschemes/pdb/solarized.json: -------------------------------------------------------------------------------- 1 | { 2 | "groups": { 3 | "stack_depth": { "fg": "solarized:base03", "bg": "solarized:base2", "attrs": ["bold"] } 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /.config/powerline/colorschemes/shell/__main__.json: -------------------------------------------------------------------------------- 1 | { 2 | "groups": { 3 | "continuation": "cwd", 4 | "continuation:current": "cwd:current_folder", 5 | "exit_fail": "critical:failure", 6 | "exit_success": "critical:success", 7 | "jobnum": "information:priority", 8 | "superuser": "warning:regular" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.config/powerline/colorschemes/shell/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Default color scheme for shell prompts", 3 | "groups": { 4 | "hostname": { "fg": "brightyellow", "bg": "mediumorange", "attrs": [] }, 5 | "environment": { "fg": "white", "bg": "darkestgreen", "attrs": [] }, 6 | "mode": { "fg": "darkestgreen", "bg": "brightgreen", "attrs": ["bold"] }, 7 | "attached_clients": { "fg": "white", "bg": "darkestgreen", "attrs": [] } 8 | }, 9 | "mode_translations": { 10 | "vicmd": { 11 | "groups": { 12 | "mode": {"fg": "darkestcyan", "bg": "white", "attrs": ["bold"]} 13 | } 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.config/powerline/colorschemes/shell/solarized.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Solarized dark for shell", 3 | "groups": { 4 | "mode": { "fg": "solarized:base3", "bg": "solarized:green", "attrs": ["bold"] } 5 | }, 6 | "mode_translations": { 7 | "vicmd": { 8 | "groups": { 9 | "mode": { "fg": "solarized:base3", "bg": "solarized:blue", "attrs": ["bold"] } 10 | } 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.config/powerline/colorschemes/tmux/__main__.json: -------------------------------------------------------------------------------- 1 | { 2 | "groups": { 3 | "used_memory_percent": "cpu_load_percent", 4 | "used_memory_percent_gradient": "cpu_load_percent_gradient" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.config/powerline/colorschemes/tmux/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "groups": { 3 | "active_window_status": {"fg": "darkblue", "bg": "gray0", "attrs": []}, 4 | "window_status": {"fg": "gray70", "bg": "gray0", "attrs": []}, 5 | "activity_status": {"fg": "yellow", "bg": "gray0", "attrs": []}, 6 | "bell_status": {"fg": "red", "bg": "gray0", "attrs": []}, 7 | "window": {"fg": "gray6", "bg": "gray0", "attrs": []}, 8 | "window:divider": {"fg": "gray4", "bg": "gray0", "attrs": []}, 9 | "window:current": {"fg": "mediumcyan", "bg": "darkblue", "attrs": []}, 10 | "window_name": {"fg": "white", "bg": "darkblue", "attrs": ["bold"]}, 11 | "session": {"fg": "black", "bg": "gray90", "attrs": ["bold"]}, 12 | "session:prefix": {"fg": "gray90", "bg": "darkblue", "attrs": ["bold"]} 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.config/powerline/colorschemes/tmux/solarized.json: -------------------------------------------------------------------------------- 1 | { 2 | "groups": { 3 | "active_window_status": { "fg": "solarized:blue", "bg": "solarized:base02", "attrs": [] }, 4 | "window_status": { "fg": "solarized:base1", "bg": "solarized:base02", "attrs": [] }, 5 | "activity_status": { "fg": "solarized:yellow", "bg": "solarized:base02", "attrs": [] }, 6 | "bell_status": { "fg": "solarized:red", "bg": "solarized:base02", "attrs": [] }, 7 | "window": { "fg": "solarized:base1", "bg": "solarized:base02", "attrs": [] }, 8 | "window:divider": { "fg": "solarized:base01", "bg": "solarized:base02", "attrs": [] }, 9 | "window:current": { "fg": "solarized:base3", "bg": "solarized:base01", "attrs": [] }, 10 | "window_name": { "fg": "solarized:base3", "bg": "solarized:base01", "attrs": ["bold"] }, 11 | "session": { "fg": "solarized:base3", "bg": "solarized:base01", "attrs": [] }, 12 | "session:prefix": { "fg": "solarized:base01", "bg": "solarized:base3", "attrs": [] } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.config/powerline/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "default_module": "powerline.segments.common", 3 | "segment_data": { 4 | "uptime": { 5 | "before": "⇑ " 6 | }, 7 | "external_ip": { 8 | "before": "ⓦ " 9 | }, 10 | "date": { 11 | "before": "⌚ " 12 | }, 13 | "email_imap_alert": { 14 | "before": "✉ ", 15 | "args": { 16 | "username": "", 17 | "password": "" 18 | } 19 | } 20 | }, 21 | "segments": { 22 | "right": [ 23 | { 24 | "name": "uptime", 25 | "priority": 50 26 | }, 27 | { 28 | "name": "external_ip", 29 | "priority": 50 30 | }, 31 | { 32 | "name": "network_load", 33 | "priority": 50 34 | }, 35 | { 36 | "name": "system_load", 37 | "priority": 50 38 | }, 39 | { 40 | "name": "weather", 41 | "priority": 50 42 | }, 43 | { 44 | "name": "date" 45 | }, 46 | { 47 | "name": "date", 48 | "args": { 49 | "format": "%H:%M", 50 | "istime": true 51 | } 52 | }, 53 | { 54 | "name": "email_imap_alert", 55 | "priority": 10 56 | }, 57 | { 58 | "name": "hostname" 59 | } 60 | ] 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /.config/powerline/ext/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphinus/dotfiles/d01324d1ceb9bb45f6ea53b918f11acdf50019c4/.config/powerline/ext/__init__.py -------------------------------------------------------------------------------- /.config/powerline/ext/segments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphinus/dotfiles/d01324d1ceb9bb45f6ea53b918f11acdf50019c4/.config/powerline/ext/segments/__init__.py -------------------------------------------------------------------------------- /.config/powerline/ext/tmux/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphinus/dotfiles/d01324d1ceb9bb45f6ea53b918f11acdf50019c4/.config/powerline/ext/tmux/__init__.py -------------------------------------------------------------------------------- /.config/powerline/ext/tmux/segments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphinus/dotfiles/d01324d1ceb9bb45f6ea53b918f11acdf50019c4/.config/powerline/ext/tmux/segments/__init__.py -------------------------------------------------------------------------------- /.config/powerline/ext/tmux/segments/branch.py: -------------------------------------------------------------------------------- 1 | # vim:fileencoding=utf-8:noet 2 | 3 | from __future__ import absolute_import 4 | 5 | from powerline.lib.vcs import guess, tree_status 6 | from powerline.theme import requires_segment_info 7 | 8 | @requires_segment_info 9 | def branch(pl, segment_info, status_colors=False, path=None): 10 | '''Return the current VCS branch in specified directory. 11 | 12 | :param bool status_colors: 13 | determines whether repository status will be used to determine highlighting. Default: False. 14 | :param string path: 15 | determines which directory will be watched. 16 | current directory will be set if this is None. Default: None. 17 | 18 | Highlight groups used: ``branch_clean``, ``branch_dirty``, ``branch``. 19 | ''' 20 | if path is None: path = segment_info['getcwd']() 21 | repo = guess(path=path) 22 | if repo is not None: 23 | branch = repo.branch() 24 | scol = ['branch'] 25 | if status_colors: 26 | status = tree_status(repo, pl) 27 | scol.insert(0, 'branch_dirty' if status and status.strip() else 'branch_clean') 28 | return [{ 29 | 'contents': branch, 30 | 'highlight_group': scol, 31 | }] 32 | 33 | -------------------------------------------------------------------------------- /.config/powerline/ext/vim/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphinus/dotfiles/d01324d1ceb9bb45f6ea53b918f11acdf50019c4/.config/powerline/ext/vim/__init__.py -------------------------------------------------------------------------------- /.config/powerline/ext/vim/matcher.py: -------------------------------------------------------------------------------- 1 | # -*- encoding: utf-8 -*- 2 | # vim:se noet: 3 | 4 | from __future__ import (unicode_literals, division, absolute_import, print_function) 5 | 6 | import os 7 | 8 | from powerline.bindings.vim import vim_getbufoption 9 | 10 | def unite(matcher_info): 11 | return vim_getbufoption(matcher_info, 'filetype') == 'unite' 12 | 13 | def gitcommit(matcher_info): 14 | return vim_getbufoption(matcher_info, 'filetype') == 'gitcommit' 15 | 16 | def calc(matcher_info): 17 | return vim_getbufoption(matcher_info, 'filetype') == 'vimcalc' 18 | 19 | def fugitive(matcher_info): 20 | name = matcher_info['buffer'].name 21 | return name and name.find('fugitive://') == 0 22 | 23 | def calendar(matcher_info): 24 | name = matcher_info['buffer'].name 25 | return name and os.path.basename(name).find('__Calendar__') == 0 26 | 27 | def iexe_mysql(matcher_info): 28 | name = matcher_info['buffer'].name 29 | return name and os.path.basename(name).find('iexe-mysql') == 0 30 | 31 | def ref_perldoc(matcher_info): 32 | return vim_getbufoption(matcher_info, 'filetype') == 'ref-perldoc' 33 | -------------------------------------------------------------------------------- /.config/powerline/ext/vim/segments/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphinus/dotfiles/d01324d1ceb9bb45f6ea53b918f11acdf50019c4/.config/powerline/ext/vim/segments/__init__.py -------------------------------------------------------------------------------- /.config/powerline/ext/vim/segments/fugitive.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim:se fenc=utf8 noet: 3 | 4 | import re 5 | 6 | from powerline.theme import requires_segment_info 7 | 8 | @requires_segment_info 9 | def fugitive_hash(pl, segment_info): 10 | name = segment_info['buffer'].name 11 | if not name: 12 | return '' 13 | 14 | prog = re.compile(r'\.git//([0-9a-fA-F]{8,})') 15 | m = re.search(prog, name) 16 | if not m: 17 | return '' 18 | 19 | return m.group(1)[0:8] 20 | -------------------------------------------------------------------------------- /.config/powerline/ext/vim/segments/iexe_mysql.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim:se fenc=utf8 noet: 3 | 4 | import os 5 | import re 6 | 7 | from powerline.theme import requires_segment_info 8 | 9 | @requires_segment_info 10 | def mysql_server(pl, segment_info): 11 | return _get_info(pl, segment_info)[0] 12 | 13 | @requires_segment_info 14 | def mysql_user(pl, segment_info): 15 | return _get_info(pl, segment_info)[1] 16 | 17 | @requires_segment_info 18 | def mysql_db(pl, segment_info): 19 | return _get_info(pl, segment_info)[2] 20 | 21 | def _get_info(pl, segment_info): 22 | name = segment_info['buffer'].name 23 | if not name: 24 | return ('', '', '') 25 | 26 | prog = re.compile(r'^iexe-mysql -A -h(.*) -u(.*) (.*)$') 27 | m = re.match(prog, os.path.basename(name)) 28 | if not m: 29 | return ('', '', '') 30 | 31 | return m.groups() 32 | -------------------------------------------------------------------------------- /.config/powerline/ext/vim/segments/ref_perldoc.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim:se fenc=utf8 noet: 3 | 4 | import re 5 | 6 | from powerline.theme import requires_segment_info 7 | 8 | @requires_segment_info 9 | def ref_perldoc_module(pl, segment_info): 10 | name = segment_info['buffer'].name 11 | pl.info(name) 12 | if not name: return '' 13 | 14 | module = re.compile(r'\[ref-perldoc:(.*)\]') 15 | m = re.match(module, name) 16 | if not m: return '' 17 | 18 | pl.info(m.group(1)) 19 | return m.group(1) 20 | -------------------------------------------------------------------------------- /.config/powerline/ext/vim/segments/table_mode.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim:se fenc=utf8 noet: 3 | from __future__ import (unicode_literals, division, absolute_import, print_function) 4 | 5 | try: 6 | import vim 7 | except ImportError: 8 | vim = object() 9 | 10 | from powerline.bindings.vim import vim_get_func 11 | 12 | def is_active(pl, word='Table'): 13 | '''Show status for vim-table-mode 14 | 15 | :param str word: 16 | A string displayed when table-mode is active. 17 | 18 | Highlight groups used ``table_mode`` or ``line_current``. 19 | ''' 20 | 21 | try: 22 | is_active = int(vim_get_func('tablemode#IsActive')()) == 1 23 | except: 24 | is_active = False 25 | 26 | return [] if not is_active else [{ 27 | 'contents': word, 28 | 'highlight_groups': ['table_mode', 'paste_indicator'], 29 | }] 30 | -------------------------------------------------------------------------------- /.config/powerline/ext/vim/segments/unite.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim:se fenc=utf8 noet: 3 | 4 | import re 5 | from powerline.bindings.vim import vim_get_func 6 | 7 | def sources(pl): 8 | status_string = parse_status_string() 9 | return [] if 'sources' not in status_string else [{ 10 | 'contents': status_string['sources'], 11 | 'highlight_groups': ['unite_sources', 'file_name'], 12 | }] 13 | 14 | def status(pl): 15 | status_string = parse_status_string() 16 | return [] if 'status' not in status_string else [{ 17 | 'contents': status_string['status'], 18 | 'highlight_groups': ['unite_sources', 'file_format'], 19 | }] 20 | 21 | def parse_status_string(): 22 | status = vim_get_func('unite#get_status_string')() 23 | try: 24 | sources, status = re.compile(r' \| ').split(status) 25 | except ValueError: 26 | return {} 27 | return { 28 | 'sources': sources, 29 | 'status': status, 30 | } 31 | -------------------------------------------------------------------------------- /.config/powerline/ext/vim/segments/watchdogs.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim:se fenc=utf8 noet: 3 | from __future__ import (unicode_literals, division, absolute_import, print_function) 4 | 5 | try: 6 | import vim 7 | except ImportError: 8 | vim = object() 9 | 10 | from powerline.segments.vim import window_cached 11 | from powerline.bindings.vim import vim_get_func 12 | 13 | @window_cached 14 | def watchdogs(pl, err_format='ERR:  {first_line} ({num})'): 15 | '''Show whether watchdogs has found any errors 16 | 17 | :param str err_format: 18 | Format string for errors. 19 | 20 | Highlight groups used ``watchdogs:error`` or ``error``. 21 | ''' 22 | 23 | bufnr = int(vim_get_func('bufnr')('')) 24 | errors = filter(lambda qf: qf['bufnr'] == bufnr, vim_get_func('getqflist')()) 25 | 26 | return [] if len(errors) == 0 else [{ 27 | 'contents': err_format.format(first_line=errors[0]['lnum'], num=len(errors)), 28 | 'highlight_groups': ['watchdogs:error', 'error'] 29 | }] 30 | -------------------------------------------------------------------------------- /.config/powerline/themes/ipython/in.json: -------------------------------------------------------------------------------- 1 | { 2 | "segments": { 3 | "left": [ 4 | { 5 | "function": "powerline.segments.common.env.virtualenv", 6 | "priority": 10 7 | }, 8 | { 9 | "type": "string", 10 | "contents": "In [", 11 | "draw_soft_divider": false, 12 | "highlight_groups": ["prompt"] 13 | }, 14 | { 15 | "function": "powerline.segments.ipython.prompt_count", 16 | "draw_soft_divider": false 17 | }, 18 | { 19 | "type": "string", 20 | "contents": "]", 21 | "highlight_groups": ["prompt"] 22 | } 23 | ] 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /.config/powerline/themes/ipython/in2.json: -------------------------------------------------------------------------------- 1 | { 2 | "segments": { 3 | "left": [ 4 | { 5 | "type": "string", 6 | "contents": "", 7 | "width": "auto", 8 | "highlight_groups": ["prompt"] 9 | } 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.config/powerline/themes/ipython/out.json: -------------------------------------------------------------------------------- 1 | { 2 | "default_module": "powerline.segments.ipython", 3 | "segments": { 4 | "left": [ 5 | { 6 | "type": "string", 7 | "contents": "Out[", 8 | "draw_soft_divider": false, 9 | "width": "auto", 10 | "align": "r", 11 | "highlight_groups": ["prompt"] 12 | }, 13 | { 14 | "function": "prompt_count", 15 | "draw_soft_divider": false 16 | }, 17 | { 18 | "type": "string", 19 | "contents": "]", 20 | "highlight_groups": ["prompt"] 21 | } 22 | ] 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.config/powerline/themes/ipython/rewrite.json: -------------------------------------------------------------------------------- 1 | { 2 | "default_module": "powerline.segments.ipython", 3 | "segments": { 4 | "left": [ 5 | { 6 | "type": "string", 7 | "contents": "", 8 | "draw_soft_divider": false, 9 | "width": "auto", 10 | "highlight_groups": ["prompt"] 11 | }, 12 | { 13 | "function": "prompt_count", 14 | "draw_soft_divider": false 15 | }, 16 | { 17 | "type": "string", 18 | "contents": ">", 19 | "highlight_groups": ["prompt"] 20 | } 21 | ] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.config/powerline/themes/pdb/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "default_module": "powerline.segments.pdb", 3 | "segments": { 4 | "left": [ 5 | { 6 | "function": "stack_depth" 7 | }, 8 | { 9 | "type": "segment_list", 10 | "function": "powerline.listers.pdb.frame_lister", 11 | "segments": [ 12 | { 13 | "function": "current_file", 14 | "after": ":" 15 | }, 16 | { 17 | "function": "current_line", 18 | "after": " " 19 | }, 20 | { 21 | "function": "current_code_name" 22 | } 23 | ] 24 | } 25 | ] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.config/powerline/themes/shell/__main__.json: -------------------------------------------------------------------------------- 1 | { 2 | "segment_data": { 3 | "hostname": { 4 | "args": { 5 | "only_if_ssh": true 6 | } 7 | }, 8 | "cwd": { 9 | "args": { 10 | "dir_limit_depth": 3 11 | } 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.config/powerline/themes/shell/continuation.json: -------------------------------------------------------------------------------- 1 | { 2 | "default_module": "powerline.segments.shell", 3 | "segments": { 4 | "left": [ 5 | { 6 | "function": "continuation" 7 | } 8 | ], 9 | "right": [ 10 | ] 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.config/powerline/themes/shell/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "segments": { 3 | "left": [ 4 | { 5 | "function": "powerline.segments.shell.mode" 6 | }, 7 | { 8 | "function": "powerline.segments.common.net.hostname", 9 | "priority": 10 10 | }, 11 | { 12 | "function": "powerline.segments.common.env.user", 13 | "priority": 30 14 | }, 15 | { 16 | "function": "powerline.segments.common.env.virtualenv", 17 | "priority": 50 18 | }, 19 | { 20 | "function": "powerline.segments.shell.cwd", 21 | "priority": 10 22 | }, 23 | { 24 | "function": "powerline.segments.shell.jobnum", 25 | "priority": 20 26 | } 27 | ], 28 | "right": [ 29 | { 30 | "function": "powerline.segments.shell.last_pipe_status", 31 | "priority": 10 32 | }, 33 | { 34 | "function": "powerline.segments.common.vcs.stash", 35 | "priority": 50 36 | }, 37 | { 38 | "function": "powerline.segments.common.vcs.branch", 39 | "priority": 40 40 | } 41 | ] 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /.config/powerline/themes/shell/default_leftonly.json: -------------------------------------------------------------------------------- 1 | { 2 | "segments": { 3 | "left": [ 4 | { 5 | "function": "powerline.segments.common.net.hostname", 6 | "priority": 10 7 | }, 8 | { 9 | "function": "powerline.segments.common.env.user", 10 | "priority": 30 11 | }, 12 | { 13 | "function": "powerline.segments.common.env.virtualenv", 14 | "priority": 50 15 | }, 16 | { 17 | "function": "powerline.segments.common.vcs.branch", 18 | "priority": 40 19 | }, 20 | { 21 | "function": "powerline.segments.shell.cwd", 22 | "priority": 10 23 | }, 24 | { 25 | "function": "powerline.segments.shell.jobnum", 26 | "priority": 20 27 | }, 28 | { 29 | "function": "powerline.segments.shell.last_status", 30 | "priority": 10 31 | } 32 | ] 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /.config/powerline/themes/shell/select.json: -------------------------------------------------------------------------------- 1 | { 2 | "segments": { 3 | "left": [ 4 | { 5 | "type": "string", 6 | "contents": "Select variant", 7 | "width": "auto", 8 | "align": "r", 9 | "highlight_groups": ["continuation:current"] 10 | } 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.config/powerline/themes/tmux/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "segments": { 3 | "right": [ 4 | { 5 | "function": "powerline.segments.common.sys.uptime", 6 | "priority": 50 7 | }, 8 | { 9 | "function": "powerline.segments.common.sys.system_load", 10 | "priority": 50 11 | }, 12 | { 13 | "function": "powerline.segments.common.time.date" 14 | }, 15 | { 16 | "function": "powerline.segments.common.time.date", 17 | "name": "time", 18 | "args": { 19 | "format": "%H:%M", 20 | "istime": true 21 | } 22 | }, 23 | { 24 | "function": "powerline.segments.common.net.hostname" 25 | } 26 | ] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /.config/powerline/themes/vim/__main__.json: -------------------------------------------------------------------------------- 1 | { 2 | "segment_data": { 3 | "line_percent": { 4 | "args": { 5 | "gradient": true 6 | }, 7 | "after": "%" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.config/powerline/themes/vim/cmdwin.json: -------------------------------------------------------------------------------- 1 | { 2 | "segments": { 3 | "left": [ 4 | { 5 | "type": "string", 6 | "contents": "Command Line", 7 | "highlight_groups": ["file_name"] 8 | }, 9 | { 10 | "type": "string", 11 | "highlight_groups": ["background"], 12 | "draw_soft_divider": false, 13 | "draw_hard_divider": false, 14 | "width": "auto" 15 | } 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.config/powerline/themes/vim/help.json: -------------------------------------------------------------------------------- 1 | { 2 | "segments": { 3 | "left": [ 4 | { 5 | "function": "file_name", 6 | "draw_soft_divider": false 7 | }, 8 | { 9 | "type": "string", 10 | "highlight_groups": ["background"], 11 | "draw_soft_divider": false, 12 | "draw_hard_divider": false, 13 | "width": "auto" 14 | } 15 | ], 16 | "right": [ 17 | { 18 | "function": "line_percent", 19 | "priority": 30, 20 | "width": 4, 21 | "align": "r" 22 | }, 23 | { 24 | "type": "string", 25 | "name": "line_current_symbol", 26 | "highlight_groups": ["line_current_symbol", "line_current"] 27 | }, 28 | { 29 | "function": "line_current", 30 | "draw_soft_divider": false, 31 | "width": 3, 32 | "align": "r" 33 | } 34 | ] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /.config/powerline/themes/vim/plugin_calc.json: -------------------------------------------------------------------------------- 1 | { 2 | "segment_data": { 3 | "buffer_name": { 4 | "contents": "Calc" 5 | } 6 | }, 7 | "segments": { 8 | "left": [ 9 | { 10 | "type": "string", 11 | "name": "buffer_name", 12 | "highlight_groups": ["mode"] 13 | }, 14 | { 15 | "type": "string", 16 | "highlight_groups": ["background"], 17 | "draw_soft_divider": false, 18 | "draw_hard_divider": false, 19 | "width": "auto" 20 | } 21 | ], 22 | "right": [ 23 | { 24 | "type": "string", 25 | "name": "line_current_symbol", 26 | "highlight_groups": ["line_current_symbol", "line_current"] 27 | }, 28 | { 29 | "function": "line_current", 30 | "draw_soft_divider": false, 31 | "width": 3, 32 | "align": "r" 33 | } 34 | ] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /.config/powerline/themes/vim/plugin_calendar.json: -------------------------------------------------------------------------------- 1 | { 2 | "segment_data": { 3 | "buffer_name": { 4 | "contents": "Calendar" 5 | } 6 | }, 7 | "segments": { 8 | "left": [ 9 | { 10 | "type": "string", 11 | "name": "buffer_name", 12 | "highlight_groups": ["mode"] 13 | }, 14 | { 15 | "type": "string", 16 | "highlight_groups": ["background"], 17 | "draw_soft_divider": false, 18 | "draw_hard_divider": false, 19 | "width": "auto" 20 | } 21 | ], 22 | "right": [ 23 | { 24 | "type": "string", 25 | "name": "line_current_symbol", 26 | "highlight_groups": ["line_current_symbol", "line_current"] 27 | }, 28 | { 29 | "function": "line_current", 30 | "draw_soft_divider": false, 31 | "width": 3, 32 | "align": "r" 33 | } 34 | ] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /.config/powerline/themes/vim/plugin_commandt.json: -------------------------------------------------------------------------------- 1 | { 2 | "segments": { 3 | "left": [ 4 | { 5 | "type": "string", 6 | "contents": "Command-T", 7 | "highlight_groups": ["commandt:label"] 8 | }, 9 | { 10 | "function": "powerline.segments.vim.plugin.commandt.finder" 11 | }, 12 | { 13 | "function": "powerline.segments.vim.plugin.commandt.path" 14 | }, 15 | { 16 | "type": "string", 17 | "highlight_groups": ["commandt:background"], 18 | "draw_soft_divider": false, 19 | "draw_hard_divider": false, 20 | "width": "auto" 21 | } 22 | ], 23 | "right": [ 24 | ] 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /.config/powerline/themes/vim/plugin_fugitive.json: -------------------------------------------------------------------------------- 1 | { 2 | "segment_data": { 3 | "buffer_name": { 4 | "contents": "Fugitive" 5 | } 6 | }, 7 | "segments": { 8 | "left": [ 9 | { 10 | "type": "string", 11 | "name": "buffer_name", 12 | "highlight_groups": ["mode"] 13 | }, 14 | { 15 | "function": "file_name", 16 | "draw_soft_divider": true, 17 | "priority": 10 18 | }, 19 | { 20 | "function": "ext.vim.segments.fugitive.fugitive_hash", 21 | "draw_soft_divider": false, 22 | "priority": 30 23 | }, 24 | { 25 | "type": "string", 26 | "highlight_groups": ["background"], 27 | "draw_soft_divider": false, 28 | "draw_hard_divider": false, 29 | "width": "auto" 30 | } 31 | ], 32 | "right": [ 33 | { 34 | "type": "string", 35 | "name": "line_current_symbol", 36 | "highlight_groups": ["line_current_symbol", "line_current"] 37 | }, 38 | { 39 | "function": "line_current", 40 | "draw_soft_divider": false, 41 | "width": 3, 42 | "align": "r" 43 | } 44 | ] 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /.config/powerline/themes/vim/plugin_gitcommit.json: -------------------------------------------------------------------------------- 1 | { 2 | "segment_data": { 3 | "buffer_name": { 4 | "contents": "Fugitive" 5 | } 6 | }, 7 | "segments": { 8 | "left": [ 9 | { 10 | "type": "string", 11 | "name": "buffer_name", 12 | "highlight_groups": ["mode"] 13 | }, 14 | { 15 | "type": "string", 16 | "highlight_groups": ["background"], 17 | "draw_soft_divider": false, 18 | "draw_hard_divider": false, 19 | "width": "auto" 20 | } 21 | ], 22 | "right": [ 23 | { 24 | "type": "string", 25 | "name": "line_current_symbol", 26 | "highlight_groups": ["line_current_symbol", "line_current"] 27 | }, 28 | { 29 | "function": "line_current", 30 | "draw_soft_divider": false, 31 | "width": 3, 32 | "align": "r" 33 | } 34 | ] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /.config/powerline/themes/vim/plugin_gundo-preview.json: -------------------------------------------------------------------------------- 1 | { 2 | "segments": { 3 | "left": [ 4 | { 5 | "type": "string", 6 | "highlight_groups": ["gundo:name", "file_name"], 7 | "contents": "Undo diff" 8 | }, 9 | { 10 | "type": "string", 11 | "highlight_groups": ["gundo:background", "background"], 12 | "draw_soft_divider": false, 13 | "draw_hard_divider": false, 14 | "width": "auto" 15 | } 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.config/powerline/themes/vim/plugin_gundo.json: -------------------------------------------------------------------------------- 1 | { 2 | "segments": { 3 | "left": [ 4 | { 5 | "type": "string", 6 | "highlight_groups": ["gundo:name", "file_name"], 7 | "contents": "Undo tree" 8 | }, 9 | { 10 | "type": "string", 11 | "highlight_groups": ["gundo:background", "background"], 12 | "draw_soft_divider": false, 13 | "draw_hard_divider": false, 14 | "width": "auto" 15 | } 16 | ] 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.config/powerline/themes/vim/plugin_nerdtree.json: -------------------------------------------------------------------------------- 1 | { 2 | "default_module": "powerline.segments.vim.plugin.nerdtree", 3 | "segments": { 4 | "left": [ 5 | { 6 | "function": "nerdtree" 7 | }, 8 | { 9 | "type": "string", 10 | "highlight_groups": ["background"], 11 | "draw_soft_divider": false, 12 | "draw_hard_divider": false, 13 | "width": "auto" 14 | } 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.config/powerline/themes/vim/plugin_ref_perldoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "segment_data": { 3 | "buffer_name": { 4 | "contents": "Ref" 5 | } 6 | }, 7 | "segments": { 8 | "left": [ 9 | { 10 | "type": "string", 11 | "name": "buffer_name", 12 | "highlight_groups": ["mode"] 13 | }, 14 | { 15 | "function": "ext.vim.segments.ref_perldoc.ref_perldoc_module", 16 | "draw_soft_divider": true 17 | }, 18 | { 19 | "type": "string", 20 | "highlight_groups": ["background"], 21 | "draw_soft_divider": false, 22 | "draw_hard_divider": false, 23 | "width": "auto" 24 | } 25 | ], 26 | "right": [ 27 | { 28 | "type": "string", 29 | "name": "line_current_symbol", 30 | "highlight_groups": ["line_current_symbol", "line_current"] 31 | }, 32 | { 33 | "function": "line_current", 34 | "draw_soft_divider": false, 35 | "width": 3, 36 | "align": "r" 37 | } 38 | ] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /.config/powerline/themes/vim/plugin_unite.json: -------------------------------------------------------------------------------- 1 | { 2 | "segment_data": { 3 | "buffer_name": { 4 | "contents": "Unite" 5 | } 6 | }, 7 | "segments": { 8 | "left": [ 9 | { 10 | "type": "string", 11 | "name": "buffer_name", 12 | "highlight_groups": ["mode"] 13 | }, 14 | { 15 | "function": "ext.vim.segments.unite.sources" 16 | }, 17 | { 18 | "function": "ext.vim.segments.unite.status", 19 | "draw_soft_divider": false 20 | }, 21 | { 22 | "type": "string", 23 | "highlight_groups": ["background"], 24 | "draw_soft_divider": false, 25 | "draw_hard_divider": false, 26 | "width": "auto" 27 | } 28 | ], 29 | "right": [ 30 | { 31 | "type": "string", 32 | "name": "line_current_symbol", 33 | "highlight_groups": ["line_current_symbol", "line_current"] 34 | }, 35 | { 36 | "function": "line_current", 37 | "draw_soft_divider": false, 38 | "width": 3, 39 | "align": "r" 40 | } 41 | ] 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /.config/powerline/themes/vim/plugin_vimshell.json: -------------------------------------------------------------------------------- 1 | { 2 | "segment_data": { 3 | "buffer_name": { 4 | "contents": "Vimshell" 5 | } 6 | }, 7 | "segments": { 8 | "left": [ 9 | { 10 | "type": "string", 11 | "name": "buffer_name", 12 | "highlight_groups": ["mode"] 13 | }, 14 | { 15 | "type": "string", 16 | "highlight_groups": ["background"], 17 | "draw_soft_divider": false, 18 | "draw_hard_divider": false, 19 | "width": "auto" 20 | } 21 | ], 22 | "right": [ 23 | { 24 | "type": "string", 25 | "name": "line_current_symbol", 26 | "highlight_groups": ["line_current_symbol", "line_current"] 27 | }, 28 | { 29 | "function": "line_current", 30 | "draw_soft_divider": false, 31 | "width": 3, 32 | "align": "r" 33 | } 34 | ] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /.config/powerline/themes/vim/quickfix.json: -------------------------------------------------------------------------------- 1 | { 2 | "segment_data": { 3 | "buffer_name": { 4 | "contents": "Location List" 5 | } 6 | }, 7 | "segments": { 8 | "left": [ 9 | { 10 | "type": "string", 11 | "name": "buffer_name", 12 | "highlight_groups": ["file_name"] 13 | }, 14 | { 15 | "function": "window_title", 16 | "draw_soft_divider": false 17 | }, 18 | { 19 | "type": "string", 20 | "highlight_groups": ["background"], 21 | "draw_soft_divider": false, 22 | "draw_hard_divider": false, 23 | "width": "auto" 24 | } 25 | ], 26 | "right": [ 27 | { 28 | "type": "string", 29 | "name": "line_current_symbol", 30 | "highlight_groups": ["line_current_symbol", "line_current"] 31 | }, 32 | { 33 | "function": "line_current", 34 | "draw_soft_divider": false, 35 | "width": 3, 36 | "align": "r" 37 | } 38 | ] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /.config/powerline/themes/wm/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "segments": { 3 | "right": [ 4 | { 5 | "function": "powerline.segments.common.wthr.weather", 6 | "priority": 50 7 | }, 8 | { 9 | "function": "powerline.segments.common.time.date" 10 | }, 11 | { 12 | "function": "powerline.segments.common.time.date", 13 | "name": "time", 14 | "args": { 15 | "format": "%H:%M", 16 | "istime": true 17 | } 18 | }, 19 | { 20 | "function": "powerline.segments.common.mail.email_imap_alert", 21 | "priority": 10, 22 | "args": { 23 | "username": "", 24 | "password": "" 25 | } 26 | } 27 | ] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.config/ranger/tagged: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphinus/dotfiles/d01324d1ceb9bb45f6ea53b918f11acdf50019c4/.config/ranger/tagged -------------------------------------------------------------------------------- /.config/wezterm/colors.lua: -------------------------------------------------------------------------------- 1 | local wezterm = require "wezterm" 2 | 3 | return function(config) 4 | local sweetie = "/Users/jinnouchi.yasushi/.local/share/nvim/lazy/sweetie.nvim" 5 | if #wezterm.glob(sweetie) > 0 then 6 | config.colors = wezterm.color.load_scheme(sweetie .. "/extras/wezterm/sweetie_dark.toml") 7 | -- config.colors = wezterm.color.load_scheme(sweetie .. "/extras/wezterm/sweetie_light.toml") 8 | else 9 | config.color_scheme = "nord" 10 | end 11 | config.window_frame = { 12 | font = wezterm.font { family = "SF Mono Square", weight = "Bold" }, 13 | font_size = 16.0, 14 | } 15 | end 16 | -------------------------------------------------------------------------------- /.config/wezterm/const.lua: -------------------------------------------------------------------------------- 1 | local wezterm = require "wezterm" 2 | local homebrew_path = wezterm.target_triple:match "^x86_64" and "/usr/local" or "/opt/homebrew" 3 | 4 | local function detect_file(filename) 5 | local f = io.open(filename, "r") 6 | return f and f:close() and filename or false 7 | end 8 | 9 | return { 10 | regex = { 11 | file = [=[[-\w]+(?:\.[-\w]+)+]=], 12 | tag = [=[[A-Z0-9]+(?:[-_][A-Z0-9]+)+|v?\d+\.\d+(?:\.\d+)?(?:-[-\w+]+)?]=], 13 | hash = [=[[a-f\d]{4,}|[A-Z_]{4,}]=], 14 | mail = [=[[-.\w]+@[-.\w]+]=], 15 | path = [[~?(?:[-.\w]+/)+(?:[-.\w]/?)*]], 16 | url = [[https?://[^<>"\s{-}\^⟨⟩`│⏎]+]], 17 | }, 18 | fish = detect_file(homebrew_path .. "/bin/fish") or "/usr/bin/fish", 19 | op = homebrew_path .. "/bin/op", 20 | jq = homebrew_path .. "/bin/jq", 21 | } 22 | -------------------------------------------------------------------------------- /.config/wezterm/op_envs.lua: -------------------------------------------------------------------------------- 1 | local const = require "const" 2 | local wezterm = require "wezterm" 3 | 4 | return function(envs) 5 | local filename = wezterm.home_dir .. "/.1password-env" 6 | if #wezterm.glob(filename) == 0 then 7 | wezterm.log_warn "envs from op are not found" 8 | return envs 9 | end 10 | local file = io.open(filename) 11 | assert(file, "op_secrets exists") 12 | 13 | for line in file:lines() do 14 | for key, value in line:gmatch "([^=]+)=([^=]+)" do 15 | envs[key] = value 16 | end 17 | end 18 | return envs 19 | end 20 | -------------------------------------------------------------------------------- /.config/yamllint/config: -------------------------------------------------------------------------------- 1 | --- 2 | extends: default 3 | 4 | rules: 5 | line-length: 6 | max: 80 7 | level: warning 8 | 9 | # vim:se ft=yaml: 10 | -------------------------------------------------------------------------------- /.cspell.yaml: -------------------------------------------------------------------------------- 1 | # yaml-language-server: $schema=https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json 2 | version: "0.2" 3 | ignoreRegExpList: 4 | - | 5 | / 6 | ^\s*([`'"]{3,}) 7 | [\s\S]*? 8 | ^\s*\1$ 9 | /gmx 10 | -------------------------------------------------------------------------------- /.curlrc: -------------------------------------------------------------------------------- 1 | insecure 2 | -------------------------------------------------------------------------------- /.editrc: -------------------------------------------------------------------------------- 1 | bind -v 2 | bind ^I rl_complete 3 | 4 | mysql:bind "^r" em-inc-search-prev # enable incremental backward search 5 | mysql:bind "\\t" rl_complete # enable completion 6 | 7 | mysql:bind '^U' vi-kill-line-prev 8 | mysql:bind '^W' ed-delete-prev-word 9 | mysql:bind '^R' em-inc-search-prev 10 | 11 | mysql:bind -s "^xd" "show databases;" 12 | mysql:bind -s "^xt" "show tables;" 13 | mysql:bind -s "^xu" "select user,host,password from mysql.user order by user,host;" 14 | mysql:bind -s "^xb" "select user,host,db from mysql.db order by user,host;" 15 | mysql:bind -s "^xc" "show create table TN\\\\G" 16 | mysql:bind -s "^xn" "select count(*) from ;" 17 | mysql:bind -s "^xv" "show variables like '%%';" 18 | mysql:bind -s "^xs" "show slave status\\\\G" 19 | mysql:bind -s "^xm" "show master status\\\\G" 20 | mysql:bind -s "^xp" "show full processlist;" 21 | mysql:bind -s "^xa" "show table status like 'TN'\\\\G" 22 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "extends": "standard" 3 | }; -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "es6": true, 4 | "node": true 5 | }, 6 | "parserOptions": { 7 | "ecmaVersion": 2018, 8 | "sourceType": "module" 9 | }, 10 | "plugins": ["prettier"], 11 | "extends": ["eslint:recommended", "standard", "plugin:prettier/recommended"], 12 | "rules": { 13 | "no-console": 0, 14 | "complexity": ["error", 10], 15 | "prettier/prettier": [ 16 | "error", 17 | { 18 | "arrowParens": "always", 19 | "bracketSpacing": true, 20 | "printWidth": 100, 21 | "semi": false, 22 | "singleQuote": true 23 | } 24 | ] 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /.fdignore: -------------------------------------------------------------------------------- 1 | .git 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.c diff=cpp 2 | *.h diff=cpp 3 | *.cpp diff=cpp 4 | *.hpp diff=cpp 5 | *.m diff=objc 6 | *.java diff=java 7 | *.html diff=html 8 | *.pl diff=perl 9 | *.pm diff=perl 10 | *.t diff=perl 11 | *.php diff=php 12 | *.py diff=python 13 | *.rb diff=ruby 14 | *.js diff=java 15 | 16 | # Disable LF normalization for all files 17 | * -text 18 | -------------------------------------------------------------------------------- /.gitignore-global: -------------------------------------------------------------------------------- 1 | /.direnv 2 | /.noexpandtab 3 | /.ruby-version 4 | /.vscode 5 | /_worktree 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule ".vim/bundle/neobundle.vim"] 2 | path = .vim/bundle/neobundle.vim 3 | url = https://github.com/Shougo/neobundle.vim 4 | [submodule "submodules/iterm-colors-pencil"] 5 | path = submodules/iterm-colors-pencil 6 | url = https://github.com/mattly/iterm-colors-pencil 7 | [submodule ".tmux/plugins/tpm"] 8 | path = .tmux/plugins/tpm 9 | url = https://github.com/tmux-plugins/tpm 10 | [submodule "submodules/xterm_colour_chart"] 11 | path = submodules/xterm_colour_chart 12 | url = https://github.com/delphinus/xterm_colour_chart 13 | [submodule "dircolors-solarized"] 14 | path = dircolors-solarized 15 | url = https://github.com/seebi/dircolors-solarized 16 | [submodule "submodules/dircolors-solarized"] 17 | path = submodules/dircolors-solarized 18 | url = https://github.com/seebi/dircolors-solarized 19 | [submodule "submodules/nord-dircolors"] 20 | path = submodules/nord-dircolors 21 | url = git@github.com:delphinus/dircolors 22 | -------------------------------------------------------------------------------- /.grcat: -------------------------------------------------------------------------------- 1 | #default word color 2 | #regexp=[\w.,\:\-_/]+ 3 | regexp=.+ 4 | colours=green 5 | - 6 | 7 | #table borders 8 | regexp=[+\-]+[+\-]|[|] 9 | colours=red 10 | - 11 | 12 | #data in ( ) and ' ' 13 | regexp=\([\w\d,']+\) 14 | colours=blue 15 | - 16 | 17 | #numeric 18 | regexp=\s[\d\.]+\s*($|(?=\|)) 19 | colours=yellow 20 | - 21 | 22 | #date 23 | regexp=\d{4}-\d{2}-\d{2} 24 | colours=cyan 25 | - 26 | #time 27 | regexp=\d{2}:\d{2}:\d{2} 28 | colours=cyan 29 | - 30 | 31 | #IP 32 | regexp=(\d{1,3}\.){3}\d{1,3}(:\d{1,5})? 33 | colours=cyan 34 | - 35 | 36 | #schema 37 | regexp=`\w+` 38 | colours=yellow 39 | - 40 | 41 | #email 42 | regexp=[\w\.\-_]+@[\w\.\-_]+ 43 | colours=magenta 44 | - 45 | 46 | #row delimeter when using \G key 47 | regexp=[*]+.+[*]+ 48 | count=stop 49 | colours=blue 50 | - 51 | 52 | #column names when using \G key 53 | regexp=^\s*\w+: 54 | colours=blue 55 | -------------------------------------------------------------------------------- /.inputrc: -------------------------------------------------------------------------------- 1 | # http://www.asahi-net.or.jp/~wg5k-ickw/html/online/gdb-4.18/gdb_19.html 2 | # ベルを鳴らさない 3 | set bell-style none 4 | # ファイル名補完に大文字小文字を区別しない 5 | set completion-ignore-case on 6 | # vi モード 7 | set editing-mode vi 8 | # ~ を展開する 9 | set expand-tilde on 10 | # 補完候補を水平に表示 11 | set print-completions-horizontally on 12 | # 候補をいきなり表示する 13 | set show-all-if-ambiguous on 14 | # 補完候補に追加情報を表示する 15 | set visible-stats on 16 | 17 | # Match all files 18 | set match-hidden-files on 19 | 20 | # 'Magic Space' 21 | # Insert a space character then performs 22 | # a history expansion in the line 23 | $if Bash 24 | Space: magic-space 25 | $endif 26 | -------------------------------------------------------------------------------- /.iterm2/it2dl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [ $# -lt 1 ]; then 3 | echo "Usage: $(basename $0) file ..." 4 | exit 1 5 | fi 6 | for fn in "$@" 7 | do 8 | if [ -r "$fn" ] ; then 9 | [ -d "$fn" ] && { echo "$fn is a directory"; continue; } 10 | printf '\033]1337;File=name='`echo -n "$fn" | base64`";" 11 | wc -c "$fn" | awk '{printf "size=%d",$1}' 12 | printf ":" 13 | base64 < "$fn" 14 | printf '\a' 15 | else 16 | echo File $fn does not exist or is not readable. 17 | fi 18 | done 19 | -------------------------------------------------------------------------------- /.jsbeautifyrc: -------------------------------------------------------------------------------- 1 | { 2 | "indent_size": 2, 3 | "brace_style": "end-expand,preserve-inline" 4 | } 5 | -------------------------------------------------------------------------------- /.luacheckrc: -------------------------------------------------------------------------------- 1 | cache = true 2 | std = luajit 3 | codes = true 4 | self = false 5 | globals = { 6 | "vim", 7 | "Snacks", 8 | } 9 | -------------------------------------------------------------------------------- /.luarc.json: -------------------------------------------------------------------------------- 1 | { 2 | "diagnostics.globals": [ 3 | "vim", 4 | "after_each", 5 | "before_each", 6 | "describe", 7 | "it", 8 | "Snacks" 9 | ] 10 | } -------------------------------------------------------------------------------- /.my.cnf: -------------------------------------------------------------------------------- 1 | [mysql] 2 | default-character-set=utf8 3 | prompt='\\u: [\\d] \\r:\\m \\P> ' 4 | auto-rehash 5 | show-warnings 6 | pager = grcat ~/.grcat 7 | 8 | [mysqld_multi] 9 | mysqld = /usr/local/opt/mysql56/bin/mysqld_safe 10 | mysqladmin = /usr/local/opt/mysql56/bin/mysqladmin 11 | user = multi_admin 12 | password = multipass 13 | 14 | [mysqld1] 15 | server-id = 1 16 | user = root 17 | port = 3306 18 | datadir = /usr/local/var/mysql1 19 | socket = /tmp/mysql.sock1 20 | pid-file = /tmp/mysqld.pid1 21 | language = /usr/local/share/mysql/japanese 22 | sync_binlog = 1 23 | log-bin = mysql-bin 24 | log-bin-index = mysql-bin 25 | relay-log = relay-bin 26 | relay-log-index = relay-bin 27 | 28 | [mysqld2] 29 | server-id = 2 30 | user = root 31 | port = 3307 32 | datadir = /usr/local/var/mysql2 33 | socket = /tmp/mysql.sock2 34 | pid-file = /tmp/mysqld.pid2 35 | language = /usr/local/share/mysql/japanese 36 | read_only 37 | log-slave-updates 38 | log-bin = mysql-bin 39 | log-bin-index = mysql-bin 40 | relay-log = relay-bin 41 | relay-log-index = relay-bin 42 | -------------------------------------------------------------------------------- /.nbrc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | ############################################################################### 3 | # .nbrc 4 | # 5 | # Configuration file for `nb`, a command line note-taking, bookmarking, 6 | # and knowledge base application with encryption, search, Git-backed syncing, 7 | # and more in a single portable script. 8 | # 9 | # Edit this file manually or manage settings using the `nb settings` 10 | # subcommand. Configuration options are set as environment variables, eg: 11 | # export NB_ENCRYPTION_TOOL=gpg 12 | # 13 | # https://github.com/xwmx/nb 14 | ############################################################################### 15 | 16 | 17 | 18 | export NB_COLOR_SECONDARY="${NB_COLOR_SECONDARY:-4}" # Set by `nb` • 2020年 10月12日 月曜日 13時02分12秒 JST 19 | 20 | export NB_COLOR_PRIMARY="${NB_COLOR_PRIMARY:-6}" # Set by `nb` • 2020年 10月12日 月曜日 13時02分19秒 JST 21 | 22 | export EDITOR="nvim" # Set by `nb` • 2020年 10月12日 月曜日 13時02分39秒 JST 23 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/JohnnyMorganz/StyLua 3 | rev: v0.15.1 4 | hooks: 5 | - id: stylua-github 6 | -------------------------------------------------------------------------------- /.proverc: -------------------------------------------------------------------------------- 1 | --lib 2 | --color 3 | --failures 4 | --recurse 5 | --merge 6 | --timer 7 | -------------------------------------------------------------------------------- /.ptconfig.toml: -------------------------------------------------------------------------------- 1 | color = true 2 | color-match = "3;4;93" 3 | group = true 4 | column = false 5 | after = 0 6 | before = 0 7 | context = 0 8 | files-with-matches = false 9 | count = false 10 | e = false 11 | ignore-case = false 12 | smart-case = true 13 | word-regexp = false 14 | ignore = "_worktree" 15 | vcs-ignore = ".gitignore" 16 | global-gitignore = "~/.gitignore-global" 17 | home-ptignore = "~/.ptignore" 18 | skip-vcs-ignores = false 19 | depth = 25 20 | follow = false 21 | hidden = true 22 | -------------------------------------------------------------------------------- /.screen.cygwin: -------------------------------------------------------------------------------- 1 | source $HOME/git/dotfiles/.screen/inner.cygwin 2 | 3 | # vim:se ft=screen: 4 | -------------------------------------------------------------------------------- /.screen/backtick.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use utf8; 3 | use common::sense; 4 | use Path::Class; 5 | use POSIX qw!mkfifo!; 6 | 7 | binmode STDOUT => ':utf8'; 8 | 9 | my $fifo = file("/tmp/backtick-$$.fifo"); 10 | unless (-p $fifo) { 11 | $fifo->remove; 12 | mkfifo($fifo, 0666); 13 | } 14 | 15 | while (1) { 16 | my $fh = $fifo->openr; 17 | binmode $fh => ':utf8'; 18 | while (my $line = <$fh>) { 19 | # exit if parent process died 20 | if (1 == getppid) { 21 | $fh->close; 22 | $fifo->remove; 23 | exit; 24 | } 25 | 26 | $line =~ s/\x0D?\x0A?$//; 27 | print $line, $/; 28 | (*STDOUT)->flush; 29 | } 30 | $fh->close; 31 | } 32 | -------------------------------------------------------------------------------- /.screen/battery.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ioreg -n AppleSmartBattery | \ 3 | awk '/MaxCapacity/ {MAX = $5} 4 | /CurrentCapacity/ {CURRENT = $5} 5 | /InstantTimeToEmpty/ {REMAIN = $5} 6 | END { 7 | printf("B %6.2f%% ", CURRENT / MAX*100) 8 | if (REMAIN > 1000) 9 | if (CURRENT == MAX) printf("(MAX) ") 10 | else printf("(Charge) ") 11 | else printf("(%02d:%02d) ", REMAIN / 60, REMAIN % 60) 12 | }' 13 | -------------------------------------------------------------------------------- /.screen/cpu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphinus/dotfiles/d01324d1ceb9bb45f6ea53b918f11acdf50019c4/.screen/cpu -------------------------------------------------------------------------------- /.screen/defaults-inner: -------------------------------------------------------------------------------- 1 | defmonitor on 2 | defmousetrack on 3 | activity '' 4 | attrcolor b ".I" 5 | defscrollback 1000 6 | altscreen on 7 | escape ^Zz 8 | bell_msg "Bell in window %" 9 | shell /usr/local/bin/bash 10 | startup_message off 11 | logfile "$HOME/.screen/screen-%Y%m%d-%n.log" 12 | deflog on 13 | shelltitle '$ |bash' 14 | rendition bell "=ub" "RY" 15 | rendition monitor "=b" "BW" 16 | rendition silence "=u" "WK" 17 | rendition so "=" "Rk" 18 | 19 | # vim:se ft=screen: 20 | -------------------------------------------------------------------------------- /.screen/inner: -------------------------------------------------------------------------------- 1 | source defaults 2 | source defaults-inner 3 | source binds 4 | 5 | caption always "%{= Rk} %?%F%{b kr}%? %t (screen #%n) %{-} %?%P%{b kr} *** Copy Mode *** %{-}%?%?%E%{ky} *** Escape *** %?%{-}" 6 | hardstatus alwayslastline "%{= Gk} %-Lw%40L>%{b kg} %n %?%h%:%t%? %{-}%+Lw%-040=%{b km} %l %{.b} %Y/%m/%d %C:%s %A " 7 | 8 | # vim:se ft=screen: 9 | -------------------------------------------------------------------------------- /.screen/inner.backup: -------------------------------------------------------------------------------- 1 | source defaults 2 | source defaults-inner 3 | source binds 4 | 5 | caption always "%{= Rk} %?%F%{b kr}%? %t (screen #%n) %{-} %?%P%{b kr} *** Copy Mode *** %{-}%?%?%E%{ky} *** Escape *** %?%{-}" 6 | hardstatus alwayslastline "%{= Gk} %-Lw%40L>%{b kg} %n %?%h%:%t%? %{-}%+Lw%-040=%{b km} %l %{.b} %Y/%m/%d %C:%s %A " 7 | 8 | # vim:se ft=screen: 9 | -------------------------------------------------------------------------------- /.screen/inner.cygwin: -------------------------------------------------------------------------------- 1 | source defaults 2 | source defaults-inner 3 | source binds 4 | 5 | caption always "%{= Rk} %?%F%{kR}%? %t (screen #%n) %{-} %?%P%{kc} *** Copy Mode *** %{-}%?%?%E%{ky} *** Escape *** %?%{-}" 6 | hardstatus alwayslastline "%{= gk} %-Lw%40L>%{kg} %n %?%h%? %{-}%+Lw%-040=%{km} %l %{.w} %Y/%m/%d %C:%s %A " 7 | shell /usr/bin/bash 8 | 9 | bind ^] eval 'writebuf' "exec sh -c 'cat $HOME/.exchange.key $HOME/tmp/exchange-file | nc -w1 localhost 52224'" 'echo "paste to remote"' 10 | 11 | # vim:se ft=screen: 12 | -------------------------------------------------------------------------------- /.screen/inner.office: -------------------------------------------------------------------------------- 1 | source defaults 2 | source defaults-inner 3 | source binds 4 | 5 | shell "$HOME/bin.local/bs" 6 | caption always "%{= RW} %?%F%{WR}⮀%{+b}%:⮁%? %t %?%F%{-}%?%{!r}%{.k}⮀%{-}%{-}%{kr} (screen #%n) %?%P%{!r}%{.c}⮀%{-}%{-}%{ck}%{+b} *** Copy Mode *** %{-}%?%?%E%{!r}%{.y}⮀%{-}%{-}%{yk}%{+b} *** Escape *** %{-}%?%{!r}%{.R}⮀" 7 | hardstatus alwayslastline "%{= RW} %-Lw%40L>%{!r}⮀ %n %?%h%? %{-}⮀%+Lw%0`%{!r}%{.K}⮀%{-}%{-}%{K.}%{.m} %l %{-}%{.w}⮁ %Y/%m/%d %C:%s %A %{-}%{-}" 8 | backtick 0 0 0 $HOME/git/dotfiles/.screen/backtick.pl 9 | 10 | bind ^] eval 'writebuf' "exec sh -c 'cat $HOME/.exchange.key $HOME/tmp/exchange-file | nc -w1 localhost 52224'" 'echo "paste to remote"' 11 | 12 | # vim:se ft=screen: 13 | -------------------------------------------------------------------------------- /.screen/inner.remora-air2: -------------------------------------------------------------------------------- 1 | source defaults 2 | source defaults-inner 3 | source binds 4 | 5 | caption always "%{= gk} %-Lw%{!r}%{.W}⮀%{-}%{-}%{Wr}%{+b} %t (screen #%n) %{-}%{!r}%{.g}⮀%+Lw" 6 | hardstatus alwayslastline "%{= gk}%4`%{.m} %l %{-}%{.y}M %0`%% %{.b}C %1`%% %{.r}T %2`C %{-}%{.w}%3`%{-} ⮁ %Y/%m/%d %C:%s %A " 7 | backtick 4 0 0 $HOME/git/dotfiles/.screen/backtick.pl 8 | backtick 0 10 10 $HOME/git/dotfiles/.screen/memory 9 | backtick 1 1 1 $HOME/git/dotfiles/.screen/cpu 10 | backtick 2 5 5 $HOME/git/dotfiles/.screen/temperature.sh 11 | backtick 3 5 5 $HOME/git/dotfiles/.screen/battery.sh 12 | 13 | # vim:se ft=screen: 14 | -------------------------------------------------------------------------------- /.screen/lastfm-json.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use utf8; 3 | use common::sense; 4 | use FindBin; 5 | use JSON; 6 | use Path::Class; 7 | 8 | use lib "$FindBin::Bin/lib"; 9 | use Segment::LastFM; 10 | 11 | my $interval = 30; 12 | my $tmp = '/tmp/lastfm-data.txt'; 13 | 14 | my $now = time; 15 | my %last; 16 | 17 | my $result = eval { from_json(file($tmp)->slurp) }; 18 | if (defined $result) { 19 | $last{timestamp} = $result->{timestamp} || $now; 20 | $last{data} = $result->{data} || +{}; 21 | } else { 22 | $last{timestamp} = 0; 23 | $last{data} = +{}; 24 | } 25 | 26 | if ($now - $last{timestamp} < $interval) { 27 | print to_json($last{data}); 28 | exit; 29 | } 30 | 31 | if (my $pid = fork) { 32 | print to_json($last{data}); 33 | exit 0; 34 | } else { 35 | my $lastfm = Segment::LastFM->new; 36 | my $data = $lastfm->_get_data; 37 | file($tmp)->openw->print(to_json(+{ 38 | timestamp => $now, 39 | data => $data, 40 | })); 41 | } 42 | -------------------------------------------------------------------------------- /.screen/lib/Segment.pm: -------------------------------------------------------------------------------- 1 | package Segment; 2 | use utf8; 3 | use common::sense; 4 | use parent 'Class::Accessor::Lvalue::Fast'; 5 | __PACKAGE__->mk_accessors(qw!!); 6 | 7 | use Log::Minimal; 8 | use Path::Class; 9 | 10 | my $log_file = file('/usr/local/var/logs/backtick-lastfm.log'); 11 | 12 | # log setting 13 | #{{{ 14 | $Log::Minimal::PRINT = sub { 15 | my ($time, $type, $message, $trace, $raw_message) = @_; 16 | $ENV{TEST_MODE} or return; 17 | my $msg = sprintf "%s [%s] %s%s\n", 18 | $time, $type, $message, ($type eq 'INFO' ? '' : " at $trace"); 19 | my $fh = $log_file->open('a') or die $!; 20 | binmode $fh => ':utf8'; 21 | $fh->print($msg); 22 | $fh->close; 23 | }; 24 | #}}} 25 | 26 | sub new { my $class = shift; 27 | my $args = ref $_[0] ? $_[0] : +{@_}; 28 | return $class->SUPER::new(+{ 29 | %$args, 30 | }); 31 | } 32 | 33 | sub render { ... }; 34 | 35 | sub finish { my $self = shift; 36 | $self->text->add(fg => 'm', bg => 'K', string => ''); 37 | } 38 | 39 | 1; 40 | -------------------------------------------------------------------------------- /.screen/lib/Segment/IP.pm: -------------------------------------------------------------------------------- 1 | package Segment::IP; 2 | use utf8; 3 | use common::sense; 4 | use parent 'Segment'; 5 | __PACKAGE__->mk_accessors(qw!url!); 6 | 7 | use LWP::Simple; 8 | 9 | sub new { my $class = shift; 10 | my $args = ref $_[0] ? $_[0] : +{@_}; 11 | return $class->SUPER::new(+{ 12 | url => 'http://ipv4.icanhazip.com/', 13 | %$args, 14 | }); 15 | } 16 | 17 | sub render { my $self = shift; 18 | my %data = $self->get_data; 19 | $self->text->add(fg => 'k', bg => 'y', string => $data{weather}); 20 | } 21 | 22 | sub get_data { my $self = shift; 23 | return get($self->url); 24 | } 25 | 26 | # vim:se et: 27 | -------------------------------------------------------------------------------- /.screen/lib/Segment/Location.pm: -------------------------------------------------------------------------------- 1 | package Segment::Location; 2 | use utf8; 3 | use common::sense; 4 | use parent 'Segment'; 5 | __PACKAGE__->mk_accessors(qw!!); 6 | 7 | use JSON; 8 | use LWP::Simple; 9 | 10 | use Segment::IP; 11 | 12 | sub new { my $class = shift; 13 | my $args = ref $_[0] ? $_[0] : +{@_}; 14 | return $class->SUPER::new(+{ 15 | url => 'http://freegeoip.net/json/', 16 | %$args, 17 | }); 18 | } 19 | 20 | sub render { my $self = shift; 21 | my %data = $self->get_data; 22 | $self->text->add(fg => 'W', bg => 'c', string => $data{weather}); 23 | } 24 | 25 | sub get_data { my $self = shift; 26 | my $external_ip = Segment::IP->new->get_data; 27 | my $location = eval { from_json(get($self->url . $external_ip)) } || +{}; 28 | return wantarray ? %$location : $location; 29 | } 30 | 31 | # vim:se et: 32 | -------------------------------------------------------------------------------- /.screen/lib/Segment/Weather.pm: -------------------------------------------------------------------------------- 1 | package Segment::Weather; 2 | use utf8; 3 | use common::sense; 4 | use parent 'Segment'; 5 | __PACKAGE__->mk_accessors(qw!location_query!); 6 | 7 | use LWP::UserAgent; 8 | 9 | use Segment::Location; 10 | 11 | sub new { my $class = shift; 12 | my $args = ref $_[0] ? $_[0] : +{@_}; 13 | return $class->SUPER::new(+{ 14 | %$args, 15 | }); 16 | } 17 | 18 | sub render { my $self = shift; 19 | my %data = $self->get_data; 20 | $self->text->add(fg => 'W', bg => 'c', string => $data{weather}); 21 | } 22 | 23 | sub get_data { my $self = shift; 24 | my $ua = LWP::UserAgent->new; 25 | 26 | my %location; 27 | if ($self->location_query) { 28 | @location{qw!city regeion_name country_name!} 29 | = split ',', $self->location_query; 30 | } else { 31 | %location = Segment::Location->new; 32 | } 33 | } 34 | 35 | # vim:se et: 36 | -------------------------------------------------------------------------------- /.screen/limechat-notify.vbs: -------------------------------------------------------------------------------- 1 | Option Explicit 2 | 3 | Dim args, ws 4 | Set args = WScript.Arguments 5 | Set ws = WScript.CreateObject("WScript.Shell") 6 | ws.Run "cmd /c %HOME%\git\dotfiles\.screen\limechat-notify.bat """ & args(0) & """", 0 7 | -------------------------------------------------------------------------------- /.screen/memory: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphinus/dotfiles/d01324d1ceb9bb45f6ea53b918f11acdf50019c4/.screen/memory -------------------------------------------------------------------------------- /.screen/memory.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | struct host_basic_info host; 9 | struct vm_statistics vm_info; 10 | mach_msg_type_number_t count; 11 | kern_return_t kr; 12 | vm_size_t pagesize; 13 | 14 | count = HOST_BASIC_INFO_COUNT; 15 | kr = host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)&host, &count); 16 | 17 | count = HOST_VM_INFO_COUNT; 18 | kr = host_statistics(mach_host_self(),HOST_VM_INFO,(host_info_t)&vm_info,&count); 19 | 20 | kr = host_page_size(mach_host_self(),&pagesize); 21 | 22 | uint64_t memory_size; 23 | size_t len = sizeof(memory_size); 24 | sysctlbyname("hw.memsize", &memory_size, &len, NULL, 0); 25 | 26 | if(kr == KERN_SUCCESS) 27 | printf("%5.1lf\n",(((double)(vm_info.wire_count + vm_info.active_count)*pagesize)/memory_size)*100); 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /.screen/outer: -------------------------------------------------------------------------------- 1 | source defaults 2 | 3 | caption always "%{= dd}%0`" 4 | backtick 0 0 0 $HOME/git/dotfiles/.screen/backtick.pl 5 | 6 | screen screen -qUmc $HOME/git/dotfiles/.screen/inner 7 | 8 | # vim:se ft=screen: 9 | -------------------------------------------------------------------------------- /.screen/outer.backup: -------------------------------------------------------------------------------- 1 | source defaults 2 | 3 | caption always "%{= dd}%0`" 4 | backtick 0 0 0 $HOME/git/dotfiles/.screen/backtick.pl 5 | 6 | screen screen -qUmc $HOME/git/dotfiles/.screen/inner.backup 7 | 8 | # vim:se ft=screen: 9 | -------------------------------------------------------------------------------- /.screen/outer.cygwin: -------------------------------------------------------------------------------- 1 | source defaults 2 | 3 | caption always "%{= dd}%0`" 4 | backtick 0 0 0 $HOME/git/dotfiles/.screen/backtick.pl 5 | 6 | screen screen -qUmc $HOME/git/dotfiles/.screen/inner.cygwin 7 | 8 | # vim:se ft=screen: 9 | -------------------------------------------------------------------------------- /.screen/outer.office: -------------------------------------------------------------------------------- 1 | source defaults 2 | 3 | caption always "%{= dd}%0`" 4 | backtick 0 0 0 $HOME/git/dotfiles/.screen/backtick.pl 5 | 6 | screen $HOME/usr/local/bin/screen -qUmc $HOME/git/dotfiles/.screen/inner.office 7 | 8 | # vim:se ft=screen: 9 | -------------------------------------------------------------------------------- /.screen/outer.remora-air2: -------------------------------------------------------------------------------- 1 | source defaults 2 | 3 | caption always "%{= dd}%0`" 4 | backtick 0 0 0 $HOME/git/dotfiles/.screen/backtick.pl 5 | 6 | screen screen -qUmc $HOME/git/dotfiles/.screen/inner.remora-air2 7 | 8 | # vim:se ft=screen: 9 | -------------------------------------------------------------------------------- /.screen/temperature.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | awk '{print $1}' $HOME/.screen/.temp 4 | $HOME/git/.screen/tempmonitor > .temp & 5 | 6 | -------------------------------------------------------------------------------- /.screen/twitter.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use utf8; 3 | use strict; 4 | use warnings; 5 | use Date::Manip; 6 | use Net::Twitter; 7 | use Scalar::Util qw!blessed!; 8 | 9 | binmode STDOUT => ':utf8'; 10 | binmode STDERR => ':utf8'; 11 | 12 | my $nt = Net::Twitter->new( 13 | traits => [qw!OAuth API::REST!], 14 | consumer_key => 'VKtSF6TLXPkVJw3w7FDSew', 15 | consumer_secret => 'Sd8tgWymQQRuvsjTaowyaFoDLv22VmnhCrsdxSMs', 16 | access_token => '31149073-lZBlHBXJsDp1cMMworn1qX9tLUWVfnw1dwMD1g6e0', 17 | access_token_secret => '42fXHUOaibI1APunV8BQDuFVQuVc1gPk3QSf7LGejk', 18 | ); 19 | 20 | eval { 21 | my $statuses = $nt->friends_timeline({count => 1}); 22 | for my $s (@$statuses) { 23 | my $timestamp = Date_ConvTZ $s->{created_at}, 'GMT'; 24 | $timestamp = UnixDate $timestamp => '%Y/%m/%d %H:%M:%S'; 25 | print "$timestamp <\@$s->{user}{screen_name}> $s->{text}\n"; 26 | } 27 | }; 28 | if (my $err = $@) { 29 | die $@ unless blessed $@ && $err->isa('Net::Twitter::Error'); 30 | 31 | printf "HTTP Error: %d %s, Twitter Error: %s\n", 32 | $err->code, $err->message, $err->error; 33 | } 34 | -------------------------------------------------------------------------------- /.screenrc.office: -------------------------------------------------------------------------------- 1 | source $HOME/git/dotfiles/.screen/inner.office 2 | 3 | # vim:se ft=screen: 4 | -------------------------------------------------------------------------------- /.screenrc.remora: -------------------------------------------------------------------------------- 1 | source $HOME/git/dotfiles/.screen/outer 2 | 3 | # vim:se ft=screen: 4 | -------------------------------------------------------------------------------- /.screenrc.remora-air2: -------------------------------------------------------------------------------- 1 | source $HOME/git/dotfiles/.screen/inner.remora-air2 2 | 3 | # vim:se ft=screen: 4 | -------------------------------------------------------------------------------- /.stylua.toml: -------------------------------------------------------------------------------- 1 | column_width = 120 2 | line_endings = "Unix" 3 | indent_type = "Spaces" 4 | indent_width = 2 5 | quote_style = "AutoPreferDouble" 6 | no_call_parentheses = true 7 | -------------------------------------------------------------------------------- /.styluaignore: -------------------------------------------------------------------------------- 1 | packer_compiled.lua 2 | -------------------------------------------------------------------------------- /.tern-project: -------------------------------------------------------------------------------- 1 | { 2 | "libs": [ 3 | "browser", 4 | "ecma6", 5 | "jquery", 6 | "underscore" 7 | ], 8 | "plugins": { 9 | "node": {} 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.textlintrc: -------------------------------------------------------------------------------- 1 | --- 2 | rules: 3 | preset-ja-spacing: 4 | ja-nakaguro-or-halfwidth-space-between-katakana: true 5 | ja-no-space-around-parentheses: true 6 | ja-no-space-between-full-width: true 7 | ja-space-between-half-and-full-width: 8 | space: always 9 | ja-space-after-exclamation: true 10 | ja-space-after-question: true 11 | ja-space-around-code: 12 | before: true 13 | after: true 14 | 15 | # vim:se ft=yaml: 16 | -------------------------------------------------------------------------------- /.tmux.conf.office: -------------------------------------------------------------------------------- 1 | source $HOME/git/dotfiles/.tmux/default.conf 2 | set-environment -g ZDOTDIR $HOME 3 | set-option -g default-shell $HOME/usr/local/bin/zsh 4 | source $HOME/git/dotfiles/.tmux/screen-keys.conf 5 | source $HOME/git/dotfiles/.tmux/vim-keys.conf 6 | source $HOME/git/dotfiles/.tmux/powerline.conf.office 7 | -------------------------------------------------------------------------------- /.tmux/copy-fssh.conf: -------------------------------------------------------------------------------- 1 | # copy over ssh by fssh's ui-copy 2 | unbind -T copy-mode-vi Enter 3 | bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel ui-copy 4 | unbind -T copy-mode-vi y 5 | bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel ui-copy 6 | -------------------------------------------------------------------------------- /.tmux/default.conf: -------------------------------------------------------------------------------- 1 | # Escape の反応を早くする 2 | set-option -s escape-time 0 3 | 4 | # マウスで移動 5 | set-option -g mouse on 6 | 7 | set-window-option -g automatic-rename on 8 | set-option -g base-index 1 9 | 10 | # italic 文字を有効にする 11 | set -g default-terminal "xterm-256color" 12 | set -ag terminal-overrides ",xterm-256color:RGB" 13 | 14 | # サイズの異なる端末からアクセスしたときに随時ウィンドウサイズ変更 15 | set-window-option -g aggressive-resize on 16 | 17 | # ターミナルのタイトルをウィンドウに合わせる 18 | set-option -g set-titles on 19 | 20 | # 設定のリロード 21 | bind r source-file ~/git/dotfiles/.tmux.conf \; display "Reloaded!" 22 | 23 | # ステータスバーを画面上に 24 | set-option -g status-position top 25 | 26 | # focus-event を検知できるようにする 27 | set -g focus-events on 28 | 29 | # window と pane は 1 から数える 30 | set -g base-index 1 31 | setw -g pane-base-index 1 32 | 33 | # キーボードショートカットを連続入力可能にする 34 | set -g repeat-time 3000 35 | 36 | # show pstree of the active process in the current pane 37 | bind-key C-k run-shell "/opt/homebrew/bin/fish -c 'tmux popup -E -x R -y S -w 60 -h 20 -- watch -n1 ~/git/dotfiles/bin/simple-pstree (tmux display-message -p -F #{pane_pid})'" 38 | 39 | # TODO: this is not needed? 40 | #set -s extended-keys on 41 | 42 | set -g set-clipboard on 43 | 44 | set -g allow-passthrough all 45 | -------------------------------------------------------------------------------- /.tmux/h-boetes.conf: -------------------------------------------------------------------------------- 1 | # $Id: h-boetes.conf,v 1.2 2009-10-25 21:45:26 nicm Exp $ 2 | # 3 | # From Han Boetes. 4 | 5 | set -g default-command zsh 6 | set -g status-right "#(uptime|awk '{print $11}') #(date)" 7 | 8 | # Statusbar properties. 9 | set -g display-time 3000 10 | set -g status-bg black 11 | set -g status-fg cyan 12 | set-window-option -g window-status-current-attr bright,reverse 13 | set-window-option -g window-status-current-bg cyan 14 | set-window-option -g window-status-current-fg black 15 | 16 | # Use c-t instead of c-b as the prefix 17 | unbind C-b 18 | set -g prefix C-t 19 | bind C-t send-prefix 20 | bind t send-prefix 21 | 22 | # Bind function keys. 23 | bind -n F1 select-window -t 1 24 | bind -n F2 select-window -t 2 25 | bind -n F3 select-window -t 3 26 | bind -n F4 select-window -t 4 27 | bind -n F5 select-window -t 5 28 | bind -n F6 select-window -t 6 29 | bind -n F7 select-window -t 7 30 | bind -n F8 select-window -t 8 31 | 32 | # All new windows started at startup. 33 | new emacs 34 | neww irssi 35 | neww mutt 36 | neww 37 | neww 38 | neww 39 | neww 40 | neww 41 | 42 | select-window -t 1 43 | -------------------------------------------------------------------------------- /.tmux/nord-statusline.conf: -------------------------------------------------------------------------------- 1 | set -g status-right "#{prefix_highlight}#(battery.tmux)#[fg=brightblack,bg=black,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] %Y-%m-%d #[fg=white,bg=brightblack,nobold,noitalics,nounderscore]#[fg=white,bg=brightblack] %H:%M #[fg=cyan,bg=brightblack,nobold,noitalics,nounderscore]#[fg=black,bg=cyan,bold] #H" 2 | set -g status-right-length 60 3 | -------------------------------------------------------------------------------- /.tmux/pane.conf: -------------------------------------------------------------------------------- 1 | bind-key -T prefix Z select-layout even-horizontal 2 | bind-key -T prefix X select-layout even-vertical 3 | bind-key -T prefix C select-layout main-horizontal 4 | bind-key -T prefix V select-layout main-vertical 5 | bind-key -T prefix B select-layout tiled 6 | -------------------------------------------------------------------------------- /.tmux/powerline.conf: -------------------------------------------------------------------------------- 1 | run-shell -b "powerline-daemon -q || true" 2 | source $POWERLINE_LIB/bindings/tmux/powerline.conf 3 | -------------------------------------------------------------------------------- /.tmux/prefix.conf: -------------------------------------------------------------------------------- 1 | if-shell 'env | grep SSH_CLIENT > /dev/null' 'unbind C-z ; set -g prefix ^S ; unbind ^Z ; bind ^S last-window' '' 2 | -------------------------------------------------------------------------------- /.tmux/statusline.conf: -------------------------------------------------------------------------------- 1 | # status 2 | set -g status-fg yellow 3 | set -g status-bg black 4 | 5 | set -g status-left-length 80 6 | set -g status-left '#H:[#S][' 7 | set -g status-right '#[fg=colour190,bg=colour0,bold] [%Y-%m-%d(%a) %H:%M]#[default]' 8 | 9 | # window-status-current 10 | setw -g window-status-current-fg colour230 11 | setw -g window-status-current-bg black 12 | setw -g window-status-current-attr bold#,underscore 13 | 14 | # pane-active-border 15 | set -g pane-active-border-fg colour76 16 | set -g pane-active-border-bg colour8 17 | -------------------------------------------------------------------------------- /.tmux/tpm.conf: -------------------------------------------------------------------------------- 1 | # Tmux Plugin Manager 2 | set -g @plugin 'tmux-plugins/tpm' 3 | set -g @plugin 'NHDaly/tmux-better-mouse-mode' 4 | set -g @plugin 'tmux-plugins/tmux-prefix-highlight' 5 | set -g @plugin 'arcticicestudio/nord-tmux' 6 | set -g @plugin 'tmux-plugins/tmux-logging' 7 | set -g @plugin 'Morantron/tmux-fingers' 8 | set -g @plugin 'sainnhe/tmux-fzf' 9 | 10 | # plugin settings 11 | set -g @emulate-scroll-for-no-mouse-alternate-buffer 'on' 12 | set -g @prefix_highlight_show_copy_mode 'on' 13 | set -g @fingers-key f 14 | 15 | set-environment -g PATH "/opt/homebrew/bin:/bin:/usr/bin" 16 | run ~/.tmux/plugins/tpm/tpm 17 | -------------------------------------------------------------------------------- /.vim/gvimrc: -------------------------------------------------------------------------------- 1 | scriptencoding utf-8 2 | 3 | set ambiwidth=single " 文字幅が曖昧なときは半角と見なす 4 | set printfont=SFMono\ Square:h16 " 印刷用フォント 5 | set printoptions=number:y " 印刷時に行番号を付ける 6 | set visualbell " ビープ音を使わず画面をフラッシュさせる 7 | set iminsert=0 " インサートモードの初期値は IME OFF 8 | set imsearch=-1 " 挿入モードの初期値は iminsert に従う 9 | set guioptions=A " モードレスセレクションに対する自動選択 10 | 11 | set guifont=SFMono\ Square:h16 12 | set lines=92 columns=190 " ウィンドウの大きさを指定する 13 | set antialias " 文字をなめらかに表示する 14 | set fuoptions=maxvert,maxhorz " フルスクリーン時に表示を拡張 15 | set macmeta " option キーを alt キーとして使う 16 | set transparency=0 " 画面を半透明にしない 17 | set macligatures " リガチャ(合字)を使う 18 | 19 | colorscheme nord 20 | -------------------------------------------------------------------------------- /.vim/vimrc: -------------------------------------------------------------------------------- 1 | scriptencoding 'utf-8' 2 | 3 | if &compatible 4 | " vint: -ProhibitSetNoCompatible 5 | set nocompatible 6 | " vint: +ProhibitSetNoCompatible 7 | endif 8 | 9 | set runtimepath+=$HOME/.vim,$HOME/.vim/after 10 | let s:source_rc = 'source ' . $HOME . '/.vim/rc/' 11 | let s:load_rc = {file -> execute(s:source_rc . file . '.vim')} 12 | 13 | call s:load_rc('dein') " プラグインの読み込み 14 | call s:load_rc('map') " マッピング 15 | call s:load_rc('set') " オプション設定 16 | call s:load_rc('term') " ターミナル固有の設定 17 | call s:load_rc('commands') " ユーティリティコマンド 18 | 19 | " デフォルトプラグインを無効化 20 | let g:loaded_getscriptPlugin = 1 21 | let g:loaded_logiPat = 1 22 | let g:loaded_rrhelper = 1 23 | let g:loaded_vimballPlugin = 1 24 | if ! has('gui_running') 25 | let g:plugin_scrnmode_disable = 1 26 | endif 27 | 28 | " ローカル設定 29 | let s:local_vimrc = $HOME . '/.vimrc-local' 30 | if filereadable(s:local_vimrc) 31 | execute 'source ' . s:local_vimrc 32 | endif 33 | -------------------------------------------------------------------------------- /.vimrc_first.vim: -------------------------------------------------------------------------------- 1 | let g:vimrc_first_finish = 1 2 | -------------------------------------------------------------------------------- /.xvimrc: -------------------------------------------------------------------------------- 1 | " コロンとセミコロンを入れ替える 2 | nmap ; : 3 | nmap : ; 4 | -------------------------------------------------------------------------------- /.zlogin: -------------------------------------------------------------------------------- 1 | # 2 | # Executes commands at login post-zshrc. 3 | # 4 | # Authors: 5 | # Sorin Ionescu 6 | # 7 | 8 | # Execute code that does not affect the current session in the background. 9 | { 10 | # Compile the completion dump to increase startup speed. 11 | zcompdump="${ZDOTDIR:-$HOME}/.zcompdump" 12 | if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then 13 | zcompile "$zcompdump" 14 | fi 15 | } &! 16 | 17 | # Print a random, hopefully interesting, adage. 18 | if (( $+commands[fortune] )); then 19 | if [[ -t 0 || -t 1 ]]; then 20 | fortune -s 21 | print 22 | fi 23 | fi 24 | -------------------------------------------------------------------------------- /.zlogout: -------------------------------------------------------------------------------- 1 | # 2 | # Executes commands at logout. 3 | # 4 | # Authors: 5 | # Sorin Ionescu 6 | # 7 | 8 | # Print the message. 9 | cat <<-EOF 10 | 11 | Thank you. Come again! 12 | -- Dr. Apu Nahasapeemapetilon 13 | EOF 14 | -------------------------------------------------------------------------------- /.zsh/basic.zshrc: -------------------------------------------------------------------------------- 1 | # vim:se ft=zsh: 2 | 3 | # http://d.hatena.ne.jp/kei_q/20110308/1299594629 4 | show_buffer_stack() { 5 | POSTDISPLAY=" 6 | stack: $LBUFFER" 7 | zle push-line 8 | } 9 | zle -N show_buffer_stack 10 | bindkey "^[q" show_buffer_stack 11 | 12 | setopt print_eight_bit # 日本語ファイル名を表示可能にする 13 | setopt no_flow_control # フローコントロールを無効にする 14 | setopt auto_cd # ディレクトリ名だけで移動する 15 | setopt EXTENDED_GLOB # 色んな glob 16 | setopt HIST_IGNORE_SPACE # 最初にスペースのあるコマンドを履歴に追加しない 17 | setopt inc_append_history hist_ignore_dups # 複数のターミナルで history を共有する 18 | 19 | # zsh-notify x Growl - 人生いきあたりばったりで生きてます@はてな 20 | # http://moqada.hatenablog.com/entry/2014/03/26/121915 21 | autoload -Uz add-zsh-hook 22 | 23 | # for brewed zsh 24 | if [ -d /usr/local/share/zsh/help ]; then 25 | unalias run-help 26 | autoload run-help 27 | HELPDIR=/usr/local/share/zsh/help 28 | fi 29 | 30 | # 補完で大文字小文字を区別しない 31 | zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 32 | 33 | # disable 34 | stty -ixon -ixoff 35 | # disable 36 | stty susp undef 37 | 38 | # MacVimにzshの環境変数読み込ませる方法 - エンジニアですよ! 39 | # http://totem3.hatenablog.jp/entry/2013/10/17/055942 40 | typeset -U path 41 | -------------------------------------------------------------------------------- /.zsh/dircolors/README.md: -------------------------------------------------------------------------------- 1 | from https://github.com/dotphiles/dotzsh 2 | -------------------------------------------------------------------------------- /.zsh/git-foresta.zsh: -------------------------------------------------------------------------------- 1 | if (( $+commands[git-foresta] )); then 2 | if type gf | grep alias > /dev/null; then 3 | unalias gf 4 | fi 5 | if type gfa | grep alias > /dev/null; then 6 | unalias gfa 7 | fi 8 | 9 | function gf() { git-foresta $@ | less } 10 | function gfa() { git-foresta --all $@ | less } 11 | compdef _git gf=git-log 12 | compdef _git gfa=git-log 13 | fi 14 | -------------------------------------------------------------------------------- /.zsh/iterm2.zsh: -------------------------------------------------------------------------------- 1 | # ref https://coderwall.com/p/s-2_nw/change-iterm2-color-profile-from-the-cli 2 | function it2prof() { echo -e "\e]50;SetProfile=$1\a" } 3 | -------------------------------------------------------------------------------- /.zsh/peco-brew-directories.zsh: -------------------------------------------------------------------------------- 1 | function peco-brew-directories () { 2 | local selected_dir=$(brew directories | fzf --query "$LBUFFER") 3 | if [[ -n $selected_dir ]]; then 4 | BUFFER="cd ${selected_dir}" 5 | zle accept-line 6 | fi 7 | } 8 | zle -N peco-brew-directories 9 | #bindkey '^k' peco-brew-directories 10 | 11 | function peco-brew-directories-dir () { 12 | local current_buffer=$BUFFER 13 | local selected_dir=$(brew directories | fzf --query) 14 | if [[ -n $selected_dir ]]; then 15 | BUFFER="${current_buffer}${selected_dir}" 16 | CURSOR=$#BUFFER 17 | fi 18 | } 19 | zle -N peco-brew-directories-dir 20 | bindkey '^x^k' peco-brew-directories-dir 21 | -------------------------------------------------------------------------------- /.zsh/peco-bundler.zsh: -------------------------------------------------------------------------------- 1 | function peco-bundler () { 2 | local selected_dir=$(bundler show --paths | fzf --query "$LBUFFER") 3 | if [[ -n $selected_dir ]]; then 4 | BUFFER="cd ${selected_dir}" 5 | zle accept-line 6 | fi 7 | } 8 | zle -N peco-bundler 9 | bindkey '^g' peco-bundler 10 | 11 | function peco-bundler-dir () { 12 | local current_buffer=$BUFFER 13 | local selected_dir=$(bundler show --paths | fzf --query) 14 | if [[ -n $selected_dir ]]; then 15 | BUFFER="${current_buffer}${selected_dir}" 16 | CURSOR=$#BUFFER 17 | fi 18 | } 19 | zle -N peco-bundler-dir 20 | bindkey '^x^g' peco-bundler-dir 21 | -------------------------------------------------------------------------------- /.zsh/peco-ghq.zsh: -------------------------------------------------------------------------------- 1 | function peco-src () { 2 | local selected_dir=$(ghq list --full-path | fzf --query "$LBUFFER") 3 | if [[ -n $selected_dir ]]; then 4 | BUFFER="cd ${selected_dir}" 5 | zle accept-line 6 | fi 7 | } 8 | zle -N peco-src 9 | bindkey '^]' peco-src 10 | 11 | function peco-src-dir () { 12 | local current_buffer=$BUFFER 13 | local selected_dir=$(ghq list --full-path | fzf) 14 | if [[ -n $selected_dir ]]; then 15 | BUFFER="${current_buffer}${selected_dir}" 16 | CURSOR=$#BUFFER 17 | fi 18 | } 19 | zle -N peco-src-dir 20 | bindkey '^x^]' peco-src-dir 21 | -------------------------------------------------------------------------------- /.zsh/peco-open-pullrequest.zsh: -------------------------------------------------------------------------------- 1 | function peco-open-pullrequest() { 2 | echo 3 | echo "searching..." 4 | local selected_pr=${(@f)$(gh pr \ 5 | | perl -ne 'if (/^(#\d+)\s+(.*)\s+(@[-\w]+)\s+(\(.*\))/) { print qq{$1 $base $2 $3 $4\n} } elsif (/^(\w+)/) { $base = $1 }' \ 6 | | fzf \ 7 | )} 8 | if [ -n "$selected_pr" ]; then 9 | if (( $+commands[lycia] )); then 10 | echo "opening $selected_pr" 11 | lycia p $(echo $selected_pr | perl -pe 's/#(\d+).*/$1/s') 12 | echo 13 | else 14 | echo $selected_pr 15 | fi 16 | fi 17 | } 18 | zle -N peco-open-pullrequest 19 | bindkey '^x^p' peco-open-pullrequest 20 | -------------------------------------------------------------------------------- /.zsh/peco-select-history.zsh: -------------------------------------------------------------------------------- 1 | function peco-select-history() { 2 | local tac 3 | if (( $+commands[tac] )); then 4 | tac="tac" 5 | elif (( $+commands[gtac] )); then 6 | tac="gtac" 7 | else 8 | tac="tail -r" 9 | fi 10 | BUFFER=$(history -n 1 | eval $tac | fzf --no-sort --query "$LBUFFER") 11 | CURSOR=$#BUFFER 12 | } 13 | zle -N peco-select-history 14 | bindkey '^r' peco-select-history 15 | -------------------------------------------------------------------------------- /.zsh/peco-view-sources.zsh: -------------------------------------------------------------------------------- 1 | function peco-view-sources() { 2 | exec rg -n "$@" . | peco --exec 'awk -F : '"'"'{print "+" $2 " " $1}'"'"' 2>&1 | xargs sh -c '"'"'view "$@" < /dev/tty'"'"' view' 3 | } 4 | zle -N peco-view-sources 5 | bindkey '^x^v' peco-view-sources 6 | -------------------------------------------------------------------------------- /.zsh/peco-z.zsh: -------------------------------------------------------------------------------- 1 | function peco-z() { 2 | # @f is a parameter cuts off the input lines into array. This line below makes @f only cut 3 | # off by the newline character. 4 | local IFS=$'\n' 5 | local selected_dir=${(@f)$(z | sort -k1nr \ 6 | | ruby -pe '$_.sub! /(?<=^.{11})#{ENV["HOME"]}/, "~"' \ 7 | | ruby -pe '$_.sub!(/^([\d.]+)\s+(.*)$/) { "%5d %s" % [$1.to_i, $2] }' \ 8 | | fzf --no-sort --query "$LBUFFER" \ 9 | | cut -b 8- \ 10 | | ruby -pe '$_.sub! /^~/, ENV["HOME"]' \ 11 | )} 12 | if [[ -n $selected_dir ]]; then 13 | BUFFER="cd $(printf %q "$selected_dir")" 14 | zle accept-line 15 | fi 16 | } 17 | zle -N peco-z 18 | bindkey '^t' peco-z 19 | -------------------------------------------------------------------------------- /.zsh/pretty-print-array.zsh: -------------------------------------------------------------------------------- 1 | # ref https://stackoverflow.com/questions/18906460/zsh-print-array-objects-in-color-to-terminal-window 2 | function pp-array() { 3 | autoload -Uz colors && colors 4 | local array_name=$1 5 | 6 | local array_length=${#${(P)${array_name}}} 7 | for (( i = 1; i < $array_length; i+=3 )) do 8 | print -P %{${fg[red]}%}${(P)${array_name}[i]}%{$reset_color %}${(P)${array_name}[i+1]} %{${fg[yellow]}%}${(P)${array_name}[i+2]}%{$reset_color%} 9 | done 10 | } 11 | -------------------------------------------------------------------------------- /.zsh/prezto/functions/perl-info: -------------------------------------------------------------------------------- 1 | perl-info() { 2 | local version 3 | local version_format 4 | local version_formatted 5 | 6 | # Clean up previous $ruby_info. 7 | unset perl_info 8 | typeset -gA perl_info 9 | 10 | if (( $+commands[perlbrew] )); then 11 | version="$(perlbrew list | grep '^\*' | sed 's/^\* \([^ ]*\).*/\1/')" 12 | elif (( $+commands[plenv] )); then 13 | version="$(plenv version-name)" 14 | elif (( $+commands[ruby] )); then 15 | version="${${$(ruby --version)[(w)1,(w)2]}/ /-}" 16 | fi 17 | 18 | # Format version. 19 | if [[ -n "$version" ]]; then 20 | zstyle -s ':prezto:module:perl:info:version' format 'version_format' 21 | zformat -f version_formatted "$version_format" "v:$version" 22 | perl_info[version]="$version_formatted" 23 | fi 24 | } 25 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphinus/dotfiles/d01324d1ceb9bb45f6ea53b918f11acdf50019c4/README -------------------------------------------------------------------------------- /ansible/.sops.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | creation_rules: 3 | - path_regex: secrets\.yml$ 4 | gcp_kms: projects/delphinus-dev/locations/asia-northeast1/keyRings/delphinus/cryptoKeys/delphinus 5 | -------------------------------------------------------------------------------- /ansible/ansible.cfg: -------------------------------------------------------------------------------- 1 | [ssh_connection] 2 | scp_if_ssh=True 3 | -------------------------------------------------------------------------------- /ansible/files/bash_profile: -------------------------------------------------------------------------------- 1 | export PATH=/usr/local/bin:$PATH 2 | source .bashrc 3 | -------------------------------------------------------------------------------- /ansible/files/bashrc: -------------------------------------------------------------------------------- 1 | source $(brew --repository)/Library/Contributions/brew_bash_completion.sh 2 | 3 | export PATH=/usr/X11/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin 4 | export PATH=$HOME/Library/Python/2.7/bin:$PATH 5 | 6 | # for python 7 | export PYENV_ROOT=/usr/local/opt/pyenv 8 | export PATH=$PYENV_ROOT/bin:$PATH 9 | alias py=pyenv 10 | alias pyv='pyenv versions' 11 | if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi 12 | 13 | # for ruby 14 | export RBENV_ROOT=/usr/local/opt/rbenv 15 | export PATH=$RBENV_ROOT/bin:$PATH 16 | alias rb=rbenv 17 | alias rbv='rbenv versions' 18 | if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi 19 | 20 | # for plenv 21 | export PLENV_ROOT=/usr/local/opt/plenv 22 | export PATH=$PLENV_ROOT/bin:$PATH 23 | alias pl=plenv 24 | alias plv='plenv versions' 25 | if which plenv > /dev/null; then eval "$(plenv init -)"; fi 26 | -------------------------------------------------------------------------------- /ansible/files/symlinked.rb.patch: -------------------------------------------------------------------------------- 1 | diff --git a/rubylib/hbc/artifact/symlinked.rb b/rubylib/hbc/artifact/symlinked.rb 2 | index bcaa1a3..89484c5 100644 3 | --- a/rubylib/hbc/artifact/symlinked.rb 4 | +++ b/rubylib/hbc/artifact/symlinked.rb 5 | @@ -83,13 +83,11 @@ def unlink(artifact_spec) 6 | end 7 | 8 | def install_phase 9 | - # the sort is for predictability between Ruby versions 10 | - @cask.artifacts[self.class.artifact_dsl_key].sort.each { |artifact| link(artifact) } 11 | + @cask.artifacts[self.class.artifact_dsl_key].each { |artifact| link(artifact) } 12 | end 13 | 14 | def uninstall_phase 15 | - # the sort is for predictability between Ruby versions 16 | - @cask.artifacts[self.class.artifact_dsl_key].sort.each { |artifact| unlink(artifact) } 17 | + @cask.artifacts[self.class.artifact_dsl_key].each { |artifact| unlink(artifact) } 18 | end 19 | 20 | def preflight_checks(source, target) 21 | -------------------------------------------------------------------------------- /ansible/host_vars/default: -------------------------------------------------------------------------------- 1 | --- 2 | other_homebrew_packages: [] 3 | other_homebrew_cask_packages: [] 4 | -------------------------------------------------------------------------------- /ansible/host_vars/localhost: -------------------------------------------------------------------------------- 1 | --- 2 | other_homebrew_packages: [] 3 | other_homebrew_cask_packages: 4 | - air-video-server-hd 5 | - limechat 6 | - vagrant 7 | - virtualbox 8 | - vmware-fusion 9 | -------------------------------------------------------------------------------- /ansible/host_vars/remora-air3.local: -------------------------------------------------------------------------------- 1 | --- 2 | other_homebrew_packages: [] 3 | other_homebrew_cask_packages: [] 4 | -------------------------------------------------------------------------------- /ansible/local.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: localhost 3 | gather_facts: true 4 | vars_files: 5 | - vars/main.yml 6 | - vars/secrets.yml 7 | 8 | tasks: 9 | - include: tasks/dotfiles.yml 10 | - include: tasks/secrets.yml 11 | - include: tasks/terminfo.yml 12 | - include: tasks/pip.yml 13 | - include: tasks/homebrew.yml 14 | when: ansible_system == 'Darwin' 15 | - include_tasks: tasks/secrets_office.yml 16 | when: ansible_hostname in secret_office.hostnames 17 | 18 | # vim:se ft=yaml.ansible: 19 | -------------------------------------------------------------------------------- /ansible/local_light.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: localhost 3 | gather_facts: true 4 | vars_files: 5 | - vars/main.yml 6 | - vars/secrets.yml 7 | 8 | tasks: 9 | - include_tasks: tasks/dotfiles.yml 10 | - include_tasks: tasks/aquaskk.yml 11 | when: ansible_facts['os_family'] == 'Darwin' 12 | - include_tasks: tasks/secrets.yml 13 | - include_tasks: tasks/secrets_office.yml 14 | when: ansible_facts['hostname'] in secret_office.hostnames 15 | 16 | # vim:se ft=yaml.ansible: 17 | -------------------------------------------------------------------------------- /ansible/localhost: -------------------------------------------------------------------------------- 1 | 127.0.0.1 2 | 3 | # vim:se ft=ansible_hosts: 4 | -------------------------------------------------------------------------------- /ansible/mac.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: all 3 | gather_facts: true 4 | sudo: false 5 | vars_files: 6 | - vars/main.yml 7 | - vars/secrets.yml 8 | 9 | pre_tasks: 10 | - file: path=~/.bashrc state=touch 11 | changed_when: false 12 | - file: path=~/.bash_profile state=touch 13 | changed_when: false 14 | - file: path=/usr/local owner=root group=admin mode=g+rwx state=directory 15 | sudo: true 16 | - file: path=/opt owner=root group=wheel state=directory 17 | sudo: true 18 | - file: >- 19 | path=/opt/homebrew-cask 20 | owner={{ ansible_user_id }} 21 | group=staff 22 | state=directory 23 | sudo: true 24 | 25 | roles: 26 | - role: homebrew-role 27 | bash_shell: true 28 | - hnakamur.homebrew-packages 29 | - hnakamur.homebrew-cask-packages 30 | 31 | tasks: 32 | - include: tasks/common.yml 33 | - include: tasks/ricty.yml 34 | - include: tasks/post_homebrew.yml 35 | - include: tasks/other_homebrew.yml 36 | - include: tasks/install.yml 37 | - include: tasks/env.yml 38 | - include: tasks/dotfiles.yml 39 | - include: tasks/secrets.yml 40 | 41 | # vim:se ft=yaml.ansible: 42 | -------------------------------------------------------------------------------- /ansible/tasks/common.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - copy: src=bashrc dest=~/.bashrc 3 | changed_when: false 4 | - copy: src=bash_profile dest=~/.bash_profile 5 | changed_when: false 6 | -------------------------------------------------------------------------------- /ansible/tasks/git.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - command: git --exec-path 3 | register: git_path 4 | changed_when: git_path.rc != 0 5 | 6 | - name: copy git-core.patch /tmp 7 | copy: > 8 | src=git-core.patch 9 | dest=/tmp/git-core.patch 10 | changed_when: false 11 | 12 | - name: patch to git-core 13 | patch: > 14 | src=/tmp/git-core.patch 15 | basedir={{ git_path.stdout }} 16 | strip=1 17 | -------------------------------------------------------------------------------- /ansible/tasks/homebrew.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - homebrew: 3 | state: latest 4 | name: 5 | - ansible 6 | - ccze 7 | - cmigemo 8 | - coreutils 9 | - delphinus/ghg/ghg 10 | - diff-so-fancy 11 | - docker 12 | - exa 13 | - gibo 14 | - git 15 | - go 16 | - grc 17 | - htop 18 | - hub 19 | - jq 20 | - macvim 21 | - mycli 22 | - neovim 23 | - peco 24 | - prettyping 25 | - pstree 26 | - sanemat/font/ricty 27 | - shellcheck 28 | - terminal-notifier 29 | - the_platinum_searcher 30 | - tig 31 | - tmux 32 | - tree 33 | - universal-ctags 34 | - watch 35 | - z 36 | -------------------------------------------------------------------------------- /ansible/tasks/install.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - npm: name=jshint global=yes state=latest 3 | - npm: name=coffee global=yes state=latest 4 | - npm: name=coffeelint global=yes state=latest 5 | 6 | - homebrew: name=mobile-shell state=absent 7 | - homebrew: name=mobile-shell-color-fix state=latest install_options=HEAD 8 | -------------------------------------------------------------------------------- /ansible/tasks/pip.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - dnf: 3 | name: gcc, python36-devel, rpm-build 4 | become: true 5 | when: ansible_system == 'Linux' and ansible_distribution == 'CentOS' 6 | - pip: 7 | name: 8 | - iterm2 9 | - neovim-remote 10 | - git+https://github.com/Vimjas/vint 11 | executable: pip3 12 | extra_args: --user 13 | state: latest 14 | 15 | # vim:se ft=yaml.ansible: 16 | -------------------------------------------------------------------------------- /ansible/tasks/post_homebrew.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # htop setting 3 | - file: owner=root group=wheel mode=u+s follow=yes path=/usr/local/bin/htop 4 | sudo: yes 5 | -------------------------------------------------------------------------------- /ansible/tasks/secrets.yml: -------------------------------------------------------------------------------- 1 | - name: make .git_prohibited_words 2 | template: >- 3 | src=git_prohibited_words.j2 dest=~/.git_prohibited_words 4 | - name: make .git/hooks/pre-commit 5 | template: >- 6 | src=git_hooks_pre-commit.j2 dest=~/git/dotfiles/.git/hooks/pre-commit 7 | - file: path=~/git/dotfiles/.git/hooks/pre-commit mode=0755 8 | - name: make .gitconfig_local 9 | template: >- 10 | src=gitconfig_local.j2 dest=~/.gitconfig_local 11 | - name: make config-local.fish 12 | template: >- 13 | src=config-local.fish.j2 dest=~/.config/fish/config-local.fish 14 | # - name: make general .my.cnf 15 | # template: >- 16 | # src=my_cnf.j2 dest=~/.my.cnf 17 | - name: make memo directory 18 | file: path=~/.config/memo state=directory 19 | - name: make config for memo 20 | template: >- 21 | src=config_memo_toml.j2 dest=~/.config/memo/config.toml 22 | - name: make work.inc 23 | template: src=work.inc dest=~/.work.inc 24 | - name: make .pause 25 | template: src=pause.j2 dest=~/.config/.pause 26 | - name: make tm.fish 27 | template: src=tm.fish.j2 dest=~/.config/fish/functions/tm.fish 28 | -------------------------------------------------------------------------------- /ansible/templates/3llo.j2: -------------------------------------------------------------------------------- 1 | export TRELLO_USER='{{ secret_trello.user }}' 2 | export TRELLO_KEY='{{ secret_trello.key }}' 3 | export TRELLO_TOKEN='{{ secret_trello.token }}' 4 | 5 | # vim:se ft=sh: 6 | #{# vim:se ft=sh.jinja: #} 7 | -------------------------------------------------------------------------------- /ansible/templates/aws-config.j2: -------------------------------------------------------------------------------- 1 | {{- lookup('env', 'AWS_CONFIG') | b64decode -}} 2 | {#- se:ft=conf.jinja: #} 3 | -------------------------------------------------------------------------------- /ansible/templates/config-local.fish.j2: -------------------------------------------------------------------------------- 1 | set -x FJ_API_CONFIG {{ lookup('env', 'DEFAULT_API_CONFIG') }} 2 | {# vim: se ft=fish.jinja: #} 3 | -------------------------------------------------------------------------------- /ansible/templates/config_memo_toml.j2: -------------------------------------------------------------------------------- 1 | memodir = "{{ ansible_env.HOME }}/.nb/home" 2 | editor = "nvim" 3 | column = 20 4 | selectcmd = "fzf" 5 | grepcmd = "grep -nH ${PATTERN} ${FILES}" 6 | assetsdir = "." 7 | {# vim:se ft=toml.jinja: #} 8 | # vim:se ft=toml: 9 | -------------------------------------------------------------------------------- /ansible/templates/docker-config.json.j2: -------------------------------------------------------------------------------- 1 | { 2 | "auths": { 3 | "{{ lookup('env', 'OFFICE_DOCKER_AUTH_HOST') }}": {} 4 | }, 5 | "detachKeys": "ctrl-^", 6 | "credsStore": "desktop", 7 | "currentContext": "desktop-linux" 8 | } 9 | -------------------------------------------------------------------------------- /ansible/templates/git_hooks_pre-commit.j2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This prevents pushing prohibited words e.g in-house information to 4 | # github.com by mistake. 5 | # 6 | # Usage: 7 | # 8 | # Add words you do not want to publish to the internet as follow, 9 | # $ echo "secretword" >> ~/.git_prohibited_words 10 | # 11 | if git remote -v | grep -E '^.+\s+(git@github.com:|https?://github.com/).+\(push\)$' >/dev/null; then 12 | if [ -e ~/.git_prohibited_words ]; then 13 | while read -r word; do 14 | # Skip comment or blank lines 15 | echo "$word" | grep ^# > /dev/null && continue 16 | echo "$word" | grep '^\s*$' > /dev/null && continue 17 | 18 | if git diff --cached -U0 | grep -i "$word" > /dev/null; then 19 | echo "Can't commit because of including the prohibited word '$word'" >&2 20 | exit 1 21 | fi 22 | done < ~/.git_prohibited_words 23 | fi 24 | fi 25 | 26 | #{# vim:se ft=sh.jinja: #} 27 | -------------------------------------------------------------------------------- /ansible/templates/git_prohibited_words.j2: -------------------------------------------------------------------------------- 1 | {% set words = lookup('env', 'GIT_PROHIBITED_WORDS').split(',') %} 2 | {% for word in words %} 3 | {{ word }} 4 | {% endfor %} 5 | -------------------------------------------------------------------------------- /ansible/templates/gitconfig_local.j2: -------------------------------------------------------------------------------- 1 | {% set ghe_hosts = lookup('env', 'GITHUB_ENTERPRISE_HOST') -%} 2 | {% if ghe_hosts != '' -%} 3 | {% for item in ghe_hosts.split(',') -%} 4 | [url "git@{{ item }}"] 5 | insteadOf = https://{{ item }}/ 6 | [ghq "ssh://git@{{ item }}"] 7 | vcs = git 8 | [includeIf "gitdir:{{ item }}/"] 9 | path = .work.inc 10 | {% endfor -%} 11 | {% endif %} 12 | {% if ansible_facts['os_family'] == 'Darwin' -%} 13 | [gpg] 14 | format = ssh 15 | [gpg "ssh"] 16 | program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign 17 | [commit] 18 | gpgsign = true 19 | {% endif -%} 20 | 21 | {# vim:se ft=gitconfig.jinja: #} 22 | # vim:se ft=gitconfig: 23 | -------------------------------------------------------------------------------- /ansible/templates/local_perl.py.j2: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # vim:se ft=python fenc=utf8 noet: 3 | 4 | import re 5 | import socket 6 | from powerline.theme import requires_segment_info 7 | 8 | @requires_segment_info 9 | def local_perl(pl, segment_info, format='{app}:{version}'): 10 | if socket.gethostname() not in {{ secret_office.hostnames | pprint }}: 11 | return None 12 | version = segment_info['environ'].get('PERLBREW_PERL') 13 | if version is None or version == {{ secret_default_perl_version | pprint }}: 14 | return None 15 | version = re.sub('perl-', '', version) 16 | app = segment_info['environ'].get('{{ secret_local_perl_app }}') or 'system' 17 | return [{ 18 | 'contents': format.format(version=version, app=app), 19 | 'highlight_groups': ['local_perl', 'user'], 20 | }] 21 | 22 | #{# vim:se ft=python.jinja: #} 23 | -------------------------------------------------------------------------------- /ansible/templates/local_perl.sh.j2: -------------------------------------------------------------------------------- 1 | {{ secret_local_perl_sh }} 2 | -------------------------------------------------------------------------------- /ansible/templates/office-api-config-backend.json.j2: -------------------------------------------------------------------------------- 1 | { 2 | "app_id": "{{ item.app_id }}", 3 | "app_secret": "{{ item.app_secret }}", 4 | "origin": "{{ item.origin }}" 5 | }{# vim:se ft=json.jinja2: #} 6 | -------------------------------------------------------------------------------- /ansible/templates/office-api-config.json.j2: -------------------------------------------------------------------------------- 1 | { 2 | {%- if 'client_id' in item %} 3 | "client_id": "{{ item.client_id }}", 4 | "client_secret": "{{ item.client_secret }}", 5 | "connect_origin": "{{ item.connect_origin }}", 6 | {%- else %} 7 | "user": "{{ item.user }}", 8 | "pass": "{{ item.pass }}", 9 | {%- endif %} 10 | "origin": "{{ item.origin }}", 11 | "schema_dir": "{{ item.schema_dir }}" 12 | }{# vim:se ft=json.jinja2: #} 13 | -------------------------------------------------------------------------------- /ansible/templates/organization_envrc.j2: -------------------------------------------------------------------------------- 1 | {% for env in lookup('env', 'OFFICE_ENV_JSON') | from_json -%} 2 | export {{ env.name }}={{ env.value }} 3 | {% endfor -%} 4 | export PERL5LIB={{ ':'.join(secret_office_perl_perl5lib) }}:$PERL5LIB 5 | export PERL_CPANM_OPT="--mirror-only --mirror {{ lookup('env', 'CPANM_MIRROR') }} --no-lwp $PERL_CPANM_OPT" 6 | export PERL_CARTON_MIRROR={{ lookup('env', 'CPANM_MIRROR') }} 7 | export CIRCLE_API_USER_TOKEN={{ lookup('env', 'OFFICE_CIRCLE_API_USER_TOKEN') }} 8 | use vim 9 | {# vim:se ft=direnv.jinja: #} 10 | -------------------------------------------------------------------------------- /ansible/templates/organization_envrc_go.j2: -------------------------------------------------------------------------------- 1 | # $GOPATH is derived from goenv 2 | PATH_add $GOPATH/bin 3 | # set this to install binaries into goenv bin dir. 4 | export GOBIN=$GOPATH/bin 5 | layout go 6 | use vim 7 | {{ secret_office_dev_envrc.content }} 8 | {# vim:se ft=direnv.jinja: #} 9 | -------------------------------------------------------------------------------- /ansible/templates/organization_vimrc.j2: -------------------------------------------------------------------------------- 1 | {# vim:se ft=vim.jinja: #} 2 | -------------------------------------------------------------------------------- /ansible/templates/organization_vimrc_go.j2: -------------------------------------------------------------------------------- 1 | let b:ale_fix_on_save = 0 2 | if &filetype ==# 'go' 3 | setlocal omnifunc=go#complete#GocodeComplete 4 | endif 5 | {# vim:se ft=vim.jinja: #} 6 | -------------------------------------------------------------------------------- /ansible/templates/pause.j2: -------------------------------------------------------------------------------- 1 | user delphinus 2 | password {{ lookup('env', 'PAUSE_PASSWORD') }} 3 | -------------------------------------------------------------------------------- /ansible/templates/ptignore.j2: -------------------------------------------------------------------------------- 1 | {% set ignores = lookup('env', 'PT_IGNORE').split(',') %} 2 | {% for i in ignores %} 3 | {{ i }} 4 | {% endfor %} 5 | -------------------------------------------------------------------------------- /ansible/templates/ssh_config.j2: -------------------------------------------------------------------------------- 1 | {% for h in secret_ssh.hosts -%} 2 | Host {{ h.name }} 3 | {% if 'host' in h -%} 4 | Hostname {{ h.host }} 5 | User {{ h.user }} 6 | {% endif %} 7 | {% if 'port' in h -%} 8 | Port {{ h.port }} 9 | {% endif -%} 10 | {% if 'socks_port' in h -%} 11 | DynamicForward {{ h.socks_port }} 12 | {% endif -%} 13 | {% if 'vnc_port' in h -%} 14 | LocalForward {{ h.vnc_port }} localhost:5900 15 | {% endif -%} 16 | {% if 'ignore_check' in h -%} 17 | StrictHostKeyChecking no 18 | UserKnownHostsFile /dev/null 19 | {% endif %} 20 | {% if 'identity_agent' in h -%} 21 | IdentityAgent {{ h.identity_agent }} 22 | {% endif %} 23 | 24 | {% endfor -%} 25 | 26 | #Match exec "bash -c '[[ %h = {{ secret_ssh.git }} ]] && pgrep -fl ssh | grep {{ secret_ssh.hosts[0].name }} > /dev/null'" 27 | #ProxyCommand nc -x localhost:{{ secret_ssh.socks_port }} %h %p 28 | 29 | Host * 30 | SendEnv LC_* LANG 31 | ForwardAgent yes 32 | GSSAPIAuthentication yes 33 | GSSAPIDelegateCredentials yes 34 | PubkeyAuthentication yes 35 | ServerAliveCountMax 20 36 | ServerAliveInterval 15 37 | IdentityAgent "{{ lookup('env', 'IDENTITY_AGENT') }}" 38 | 39 | {#- vim:se ft=sshconfig.jinja: #} 40 | -------------------------------------------------------------------------------- /ansible/templates/tm.fish.j2: -------------------------------------------------------------------------------- 1 | function tm --description 'launch tmux with my session' 2 | # attach the existent session and return 3 | tmux attach-session -d; and return 4 | 5 | tmux new-session \; \ 6 | new-window \; \ 7 | new-window \; \ 8 | new-window \; \ 9 | new-window \; \ 10 | send-keys 'while true; prettyping 8.8.8.8; sleep 3; end' C-m \; \ 11 | split-window -v \; \ 12 | resize-pane -y 80% \; \ 13 | send-keys "while true; prettyping $OFFICE_JIRA; sleep 3; end" C-m \; \ 14 | split-window -h \; \ 15 | send-keys "watch -n1 dig +short $OFFICE_JIRA" C-m \; \ 16 | split-window -v \; \ 17 | resize-pane -y 70% \; \ 18 | send-keys bpytop C-m \; \ 19 | select-window -t 1 20 | end 21 | 22 | # vim:se ft=fish.jinja: 23 | -------------------------------------------------------------------------------- /ansible/templates/work.inc: -------------------------------------------------------------------------------- 1 | [user] 2 | name = delphinus 3 | email = {{ lookup('env', 'EMAIL_OFFICE') }} 4 | 5 | # vim:se ft=gitconfig.jinja2: 6 | -------------------------------------------------------------------------------- /bin/ansible-vault-password: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ACCOUNT=dotfiles 3 | SERVICE=ansible 4 | if ! security find-generic-password -a $ACCOUNT -s $SERVICE -w; then 5 | >&2 echo "Register vault password: security add-generic-password -a $ACCOUNT -s $SERVICE -s P@22w0rd" 6 | fi 7 | -------------------------------------------------------------------------------- /bin/assert-vpn-on: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eu 2 | CACHE=$HOME/.cache/vpn-name 3 | # detect the cache file is older than 24 hours 4 | if ! [[ -r $CACHE ]] || test "$(find "$CACHE" -mmin +1440 2> /dev/null)"; then 5 | BIN_DIR=/opt/homebrew/bin 6 | if ! [[ -d $BIN_DIR ]]; then 7 | BIN_DIR=/usr/local/bin 8 | fi 9 | OP=$BIN_DIR/op 10 | JQ=$BIN_DIR/jq 11 | VPN_NAME=$($OP --vault CLI item get --format json secret_envs | $JQ -r '.fields[] | select(.value) | select(.label == "VPN_NAME") | .value') 12 | echo "$VPN_NAME" > "$CACHE" 13 | else 14 | VPN_NAME=$(cat "$CACHE") 15 | fi 16 | 17 | if [[ -z $VPN_NAME ]]; then 18 | echo "VPN_NAME is not set" 2>&1 19 | exit 1 20 | fi 21 | 22 | /usr/bin/osascript << EOF 23 | tell application "System Events" 24 | tell current location of network preferences 25 | set myConnection to the service "$VPN_NAME" 26 | 27 | if myConnection is not null then 28 | if current configuration of myConnection is not connected then 29 | connect myConnection 30 | end if 31 | end if 32 | end tell 33 | end tell 34 | 35 | display notification "VPN reconnecting..." with title "Reconnect VPN" 36 | delay 1 37 | EOF 38 | -------------------------------------------------------------------------------- /bin/battery.tmux: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | HAS_BATTERY_FLAG_FILE=/tmp/__battery_tmux_system_has_battery 3 | HAS_NO_BATTERY_FLAG_FILE=/tmp/__battery_tmux_system_has_no_battery 4 | if [[ -f $HAS_BATTERY_FLAG_FILE ]]; then 5 | echo -n "$(battery -t -e)" ' ' 6 | elif [[ -f $HAS_NO_BATTERY_FLAG_FILE ]]; then 7 | echo -n "" 8 | elif command -v battery > /dev/null 2>&1 && battery --has; then 9 | touch $HAS_BATTERY_FLAG_FILE 10 | echo -n "$(battery -t -e)" ' ' 11 | else 12 | touch $HAS_NO_BATTERY_FLAG_FILE 13 | fi 14 | exit 0 15 | -------------------------------------------------------------------------------- /bin/brew-all-deps: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | brew list | while read cask; do printf "\e[1;34m$cask\e[0;33m"; brew deps $cask | awk '{printf(" %s ", $0)}'; printf "\e[m\n"; done 3 | -------------------------------------------------------------------------------- /bin/brew-directories.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'pathname' 3 | prefix = Pathname `brew --prefix`.chomp 4 | puts(`brew ls --versions`.split("\n").each_with_object([]) do |str, ary| 5 | brew, *versions = str.split /\s+/ 6 | versions.each do |v| 7 | ary << prefix + 'Cellar' + brew + v 8 | end 9 | end.join "\n") 10 | -------------------------------------------------------------------------------- /bin/check-fetchmail.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'syslog' 3 | 4 | PROCESS_SUCCESS = 0 5 | PROCESS_NO_ROOT_USER = 1 6 | PROCESS_FETCHMAIL_RESTART = 2 7 | 8 | unless Process.uid == 0 9 | warn 'execute on ROOT user' 10 | exit PROCESS_NO_ROOT_USER 11 | end 12 | 13 | GREP = '/bin/grep' 14 | PGREP = '/usr/bin/pgrep' 15 | FETCHMAIL = '/usr/bin/fetchmail' 16 | SERVICE = '/sbin/service' 17 | USERS = Dir['/home/*/.fetchmailrc'].map do |rc| 18 | $1 if rc =~ %r[/home/([^/]*)/\.fetchmailrc] 19 | end 20 | 21 | process_exist = USERS.reject do |user| 22 | system "#{PGREP} -fl #{FETCHMAIL} | #{GREP} #{user} | #{GREP} -v grep" 23 | end 24 | 25 | if process_exist.empty? 26 | Syslog.open File.basename($0) do |syslog| 27 | syslog.log Syslog::LOG_INFO, 'process checked for user [ %s ]', USERS.join(', ') 28 | end 29 | exit PROCESS_SUCCESS if process_exist.empty? 30 | end 31 | 32 | system "#{SERVICE} fetchmail restart" 33 | 34 | Syslog.open File.basename($0) do |syslog| 35 | syslog.log Syslog::LOG_WARNING, 'process restart' 36 | end 37 | exit PROCESS_FETCHMAIL_RESTART 38 | -------------------------------------------------------------------------------- /bin/chmod-x.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use 5.12.0; 3 | use common::sense; 4 | use utf8; 5 | use Path::Class; 6 | use Regexp::Assemble; 7 | 8 | my $home = "$ENV{HOME}/git/dotfiles"; 9 | my @exclude_file = qw!perlbrew_env cpu memory!; 10 | my @exclude_ext = qw!pl py pyc pyo sh bat vbs!; 11 | my @exclude_re = ( 12 | qr!$home/bin!, 13 | qr!$home/\.vim/bundle!, 14 | qr!$home/\.git!, 15 | qr!$home/\.pentadactyl/info!, 16 | qr!$home/submodule!, 17 | ); 18 | my $ra = Regexp::Assemble->new; 19 | $ra->add(qr!$_$!) for @exclude_file; 20 | $ra->add(qr!\.$_$!) for @exclude_ext; 21 | $ra->add($_) for @exclude_re; 22 | dir("$ENV{HOME}/git/dotfiles")->recurse(callback => sub { 23 | my $file = shift; 24 | (!-f $file or $file->absolute =~ $ra->re) and return; 25 | my @mode = (split '', sprintf '%o', $file->stat->mode)[-3 .. -1]; 26 | scalar grep { $_ & 1 } @mode or return; 27 | say $file; 28 | system "chmod -x $file"; 29 | }); 30 | -------------------------------------------------------------------------------- /bin/chr.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | binmode STDOUT => ':encoding(utf8)'; 3 | for my $code (0xe000 .. 0xe7ff) { 4 | printf '%04x ', $code unless $code % 16; 5 | print chr($code) . ' '; 6 | print ";\n" if $code % 16 == 15; 7 | } 8 | -------------------------------------------------------------------------------- /bin/cmd_init.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | doskey alias=doskey $* 3 | doskey ls=ls -F --color=auto $* 4 | doskey ll=ls -lF --color=auto $* 5 | doskey la=ls -aF --color=auto $* 6 | doskey l.=ls -dF --color=auto .* $* 7 | -------------------------------------------------------------------------------- /bin/color-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # https://github.com/tmux/tmux/issues/696 3 | awk 'BEGIN{ 4 | s="/\\/\\/\\/\\/\\"; s=s s s s s s s s s s s s s s s s s s s s s s s; 5 | for (colnum = 0; colnum<256; colnum++) { 6 | r = 255-(colnum*255/255); 7 | g = (colnum*510/255); 8 | b = (colnum*255/255); 9 | if (g>255) g = 510-g; 10 | printf "\033[48;2;%d;%d;%dm", r,g,b; 11 | printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b; 12 | printf "%s\033[0m", substr(s,colnum+1,1); 13 | } 14 | printf "\n"; 15 | }' 16 | -------------------------------------------------------------------------------- /bin/colorterm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DEFAULT='#2e3440' 3 | PROD='#2f0005' 4 | DEV='#251900' 5 | OTHER='#001c1a' 6 | if [[ -n $TMUX ]]; then 7 | if [[ $1 = prod ]]; then 8 | tmux select-pane -P "bg=$PROD" 9 | elif [[ $1 = dev ]]; then 10 | tmux select-pane -P "bg=$DEV" 11 | elif [[ $1 = other ]]; then 12 | tmux select-pane -P "bg=$OTHER" 13 | else 14 | tmux select-pane -P "bg=$DEFAULT" 15 | fi; 16 | else 17 | if [[ $1 = prod ]]; then 18 | printf "\e]1337;SetColors=bg=%s\a\e\\" ${PROD:1} 19 | elif [[ $1 = dev ]]; then 20 | printf "\e]1337;SetColors=bg=%s\a\e\\" ${DEV:1} 21 | elif [[ $1 = other ]]; then 22 | printf "\e]1337;SetColors=bg=%s\a\e\\" ${OTHER:1} 23 | else 24 | printf "\e]1337;SetColors=bg=%s\a\e\\" ${DEFAULT:1} 25 | fi 26 | fi 27 | -------------------------------------------------------------------------------- /bin/cron_godo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export GODO_MAIL_USER=delphinus@remora.cx 3 | export GODO_MAIL_RECIPIENTS=delphinus35@me.com 4 | export GODO_MAIL=delphinus@remora.cx 5 | pass="$(cat ~/.godo_gmail_password)" 6 | export GODO_MAIL_PASSWORD="$pass" 7 | 8 | now=$(date +'%F %T') 9 | export GODO_MAIL_SUBJECT="アドレスを更新しました $now" 10 | 11 | "$HOME/.go/bin/godo" renew -z remora.cx -d remora.cx -m 12 | "$HOME/.go/bin/godo" renew -z remora.cx -d remora.cx -m -6 13 | -------------------------------------------------------------------------------- /bin/edit-ansible-vault: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eu 2 | DOTFILE_DIR=$(ghq list -p github.com/delphinus/dotfiles) 3 | if [[ ! -d $DOTFILE_DIR ]]; then 4 | echo "dir not found: $DOTFILE_DIR" >&2 5 | exit 1 6 | fi 7 | SECRETS=$DOTFILE_DIR/ansible/vars/secrets.yml 8 | PASSWORD=$DOTFILE_DIR/bin/ansible-vault-password 9 | 10 | gcloud kms decrypt --location asia-northeast1 --keyring delphinus --key delphinus --ciphertext-file "$SECRETS.gz.encrypted" --plaintext-file "$SECRETS.gz" --account me@delphinus.dev --project delphinus-dev 11 | gunzip -f "$SECRETS.gz" 12 | EDITOR=nvim ansible-vault edit --vault-password-file "$PASSWORD" "$SECRETS" 13 | gzip "$SECRETS" 14 | gcloud kms encrypt --location asia-northeast1 --keyring delphinus --key delphinus --ciphertext-file "$SECRETS.gz.encrypted" --plaintext-file "$SECRETS.gz" --account me@delphinus.dev --project delphinus-dev 15 | -------------------------------------------------------------------------------- /bin/findpm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | for i in $@; do 3 | perl -MClass::Inspector -e"print Class::Inspector->resolved_filename('$i') . qq!\\n!" 4 | done 5 | -------------------------------------------------------------------------------- /bin/fssh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # fssh execution script to set in iTerm2 profile 3 | if [[ ! $PATH =~ /usr/local/bin ]]; then 4 | export PATH=/usr/local/bin:$PATH 5 | fi 6 | exec fssh "$@" 7 | -------------------------------------------------------------------------------- /bin/git-alias: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | git config --list | grep alias | sort | sed -e 's/^alias\.//' | ruby -pe '~/(.*?)=(.*)/;$_="%-5s => %s\n"%[$1,$2]' 3 | -------------------------------------------------------------------------------- /bin/git-blame-pr: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl 2 | 3 | use strict; 4 | use warnings; 5 | 6 | my $git_blame_pid = open(my $fh, "-|", "git", "blame", "--first-parent", @ARGV) 7 | or die "failed to invoke git-blame:$!"; 8 | 9 | my %cached; # commit-id -> substitution string 10 | 11 | while (my $line = <$fh>) { 12 | my ($commit, $src) = split / .*?\) /, $line, 2; 13 | $cached{$commit} = lookup($commit) 14 | unless $cached{$commit}; 15 | print $cached{$commit}, ' ', $src; 16 | } 17 | 18 | while (waitpid($git_blame_pid, 0) != $git_blame_pid) {} 19 | exit $?; 20 | 21 | sub lookup { 22 | my $commit = shift; 23 | my $message = `git show --oneline $commit`; 24 | if ($message =~ /Merge\s+(?:pull\s+request|pr)\s+\#?(\d+)\s/i) { 25 | return sprintf '%-9s', "PR #$1"; 26 | } 27 | return $commit; 28 | } 29 | -------------------------------------------------------------------------------- /bin/git-clean-remote: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use 5.12.0; 3 | use warnings; 4 | use Getopt::Long qw(:config posix_default no_ignore_case gnu_compat); 5 | use List::MoreUtils qw(apply); 6 | 7 | GetOptions( 8 | 'e|exec', \(my $exec), 9 | ); 10 | 11 | my $merged = `git branch -r --merged master` || `git branch -r --merged main`; 12 | my @branches = apply { s{\s*origin/}{}smx; $_ } 13 | grep { ! /(?:master|main|develop)/smx } split /\n/, $merged; 14 | 15 | for my $branch (@branches) { 16 | if ($exec) { 17 | system('git', 'push', '--delete', 'origin', $branch) == 0 or die $!; 18 | } else { 19 | say "git push --delete origin $branch"; 20 | } 21 | } 22 | 23 | if (@branches) { 24 | if ($exec) { 25 | system('git', 'remote', 'prune', 'origin') == 0 or die $!; 26 | } else { 27 | say 'git remote prune origin'; 28 | say ''; 29 | say ' (to run, use --exec option)'; 30 | } 31 | } else { 32 | say ' (no branches to delete)'; 33 | } 34 | -------------------------------------------------------------------------------- /bin/glyphs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use v5.14; 3 | use warnings; 4 | binmode STDOUT => ':utf8'; 5 | 6 | my ($start, $end) = @ARGV; 7 | die 'specify start and end' if !$start || !$end; 8 | $start = hex $start; 9 | $end = hex $end; 10 | 11 | say ' 0 1 2 3 4 5 6 7 8 9 a b c d e f'; 12 | for (my $i = $start, my $need_cr = 1; $i <= $end; $i++) { 13 | my $hex_remain = $i % 16; 14 | if ($need_cr) { 15 | printf '%x', $i - $hex_remain; 16 | print ' ' x $hex_remain; 17 | } 18 | # avoid warnings for non-characters 19 | # such as U+FDD0 .. U+FDEF 20 | (my $chr = chr $i) =~ s/\p{NChar}/\x{FFFD}/; 21 | print " $chr"; 22 | $need_cr = $hex_remain == 15 || $i == $end; 23 | say '' if $need_cr; 24 | } 25 | -------------------------------------------------------------------------------- /bin/google: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eu 2 | usage_and_exit() { 3 | if [[ -n ${1:-} ]] 4 | then 5 | echo "$1" 1>&2 6 | echo 1>&2 7 | fi 8 | cat <&2 9 | Usage: google [-l LANG] 10 | 11 | Open Google Search page in browser with 12 | 13 | example: 14 | # Search 'Foo::Bar' in your favorite browser. 15 | google Foo::Bar 16 | # Search 'perl Foo::Bar' instead. 17 | google -l perl Foo::Bar 18 | EOH 19 | exit 1 20 | } 21 | 22 | lang= 23 | while getopts hl: opt 24 | do 25 | case $opt in 26 | h) 27 | usage_and_exit 28 | ;; 29 | l) 30 | lang=$OPTARG 31 | ;; 32 | esac 33 | done 34 | shift $((OPTIND - 1)) 35 | 36 | keyword=${1:-} 37 | if [[ -z $keyword ]]; 38 | then 39 | usage_and_exit 'set keyword' 2>&1 40 | fi 41 | param=${keyword// /+} 42 | if [[ -n $lang ]] 43 | then 44 | param="${lang// /+}+$param" 45 | fi 46 | open "https://www.google.com/search?q=$param" 47 | -------------------------------------------------------------------------------- /bin/info-server.js: -------------------------------------------------------------------------------- 1 | var ws = new ActiveXObject('WScript.Shell'), 2 | vbHide = 0, 3 | python = 'C:\\Python27\\python.exe', 4 | script = '%HOME%\\git\\dotfiles\\bin\\info-server.py'; 5 | 6 | ws.Run([python, script].join(' '), vbHide, true); 7 | -------------------------------------------------------------------------------- /bin/itunes.scpt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env osascript 2 | # Returns the current playing song in iTunes for OSX 3 | 4 | tell application "System Events" 5 | set itunes_active to the count(every process whose name is "iTunes") 6 | if itunes_active is 0 then 7 | return 8 | end if 9 | end tell 10 | 11 | tell application "iTunes" 12 | set player_state to player state 13 | set track_name to name of current track 14 | set artist_name to artist of current track 15 | set album_name to album of current track 16 | set trim_length to 40 17 | set music_duration to the duration of the current track 18 | set music_elapsed to the player position 19 | return track_name & "{0}" & artist_name & "{0}" & album_name & "{0}" & music_elapsed & "{0}" & music_duration & "{0}" & player_state 20 | end tell 21 | -------------------------------------------------------------------------------- /bin/last-line.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from __future__ import absolute_import 4 | 5 | import math 6 | import os 7 | import re 8 | 9 | filename = '/tmp/last-message-history.log' 10 | 11 | f = open(filename, 'r') 12 | filesize = os.path.getsize(filename) 13 | bufsize = 4 14 | pos = int(math.ceil(float(filesize) / bufsize)) 15 | 16 | buf_tmp = '' 17 | tail = [] 18 | num = 1 19 | while pos: 20 | f.seek(bufsize * pos) 21 | buf = f.read(bufsize) + buf_tmp 22 | matches = re.findall(r'[^\x0D\x0A]*\x0D?\x0A?', buf) 23 | lines = [] 24 | for i in xrange(len(matches)): 25 | if i == 0: 26 | buf_tmp = matches[i] 27 | else: 28 | lines.append(matches[i]) 29 | 30 | if len(lines): 31 | lines.pop() 32 | tail[1:1] = lines 33 | 34 | if len(tail) > num: 35 | break 36 | else: 37 | pos -= 1 38 | 39 | if len(tail) > num: 40 | tail = tail[-num:] 41 | -------------------------------------------------------------------------------- /bin/macos-askpass: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env osascript -l JavaScript 2 | var app = Application.currentApplication() 3 | app.includeStandardAdditions = true 4 | app.displayDialog("Enter password:", { 5 | hiddenAnswer: true, 6 | defaultAnswer: "" 7 | }).textReturned 8 | -------------------------------------------------------------------------------- /bin/make-repository.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ssh git@orcinus.remora.cx "cd delphinus && mkdir $1 && cd $1 && git init --bare" 3 | -------------------------------------------------------------------------------- /bin/make_api_config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use 5.30.0; 3 | use warnings; 4 | use JSON::PP; 5 | use Path::Tiny; 6 | 7 | my $json = JSON::PP->new->pretty(1)->canonical; 8 | my $config = `op item get api_config --format json`; 9 | my $value = $json->decode($config)->{fields}[0]{value}; 10 | my $settings = $json->decode($value); 11 | for my $setting (@$settings) { 12 | my $filename = delete $setting->{filename}; 13 | my $output = $json->encode($setting); 14 | my $file = path($filename); 15 | if (-f $file) { 16 | my $content = $file->slurp; 17 | if ($content eq $output) { 18 | say "already exists $file"; 19 | next; 20 | } 21 | } 22 | mkdir $file->parent unless -d $file->parent; 23 | $file->openw->print($json->encode($setting)); 24 | say "created $file"; 25 | } 26 | -------------------------------------------------------------------------------- /bin/manbash: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | man bash | less +"/^ $1 " 3 | -------------------------------------------------------------------------------- /bin/md_to_qiita: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -0777 -pl 2 | # remove Obsidian header 3 | s/^---$ .*? ^---$//msx; 4 | # remove the title 5 | s/^#.*$//m; 6 | # convert quotes from Qiita style to GFM one 7 | s[ 8 | ^\s*>\s\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]$ 9 | \n 10 | ((?:^[\ \t]*>[\ \t]*.*$ \n)+) 11 | ][ 12 | ($head, $content) = ($1, $2); 13 | $result = ":::note " . +{ 14 | NOTE => 'info', 15 | TIP => 'info', 16 | IMPORTANT => 'warn', 17 | WARNING => 'warn', 18 | CAUTION => 'alert', 19 | }->{$head} . "\n"; 20 | while ($content =~ /[ \t]*>[ \t]*(.*)/g) { 21 | $result .= "\n$1"; 22 | } 23 | "\n$result\n\n:::\n"; 24 | ]egmx; 25 | # remove blank lines 26 | s/\A(?:^$ \n)+//mx; 27 | s/(?:^$ \n)+\z//mx; 28 | -------------------------------------------------------------------------------- /bin/minivim: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [[ -n $TMUX ]]; then 3 | exec tmux popup -w 80% -h 80% -b rounded -T minivim -e MINIMAL=1 -E -- nvim '+se nonu nornu laststatus=2' +startinsert "$@" 4 | else 5 | exec env MINIMAL=1 nvim '+se nonu nornu laststatus=2' +startinsert "$@" 6 | fi 7 | -------------------------------------------------------------------------------- /bin/mtime2ctime: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use 5.30.0; 3 | use warnings; 4 | use feature 'signatures'; 5 | no warnings 'experimental::signatures'; 6 | use Path::Tiny; 7 | use Time::Piece; 8 | 9 | sub readable($epoch) { 10 | localtime($epoch)->strftime('%D %T'); 11 | } 12 | 13 | my $execute = (shift // '') eq '-e'; 14 | for my $file (path('./')->children) { 15 | local $, = ': '; 16 | say $file->basename, 'mtime', readable($file->stat->mtime); 17 | my @cmd = ('SetFile', '-d', readable($file->stat->mtime), $file); 18 | if ($execute) { 19 | local $" = ' '; 20 | 0 == system @cmd or die "failed: @cmd: $!"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /bin/nocolor: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl -p 2 | s/[[:cntrl:]]\[(?:\d+;)*\d+m//g 3 | -------------------------------------------------------------------------------- /bin/norm_re: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use Encode; 3 | use Unicode::Normalize; 4 | binmode STDOUT => ":utf8"; 5 | for (shift @ARGV) { 6 | $_ = decode_utf8 $_; 7 | print NFC($_) . "|" . NFD($_); 8 | } 9 | -------------------------------------------------------------------------------- /bin/nview: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | exec env MINIMAL=1 nvim -R +'set nolist nonu nornu buftype=nofile cc=' +BaleiaColorizeStartup "$@" 3 | -------------------------------------------------------------------------------- /bin/path: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use 5.12.0; 3 | use warnings; 4 | my @paths = map { s|^$ENV{HOME}|~|; $_ } split /:/, shift // $ENV{PATH}; 5 | @paths = sort @paths if defined $ARGV[0] && $ARGV[0] eq '-s'; 6 | say join "\n", @paths; 7 | -------------------------------------------------------------------------------- /bin/pbclip: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eu 2 | base64 | xargs echo -n | xargs -0 printf "\033]52;0;%s\033\\" 3 | -------------------------------------------------------------------------------- /bin/pbcopy.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | use strict; 3 | use warnings; 4 | use MIME::Base64; 5 | use Encode; 6 | use constant TMUXLEN => 250; 7 | use constant SCREENLEN => 510; 8 | 9 | my $input = do { 10 | local $/; 11 | ; 12 | }; 13 | $input =~ s/ \n+ \z//xsm; 14 | $input =~ s/\n/\r\n/g; 15 | $input = encode_base64( $input, q{} ); 16 | 17 | if( $ENV{TMUX}) { 18 | print "\ePtmux;\e\e]52;;\e\\"; 19 | # 分割して送信 20 | for(my $i = 0, my $len = length($input); TMUXLEN * $i < $len; $i++) { 21 | my $str = substr($input, TMUXLEN * $i, TMUXLEN); 22 | print "\ePtmux;$str\e\\"; 23 | } 24 | print "\ePtmux;\e\e\\\\\e\\"; 25 | } elsif( $ENV{TERM} eq 'screen' ) { 26 | print "\eP\e]52;;\e\\"; 27 | for(my $i = 0, my $len = length($input); SCREENLEN * $i < $len; $i++) { 28 | my $str = substr($input, SCREENLEN * $i, SCREENLEN); 29 | print "\eP$str\e\\"; 30 | } 31 | print "\eP\x07\e\\"; 32 | } else { 33 | print "\e]52;;$input\e\\"; 34 | } 35 | 36 | # vim:se et: 37 | -------------------------------------------------------------------------------- /bin/perlbrew.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | source $HOME/perl5/perlbrew/etc/bashrc 3 | -------------------------------------------------------------------------------- /bin/pevo: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exec rg -n "$@" . | peco --exec 'awk -F : '"'"'{print "+" $2 " " $1}'"'"' 2>&1 | xargs sh -c '"'"'view "$@" < /dev/tty'"'"' view' 3 | -------------------------------------------------------------------------------- /bin/play-ansbile: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eux 2 | cd ~/git/dotfiles/ansible 3 | sops -d vars/encrypted.secrets.yml > vars/secrets.yml 4 | ansible-playbook -c local ~/git/dotfiles/ansible/local_light.yml 5 | rm vars/secrets.yml 6 | -------------------------------------------------------------------------------- /bin/private-use-area-table.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | open('/tmp/test.txt', 'w') do |f| 3 | (0x1f300 .. 0x1f7ff).each do |code| 4 | if code % 0x100 == 0 5 | f.puts '' 6 | f.print ' ' 7 | (0 .. 15).each do |head| 8 | f.print ' %x ' % head 9 | end 10 | f.puts ';' 11 | end 12 | 13 | chr = code.chr Encoding::UTF_8 14 | case code % 16 15 | when 0 16 | f.print '0x%05x %s ' % [code, chr] 17 | when 15 18 | f.puts "#{chr} ;" 19 | else 20 | f.print "#{chr} " 21 | end 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /bin/reverse-ssh-tunnel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # http://qiita.com/syoyo/items/d31e9db6851dfee3ef82 3 | SSH_AUTH_SOCK=$("$HOME/.ghg/bin/gosshauth" list -f '{{.Path}}' | head -1) 4 | export SSH_AUTH_SOCK 5 | COMMAND='/usr/local/bin/autossh -M 50000 -N -f -R 20023:localhost:22 git@remora.cx' 6 | /usr/bin/pgrep -f -x "$COMMAND" > /dev/null 2>&1 || $COMMAND 7 | -------------------------------------------------------------------------------- /bin/set_env_for_fssh.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | tmux_fssh_port = `tmux showenv LC_FSSH_PORT 2> /dev/null` =~ /(?<==).*/ && $& 3 | unless tmux_fssh_port == ENV['LC_FSSH_PORT'] 4 | `env | grep LC_FSSH_`.scan /^([^=]+)=(.*)$/ do |name, value| 5 | system %Q[tmux setenv "#{name}" "#{value}"] 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /bin/set_ssh_auth_sock.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | if ! ENV['SSH_AUTH_SOCK'].is_a?(String) || ENV['SSH_AUTH_SOCK'].empty? 3 | warn "invalid \$SSH_AUTH_SOCK: '#{ENV['SSH_AUTH_SOCK']}'" 4 | exit false 5 | end 6 | 7 | ssh_auth_sock_path = "#{ENV['HOME']}/.ssh/auth_sock" 8 | 9 | def available_as_sock?(file_path) 10 | test(?S, file_path) && test(?r, file_path) 11 | end 12 | 13 | if ENV['SSH_AUTH_SOCK'] == ssh_auth_sock_path 14 | if available_as_sock? ssh_auth_sock_path 15 | warn "'#{ssh_auth_sock_path}' is sock" 16 | exit true 17 | end 18 | sock_file = Dir.glob('/tmp/ssh*/*')[0] 19 | else 20 | sock_file = ENV['SSH_AUTH_SOCK'] 21 | end 22 | 23 | if available_as_sock? sock_file 24 | File.delete ssh_auth_sock_path if test ?l, ssh_auth_sock_path 25 | File.symlink sock_file, ssh_auth_sock_path 26 | warn "set symlink #{sock_file} => #{ssh_auth_sock_path}" 27 | else 28 | warn "'#{sock_file}' is not sock" 29 | end 30 | -------------------------------------------------------------------------------- /bin/simple-pstree: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use 5.14.0; 3 | use warnings; 4 | use File::Basename; 5 | use File::Which; 6 | 7 | my $target = shift; 8 | die 'set a PID for print' if !$target || $target =~ /\D/; 9 | 10 | my $pstree = which 'pstree' or die '`pstree` not found'; 11 | 12 | open my $out, "$pstree -g3 -p $target |" or die 'cannot open pstree'; 13 | while ($_ = <$out>) { 14 | my ($tree, $pid, $user, $commands) = /^(\D+)(\d+) (\S+) (.*)/; 15 | next unless defined $commands; 16 | my ($cmd1, $cmd2) = $commands =~ /^(\S+)(?: (\S+))?/; 17 | next if !defined $cmd1 || 18 | $cmd1 eq '(bash)' || 19 | $cmd1 eq '(fish)' || 20 | $cmd1 eq '(tmux)' || 21 | $cmd1 eq '(git)'; 22 | $cmd1 = basename $cmd1; 23 | $cmd2 = $cmd2 ? basename $cmd2 : ''; 24 | say join " ", $tree, $pid, $cmd1, $cmd2; 25 | } 26 | close $out; 27 | -------------------------------------------------------------------------------- /bin/tab-space-pre-commit.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'optparse' 3 | params = ARGV.getopts 'r:e:' 4 | re_to_check = if params['e'] 5 | Regexp.new '\.(?:' + params['e'].split(/\s*,\s*/).join('|') + ')\z' 6 | elsif params['r'] 7 | Regexp.new params['r'] 8 | else 9 | %r[\.(?:rb|pl|html|js|css|yml|yaml|txt|md)\z] 10 | end 11 | 12 | error_filenames = `git diff --cached --name-only`.split("\n").select do |path| 13 | next unless File.file?(path) && path =~ re_to_check 14 | whole_script = IO.read(path) 15 | true if whole_script =~ /^ *\t/ && whole_script =~ /^\t* / 16 | end 17 | 18 | if error_filenames.count > 0 19 | warn "\033[31mfiles below has mixed indents.\033[0m" 20 | error_filenames.each { |n| warn "\033[31m - #{n}\033[0m" } 21 | exit 1 22 | else 23 | exit 0 24 | end 25 | -------------------------------------------------------------------------------- /bin/tmux-run: -------------------------------------------------------------------------------- 1 | #!/bin/bash -eu 2 | BIN_DIR=/opt/homebrew/bin 3 | if ! [[ -d $BIN_DIR ]]; then 4 | BIN_DIR=/usr/local/bin 5 | fi 6 | OP=$BIN_DIR/op 7 | TMUX=$BIN_DIR/tmux 8 | FISH=$BIN_DIR/fish 9 | export SHELL=$BIN_DIR/fish 10 | 11 | if [[ -x $TMUX ]]; then 12 | $TMUX a -d || $OP run --env-file "$HOME/.1password-env" -- $TMUX 13 | else 14 | exec $FISH -l 15 | fi 16 | -------------------------------------------------------------------------------- /bin/tmux-vpn: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use 5.30.0; 3 | use warnings; 4 | use feature 'signatures'; 5 | no warnings "experimental::signatures"; 6 | binmode STDOUT => ':encoding(UTF-8)'; 7 | 8 | my $vpn_on = chr 0xf05a9; # 󰖩 9 | my $vpn_off = chr 0xf05aa; # 󰖪 10 | my $home = chr 0xf02dc; # 󰋜 11 | my $office = chr 0xf0f7; #  12 | 13 | my $normal_host = '8.8.8.8'; 14 | my $vpn_host = $ENV{OFFICE_JIRA}; 15 | printf '#[bg=brightblack]%s%s %s', pinger($home, $normal_host), pinger($office, $vpn_host), vpn(); 16 | 17 | sub pinger ($icon, $host) { 18 | my ($latency) = `/sbin/ping -c1 -t1 $host` =~ /time=(\d+\.\d+)/; 19 | return '#[fg=red] ---' if !defined $latency; 20 | $latency += 0; 21 | my $color = $latency < 10 ? 'green' : 22 | $latency < 50 ? 'yellow' : 23 | 'magenta'; 24 | return sprintf '#[fg=%s] %s %.2f ms', $color, $icon, $latency; 25 | } 26 | 27 | sub vpn { 28 | my $is_on = `/sbin/ifconfig` =~ 'ppp0'; 29 | return $is_on ? "#[fg=black,bg=green,bold] $vpn_on VPN ON " : "#[fg=red,bg=black] $vpn_off VPN OFF "; 30 | } 31 | 32 | # vim:se ft=perl.jinja: 33 | -------------------------------------------------------------------------------- /bin/tmux-vpn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if ifconfig | grep ppp0 > /dev/null; then 3 | echo -n '#[fg=black,bg=green,bold] 󰖩 VPN ON ' 4 | else 5 | echo -n '#[fg=red,bg=black] 󰖪 VPN OFF ' 6 | fi 7 | -------------------------------------------------------------------------------- /bin/tmux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if [[ -n $TMUX ]]; then 3 | exec tmux "$@" 4 | fi 5 | 6 | tmux_cmd="tmux -u2" 7 | if tmux has-session 2> /dev/null; then 8 | "$HOME/git/dotfiles/bin/set_env_for_fssh.rb" 9 | $tmux_cmd "$@" attach 10 | else 11 | $tmux_cmd "$@" 12 | fi 13 | -------------------------------------------------------------------------------- /bin/ttc2otf: -------------------------------------------------------------------------------- 1 | #!/usr/local/opt/python@3.8/bin/python3 2 | 3 | import sys 4 | import fontforge 5 | 6 | 7 | def main(file): 8 | for font in fontforge.fontsInFile(file): 9 | f = fontforge.open(u"%s(%s)" % (file, font)) 10 | f.generate("%s.otf" % font) 11 | 12 | 13 | if __name__ == "__main__": 14 | if len(sys.argv) != 2: 15 | sys.exit("one ttc file one time.") 16 | main(sys.argv[1]) 17 | -------------------------------------------------------------------------------- /bin/update-gitignore/gibo.ts: -------------------------------------------------------------------------------- 1 | import { exec, spawn } from "child_process" 2 | import { promisify } from "util" 3 | 4 | const execAsync = promisify(exec) 5 | const spawnAsync = promisify(spawn) 6 | 7 | export class Gibo { 8 | static async create(exeName = "gibo") { 9 | try { 10 | const { stdout } = await execAsync(`which ${exeName}`) 11 | return new Gibo(stdout.trim()) 12 | } catch (e) { 13 | throw new Error("executable: `gibo` not found") 14 | } 15 | } 16 | 17 | private constructor(public exe: string) {} 18 | 19 | async update() { 20 | await spawnAsync(this.exe, ["update"], { stdio: "inherit" }) 21 | } 22 | 23 | async dump(name: string) { 24 | // `gibo dump` always return exit code: 0. If it has stderr, it 25 | // has failed. 26 | const { stdout, stderr } = await execAsync(`${this.exe} dump ${name}`) 27 | if (stderr.length) { 28 | throw new Error(`failed to dump: ${name}`) 29 | } 30 | return stdout 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /bin/update-gitignore/latest.test.ts: -------------------------------------------------------------------------------- 1 | import { Latest } from "./latest" 2 | 3 | describe("Latest", () => 4 | describe("read", () => 5 | it("reads successfully from dump", async () => { 6 | const dumper = { 7 | async dump(name: string) { 8 | return `${name}: hoge` 9 | }, 10 | } 11 | const languages = [ 12 | { name: "Python", setting: "hogefugao" }, 13 | { setting: "fugahogeo" }, 14 | { name: "Go", setting: "fugehogao" }, 15 | ] 16 | const latest = new Latest("/dev/null", dumper) 17 | await expect(latest.read(languages)).resolves.not.toThrow() 18 | expect(latest.settings).toEqual([ 19 | "Python: hoge", 20 | "fugahogeo", 21 | "Go: hoge", 22 | ]) 23 | }))) 24 | -------------------------------------------------------------------------------- /bin/update-gitignore/temp-file.ts: -------------------------------------------------------------------------------- 1 | import { tmpdir } from "os" 2 | import { basename, join } from "path" 3 | 4 | export const tempFile = () => 5 | join( 6 | tmpdir(), 7 | `${basename(__filename)}-${Math.floor(Math.random() * 100000000)}`, 8 | ) 9 | -------------------------------------------------------------------------------- /bin/watch-timemachine: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use 5.30.0; 3 | use warnings; 4 | use JSON; 5 | use Path::Tiny; 6 | 7 | my $tmutil = '/usr/bin/tmutil'; 8 | my $threshold_minutes = 5; 9 | 10 | my $cache_file = path('~/.cache/watch-timemachine.json'); 11 | my $cache = decode_json($cache_file->touch->slurp || '{}'); 12 | my $count = $cache->{count} // 0; # FindingBackupVol が連続している分数 13 | my $status = `$tmutil status`; 14 | die 'tmutil status failed' if $? != 0; 15 | my ($backup_phase) = $status =~ /BackupPhase = (\S+);/; 16 | if (!defined $backup_phase || $backup_phase eq 'ThinningPostBackup') { 17 | exit 0; 18 | } elsif ($backup_phase eq 'FindingBackupVol') { 19 | if (++$count >= $threshold_minutes) { 20 | 0 == system $tmutil, 'stopbackup' or die 'failed to stopbackup'; 21 | sleep 5; 22 | 0 == system $tmutil, 'startbackup', '-a' or die 'failed to startbackup'; 23 | $count = 0; 24 | } 25 | } else { 26 | $count = 0; 27 | } 28 | $cache_file->spew(encode_json +{ count => $count }); 29 | -------------------------------------------------------------------------------- /bin/xterm_colour_chart: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | DIR=$(cd $(dirname $0);pwd) 3 | cd $DIR/.. 4 | /usr/bin/python3 submodules/xterm_colour_chart/xterm_colour_chart.py $@ 5 | -------------------------------------------------------------------------------- /commit-template.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | # # Semantic Commit Messages 4 | # 5 | # See how a minor change to your commit message style can make you a better programmer. 6 | # 7 | # Format: `(): ` 8 | # 9 | # `` is optional 10 | # 11 | # ## Example 12 | # 13 | # ``` 14 | # feat: add hat wobble 15 | # ^--^ ^------------^ 16 | # | | 17 | # | +-> Summary in present tense. 18 | # | 19 | # +-------> Type: chore, docs, feat, fix, refactor, style, or test. 20 | # ``` 21 | # 22 | # More Examples: 23 | # 24 | # - `feat`: (new feature for the user, not a new feature for build script) 25 | # - `fix`: (bug fix for the user, not a fix to a build script) 26 | # - `docs`: (changes to the documentation) 27 | # - `style`: (formatting, missing semi colons, etc; no production code change) 28 | # - `refactor`: (refactoring production code, eg. renaming a variable) 29 | # - `test`: (adding missing tests, refactoring tests; no production code change) 30 | # - `chore`: (updating grunt tasks etc; no production code change) 31 | # 32 | # References: 33 | # 34 | # - https://www.conventionalcommits.org/ 35 | # - https://seesparkbox.com/foundry/semantic_commit_messages 36 | # - http://karma-runner.github.io/1.0/dev/git-commit-msg.html 37 | -------------------------------------------------------------------------------- /cpanfile: -------------------------------------------------------------------------------- 1 | requires 'Test::MockTime'; 2 | requires 'Test2::V0'; 3 | -------------------------------------------------------------------------------- /iterm2/load_average.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | from os import getloadavg 4 | from iterm2 import Connection, StatusBarComponent, StatusBarRPC, run_forever 5 | from iterm2.statusbar import Knob 6 | from typing import List 7 | 8 | 9 | async def main(connection: Connection) -> None: 10 | component: StatusBarComponent = StatusBarComponent( 11 | "Load Average", 12 | "Show load average", 13 | [], 14 | "0.01 0.12 1.23", 15 | 30, 16 | "dev.delphinus.load_average", 17 | ) 18 | 19 | @StatusBarRPC 20 | async def load_average(knobs: List[Knob]) -> str: 21 | return " ".join(f"{x:.2f}" for x in getloadavg()) 22 | 23 | await component.async_register(connection, load_average, timeout=None) 24 | 25 | 26 | if __name__ == "__main__": 27 | run_forever(main) 28 | -------------------------------------------------------------------------------- /iterm2/mousemode.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | import iterm2 3 | 4 | 5 | async def main(connection): 6 | component = iterm2.StatusBarComponent( 7 | short_description="Mouse Mode", 8 | detailed_description="Indicates if mouse reporting is enabled", 9 | knobs=[], 10 | exemplar="[mouse on]", 11 | update_cadence=None, 12 | identifier="com.iterm2.example.mouse-mode", 13 | ) 14 | 15 | # This function gets called whenever any of the paths named in defaults (below) changes 16 | # or its configuration changes. This will be called when mouseReportingMode changes. 17 | @iterm2.StatusBarRPC 18 | async def coro(knobs, reporting=iterm2.Reference("mouseReportingMode")): 19 | if reporting < 0: 20 | return " " 21 | else: 22 | return "ソ" 23 | 24 | # Register the component. 25 | await component.async_register(connection, coro) 26 | 27 | 28 | iterm2.run_forever(main) -------------------------------------------------------------------------------- /keyhac/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/delphinus/dotfiles/d01324d1ceb9bb45f6ea53b918f11acdf50019c4/keyhac/README -------------------------------------------------------------------------------- /keyhac/config.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | # 設定開始 3 | import sys 4 | import os 5 | sys.path.append(os.environ.get('HOME') + '/git/dotfiles/keyhac') 6 | import MyConfig 7 | 8 | def configure(km): 9 | MyConfig.MyConfig(km) 10 | 11 | # vim:se et ts=4 sts=4 sw=4 fdm=marker: 12 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "defaultSeverity": "warning", 3 | "extends": [ 4 | "tslint:latest", 5 | "tslint-plugin-prettier", 6 | "tslint-config-prettier" 7 | ], 8 | "rules": { 9 | "array-type": [true, "array"], 10 | "arrow-parens": false, 11 | "cyclomatic-complexity": [true, 10], 12 | "interface-name": [true, "never-prefix"], 13 | "member-access": [true, "no-public"], 14 | "no-console": false, 15 | "no-implicit-dependencies": [true, ["tslint", "typescript"]], 16 | "no-submodule-imports": false, 17 | "prettier": [ 18 | true, 19 | { 20 | "semi": false, 21 | "singleQuote": false, 22 | "tabWidth": 4, 23 | "trailingComma": "all" 24 | } 25 | ] 26 | }, 27 | "linterOptions": { 28 | "exclude": ["**/*.d.ts", "**/*.d.ts.map"] 29 | } 30 | } 31 | --------------------------------------------------------------------------------