From 514a0ebec8d980c96c061f664df10fc3adee152e Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sat, 14 Sep 2024 09:09:43 +0900 Subject: [PATCH 01/28] feat:first commit From dfd629afe01ca0ab558f8ad1bc8249020da2ff2f Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sat, 14 Sep 2024 11:04:50 +0900 Subject: [PATCH 02/28] iterm: lower transparency --- config/iterm2/com.googlecode.iterm2.plist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/iterm2/com.googlecode.iterm2.plist b/config/iterm2/com.googlecode.iterm2.plist index a7346ff..cbcd36e 100644 --- a/config/iterm2/com.googlecode.iterm2.plist +++ b/config/iterm2/com.googlecode.iterm2.plist @@ -543,7 +543,7 @@ Name Default Non Ascii Font - Monaco 12 + MesloLGS-NF-Regular 12 Non-ASCII Anti Aliased Normal Font @@ -1231,7 +1231,7 @@ Terminal Type xterm-256color Transparency - 0.49702460106382984 + 0.1535405585106383 Unlimited Scrollback Use Bold Font From 91755b1b701678889a3e199a7057b4442472b9a7 Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sat, 14 Sep 2024 11:48:30 +0900 Subject: [PATCH 03/28] editorconfig: add .editorconfig file --- config/editorconfig/.editorconfig | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 config/editorconfig/.editorconfig diff --git a/config/editorconfig/.editorconfig b/config/editorconfig/.editorconfig new file mode 100644 index 0000000..fab77b4 --- /dev/null +++ b/config/editorconfig/.editorconfig @@ -0,0 +1,57 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = false + +[*.html] +indent_style = space +indent_size = 2 + +[*.{css,scss}] +indent_style = space +indent_size = 2 + +[*.json] +indent_style = space +indent_size = 2 + +[*.{yml,yaml}] +indent_style = space +indent_size = 2 + +# 4 space indentation +[*.py] +indent_style = space +indent_size = 4 + +[*.{js,ts}] +indent_style = space +indent_size = 2 + +# Tab indentation (no size specified) +[Makefile] +indent_style = tab + +[{*.sh,*.bash,*.zsh,.zsh*,.bash*}] +indent_style = space +indent_size = 4 + +# The indent size used in the `package.json` file cannot be changed +# https://github.com/npm/npm/pull/3180#issuecomment-16336516 +[{.travis.yml,npm-shrinkwrap.json,package.json}] +indent_style = space +indent_size = 4 \ No newline at end of file From 41326976bfb3427948973174e63ca51f4da77ac8 Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sat, 14 Sep 2024 12:22:41 +0900 Subject: [PATCH 04/28] iterm: update config --- config/iterm2/com.googlecode.iterm2.plist | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config/iterm2/com.googlecode.iterm2.plist b/config/iterm2/com.googlecode.iterm2.plist index cbcd36e..5146571 100644 --- a/config/iterm2/com.googlecode.iterm2.plist +++ b/config/iterm2/com.googlecode.iterm2.plist @@ -869,6 +869,8 @@ Idle Code 0 + Initial Text + Initial Use Transparency Jobs to Ignore @@ -1173,7 +1175,7 @@ Left Option Key Changeable - + Mouse Reporting Name @@ -1185,9 +1187,9 @@ Normal Font MesloLGS-NF-Regular 15 Only The Default BG Color Uses Transparency - + Option Key Sends - 2 + 0 Prompt Before Closing 2 Right Option Key Sends From 61814957282413280cd05afa4b254e1675eaf4be Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Tue, 17 Sep 2024 02:19:54 +0900 Subject: [PATCH 05/28] minor: update gitignore --- .gitignore | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7e7ab65..32bd97c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,13 @@ snippets/ backup/ request/ var -zsh_plugin/ config/iterm2/AppSupport -.zcomp* + +### Local settings ### +*.local +local.* +!local.*.sample + +### Zsh cache ### *.zwc +.zcomp* \ No newline at end of file From d288755c217e15b672df391325d160c1b00a7b9a Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Tue, 17 Sep 2024 04:41:40 +0900 Subject: [PATCH 06/28] poetry: remove poetry. Instead set en each venv --- config/pypoetry/config.toml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 config/pypoetry/config.toml diff --git a/config/pypoetry/config.toml b/config/pypoetry/config.toml deleted file mode 100644 index cc8c512..0000000 --- a/config/pypoetry/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[repositories.testpypi] -url = "https://test.pypi.org/legacy/" From 2b2c6faa03ce538ef448136acb7b5482ba7fa294 Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Tue, 17 Sep 2024 04:42:59 +0900 Subject: [PATCH 07/28] build: add build script for sheldon --- scripts/setup-sheldon.bash | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scripts/setup-sheldon.bash diff --git a/scripts/setup-sheldon.bash b/scripts/setup-sheldon.bash new file mode 100644 index 0000000..b9004a0 --- /dev/null +++ b/scripts/setup-sheldon.bash @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -x +# shellcheck source=./scripts/common.bash +source "$(dirname "$0")/common.bash" + +if [ -d "$XDG_DATA_HOME/sheldon/bin" ]; then + echo "sheldon is already installed." +else + echo "Installing sheldon..." + curl --proto '=https' -fLsS https://rossmacarthur.github.io/install/crate.sh \ + | bash -s -- --repo rossmacarthur/sheldon --to "$XDG_DATA_HOME/bin" + ln -s "$XDG_DATA_HOME/sheldon/bin/sheldon" "$HOME/.local/bin/sheldon" +fi From 858408c0519ace58c9900e204cd8c6eaf1c0b1ed Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Tue, 17 Sep 2024 08:28:29 +0900 Subject: [PATCH 08/28] zsh: install sheldon --- config/zsh/.p10k.zsh | 307 +++++++++++++++++++++++----------------- config/zsh/.zshenv | 5 +- config/zsh/.zshrc | 103 ++++++-------- config/zsh/.zshrc.lazy | 98 ------------- config/zsh/conda.zsh | 14 ++ config/zsh/lazy.zsh | 54 +++++++ config/zsh/plugins.toml | 77 ++++++++++ 7 files changed, 372 insertions(+), 286 deletions(-) delete mode 100644 config/zsh/.zshrc.lazy create mode 100644 config/zsh/conda.zsh create mode 100644 config/zsh/lazy.zsh create mode 100644 config/zsh/plugins.toml diff --git a/config/zsh/.p10k.zsh b/config/zsh/.p10k.zsh index b0eb101..2958fbe 100644 --- a/config/zsh/.p10k.zsh +++ b/config/zsh/.p10k.zsh @@ -1,11 +1,10 @@ -# Generated by Powerlevel10k configuration wizard on 2023-03-21 at 04:33 JST. -# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 53731. -# Wizard options: nerdfont-complete + powerline, small icons, classic, unicode, darkest, -# angled separators, sharp heads, flat tails, 2 lines, disconnected, no frame, compact, -# many icons, concise, instant_prompt=verbose. +# Generated by Powerlevel10k configuration wizard on 2024-09-17 at 06:11 JST. +# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 4242. +# Wizard options: nerdfont-complete + powerline, small icons, unicode, lean, 2 lines, +# disconnected, no frame, compact, many icons, concise, instant_prompt=verbose. # Type `p10k configure` to generate another config. # -# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate +# Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate # your own config based on it. # # Tip: Looking for a nice color? Here's a one-liner to print colormap. @@ -33,10 +32,10 @@ typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=( # =========================[ Line #1 ]========================= os_icon # os identifier + dir # current directory virtualenv # python virtual environment (https://docs.python.org/3/library/venv.html) anaconda # conda environment (https://conda.io/) pyenv # python environment (https://github.com/pyenv/pyenv) - dir # current directory vcs # git status # =========================[ Line #2 ]========================= newline # \n @@ -88,13 +87,14 @@ context # user@hostname nordvpn # nordvpn connection status, linux only (https://nordvpn.com/) ranger # ranger shell (https://github.com/ranger/ranger) + yazi # yazi shell (https://github.com/sxyazi/yazi) nnn # nnn shell (https://github.com/jarun/nnn) lf # lf shell (https://github.com/gokcehan/lf) xplr # xplr shell (https://github.com/sayanarijit/xplr) vim_shell # vim shell indicator (:sh) midnight_commander # midnight commander shell (https://midnight-commander.org/) nix_shell # nix shell (https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html) - # vi_mode # vi mode (you don't need this if you've enabled prompt_char) + chezmoi_shell # chezmoi shell (https://www.chezmoi.io/) # vpn_ip # virtual private network indicator # load # CPU load # disk_usage # disk usage @@ -103,10 +103,11 @@ todo # todo items (https://github.com/todotxt/todo.txt-cli) timewarrior # timewarrior tracking status (https://timewarrior.net/) taskwarrior # taskwarrior task count (https://taskwarrior.org/) + per_directory_history # Oh My Zsh per-directory-history local/global indicator # cpu_arch # CPU architecture # time # current time # =========================[ Line #2 ]========================= - newline # \n + newline # ip # ip address and bandwidth usage for a specified network interface # public_ip # public IP address # proxy # system-wide http/https/ftp proxy @@ -121,6 +122,13 @@ # icon overlap when using non-monospace fonts. When set to `none`, spaces are not added. typeset -g POWERLEVEL9K_ICON_PADDING=none + # Basic style options that define the overall look of your prompt. You probably don't want to + # change them. + typeset -g POWERLEVEL9K_BACKGROUND= # transparent background + typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace + typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space + typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol + # When set to true, icons appear before content on both sides of the prompt. When set # to false, icons go after content. If empty or not set, icons go before content in the left # prompt and after content in the right prompt. @@ -132,13 +140,12 @@ # Or for a specific segment in specific state: # # POWERLEVEL9K_DIR_NOT_WRITABLE_ICON_BEFORE_CONTENT=false - typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT= + typeset -g POWERLEVEL9K_ICON_BEFORE_CONTENT=true # Add an empty line before each prompt. typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false - # Connect left prompt lines with these symbols. You'll probably want to use the same color - # as POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND below. + # Connect left prompt lines with these symbols. typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX= typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_PREFIX= typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX= @@ -147,54 +154,45 @@ typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_SUFFIX= typeset -g POWERLEVEL9K_MULTILINE_LAST_PROMPT_SUFFIX= - # Filler between left and right prompt on the first prompt line. You can set it to ' ', '·' or - # '─'. The last two make it easier to see the alignment between left and right prompt and to - # separate prompt from command output. You might want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false - # for more compact prompt if using this option. + # The left end of left prompt. + typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= + # The right end of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL= + + # Ruler, a.k.a. the horizontal line before each prompt. If you set it to true, you'll + # probably want to set POWERLEVEL9K_PROMPT_ADD_NEWLINE=false above and + # POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' below. + typeset -g POWERLEVEL9K_SHOW_RULER=false + typeset -g POWERLEVEL9K_RULER_CHAR='─' # reasonable alternative: '·' + typeset -g POWERLEVEL9K_RULER_FOREGROUND=242 + + # Filler between left and right prompt on the first prompt line. You can set it to '·' or '─' + # to make it easier to see the alignment between left and right prompt and to separate prompt + # from command output. It serves the same purpose as ruler (see above) without increasing + # the number of prompt lines. You'll probably want to set POWERLEVEL9K_SHOW_RULER=false + # if using this. You might also like POWERLEVEL9K_PROMPT_ADD_NEWLINE=false for more compact + # prompt. typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR=' ' - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_BACKGROUND= - typeset -g POWERLEVEL9K_MULTILINE_NEWLINE_PROMPT_GAP_BACKGROUND= if [[ $POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_CHAR != ' ' ]]; then - # The color of the filler. You'll probably want to match the color of POWERLEVEL9K_MULTILINE - # ornaments defined above. - typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=238 + # The color of the filler. + typeset -g POWERLEVEL9K_MULTILINE_FIRST_PROMPT_GAP_FOREGROUND=242 + # Add a space between the end of left prompt and the filler. + typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL=' ' + # Add a space between the filler and the start of right prompt. + typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL=' ' # Start filler from the edge of the screen if there are no left segments on the first line. typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_FIRST_SEGMENT_END_SYMBOL='%{%}' # End filler on the edge of the screen if there are no right segments on the first line. typeset -g POWERLEVEL9K_EMPTY_LINE_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='%{%}' fi - # Default background color. - typeset -g POWERLEVEL9K_BACKGROUND=234 - - # Separator between same-color segments on the left. - typeset -g POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR='%242F\uE0B1' - # Separator between same-color segments on the right. - typeset -g POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR='%242F\uE0B3' - # Separator between different-color segments on the left. - typeset -g POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR='\uE0B0' - # Separator between different-color segments on the right. - typeset -g POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR='\uE0B2' - # The right end of left prompt. - typeset -g POWERLEVEL9K_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='\uE0B0' - # The left end of right prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_FIRST_SEGMENT_START_SYMBOL='\uE0B2' - # The left end of left prompt. - typeset -g POWERLEVEL9K_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL='' - # The right end of right prompt. - typeset -g POWERLEVEL9K_RIGHT_PROMPT_LAST_SEGMENT_END_SYMBOL='' - # Left prompt terminator for lines without any segments. - typeset -g POWERLEVEL9K_EMPTY_LINE_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= - #################################[ os_icon: os identifier ]################################## # OS identifier color. - typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND=255 + typeset -g POWERLEVEL9K_OS_ICON_FOREGROUND= # Custom icon. # typeset -g POWERLEVEL9K_OS_ICON_CONTENT_EXPANSION='⭐' ################################[ prompt_char: prompt symbol ]################################ - # Transparent background. - typeset -g POWERLEVEL9K_PROMPT_CHAR_BACKGROUND= # Green prompt symbol if the last command succeeded. typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS,VIOWR}_FOREGROUND=76 # Red prompt symbol if the last command failed. @@ -209,11 +207,9 @@ typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIOWR_CONTENT_EXPANSION='▶' typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=true # No line terminator if prompt_char is the last segment. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL= + typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_LAST_SEGMENT_END_SYMBOL='' # No line introducer if prompt_char is the first segment. typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_PROMPT_FIRST_SEGMENT_START_SYMBOL= - # No surrounding whitespace. - typeset -g POWERLEVEL9K_PROMPT_CHAR_LEFT_{LEFT,RIGHT}_WHITESPACE= ##################################[ dir: current directory ]################################## # Default current directory color. @@ -244,7 +240,7 @@ .java-version .perl-version .php-version - .tool-version + .tool-versions .shorten_folder_marker .svn .terraform @@ -347,7 +343,7 @@ # typeset -g POWERLEVEL9K_DIR_CLASSES=() # Custom prefix. - # typeset -g POWERLEVEL9K_DIR_PREFIX='%244Fin ' + # typeset -g POWERLEVEL9K_DIR_PREFIX='%fin ' #####################################[ vcs: git status ]###################################### # Branch icon. Set this parameter to '\UE0A0 ' for the popular Powerline branch icon. @@ -377,7 +373,7 @@ if (( $1 )); then # Styling for up-to-date Git status. - local meta='%244F' # grey foreground + local meta='%f' # default foreground local clean='%76F' # green foreground local modified='%178F' # yellow foreground local untracked='%39F' # blue foreground @@ -430,11 +426,17 @@ res+=" ${modified}wip" fi - # ⇣42 if behind the remote. - (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" - # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. - (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " - (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + if (( VCS_STATUS_COMMITS_AHEAD || VCS_STATUS_COMMITS_BEHIND )); then + # ⇣42 if behind the remote. + (( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}" + # ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42. + (( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" " + (( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}⇡${VCS_STATUS_COMMITS_AHEAD}" + elif [[ -n $VCS_STATUS_REMOTE_BRANCH ]]; then + # Tip: Uncomment the next line to display '=' if up to date with the remote. + # res+=" ${clean}=" + fi + # ⇠42 if behind the push remote. (( VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" ${clean}⇠${VCS_STATUS_PUSH_COMMITS_BEHIND}" (( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" " @@ -493,11 +495,11 @@ # Custom icon. # typeset -g POWERLEVEL9K_VCS_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom prefix. - # typeset -g POWERLEVEL9K_VCS_PREFIX='%244Fon ' + # typeset -g POWERLEVEL9K_VCS_PREFIX='%fon ' # Show status of repositories of these types. You can add svn and/or hg if you are # using them. If you do, your prompt may become slow even when your current directory - # isn't in an svn or hg reposotiry. + # isn't in an svn or hg repository. typeset -g POWERLEVEL9K_VCS_BACKENDS=(git) # These settings are used for repositories other than Git or when gitstatusd fails and @@ -548,19 +550,19 @@ # Show this many fractional digits. Zero means round to seconds. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0 # Execution time color. - typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=248 + typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=101 # Duration format: 1d 2h 3m 4s. typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s' # Custom icon. # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom prefix. - # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%244Ftook ' + # typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PREFIX='%ftook ' #######################[ background_jobs: presence of background jobs ]####################### # Don't show the number of background jobs. typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VERBOSE=false # Background jobs color. - typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=37 + typeset -g POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND=70 # Custom icon. # typeset -g POWERLEVEL9K_BACKGROUND_JOBS_VISUAL_IDENTIFIER_EXPANSION='⭐' @@ -658,7 +660,7 @@ # .NET Core version from asdf. typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_FOREGROUND=134 # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_ASDF_DOTNET_CORE_SHOW_ON_UPGLOB='*.foo|*.bar' + # typeset -g POWERLEVEL9K_ASDF_DOTNET_SHOW_ON_UPGLOB='*.foo|*.bar' # Flutter version from asdf. typeset -g POWERLEVEL9K_ASDF_FLUTTER_FOREGROUND=38 @@ -724,6 +726,12 @@ typeset -g POWERLEVEL9K_RANGER_FOREGROUND=178 # Custom icon. # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + ####################[ yazi: yazi shell (https://github.com/sxyazi/yazi) ]##################### + # Yazi shell color. + typeset -g POWERLEVEL9K_YAZI_FOREGROUND=178 + # Custom icon. + # typeset -g POWERLEVEL9K_YAZI_VISUAL_IDENTIFIER_EXPANSION='⭐' ######################[ nnn: nnn shell (https://github.com/jarun/nnn) ]####################### # Nnn shell color. @@ -759,12 +767,21 @@ # Nix shell color. typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74 + # Display the icon of nix_shell if PATH contains a subdirectory of /nix/store. + # typeset -g POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH=false + # Tip: If you want to see just the icon without "pure" and "impure", uncomment the next line. # typeset -g POWERLEVEL9K_NIX_SHELL_CONTENT_EXPANSION= # Custom icon. # typeset -g POWERLEVEL9K_NIX_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################[ chezmoi_shell: chezmoi shell (https://www.chezmoi.io/) ]################## + # chezmoi shell color. + typeset -g POWERLEVEL9K_CHEZMOI_SHELL_FOREGROUND=33 + # Custom icon. + # typeset -g POWERLEVEL9K_CHEZMOI_SHELL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ##################################[ disk_usage: disk usage ]################################## # Colors for different levels of disk usage. typeset -g POWERLEVEL9K_DISK_USAGE_NORMAL_FOREGROUND=35 @@ -778,23 +795,6 @@ # Custom icon. # typeset -g POWERLEVEL9K_DISK_USAGE_VISUAL_IDENTIFIER_EXPANSION='⭐' - ###########[ vi_mode: vi mode (you don't need this if you've enabled prompt_char) ]########### - # Text and color for normal (a.k.a. command) vi mode. - typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL - typeset -g POWERLEVEL9K_VI_MODE_NORMAL_FOREGROUND=106 - # Text and color for visual vi mode. - typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL - typeset -g POWERLEVEL9K_VI_MODE_VISUAL_FOREGROUND=68 - # Text and color for overtype (a.k.a. overwrite and replace) vi mode. - typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE - typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_FOREGROUND=172 - # Text and color for insert vi mode. - typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= - typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=66 - - # Custom icon. - # typeset -g POWERLEVEL9K_RANGER_VISUAL_IDENTIFIER_EXPANSION='⭐' - ######################################[ ram: free RAM ]####################################### # RAM color. typeset -g POWERLEVEL9K_RAM_FOREGROUND=66 @@ -875,6 +875,19 @@ # Custom icon. # typeset -g POWERLEVEL9K_TASKWARRIOR_VISUAL_IDENTIFIER_EXPANSION='⭐' + ######[ per_directory_history: Oh My Zsh per-directory-history local/global indicator ]####### + # Color when using local/global history. + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_FOREGROUND=135 + typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_FOREGROUND=130 + + # Tip: Uncomment the next two lines to hide "local"/"global" text and leave just the icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_CONTENT_EXPANSION='' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_CONTENT_EXPANSION='' + + # Custom icon. + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_LOCAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_PER_DIRECTORY_HISTORY_GLOBAL_VISUAL_IDENTIFIER_EXPANSION='⭐' + ################################[ cpu_arch: CPU architecture ]################################ # CPU architecture color. typeset -g POWERLEVEL9K_CPU_ARCH_FOREGROUND=172 @@ -908,7 +921,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_CONTEXT_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom prefix. - # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%244Fwith ' + # typeset -g POWERLEVEL9K_CONTEXT_PREFIX='%fwith ' ###[ virtualenv: python virtual environment (https://docs.python.org/3/library/venv.html) ]### # Python virtual environment color. @@ -1011,6 +1024,11 @@ ##############[ nvm: node.js version from nvm (https://github.com/nvm-sh/nvm) ]############### # Nvm color. typeset -g POWERLEVEL9K_NVM_FOREGROUND=70 + # If set to false, hide node version if it's the same as default: + # $(nvm version current) == $(nvm version default). + typeset -g POWERLEVEL9K_NVM_PROMPT_ALWAYS_SHOW=false + # If set to false, hide node version if it's equal to "system". + typeset -g POWERLEVEL9K_NVM_SHOW_SYSTEM=true # Custom icon. # typeset -g POWERLEVEL9K_NVM_VISUAL_IDENTIFIER_EXPANSION='⭐' @@ -1210,49 +1228,10 @@ # Custom icon. # typeset -g POWERLEVEL9K_HASKELL_STACK_VISUAL_IDENTIFIER_EXPANSION='⭐' - ################[ terraform: terraform workspace (https://www.terraform.io) ]################# - # Don't show terraform workspace if it's literally "default". - typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false - # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element - # in each pair defines a pattern against which the current terraform workspace gets matched. - # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) - # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, - # you'll see this value in your prompt. The second element of each pair in - # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The - # first match wins. - # - # For example, given these settings: - # - # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( - # '*prod*' PROD - # '*test*' TEST - # '*' OTHER) - # - # If your current terraform workspace is "project_test", its class is TEST because "project_test" - # doesn't match the pattern '*prod*' but does match '*test*'. - # - # You can define different colors, icons and content expansions for different classes: - # - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=28 - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' - # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' - typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( - # '*prod*' PROD # These values are examples that are unlikely - # '*test*' TEST # to match your needs. Customize them as needed. - '*' OTHER) - typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=38 - # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' - - #############[ terraform_version: terraform version (https://www.terraform.io) ]############## - # Terraform version color. - typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=38 - # Custom icon. - # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' - #############[ kubecontext: current kubernetes context (https://kubernetes.io/) ]############# # Show kubecontext only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show kubecontext. - typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent' + typeset -g POWERLEVEL9K_KUBECONTEXT_SHOW_ON_COMMAND='kubectl|helm|kubens|kubectx|oc|istioctl|kogito|k9s|helmfile|flux|fluxctl|stern|kubeseal|skaffold|kubent|kubecolor|cmctl|sparkctl' # Kubernetes context classes for the purpose of using different colors, icons and expansions with # different contexts. @@ -1334,12 +1313,51 @@ POWERLEVEL9K_KUBECONTEXT_DEFAULT_CONTENT_EXPANSION+='${${:-/$P9K_KUBECONTEXT_NAMESPACE}:#/default}' # Custom prefix. - # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%244Fat ' + # typeset -g POWERLEVEL9K_KUBECONTEXT_PREFIX='%fat ' + + ################[ terraform: terraform workspace (https://www.terraform.io) ]################# + # Don't show terraform workspace if it's literally "default". + typeset -g POWERLEVEL9K_TERRAFORM_SHOW_DEFAULT=false + # POWERLEVEL9K_TERRAFORM_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current terraform workspace gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_TERRAFORM_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_TERRAFORM_CLASSES defines the workspace class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current terraform workspace is "project_test", its class is TEST because "project_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_TERRAFORM_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_TERRAFORM_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + typeset -g POWERLEVEL9K_TERRAFORM_OTHER_FOREGROUND=38 + # typeset -g POWERLEVEL9K_TERRAFORM_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' + + #############[ terraform_version: terraform version (https://www.terraform.io) ]############## + # Terraform version color. + typeset -g POWERLEVEL9K_TERRAFORM_VERSION_FOREGROUND=38 + # Custom icon. + # typeset -g POWERLEVEL9K_TERRAFORM_VERSION_VISUAL_IDENTIFIER_EXPANSION='⭐' #[ aws: aws profile (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) ]# # Show aws only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show aws. - typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|terraform|pulumi|terragrunt' + typeset -g POWERLEVEL9K_AWS_SHOW_ON_COMMAND='aws|awless|cdk|terraform|pulumi|terragrunt' # POWERLEVEL9K_AWS_CLASSES is an array with even number of elements. The first element # in each pair defines a pattern against which the current AWS profile gets matched. @@ -1387,10 +1405,39 @@ # Show azure only when the command you are typing invokes one of these tools. # Tip: Remove the next line to always show azure. typeset -g POWERLEVEL9K_AZURE_SHOW_ON_COMMAND='az|terraform|pulumi|terragrunt' + + # POWERLEVEL9K_AZURE_CLASSES is an array with even number of elements. The first element + # in each pair defines a pattern against which the current azure account name gets matched. + # More specifically, it's P9K_CONTENT prior to the application of context expansion (see below) + # that gets matched. If you unset all POWERLEVEL9K_AZURE_*CONTENT_EXPANSION parameters, + # you'll see this value in your prompt. The second element of each pair in + # POWERLEVEL9K_AZURE_CLASSES defines the account class. Patterns are tried in order. The + # first match wins. + # + # For example, given these settings: + # + # typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD + # '*test*' TEST + # '*' OTHER) + # + # If your current azure account is "company_test", its class is TEST because "company_test" + # doesn't match the pattern '*prod*' but does match '*test*'. + # + # You can define different colors, icons and content expansions for different classes: + # + # typeset -g POWERLEVEL9K_AZURE_TEST_FOREGROUND=28 + # typeset -g POWERLEVEL9K_AZURE_TEST_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_TEST_CONTENT_EXPANSION='> ${P9K_CONTENT} <' + typeset -g POWERLEVEL9K_AZURE_CLASSES=( + # '*prod*' PROD # These values are examples that are unlikely + # '*test*' TEST # to match your needs. Customize them as needed. + '*' OTHER) + # Azure account name color. - typeset -g POWERLEVEL9K_AZURE_FOREGROUND=32 + typeset -g POWERLEVEL9K_AZURE_OTHER_FOREGROUND=32 # Custom icon. - # typeset -g POWERLEVEL9K_AZURE_VISUAL_IDENTIFIER_EXPANSION='⭐' + # typeset -g POWERLEVEL9K_AZURE_OTHER_VISUAL_IDENTIFIER_EXPANSION='⭐' ##########[ gcloud: google cloud account and project (https://cloud.google.com/) ]########### # Show gcloud only when the command you are typing invokes one of these tools. @@ -1495,7 +1542,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_TOOLBOX_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom prefix. - # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%244Fin ' + # typeset -g POWERLEVEL9K_TOOLBOX_PREFIX='%fin ' ###############################[ public_ip: public IP address ]############################### # Public IP color. @@ -1534,7 +1581,7 @@ # P9K_IP_TX_BYTES_DELTA | number of bytes sent since last prompt # P9K_IP_RX_RATE | receive rate (since last prompt) # P9K_IP_TX_RATE | send rate (since last prompt) - typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='${P9K_IP_RX_RATE:+%70F⇣$P9K_IP_RX_RATE }${P9K_IP_TX_RATE:+%215F⇡$P9K_IP_TX_RATE }%38F$P9K_IP_IP' + typeset -g POWERLEVEL9K_IP_CONTENT_EXPANSION='$P9K_IP_IP${P9K_IP_RX_RATE:+ %70F⇣$P9K_IP_RX_RATE}${P9K_IP_TX_RATE:+ %215F⇡$P9K_IP_TX_RATE}' # Show information for the first network interface whose name matches this regular expression. # Run `ifconfig` or `ip -4 a show` to see the names of all network interfaces. typeset -g POWERLEVEL9K_IP_INTERFACE='[ew].*' @@ -1598,7 +1645,7 @@ # Custom icon. # typeset -g POWERLEVEL9K_TIME_VISUAL_IDENTIFIER_EXPANSION='⭐' # Custom prefix. - # typeset -g POWERLEVEL9K_TIME_PREFIX='%244Fat ' + # typeset -g POWERLEVEL9K_TIME_PREFIX='%fat ' # Example of a user-defined prompt segment. Function prompt_example will be called on every # prompt if `example` prompt segment is added to POWERLEVEL9K_LEFT_PROMPT_ELEMENTS or @@ -1611,7 +1658,7 @@ # User-defined prompt segments may optionally provide an instant_prompt_* function. Its job # is to generate the prompt segment for display in instant prompt. See - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # https://github.com/romkatv/powerlevel10k#instant-prompt. # # Powerlevel10k will call instant_prompt_* at the same time as the regular prompt_* function # and will record all `p10k segment` calls it makes. When displaying instant prompt, Powerlevel10k @@ -1647,7 +1694,7 @@ # it incompatible with your zsh configuration files. # - quiet: Enable instant prompt and don't print warnings when detecting console output # during zsh initialization. Choose this if you've read and understood - # https://github.com/romkatv/powerlevel10k/blob/master/README.md#instant-prompt. + # https://github.com/romkatv/powerlevel10k#instant-prompt. # - verbose: Enable instant prompt and print a warning when detecting console output during # zsh initialization. Choose this if you've never tried instant prompt, haven't # seen the warning, or if you are unsure what this all means. diff --git a/config/zsh/.zshenv b/config/zsh/.zshenv index 0e85219..696663f 100644 --- a/config/zsh/.zshenv +++ b/config/zsh/.zshenv @@ -1,10 +1,11 @@ - # XDG export XDG_CONFIG_HOME=$HOME/.config -export XDG_CACHE_HOME=$HOME/.cache export XDG_DATA_HOME=$HOME/.local/share export XDG_STATE_HOME=$HOME/.local/state +export XDG_CACHE_HOME=$HOME/.cache # ZDOTDIR export ZDOTDIR=$XDG_CONFIG_HOME/zsh +### sheldon ### +export SHELDON_CONFIG_DIR="$ZDOTDIR" \ No newline at end of file diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc index 99e13c2..41af348 100644 --- a/config/zsh/.zshrc +++ b/config/zsh/.zshrc @@ -5,72 +5,63 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]] source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" fi -### zinit ### -typeset -gAH ZINIT -ZINIT[HOME_DIR]="$XDG_DATA_HOME/zinit" -ZINIT[ZCOMPDUMP_PATH]="$XDG_STATE_HOME/zcompdump" -source "${ZINIT[HOME_DIR]}/zinit.git/zinit.zsh" +### paths ### +typeset -gU PATH path +typeset -gU FPATH fpath -# powerlevel10k -zinit ice depth=1; zinit light romkatv/powerlevel10k -# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh. -[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh +path=( + '/usr/local/bin'(N-/) + '/opt/homebrew/bin'(N-/) + '/usr/bin'(N-/) + '/bin'(N-/) + '/usr/local/sbin'(N-/) + '/opt/homebrew/sbin'(N-/) + '/usr/sbin'(N-/) + '/sbin'(N-/) +) -# >>> conda initialize >>> -# !! Contents within this block are managed by 'conda init' !! -__conda_setup="$('/Users/shunmakino/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" -if [ $? -eq 0 ]; then - eval "$__conda_setup" -else - if [ -f "/Users/shunmakino/miniconda3/etc/profile.d/conda.sh" ]; then - . "/Users/shunmakino/miniconda3/etc/profile.d/conda.sh" - else - export PATH="/Users/shunmakino/miniconda3/bin:$PATH" - fi -fi -unset __conda_setup -# <<< conda initialize <<< +path=( + "$HOME/.local/bin"(N-/) + "$DENO_INSTALL/bin"(N-/) + "$path[@]" +) -### history ### +fpath=( + "$XDG_DATA_HOME/zsh/completions"(N-/) + "$fpath[@]" +) + +## history ### export HISTFILE="$XDG_STATE_HOME/zsh_history" export HISTSIZE=12000 export SAVEHIST=10000 -# zsh_sessionsを作らない -export SHELL_SESSIONS_DISABLE=1 - -setopt AUTO_PUSHD -setopt PUSHD_IGNORE_DUPS -setopt GLOBDOTS -setopt APPEND_HISTORY -setopt EXTENDED_HISTORY -setopt HIST_IGNORE_ALL_DUPS -setopt HIST_IGNORE_SPACE -setopt HIST_REDUCE_BLANKS -setopt HIST_SAVE_NO_DUPS -setopt INTERACTIVE_COMMENTS -setopt NO_SHARE_HISTORY -setopt MAGIC_EQUAL_SUBST -setopt PRINT_EIGHT_BIT -setopt NO_FLOW_CONTROL -# 補完で大文字にもマッチ -zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' -# 塗りつぶし -zstyle ':completion:*' menu select -## 補完候補を一覧表示したとき、Tabや矢印で選択できるようにする -zstyle ':completion:*:default' menu select=1 -# ../ の後は今いるディレクトリを補完しない -zstyle ':completion:*' ignore-parents parent pwd .. -setopt correct -setopt no_beep -setopt AUTO_PARAM_KEYS +### source ### +source() { + local input="$1" + local cache="$input.zwc" + if [[ ! -f "$cache" || "$input" -nt "$cache" ]]; then + zcompile "$input" + fi + \builtin source "$@" +} +### hooks ### zshaddhistory() { local line="${1%%$'\n'}" [[ ! "$line" =~ "^(cd|history|jj?|lazygit|la|ll|ls|rm|rmdir|trash)($| )" ]] } -### plugins ### -zinit wait lucid null for \ - atinit'source "$ZDOTDIR/.zshrc.lazy"' \ - @'zdharma-continuum/null' +# sheldon cache technique +# See also https://zenn.dev/fuzmare/articles/zsh-plugin-manager-cache +cache_dir=${XDG_CACHE_HOME:-$HOME/.cache} +sheldon_cache="$cache_dir/sheldon.zsh" +sheldon_toml="$SHELDON_CONFIG_DIR/plugins.toml" +if [[ ! -r "$sheldon_cache" || "$sheldon_toml" -nt "$sheldon_cache" ]]; then + sheldon source > $sheldon_cache +fi +source "$sheldon_cache" +unset cache_dir sheldon_cache sheldon_toml + +# To customize prompt, run `p10k configure` or edit ~/.config/zsh/.p10k.zsh. +[[ ! -f ~/.config/zsh/.p10k.zsh ]] || source ~/.config/zsh/.p10k.zsh \ No newline at end of file diff --git a/config/zsh/.zshrc.lazy b/config/zsh/.zshrc.lazy deleted file mode 100644 index 54c315f..0000000 --- a/config/zsh/.zshrc.lazy +++ /dev/null @@ -1,98 +0,0 @@ -# homebrew -export HOMEBREW_PREFIX="/opt/homebrew"; -export HOMEBREW_CELLAR="/opt/homebrew/Cellar"; -export HOMEBREW_REPOSITORY="/opt/homebrew"; -export PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}"; -export MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:"; -export INFOPATH="/opt/homebrew/share/info:${INFOPATH:-}"; - -# poetry -export POETRY_HOME=$XDG_DATA_HOME/pypoetry -export PATH=$PATH:$HOME/.local/bin -export POETRY_CONFIG_DIR=$XDG_CONFIG_HOME/pypoetry -#export POETRY_DATA_DIR=$XDG_DATA_HOME/pypoetry -export POETRY_CACHE_DIR=$XDG_CACHE_HOME/pypoetry -export PATH=$POETRY_HOME/bin:$PATH - -# fzf -export FZF_DEFAULT_OPTS='--reverse' - -# perl -eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)" - -# java tomcat -#export JAVA_HOME=$(/usr/libexec/java_home v 1.0) -#export PATH=$PATH:$JAVA_HOME/bin -#export PATH=/opt/homebrew/opt/tomcat@8/bin:$PATH -#export CATALINA_HOME=/opt/homebrew/opt/tomcat@8/libexec -#export CATALINA_OPTS='-Dfile.encoding=UTF-8' -#export CLASSPATH=$CATALINA_HOME/lib/servlet-api.jar - -# Rust -. "$HOME/.cargo/env" - -# julia -export JULIA_DEPOT_PATH="$XDG_DATA_HOME/julia:$JULIA_DEPOT_PATH" - -# alias -alias ls="ls -F" -alias la="ls -a" -alias ll="ls -l" -alias lla="ls -la" -alias mkdir="mkdir -p" -alias python="python3" - -case "$OSTYPE" in - darwin*) - (( ${+commands[gdate]} )) && alias date='gdate' - (( ${+commands[gls]} )) && alias ls='gls' - (( ${+commands[gmkdir]} )) && alias mkdir='gmkdir' - (( ${+commands[gcp]} )) && alias cp='gcp' - (( ${+commands[gmv]} )) && alias mv='gmv' - (( ${+commands[grm]} )) && alias rm='grm' - (( ${+commands[gdu]} )) && alias du='gdu' - (( ${+commands[ghead]} )) && alias head='ghead' - (( ${+commands[gtail]} )) && alias tail='gtail' - (( ${+commands[gsed]} )) && alias sed='gsed' - (( ${+commands[ggrep]} )) && alias grep='ggrep' - (( ${+commands[gfind]} )) && alias find='gfind' - (( ${+commands[gdirname]} )) && alias dirname='gdirname' - (( ${+commands[gxargs]} )) && alias xargs='gxargs' - ;; -esac - -## コマンド補完 -zinit ice wait lucid -zinit light zsh-users/zsh-completions -autoload -Uz compinit && compinit - -# zeno -export ZENO_HOME="$XDG_CONFIG_HOME/zeno" -export ZENO_ENABLE_SOCK=1 -# export ZENO_DISABLE_BUILTIN_COMPLETION=1 -export ZENO_GIT_CAT="bat --color=always" -export ZENO_GIT_TREE="exa --tree" -## zeno install ## -zinit ice lucid depth"1" blockf -zinit light yuki-yano/zeno.zsh - -if [[ -n $ZENO_LOADED ]]; then - # ここに任意のZLEの記述を行う - bindkey ' ' zeno-auto-snippet - bindkey '^m' zeno-auto-snippet-and-accept-line - bindkey '^s' zeno-completion - bindkey '^g' zeno-ghq-cd - bindkey '^r' zeno-history-selection - bindkey '^x' zeno-insert-snippet -fi - -## 履歴補完 -zinit ice wait lucid -zinit light zsh-users/zsh-autosuggestions -ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=244" -ZSH_AUTOSUGGEST_CLEAR_WIDGETS=(zeno-auto-snippet-and-accept-line $ZSH_AUTOSUGGEST_CLEAR_WIDGETS) - -## シンタックスハイライト -zinit ice wait lucid -zinit light zdharma-continuum/fast-syntax-highlighting - diff --git a/config/zsh/conda.zsh b/config/zsh/conda.zsh new file mode 100644 index 0000000..d2facf8 --- /dev/null +++ b/config/zsh/conda.zsh @@ -0,0 +1,14 @@ +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +__conda_setup="$('/Users/shunmakino/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" +if [ $? -eq 0 ]; then + eval "$__conda_setup" +else + if [ -f "/Users/shunmakino/miniconda3/etc/profile.d/conda.sh" ]; then + . "/Users/shunmakino/miniconda3/etc/profile.d/conda.sh" + else + export PATH="/Users/shunmakino/miniconda3/bin:$PATH" + fi +fi +unset __conda_setup +# <<< conda initialize <<< \ No newline at end of file diff --git a/config/zsh/lazy.zsh b/config/zsh/lazy.zsh new file mode 100644 index 0000000..3d4a28c --- /dev/null +++ b/config/zsh/lazy.zsh @@ -0,0 +1,54 @@ +# recommended scripts for homebrew +case "$OSTYPE" in + darwin*) + export HOMEBREW_PREFIX="/opt/homebrew" + export HOMEBREW_CELLAR="/opt/homebrew/Cellar" + export HOMEBREW_REPOSITORY="/opt/homebrew" + export MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:" + export INFOPATH="/opt/homebrew/share/info:${INFOPATH:-}" + ;; +esac + +# fzf +export FZF_DEFAULT_OPTS='--reverse' + +# alias +alias ls="ls -F" +alias la="ls -a" +alias ll="ls -l" +alias lla="ls -la" +alias mkdir="mkdir -p" +alias python="python3" + +# zsh_sessionsを作らない +# export SHELL_SESSIONS_DISABLE=1 +setopt AUTO_PUSHD +setopt PUSHD_IGNORE_DUPS +setopt GLOBDOTS +setopt APPEND_HISTORY +setopt EXTENDED_HISTORY +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_IGNORE_SPACE +setopt HIST_REDUCE_BLANKS +setopt HIST_SAVE_NO_DUPS +setopt INTERACTIVE_COMMENTS +setopt NO_SHARE_HISTORY # 少し微妙 +setopt MAGIC_EQUAL_SUBST +setopt PRINT_EIGHT_BIT +setopt NO_FLOW_CONTROL +# 補完で大文字にもマッチ +zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' +# 塗りつぶし +zstyle ':completion:*' menu select +## 補完候補を一覧表示したとき、Tabや矢印で選択できるようにする +zstyle ':completion:*:default' menu select=1 +# ../ の後は今いるディレクトリを補完しない +zstyle ':completion:*' ignore-parents parent pwd .. +setopt correct +setopt no_beep +setopt AUTO_PARAM_KEYS + +### key-bindings +bindkey "^A" beginning-of-line # C-a +bindkey "^E" end-of-line # C-e +bindkey "^K" kill-line # C-k diff --git a/config/zsh/plugins.toml b/config/zsh/plugins.toml new file mode 100644 index 0000000..803be25 --- /dev/null +++ b/config/zsh/plugins.toml @@ -0,0 +1,77 @@ +# `sheldon` configuration file +# ---------------------------- +# +# You can modify this file directly or you can use one of the following +# `sheldon` commands which are provided to assist in editing the config file: +# +# - `sheldon add` to add a new plugin to the config file +# - `sheldon edit` to open up the config file in the default editor +# - `sheldon remove` to remove a plugin from the config file +# +# See the documentation for more https://github.com/rossmacarthur/sheldon#readme + +shell = "zsh" + +apply = ["defer"] + +[templates] +defer = "{{ hooks?.pre | nl }}{% for file in files %}zsh-defer source \"{{ file }}\"\n{% endfor %}{{ hooks?.post | nl }}" + +[plugins] + +[plugins.zsh-defer] +github = "romkatv/zsh-defer" +apply = ["source"] + +[plugins.powerlevel10k] +github = "romkatv/powerlevel10k" +apply = ["source"] + +[plugins.conda] +local = "~/.config/zsh" +use = ["conda.zsh"] +apply = ["source"] + +#################### +# lazy +#################### + +[plugins.zsh-completions] +github = "zsh-users/zsh-completions" +dir = "src" +apply = ["fpath"] + +[plugins.zsh-autosuggestions] +github = "zsh-users/zsh-autosuggestions" + +[plugins.fast-syntax-highlighting] +github = "zdharma-continuum/fast-syntax-highlighting" + +[plugins.zeno] +github = "yuki-yano/zeno.zsh" +hooks.pre = """ +export ZENO_HOME="$XDG_CONFIG_HOME/zeno" +export ZENO_ENABLE_SOCK=1 +# export ZENO_DISABLE_BUILTIN_COMPLETION=1 +export ZENO_GIT_CAT="bat --color=always" +export ZENO_GIT_TREE="exa --tree" +""" +hooks.post = """ +bindkey ' ' zeno-auto-snippet +bindkey '^m' zeno-auto-snippet-and-accept-line +bindkey '^i' zeno-completion +bindkey '^g' zeno-ghq-cd +bindkey '^r' zeno-history-selection +bindkey '^x' zeno-insert-snippet +""" + +[plugins.lazy] +local = "~/.config/zsh" +use = ["lazy.zsh"] + +[plugins.compinit] +inline = """ +autoload -Uz compinit +compinit -d "$XDG_STATE_HOME/zcompdump" +""" + From b466804fdf67ab8b7f006a6ff3ec30708a422ef9 Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Tue, 17 Sep 2024 09:07:29 +0900 Subject: [PATCH 09/28] python: update initializer for conda --- config/zsh/conda.zsh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/config/zsh/conda.zsh b/config/zsh/conda.zsh index d2facf8..36ce3d5 100644 --- a/config/zsh/conda.zsh +++ b/config/zsh/conda.zsh @@ -1,14 +1,18 @@ # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! -__conda_setup="$('/Users/shunmakino/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" -if [ $? -eq 0 ]; then - eval "$__conda_setup" -else - if [ -f "/Users/shunmakino/miniconda3/etc/profile.d/conda.sh" ]; then - . "/Users/shunmakino/miniconda3/etc/profile.d/conda.sh" +if [ -d "$HOME/miniconda3/bin" ]; then + __conda_setup="$("$HOME/miniconda3/bin/conda" 'shell.zsh' 'hook' 2> /dev/null)" + if [ $? -eq 0 ]; then + eval "$__conda_setup" else - export PATH="/Users/shunmakino/miniconda3/bin:$PATH" + if [ -f "$HOME/miniconda3/etc/profile.d/conda.sh" ]; then + . "$HOME/miniconda3/etc/profile.d/conda.sh" + else + export PATH="$HOME/miniconda3/bin:$PATH" + fi fi + unset __conda_setup +else + echo "conda is not installed, skipping the procedure" fi -unset __conda_setup # <<< conda initialize <<< \ No newline at end of file From e3a7d5244f9a3ad31871d9b52dc092949cbe908b Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sun, 22 Sep 2024 18:39:51 +0900 Subject: [PATCH 10/28] tig: add config for tig --- config/tig/config | 419 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 419 insertions(+) create mode 100644 config/tig/config diff --git a/config/tig/config b/config/tig/config new file mode 100644 index 0000000..ebf3a54 --- /dev/null +++ b/config/tig/config @@ -0,0 +1,419 @@ +# Tig default configuration +# +# Please see 'man tigrc' for a complete reference. + +# Settings +# -------- +# Most of these settings can be toggleable, either via the toggle-* +# actions or via the option menu (bound to `o` by default). + +# View settings +# +# Supported column types and their options: +# +# author +# - display (enum) [no|full|abbreviated|email|email-user] +# : Show author information? +# commit-title +# - display (bool) : Show the commit title? +# - graph (enum) [no|v2|v1] : Show the commit graph? (main view only) +# - refs (bool) : Show branches, tags and remotes? (main view only) +# - overflow (boolint) : Highlight overflows? Defaults to 50 when enabled. +# +# date +# - display (enum) [no|default|relative|relative-compact|custom] +# : Show dates? +# - local (bool) : Show local dates? +# - format (string) : Custom strftime(3) format +# +# file-name +# - display (enum) [no|always|auto] : Show file names? +# +# file-size +# - display (enum) [no|default|units] : Show file sizes? +# +# id +# - display (bool) : Show commit/tree ID? +# +# line-number +# - display (bool) : Show line numbers? +# - interval (int) : Interval between line numbers; defaults to 5 +# +# mode +# - display (bool) : Show file modes? +# +# status +# - display (enum) [no|short|long] : Show status label? +# +# text +# - display (bool) : Show text? +# - commit-title-overflow (boolint) : Highlight overflow in log and diff view? +# +# All columns also support a width option to configure the max width of +# the column. Use zero (the default value) to auto-size the column based +# on the content. + +set blame-view = date:default author:full file-name:auto id:yes,color line-number:no,interval=5 text +set grep-view = file-name:no line-number:yes,interval=1 text +set main-view = line-number:no,interval=5 id:no date:default author:full commit-title:yes,graph,refs,overflow=no +set refs-view = line-number:no id:no date:default author:full ref commit-title +set stash-view = line-number:no,interval=5 id:no date:default author:full commit-title +set status-view = line-number:no,interval=5 status:short file-name +set tree-view = line-number:no,interval=5 mode author:full file-size date:default id:no file-name + +# Pager based views +set pager-view = line-number:no,interval=5 text +set stage-view = line-number:no,interval=5 text +set log-view = line-number:no,interval=5 text +set blob-view = line-number:no,interval=5 text +set diff-view = line-number:no,interval=5 text:yes,commit-title-overflow=no + +# UI display settings +set show-changes = yes # Show changes commits in the main view? +set wrap-lines = no # Wrap long lines in pager views? +set tab-size = 8 # Number of spaces to use when expanding tabs +set line-graphics = default # Enum: ascii, default, utf-8 + +# Format reference names based on type. +# - head : The current HEAD. +# - tag : A signed tag. +# - local-tag : An unsigned tag. +# - remote : A remote. +# - tracked-remote : The remote tracked by current HEAD. +# - replace : A replaced reference. +# - branch : Any other reference. +# If no format is defined for `local-tag` then the one for `tag` is used. +# Similarly, `remote` is used if no `tracked-remote` format exists. +# Prefix with `hide:` to not show that reference type, e.g. `hide:remote`. +# Expects a space separated list of format strings. +set reference-format = [branch] {remote} ~replace~ + +# Settings controlling how content is read from Git +set commit-order = auto # Enum: auto, default, topo, date, reverse (main) +set status-show-untracked-dirs = yes # Show files in untracked directories? (status) +set status-show-untracked-files = yes # Show untracked files? +set ignore-space = no # Enum: no, all, some, at-eol (diff) +set show-notes = yes # When non-bool passed as `--show-notes=...` (diff) +#set diff-context = 3 # Number of lines to show around diff changes (diff) +#set diff-options = -C # User-defined options for `tig show` (git-diff) +#set diff-highlight = true # String (or bool): Path to diff-highlight script, + # defaults to `diff-highlight`. +#set blame-options = -C -C -C # User-defined options for `tig blame` (git-blame) +#set log-options = --pretty=raw # User-defined options for `tig log` (git-log) +#set main-options = -n 1000 # User-defined options for `tig` (git-log) +#set mailmap = yes # Use .mailmap to show canonical name and email address + +# Misc +set refresh-mode = auto # Enum: manual, auto, after-command, periodic +set refresh-interval = 10 # Interval in seconds between refreshes +set ignore-case = no # Enum: no, yes, smart-case + # Ignore case when searching? Smart-case option will +set wrap-search = yes # Wrap around to top/bottom of view when searching +set focus-child = yes # Move focus to child view when opened? +set horizontal-scroll = 50% # Number of columns to scroll as % of width +set split-view-height = 67% # Height of the bottom view for horizontal splits +set vertical-split = auto # Enum: horizontal, vertical, auto; Use auto to + # switch to horizontal split when width allows it +set split-view-width = 50% # Width of right-most view for vertical splits +set editor-line-number = yes # Automatically pass line number to editor? Used + # for opening file at specific line e.g. from a diff +set mouse = no # Enable mouse support? +set mouse-scroll = 3 # Number of lines to scroll via the mouse + +# User-defined commands +# --------------------- +# These commands allow to run shell commands directly from within Tig. +# Unless otherwise specified, commands are run in the foreground with +# their console output shown (as if '!' was specified). When multiple +# command options are specified their behavior are combined, e.g. "? enter # Enter and open selected entry +bind generic back # Go back to the previous view state +bind generic next # Move to next +bind generic next +bind generic J next +bind generic previous # Move to previous +bind generic previous +bind generic K previous +bind generic , parent # Move to parent +bind generic view-next # Move focus to the next view +bind generic R refresh # Reload and refresh view +bind generic refresh +bind generic O maximize # Maximize the current view +bind generic q view-close # Close the current view +bind generic Q quit # Close all views and quit + +# View specific +bind status u status-update # Stage/unstage changes in file +bind status ! status-revert # Revert changes in file +bind status M status-merge # Open git-mergetool(1) +#bind status ??? :toggle status # Show short or long status labels +bind stage u status-update # Stage/unstage current diff (c)hunk +bind stage 1 stage-update-line # Stage/unstage current line +bind stage ! status-revert # Revert current diff (c)hunk +bind stage \ stage-split-chunk # Split current diff (c)hunk +bind stage @ :/^@@ # Jump to next (c)hunk +bind stage [ :toggle diff-context -1 # Decrease the diff context +bind stage ] :toggle diff-context +1 # Increase the diff context +bind diff @ :/^@@ # Jump to next (c)hunk +bind diff [ :toggle diff-context -1 +bind diff ] :toggle diff-context +1 +bind main G :toggle commit-title-graph # Toggle revision graph visualization +bind main F :toggle commit-title-refs # Toggle reference display (tags/branches) + +# Cursor navigation +bind generic j move-down +bind generic k move-up +bind generic move-half-page-down +bind generic move-half-page-up +bind generic move-page-down +bind generic move-page-down +bind generic move-page-up +bind generic - move-page-up +bind generic move-first-line +bind generic move-last-line + +# Scrolling +bind generic | scroll-first-col +bind generic scroll-left +bind generic scroll-right +bind generic scroll-line-up +bind generic scroll-line-up +bind generic scroll-line-down +bind generic scroll-line-down +bind generic scroll-page-up +bind generic scroll-page-down + +# Searching +bind generic / search +bind generic ? search-back +bind generic n find-next +bind generic N find-prev +# Navigation keys used while searching +bind search find-next +bind search find-next +bind search find-next +bind search find-prev +bind search find-prev +bind search find-prev + +# Option manipulation +bind generic o options # Open the options menu +# Bindings for toggling settings +bind generic I :toggle sort-order # Toggle ascending/descending sort order +bind generic i :toggle sort-field # Toggle field to sort by +bind generic :toggle line-number # Toggle line numbers +bind generic D :toggle date # Toggle date display +bind generic A :toggle author # Toggle author display +bind generic ~ :toggle line-graphics # Toggle (line) graphics mode +bind generic F :toggle file-name # Toggle file name display +# bind generic ??? :toogle show-changes # Toggle local changes display in the main view +bind generic W :toggle ignore-space # Toggle ignoring whitespace in diffs +# bind generic ? :toggle commit-order # Toggle commit ordering +bind generic X :toggle id # Toggle commit ID display +bind generic $ :toggle commit-title-overflow + # Toggle highlighting of commit title overflow +# bind generic ??? :toggle file-size # Toggle file size format +# bind generic ??? :toggle status # Toggle status display +# bind generic ??? :toggle status-untracked-dirs + # Toggle display of file in untracked directories +# bind generic ??? :toggle vertical-split # Toggle vertical split +bind generic % :toggle file-filter + +# Misc +bind generic e edit # Open in editor +bind generic : prompt # Open the prompt +bind generic screen-redraw # Redraw the screen +bind generic z stop-loading # Stop all loading views +bind generic v show-version # Show Tig version + +# Colors +# ------ + +# The colors in the UI can be customized. In addition to the colors used +# for the UI you can also define new colors to use in the pager, blob, +# diff, and stage views by placing the text to match for in quotes. +# +# Prefix the name of a view to set a color only for that view, e.g. +# +# color grep.file blue default +# +# As an example, this setting will to color Signed-off-by lines with a +# yellow foreground color and use the default background color. +# +# color " Signed-off-by" yellow default +# +# Note the four leading spaces in the string to match. This is because +# Git automatically indents commit messages by four spaces. + +color "---" blue default +color "diff --" yellow default +color "--- " yellow default +color "+++ " yellow default +color "@@" magenta default +color "+" green default +color " +" green default +color "-" red default +color " -" red default +color "index " blue default +color "old file mode " yellow default +color "new file mode " yellow default +color "deleted file mode " yellow default +color "copy from " yellow default +color "copy to " yellow default +color "rename from " yellow default +color "rename to " yellow default +color "similarity " yellow default +color "dissimilarity " yellow default +color "diff-tree " blue default +color "Author: " cyan default +color "Commit: " magenta default +color "Tagger: " magenta default +color "Merge: " blue default +color "Date: " yellow default +color "AuthorDate: " yellow default +color "CommitDate: " yellow default +color "TaggerDate: " yellow default +color "Refs: " red default +color "Reflog: " red default +color "Reflog message: " yellow default +color "stash@{" magenta default +color "commit " green default +color "parent " blue default +color "tree " blue default +color "author " green default +color "committer " magenta default +color " Signed-off-by" yellow default +color " Acked-by" yellow default +color " Tested-by" yellow default +color " Reviewed-by" yellow default +color default default default normal +color cursor white green bold +color status green default +color delimiter magenta default +color date blue default +color mode cyan default +color id magenta default +color overflow red default +color header yellow default +color section cyan default +color directory yellow default +color file default default +color grep.file blue default +color file-size default default +color line-number cyan default +color title-blur white blue +color title-focus white blue bold +color main-commit default default +color main-tag magenta default bold +color main-local-tag magenta default +color main-remote yellow default +color main-replace cyan default +color main-tracked yellow default bold +color main-ref cyan default +color main-head cyan default bold +color stat-none default default +color stat-staged magenta default +color stat-unstaged magenta default +color stat-untracked magenta default +color help-group blue default +color help-action yellow default +color diff-stat blue default +color palette-0 magenta default +color palette-1 yellow default +color palette-2 cyan default +color palette-3 green default +color palette-4 default default +color palette-5 white default +color palette-6 red default +color palette-7 magenta default bold +color palette-8 yellow default bold +color palette-9 cyan default bold +color palette-10 green default bold +color palette-11 default default bold +color palette-12 white default bold +color palette-13 red default bold +color graph-commit blue default +color search-result black yellow + +# Mappings for colors read from git configuration. +# Set to "no" to disable. +set git-colors = \ + branch.current=main-head \ + branch.local=main-ref \ + branch.plain=main-ref \ + branch.remote=main-remote \ + \ + diff.meta=diff-header \ + diff.meta=diff-index \ + diff.meta=diff-oldmode \ + diff.meta=diff-newmode \ + diff.frag=diff-chunk \ + diff.old=diff-del \ + diff.new=diff-add \ + \ + grep.filename=grep.file \ + grep.linenumber=grep.line-number \ + grep.separator=grep.delimiter \ + \ + status.branch=status.header \ + status.added=stat-staged \ + status.updated=stat-staged \ + status.changed=stat-unstaged \ + status.untracked=stat-untracked \ No newline at end of file From c6d98d85afb481b02677408372da0d9f98a8fbd5 Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Mon, 23 Sep 2024 12:33:31 +0900 Subject: [PATCH 11/28] vim: add vimrc --- config/vim/vimrc | 117 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 config/vim/vimrc diff --git a/config/vim/vimrc b/config/vim/vimrc new file mode 100644 index 0000000..1bffd89 --- /dev/null +++ b/config/vim/vimrc @@ -0,0 +1,117 @@ +syntax on +filetype plugin on + +""" Options """ +set fenc=utf-8 +set hidden +set autoread +set showcmd +set signcolumn=yes +" Indentation +set autoindent +set tabstop=4 +set softtabstop=4 +set shiftwidth=4 +set shiftround +set smarttab +set list +set listchars=tab:>-,trail:-,extends:>,precedes:<,nbsp:% +" Views +set title +set number +set relativenumber +set cursorline +set showmatch +set laststatus=2 +set statusline=%F%m\ %<[%{&fenc!=''?&fenc:&enc}]\ [%Y]\ [ln:%l,col:%v] +set showtabline=2 +" Controls +set mouse=a +set whichwrap=b,s,h,l,<,>,[,],~ +" Search +set hlsearch +set incsearch +set smartcase +set ignorecase +" Split +set splitbelow +set splitright +" Backspace +set backspace=indent,eol,start +" Menu +set wildmenu +set wildmode=longest:full,full + +" .viminfo +set viminfo+=n~/.local/share/vim/viminfo + +""" Keymaps """ +nnoremap ; : +nnoremap j gj +nnoremap k gk +nnoremap gj +nnoremap gk +nnoremap ^ +nnoremap $ +inoremap jj +vnoremap ^ +vnoremap $ + +""" terminal """ +command! -nargs=* T botright term + +""" Packages """ +let g:Packages = {} +let g:PackageDir = $HOME . '/.vim/pack/plugins' + +function! Package(repo, ...) + let arg = get(a:, 1, {}) + let base = has_key(arg, 'base') ? arg.base : 'start' + + let url = 'https://github.com/' . a:repo + let path = g:PackageDir . '/' . base . '/' . substitute(a:repo, '/', '--', 'g') + + let g:Packages[a:repo] = { + \ 'path': path, + \ 'url': url, + \ 'arg': arg, + \ } + + if isdirectory(path) + return + endif + + echo 'install ' . a:repo + echo system('git clone ' . shellescape(url) . ' ' . shellescape(path)) + + if has_key(arg, 'build') + echo system('cd ' . shellescape(path) . ';' . arg.build) + endif +endfunction + +function! PackageUpdate() + for repo in keys(g:Packages) + let path = g:Packages[repo].path + + echo 'update ' . repo + echo system('git -C ' . shellescape(path) . ' pull') + endfor +endfunction + +command! PackageUpdate call PackageUpdate() + +" Editorconfig +call Package('editorconfig/editorconfig-vim') + +" Colorschemes +call Package('tomasiser/vim-code-dark') + +colorscheme codedark + +" fzf.vim +call Package('junegunn/fzf', { 'build': 'bash install --bin' }) +call Package('junegunn/fzf.vim') + +nnoremap // :BLines +nnoremap :Lines +nnoremap :Files \ No newline at end of file From 923d6d04e8094e7c84f1b273913e35162ace8b79 Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sat, 28 Sep 2024 17:31:55 +0900 Subject: [PATCH 12/28] update: update readme --- README.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 874fc9e..166c8d0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ -## my_dotfiles -- My dotfiles -- https://wiki.archlinux.org/title/XDG_Base_Directory +# dotfiles + +- My dotfiles: config files and build scripts. +- I follow the design specified by [XDG_Base_Directory](https://wiki.archlinux.org/title/XDG_Base_Directory). + +## Requires + +- [sheldon](https://github.com/rossmacarthur/sheldon) + - Shell plugin manager. + - Install sheldon using one of the install options you prefer. +- [Deno](https://deno.com/) + - [zeno.zsh](https://github.com/yuki-yano/zeno.zsh) uses deno. + - Install deno using one of the install options you prefer. From 03d9011bf3747fc7000406345da7389a97914e61 Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sat, 28 Sep 2024 17:42:35 +0900 Subject: [PATCH 13/28] rust: add CARGO_HOME and RUSTUP_HOME --- config/zsh/.zshenv | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/zsh/.zshenv b/config/zsh/.zshenv index 696663f..b64ddf2 100644 --- a/config/zsh/.zshenv +++ b/config/zsh/.zshenv @@ -7,5 +7,9 @@ export XDG_CACHE_HOME=$HOME/.cache # ZDOTDIR export ZDOTDIR=$XDG_CONFIG_HOME/zsh +# Rust +export RUSTUP_HOME="$XDG_DATA_HOME/rustup" +export CARGO_HOME="$XDG_DATA_HOME/cargo" + ### sheldon ### export SHELDON_CONFIG_DIR="$ZDOTDIR" \ No newline at end of file From 623a4e80f3fd861b3c3a2b3b5d82bef452b8a5ba Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sat, 28 Sep 2024 17:44:17 +0900 Subject: [PATCH 14/28] minor: format documents --- config/zsh/.zshenv | 2 +- config/zsh/.zshrc | 1 + config/zsh/conda.zsh | 4 ++-- config/zsh/lazy.zsh | 20 ++++++++++---------- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/config/zsh/.zshenv b/config/zsh/.zshenv index b64ddf2..c51c0cd 100644 --- a/config/zsh/.zshenv +++ b/config/zsh/.zshenv @@ -12,4 +12,4 @@ export RUSTUP_HOME="$XDG_DATA_HOME/rustup" export CARGO_HOME="$XDG_DATA_HOME/cargo" ### sheldon ### -export SHELDON_CONFIG_DIR="$ZDOTDIR" \ No newline at end of file +export SHELDON_CONFIG_DIR="$ZDOTDIR" diff --git a/config/zsh/.zshrc b/config/zsh/.zshrc index 41af348..529b44a 100644 --- a/config/zsh/.zshrc +++ b/config/zsh/.zshrc @@ -22,6 +22,7 @@ path=( path=( "$HOME/.local/bin"(N-/) + "$CARGO_HOME/bin"(N-/) "$DENO_INSTALL/bin"(N-/) "$path[@]" ) diff --git a/config/zsh/conda.zsh b/config/zsh/conda.zsh index 36ce3d5..61878a9 100644 --- a/config/zsh/conda.zsh +++ b/config/zsh/conda.zsh @@ -1,7 +1,7 @@ # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! if [ -d "$HOME/miniconda3/bin" ]; then - __conda_setup="$("$HOME/miniconda3/bin/conda" 'shell.zsh' 'hook' 2> /dev/null)" + __conda_setup="$("$HOME/miniconda3/bin/conda" 'shell.zsh' 'hook' 2>/dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else @@ -15,4 +15,4 @@ if [ -d "$HOME/miniconda3/bin" ]; then else echo "conda is not installed, skipping the procedure" fi -# <<< conda initialize <<< \ No newline at end of file +# <<< conda initialize <<< diff --git a/config/zsh/lazy.zsh b/config/zsh/lazy.zsh index 3d4a28c..a268781 100644 --- a/config/zsh/lazy.zsh +++ b/config/zsh/lazy.zsh @@ -1,11 +1,11 @@ # recommended scripts for homebrew case "$OSTYPE" in - darwin*) - export HOMEBREW_PREFIX="/opt/homebrew" - export HOMEBREW_CELLAR="/opt/homebrew/Cellar" - export HOMEBREW_REPOSITORY="/opt/homebrew" - export MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:" - export INFOPATH="/opt/homebrew/share/info:${INFOPATH:-}" +darwin*) + export HOMEBREW_PREFIX="/opt/homebrew" + export HOMEBREW_CELLAR="/opt/homebrew/Cellar" + export HOMEBREW_REPOSITORY="/opt/homebrew" + export MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:" + export INFOPATH="/opt/homebrew/share/info:${INFOPATH:-}" ;; esac @@ -41,7 +41,7 @@ zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # 塗りつぶし zstyle ':completion:*' menu select ## 補完候補を一覧表示したとき、Tabや矢印で選択できるようにする -zstyle ':completion:*:default' menu select=1 +zstyle ':completion:*:default' menu select=1 # ../ の後は今いるディレクトリを補完しない zstyle ':completion:*' ignore-parents parent pwd .. setopt correct @@ -49,6 +49,6 @@ setopt no_beep setopt AUTO_PARAM_KEYS ### key-bindings -bindkey "^A" beginning-of-line # C-a -bindkey "^E" end-of-line # C-e -bindkey "^K" kill-line # C-k +bindkey "^A" beginning-of-line # C-a +bindkey "^E" end-of-line # C-e +bindkey "^K" kill-line # C-k From 53a3b6a707b3b8d50a463a026c2857543b135ca5 Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sun, 29 Sep 2024 02:00:28 +0900 Subject: [PATCH 15/28] minor: update gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 32bd97c..5be8dcf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,12 @@ -.lsp-session-v1 +### emacs ### elpa/ init.elc snippets/ backup/ request/ var + +### iterm ### config/iterm2/AppSupport ### Local settings ### From 1d57f7f79bfa767cc55f006391562781387aa11e Mon Sep 17 00:00:00 2001 From: Shun Makino <77489075+ShuN6211@users.noreply.github.com> Date: Sun, 29 Sep 2024 02:01:41 +0900 Subject: [PATCH 16/28] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 166c8d0..b905b16 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # dotfiles - My dotfiles: config files and build scripts. -- I follow the design specified by [XDG_Base_Directory](https://wiki.archlinux.org/title/XDG_Base_Directory). +- I follow the design specified in [XDG_Base_Directory](https://wiki.archlinux.org/title/XDG_Base_Directory). ## Requires From a9531be3b2683eff6c2e028fc875f799fe80e13e Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sun, 29 Sep 2024 02:12:56 +0900 Subject: [PATCH 17/28] emacs: add editorconfig --- config/emacs/init.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/emacs/init.el b/config/emacs/init.el index 5eea968..9245922 100644 --- a/config/emacs/init.el +++ b/config/emacs/init.el @@ -91,7 +91,13 @@ (set-default-coding-systems 'utf-8) (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) -(set-buffer-file-coding-system 'utf-8)) + (set-buffer-file-coding-system 'utf-8)) + +(leaf editorconfig + :ensure t + :require t + :config + (editorconfig-mode 1)) ;; auto-convert (leaf autorevert From 84bea01143ef09fee2fa45fe5408f3f965583229 Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sun, 29 Sep 2024 02:15:24 +0900 Subject: [PATCH 18/28] emacs: remove lsp settings --- config/emacs/init.el | 48 -------------------------------------------- 1 file changed, 48 deletions(-) diff --git a/config/emacs/init.el b/config/emacs/init.el index 9245922..c6a40c1 100644 --- a/config/emacs/init.el +++ b/config/emacs/init.el @@ -266,54 +266,6 @@ (c++-mode-hook . ((c-set-style "bsd") (setq c-basic-offset 4)))) -;; lsp - -(leaf lsp-mode - :doc "LSP mode" - :tag "languages" "emacs>=26.1" - :url "https://github.com/emacs-lsp/lsp-mode" - :added "2022-07-22" - :emacs>= 26.1 - :ensure t - :commands (lsp lsp-deferred) - :custom ((lsp-keymap-prefix . "C-c l")) - :hook (lsp-mode-hook . lsp-headerline-breadcrumb-mode) - ) - -(leaf lsp-ui - :doc "UI modules for lsp-mode" - :req "emacs-26.1" "dash-2.18.0" "lsp-mode-6.0" "markdown-mode-2.3" - :tag "tools" "languages" "emacs>=26.1" - :url "https://github.com/emacs-lsp/lsp-ui" - :added "2022-11-19" - :emacs>= 26.1 - :ensure t - :custom ((lsp-ui-doc-enable . t) - (lsp-ui-doc-position . 'at-point) - (lsp-ui-doc-header . t) - (lsp-ui-doc-include-signature . t) - (lsp-ui-doc-max-width . 150) - (lsp-ui-doc-max-height . 30) - (lsp-ui-doc-use-childframe . nil) - (lsp-ui-doc-use-webkit . nil) - (lsp-ui-peek-enable . t) - (lsp-ui-peek-peek-height . 20) - (lsp-ui-peek-list-width . 50)) - ) - -(leaf lsp-pyright - :doc "Python LSP client using Pyright" - :req "emacs-26.1" "lsp-mode-7.0" "dash-2.18.0" "ht-2.0" - :tag "lsp" "tools" "languages" "emacs>=26.1" - :url "https://github.com/emacs-lsp/lsp-pyright" - :added "2022-07-22" - :emacs>= 26.1 - :ensure t - :hook (python-mode-hook . (lambda () - (require 'lsp-pyright) - (lsp))) ; or lsp-deferred - ) - ;; python (leaf python-mode From 1783b989283c0b81da51358bd5060f09f2b55561 Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sun, 29 Sep 2024 02:16:42 +0900 Subject: [PATCH 19/28] emacs: remove jupyter for emacs --- config/emacs/init.el | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/config/emacs/init.el b/config/emacs/init.el index c6a40c1..0f8a4b0 100644 --- a/config/emacs/init.el +++ b/config/emacs/init.el @@ -295,18 +295,6 @@ :custom ((blacken-line-length . 119) ; 1行の流さを119文字まで許可 (blacken-skip-string-normalization . t))) ; 文字リテラルで '' を""に変えない. -;; jupyter -(leaf ein - :doc "Emacs IPython Notebook" - :req "emacs-25" "websocket-1.12" "anaphora-1.0.4" "request-0.3.3" "deferred-0.5" "polymode-0.2.2" "dash-2.13.0" "with-editor-0.-1" - :tag "reproducible research" "literate programming" "jupyter" "emacs>=25" - :url "https://github.com/dickmao/emacs-ipython-notebook" - :added "2022-11-19" - :emacs>= 25 - :custom (ein:polymode . t) - :ensure t - ) - ;; isort (leaf py-isort :ensure t) From 1a803d5df8eba41971a7451bc58f92583554d8e4 Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sun, 29 Sep 2024 03:56:10 +0900 Subject: [PATCH 20/28] emacs: update init.el --- config/emacs/.gitignore | 8 ++ config/emacs/init.el | 174 +++++++++++----------------------------- 2 files changed, 56 insertions(+), 126 deletions(-) create mode 100644 config/emacs/.gitignore diff --git a/config/emacs/.gitignore b/config/emacs/.gitignore new file mode 100644 index 0000000..98c93d6 --- /dev/null +++ b/config/emacs/.gitignore @@ -0,0 +1,8 @@ +/backup +/eln-cache +/elpa +/savehist +*.elc +/custom.el +/projects +/transient \ No newline at end of file diff --git a/config/emacs/init.el b/config/emacs/init.el index 0f8a4b0..8fc24a7 100644 --- a/config/emacs/init.el +++ b/config/emacs/init.el @@ -1,97 +1,67 @@ - -;; download leaf -;; (eval-and-compile (customize-set-variable - 'package-archives '(("org" . "https://orgmode.org/elpa/") - ("melpa" . "https://melpa.org/packages/") - ("gnu" . "https://elpa.gnu.org/packages/"))) + 'package-archives '(("gnu" . "https://elpa.gnu.org/packages/") + ("melpa" . "https://melpa.org/packages/"))) (package-initialize) - (unless (package-installed-p 'leaf) - (package-refresh-contents) - (package-install 'leaf)) + (use-package leaf :ensure t) (leaf leaf-keywords :ensure t :init - ;; optional packages if you want to use :hydra, :el-get, :blackout,,, - (leaf hydra :ensure t) - (leaf el-get :ensure t) (leaf blackout :ensure t) - :config - ;; initialize leaf-keywords.el (leaf-keywords-init))) -;; -;; now you can use leaf - -;;;; leaf-convert, tree, macrostep -(leaf leaf - :config - (leaf leaf-convert :ensure t) - (leaf leaf-tree - :ensure t - :custom ((imenu-list-size . 30) - (imenu-list-position . 'left)))) - -(leaf macrostep - :ensure t - :bind (("C-c e" . macrostep-expand))) +(leaf leaf-convert + :doc "Convert many format to leaf format" + :ensure t) -;; 2重管理予防 (leaf cus-edit :doc "tools for customizing Emacs and Lisp packages" - :tag "builtin" "faces" "help" :custom `((custom-file . ,(locate-user-emacs-file "custom.el")))) -;; 基本的な設定 -;; emacs テーマ選択 -(load-theme 'manoj-dark t) - -;; y or n -(fset 'yes-or-no-p 'y-or-n-p) - -;; clip board -(setq select-enable-clipboard t) - -;; 括弧の補完 -;;(electric-pair-mode t) - -;; リージョンのハイライト -(transient-mark-mode t) - -;; 現在位置列数表示 -(column-number-mode t) - -;; line number の表示 -(global-linum-mode t) - -;; line number を分かりやすくする -(set-face-attribute 'linum nil - :foreground "#a9a9a9" - :background "#404040" - :height 0.9) -;; スタートアップメッセージを表示させない -(setq inhibit-startup-message t) - -;; スクロールは 1 行ごと -(setq mouse-wheel-scroll-amount '(1 ((shift) . 5))) - -;; スクロールの加速をやめる -(setq mouse-wheel-progressive-speed nil) - -;; 大文字・小文字を区別しない -(setq case-fold-search t) - -;; utf-8 -(leaf leaf-convert +(leaf cus-start + :doc "define customization properties of builtins" + :preface + (defun c/redraw-frame nil + (interactive) + (redraw-frame)) + + :bind (("M-ESC ESC" . c/redraw-frame)) + :custom '((user-full-name . "Shun Makino") + (user-login-name . "ShuN") + (create-lockfiles . nil) + (tab-width . 4) + (debug-on-error . t) + (init-file-debug . t) + (frame-resize-pixelwise . t) + (enable-recursive-minibuffers . t) + (history-length . 1000) + (transient-mark-mode . t) + (history-delete-duplicates . t) + (scroll-preserve-screen-position . t) + (scroll-conservatively . 100) + (mouse-wheel-scroll-amount . '(1 ((control) . 5))) + (select-enable-clipboard . t) + (case-fold-search . t) + (ring-bell-function . 'ignore) + (text-quoting-style . 'straight) + (mouse-wheel-progressive-speed . nil) + (truncate-lines . t) + (inhibit-startup-message . t) + (use-dialog-box . nil) + (use-file-dialog . nil) + (menu-bar-mode . t) + (tool-bar-mode . nil) + (scroll-bar-mode . nil) + (global-display-line-numbers-mode . t ) + (indent-tabs-mode . nil)) :config - (set-language-environment "japanese") - (set-default-coding-systems 'utf-8) - (set-terminal-coding-system 'utf-8) - (set-keyboard-coding-system 'utf-8) - (set-buffer-file-coding-system 'utf-8)) + (defalias 'yes-or-no-p 'y-or-n-p) + (keyboard-translate ?\C-h ?\C-?)) + +;; theme +(load-theme 'manoj-dark t) (leaf editorconfig :ensure t @@ -207,7 +177,7 @@ :custom ((ivy-prescient-retain-classic-highlighting . t)) :global-minor-mode t) -;; flycheck 構文チェッカー +;; flycheck (leaf flycheck :doc "On-the-fly syntax checking" :req "dash-2.12.1" "pkg-info-0.4" "let-alist-1.0.4" "seq-1.11" "emacs-24.3" @@ -266,60 +236,12 @@ (c++-mode-hook . ((c-set-style "bsd") (setq c-basic-offset 4)))) -;; python - -(leaf python-mode - :doc "Python major mode" - :tag "oop" "python" "processes" "languages" - :url "https://gitlab.com/groups/python-mode-devs" - :added "2022-07-12" - :ensure t - :custom (python-indent-guess-indent-offset . nil)) - -;; smartparens 括弧の補完など. -(leaf smartparens - :ensure t - :require smartparens-config - :custom ((electric-pair-mode . nil))) ; electirc-pair-modeを無効化. - -;; rainbow-delimiters 括弧の強調表示 -(leaf rainbow-delimiters - :ensure t - :hook - ((prog-mode-hook . rainbow-delimiters-mode))) - - -;; formatter, blacken -(leaf blacken - :ensure t - :custom ((blacken-line-length . 119) ; 1行の流さを119文字まで許可 - (blacken-skip-string-normalization . t))) ; 文字リテラルで '' を""に変えない. - -;; isort -(leaf py-isort :ensure t) - -(leaf highlight-indent-guides - :ensure t - :blackout t - :hook (((prog-mode-hook yaml-mode-hook) . highlight-indent-guides-mode)) - :custom ( - (highlight-indent-guides-method . 'character) - (highlight-indent-guides-auto-enabled . t) - (highlight-indent-guides-responsive . t) - (highlight-indent-guides-character . ?\|))) - ;; コードの先頭, 末尾への移動, 行頭, 行末への移動. (leaf mwim :ensure t :bind (("C-a" . mwim-beginning-of-code-or-line) ("C-e" . mwim-end-of-code-or-line))) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(default ((t (:inherit nil :stipple nil :background "black" :foreground "WhiteSmoke" :inverse-video nil :box nil :strike-through nil :extend nil :overline nil :underline nil :slant normal :weight normal :height 160 :width normal :foundry "nil" :family "Cica"))))) ;; end of init.el (provide 'init) From 3cd18cc5144e4b4039c3646c442d687324e7a9ac Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sun, 29 Sep 2024 03:58:38 +0900 Subject: [PATCH 21/28] minor: update gitignore --- .gitignore | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.gitignore b/.gitignore index 5be8dcf..4a037e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,3 @@ -### emacs ### -elpa/ -init.elc -snippets/ -backup/ -request/ -var - ### iterm ### config/iterm2/AppSupport From 04a9d4f38e1c527cdf913bb85d534f80c8687098 Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sun, 29 Sep 2024 03:59:25 +0900 Subject: [PATCH 22/28] minor: update gitignore --- config/emacs/.gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/emacs/.gitignore b/config/emacs/.gitignore index 98c93d6..99406e8 100644 --- a/config/emacs/.gitignore +++ b/config/emacs/.gitignore @@ -5,4 +5,6 @@ *.elc /custom.el /projects -/transient \ No newline at end of file +/transient +/var +/auto-save-list \ No newline at end of file From eb0af49bdd2b01392169075b7acef44cf919a0b6 Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sun, 29 Sep 2024 04:28:16 +0900 Subject: [PATCH 23/28] zsh: add hook for zsh-auto-suggestion --- config/zsh/plugins.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/zsh/plugins.toml b/config/zsh/plugins.toml index 803be25..c644b03 100644 --- a/config/zsh/plugins.toml +++ b/config/zsh/plugins.toml @@ -43,6 +43,10 @@ apply = ["fpath"] [plugins.zsh-autosuggestions] github = "zsh-users/zsh-autosuggestions" +hooks.post = """ +ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=244" +ZSH_AUTOSUGGEST_CLEAR_WIDGETS=(zeno-auto-snippet-and-accept-line $ZSH_AUTOSUGGEST_CLEAR_WIDGETS) +""" [plugins.fast-syntax-highlighting] github = "zdharma-continuum/fast-syntax-highlighting" From df9cf686fe3d9ce4e6f139cbb2b03a29c5ecd850 Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sun, 29 Sep 2024 05:49:07 +0900 Subject: [PATCH 24/28] bugfix: clear shell check1091 --- scripts/setup-sheldon.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setup-sheldon.bash b/scripts/setup-sheldon.bash index ac83d0e..e7bedbb 100644 --- a/scripts/setup-sheldon.bash +++ b/scripts/setup-sheldon.bash @@ -3,7 +3,7 @@ set -x # shellcheck source=./scripts/common.bash source "$(dirname "$0")/common.bash" -if [ ! -e "$CARGO_HOME/env" ]; then +if type $CARGO_HOME/bin/cargo >/dev/null; then echo "Installing Rust..." curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | /bin/sh -s -- -y --no-modify-path else From 3a1878575a5e4c2d95795094675d066b07e4f393 Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sun, 29 Sep 2024 05:53:58 +0900 Subject: [PATCH 25/28] bugfix: clear shell check1091 --- scripts/setup-sheldon.bash | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/setup-sheldon.bash b/scripts/setup-sheldon.bash index e7bedbb..908db72 100644 --- a/scripts/setup-sheldon.bash +++ b/scripts/setup-sheldon.bash @@ -3,12 +3,11 @@ set -x # shellcheck source=./scripts/common.bash source "$(dirname "$0")/common.bash" -if type $CARGO_HOME/bin/cargo >/dev/null; then +if type "$CARGO_HOME/bin/cargo" >/dev/null; then echo "Installing Rust..." curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | /bin/sh -s -- -y --no-modify-path else echo "Rust is already installed, skipping the procedure" fi -. "$CARGO_HOME/env" -cargo install sheldon +"$CARGO_HOME/bin/cargo" install sheldon From 27f49849b41e175a80680c02e751e4d261cab9db Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sun, 29 Sep 2024 05:55:28 +0900 Subject: [PATCH 26/28] bugfix: fix typo --- scripts/{setup-zeno.bash => setup-deno.bash} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{setup-zeno.bash => setup-deno.bash} (100%) diff --git a/scripts/setup-zeno.bash b/scripts/setup-deno.bash similarity index 100% rename from scripts/setup-zeno.bash rename to scripts/setup-deno.bash From 9b73d07e13bdbe4ba999ee324d17f80b43b5da4e Mon Sep 17 00:00:00 2001 From: Shun Makino Date: Sun, 29 Sep 2024 06:41:22 +0900 Subject: [PATCH 27/28] bugfix: fix if segment --- scripts/setup-sheldon.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/setup-sheldon.bash b/scripts/setup-sheldon.bash index 908db72..51cfc0c 100644 --- a/scripts/setup-sheldon.bash +++ b/scripts/setup-sheldon.bash @@ -4,10 +4,10 @@ set -x source "$(dirname "$0")/common.bash" if type "$CARGO_HOME/bin/cargo" >/dev/null; then + echo "Rust is already installed, skipping the procedure" +else echo "Installing Rust..." curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | /bin/sh -s -- -y --no-modify-path -else - echo "Rust is already installed, skipping the procedure" fi "$CARGO_HOME/bin/cargo" install sheldon From 9d80939fb6a945e477d410d519556095d05cbb36 Mon Sep 17 00:00:00 2001 From: Shun Makino <77489075+ShuN6211@users.noreply.github.com> Date: Sun, 29 Sep 2024 06:54:28 +0900 Subject: [PATCH 28/28] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index b905b16..dd10a6c 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,8 @@ - [Deno](https://deno.com/) - [zeno.zsh](https://github.com/yuki-yano/zeno.zsh) uses deno. - Install deno using one of the install options you prefer. + +## Install +```shell +curl -sL https://raw.githubusercontent.com/ShuN6211/dotfiles/refs/heads/main/install.sh | sh +```