diff --git a/.gitignore b/.gitignore index 681f50d..5ce13dd 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ _set_env_*.sh _set_env.sh log cn.sh +__pycache__ diff --git a/fish/config.fish b/fish/config.fish index fc96080..e5388d5 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -1,6 +1,10 @@ - +################################################################# +# option fish_vi_key_bindings + +################################################################# +# basic # 定义一个函数来检查并添加路径到 PATH function add_to_path # 遍历传递给函数的所有参数 @@ -20,55 +24,108 @@ function add_to_path end end -## set environment -# default -set paths_to_check /usr/sbin /usr/local/bin /usr/bin /bin /usr/sbin /sbin /opt/bin /opt/sbin /usr/syno/sbin /usr/syno/bin /usr/local/sbin +function refish + echo "Updating fish configuration..." + source ~/.config/fish/config.fish + echo "Fish configuration updated!" +end + +alias vifish="vim ~/.config/fish/custom.fish" +alias cdfish="cd ~/.config/fish/" + +# set environment +set paths_to_check /usr/sbin /usr/local/bin /usr/bin /bin /usr/sbin /sbin /opt/bin /opt/sbin /usr/syno/sbin /usr/syno/bin /usr/local/sbin $HOME/.local/bin for path in $paths_to_check add_to_path $path end +function sudoo + eval sudo $history[1] +end + +# add my script +add_to_path $HOME/.dotfile/script $HOME/.app00/script + +if test -f ~/.config/fish/custom.fish + source ~/.config/fish/custom.fish +end + +function resetp + set -e http_proxy + set -e https_proxy + set -e ftp_proxy + set -e all_proxy + set -e HTTP_PROXY + set -e HTTPS_PROXY + set -e FTP_PROXY + set -e ALL_PROXY + echo "Proxy environment variables have been reset." + export | grep -i 'proxy' +end + +function showp + export | grep -i 'proxy' +end + + +################################################################# # brew set -gx HOMEBREW_BREW_GIT_REMOTE "https://mirrors.ustc.edu.cn/brew.git" set -gx HOMEBREW_CORE_GIT_REMOTE "https://mirrors.ustc.edu.cn/homebrew-core.git" set -gx HOMEBREW_BOTTLE_DOMAIN "https://mirrors.ustc.edu.cn/homebrew-bottles" +################################################################# # go set -gx GOPATH $HOME/go:$HOME/workrepo/go set -gx GOPROXY "goproxy.cn,direct" set -gx GOSUMDB "sum.golang.google.cn" - add_to_path $HOME/go/bin add_to_path $HOME/.yarn/bin $HOME/.config/yarn/global/node_modules/.bin -# add nvim + +################################################################# +# node +add_to_path /usr/local/node/bin + + +################################################################# +# python +set -gx PYENV_ROOT $HOME/.pyenv +# Pyenv initialization +if command -v pyenv 1>/dev/null 2>&1 + pyenv init - | source +end + +add_to_path $PYENV_ROOT/bin + + +################################################################# +# nvim add_to_path usr/local/nvim/bin /usr/local/osx-64/nvim/bin set -gx EDITOR vim +function gtr + go test -gcflags=all=-l -v -run=$argv +end -# add my script -add_to_path $HOME/.dotfile/script $HOME/.app00/script -# alias +################################################################# # git +# alias alias gitb="git branch --show-current | tr -d '\n' | pbcopy" alias gci="golangci-lint run -c=~/.dotfile/.golangci.yml ./..." alias gmt="go mod tidy" alias gtc="go test -gcflags=all=-l -cover ./..." alias swg="swag init -o docs -g " alias sws="swagger serve -F=swagger" +alias sourceit="source ~/.config/fish/config.fish" -function gtr - go test -gcflags=all=-l -v -run=$argv +################################################################# +# other +function ctl + systemctl $argv end -if test -f ~/.config/fish/custom.fish - source ~/.config/fish/custom.fish -end - - - if status is-interactive # Commands to run in interactive sessions can go here end - - diff --git a/git/.gitconfig b/git/.gitconfig index a77e2fc..602525b 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -1,5 +1,5 @@ [user] - name = Laily + name = laily email = i@laily.net [core] autocrlf = input @@ -49,6 +49,7 @@ # list files which have changed since REVIEW_BASE # (REVIEW_BASE defaults to 'master' in my zshrc) files = !git diff --name-only $(git merge-base HEAD \"$REVIEW_BASE\") + rmsubmodule = "!f(){ git submodule deinit -f \"$1\"; git rm -f \"$1\"; git commit -m \"Removed submodule $1\"; };f" # Same as above, but with a diff stat instead of just names # (better for interactive use) @@ -65,3 +66,7 @@ #git filter-branch -f --env-filter "GIT_AUTHOR_NAME='Laily'; GIT_AUTHOR_EMAIL='i@laily.net'; GIT_COMMITTER_NAME='Laily'; GIT_COMMITTER_EMAIL='i@laily.net';" HEAD [protocol "file"] allow = always + +# https://hyperzsb.io/posts/git-ssl-error/ +[url "git@github.com:"] + insteadOf = https://github.com/ diff --git a/git/.gitignore b/git/.gitignore index ebb64c9..c9915ba 100644 --- a/git/.gitignore +++ b/git/.gitignore @@ -32,6 +32,6 @@ _testmain.go .log go.work go.work.sum -init_test.go -_set_env.sh -_set_env_*.sh +_set_env*.sh +.env* +!.env.example diff --git a/gitremtoe.sh b/gitremtoe.sh new file mode 100644 index 0000000..5ae2809 --- /dev/null +++ b/gitremtoe.sh @@ -0,0 +1 @@ +git remote set-url origin git@github.com:hilaily/.dotfile.git \ No newline at end of file diff --git a/iterm2/com.googlecode.iterm2.plist b/iterm2/com.googlecode.iterm2.plist new file mode 100644 index 0000000..a49a22d --- /dev/null +++ b/iterm2/com.googlecode.iterm2.plist @@ -0,0 +1,1465 @@ + + + + + AllowClipboardAccess + + AlternateMouseScroll + + Default Bookmark Guid + DC379BB9-FF36-4714-A6B6-F8733C90E251 + HapticFeedbackForEsc + + HotkeyMigratedFromSingleToMulti + + New Bookmarks + + + ASCII Anti Aliased + + ASCII Ligatures + + Ambiguous Double Width + + Ansi 0 Color + + Alpha Component + 1 + Blue Component + 0.11764705926179886 + Color Space + sRGB + Green Component + 0.098039217293262482 + Red Component + 0.078431375324726105 + + Ansi 0 Color (Dark) + + Blue Component + 0.25882352941176473 + Color Space + sRGB + Green Component + 0.21176470588235294 + Red Component + 0.027450980392156862 + + Ansi 0 Color (Light) + + Blue Component + 0.25882352941176473 + Color Space + sRGB + Green Component + 0.21176470588235294 + Red Component + 0.027450980392156862 + + Ansi 1 Color + + Alpha Component + 1 + Blue Component + 0.16300037503242493 + Color Space + sRGB + Green Component + 0.23660069704055786 + Red Component + 0.7074432373046875 + + Ansi 1 Color (Dark) + + Blue Component + 0.18431372549019609 + Color Space + sRGB + Green Component + 0.19607843137254902 + Red Component + 0.86274509803921573 + + Ansi 1 Color (Light) + + Blue Component + 0.18431372549019609 + Color Space + sRGB + Green Component + 0.19607843137254902 + Red Component + 0.86274509803921573 + + Ansi 10 Color + + Alpha Component + 1 + Blue Component + 0.56541937589645386 + Color Space + sRGB + Green Component + 0.9042816162109375 + Red Component + 0.3450070321559906 + + Ansi 10 Color (Dark) + + Blue Component + 0.45882352941176469 + Color Space + sRGB + Green Component + 0.43137254901960786 + Red Component + 0.34509803921568627 + + Ansi 10 Color (Light) + + Blue Component + 0.45882352941176469 + Color Space + sRGB + Green Component + 0.43137254901960786 + Red Component + 0.34509803921568627 + + Ansi 11 Color + + Alpha Component + 1 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.8833775520324707 + Red Component + 0.9259033203125 + + Ansi 11 Color (Dark) + + Blue Component + 0.51372549019607838 + Color Space + sRGB + Green Component + 0.4823529411764706 + Red Component + 0.396078431372549 + + Ansi 11 Color (Light) + + Blue Component + 0.51372549019607838 + Color Space + sRGB + Green Component + 0.4823529411764706 + Red Component + 0.396078431372549 + + Ansi 12 Color + + Alpha Component + 1 + Blue Component + 0.9485321044921875 + Color Space + sRGB + Green Component + 0.67044717073440552 + Red Component + 0.65349078178405762 + + Ansi 12 Color (Dark) + + Blue Component + 0.58823529411764708 + Color Space + sRGB + Green Component + 0.58039215686274515 + Red Component + 0.51372549019607838 + + Ansi 12 Color (Light) + + Blue Component + 0.58823529411764708 + Color Space + sRGB + Green Component + 0.58039215686274515 + Red Component + 0.51372549019607838 + + Ansi 13 Color + + Alpha Component + 1 + Blue Component + 0.8821563720703125 + Color Space + sRGB + Green Component + 0.4927266538143158 + Red Component + 0.8821563720703125 + + Ansi 13 Color (Dark) + + Blue Component + 0.7686274509803922 + Color Space + sRGB + Green Component + 0.44313725490196076 + Red Component + 0.42352941176470588 + + Ansi 13 Color (Light) + + Blue Component + 0.7686274509803922 + Color Space + sRGB + Green Component + 0.44313725490196076 + Red Component + 0.42352941176470588 + + Ansi 14 Color + + Alpha Component + 1 + Blue Component + 1 + Color Space + sRGB + Green Component + 0.99263292551040649 + Red Component + 0.37597531080245972 + + Ansi 14 Color (Dark) + + Blue Component + 0.63137254901960782 + Color Space + sRGB + Green Component + 0.63137254901960782 + Red Component + 0.57647058823529407 + + Ansi 14 Color (Light) + + Blue Component + 0.63137254901960782 + Color Space + sRGB + Green Component + 0.63137254901960782 + Red Component + 0.57647058823529407 + + Ansi 15 Color + + Alpha Component + 1 + Blue Component + 1 + Color Space + sRGB + Green Component + 1 + Red Component + 0.99999600648880005 + + Ansi 15 Color (Dark) + + Blue Component + 0.8901960784313725 + Color Space + sRGB + Green Component + 0.96470588235294119 + Red Component + 0.99215686274509807 + + Ansi 15 Color (Light) + + Blue Component + 0.8901960784313725 + Color Space + sRGB + Green Component + 0.96470588235294119 + Red Component + 0.99215686274509807 + + Ansi 2 Color + + Alpha Component + 1 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.7607843279838562 + Red Component + 0.0 + + Ansi 2 Color (Dark) + + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.59999999999999998 + Red Component + 0.52156862745098043 + + Ansi 2 Color (Light) + + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.59999999999999998 + Red Component + 0.52156862745098043 + + Ansi 3 Color + + Alpha Component + 1 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.76959484815597534 + Red Component + 0.78058648109436035 + + Ansi 3 Color (Dark) + + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.53725490196078429 + Red Component + 0.70980392156862748 + + Ansi 3 Color (Light) + + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.53725490196078429 + Red Component + 0.70980392156862748 + + Ansi 4 Color + + Alpha Component + 1 + Blue Component + 0.78216177225112915 + Color Space + sRGB + Green Component + 0.26474356651306152 + Red Component + 0.15404300391674042 + + Ansi 4 Color (Dark) + + Blue Component + 0.82352941176470584 + Color Space + sRGB + Green Component + 0.54509803921568623 + Red Component + 0.14901960784313725 + + Ansi 4 Color (Light) + + Blue Component + 0.82352941176470584 + Color Space + sRGB + Green Component + 0.54509803921568623 + Red Component + 0.14901960784313725 + + Ansi 5 Color + + Alpha Component + 1 + Blue Component + 0.74494361877441406 + Color Space + sRGB + Green Component + 0.24931684136390686 + Red Component + 0.752197265625 + + Ansi 5 Color (Dark) + + Blue Component + 0.50980392156862742 + Color Space + sRGB + Green Component + 0.21176470588235294 + Red Component + 0.82745098039215681 + + Ansi 5 Color (Light) + + Blue Component + 0.50980392156862742 + Color Space + sRGB + Green Component + 0.21176470588235294 + Red Component + 0.82745098039215681 + + Ansi 6 Color + + Alpha Component + 1 + Blue Component + 0.78166204690933228 + Color Space + sRGB + Green Component + 0.77425903081893921 + Red Component + 0.0 + + Ansi 6 Color (Dark) + + Blue Component + 0.59607843137254901 + Color Space + sRGB + Green Component + 0.63137254901960782 + Red Component + 0.16470588235294117 + + Ansi 6 Color (Light) + + Blue Component + 0.59607843137254901 + Color Space + sRGB + Green Component + 0.63137254901960782 + Red Component + 0.16470588235294117 + + Ansi 7 Color + + Alpha Component + 1 + Blue Component + 0.78104829788208008 + Color Space + sRGB + Green Component + 0.78105825185775757 + Red Component + 0.7810397744178772 + + Ansi 7 Color (Dark) + + Blue Component + 0.83529411764705885 + Color Space + sRGB + Green Component + 0.90980392156862744 + Red Component + 0.93333333333333335 + + Ansi 7 Color (Light) + + Blue Component + 0.83529411764705885 + Color Space + sRGB + Green Component + 0.90980392156862744 + Red Component + 0.93333333333333335 + + Ansi 8 Color + + Alpha Component + 1 + Blue Component + 0.4078223705291748 + Color Space + sRGB + Green Component + 0.40782788395881653 + Red Component + 0.40781760215759277 + + Ansi 8 Color (Dark) + + Blue Component + 0.21176470588235294 + Color Space + sRGB + Green Component + 0.16862745098039217 + Red Component + 0.0 + + Ansi 8 Color (Light) + + Blue Component + 0.21176470588235294 + Color Space + sRGB + Green Component + 0.16862745098039217 + Red Component + 0.0 + + Ansi 9 Color + + Alpha Component + 1 + Blue Component + 0.45833224058151245 + Color Space + sRGB + Green Component + 0.47524076700210571 + Red Component + 0.8659515380859375 + + Ansi 9 Color (Dark) + + Blue Component + 0.086274509803921567 + Color Space + sRGB + Green Component + 0.29411764705882354 + Red Component + 0.79607843137254897 + + Ansi 9 Color (Light) + + Blue Component + 0.086274509803921567 + Color Space + sRGB + Green Component + 0.29411764705882354 + Red Component + 0.79607843137254897 + + BM Growl + + Background Color + + Alpha Component + 1 + Blue Component + 0.97999999999999998 + Color Space + sRGB + Green Component + 0.97999999999999998 + Red Component + 0.97999999999999998 + + Background Color (Dark) + + Blue Component + 0.21176470588235294 + Color Space + sRGB + Green Component + 0.16862745098039217 + Red Component + 0.0 + + Background Color (Light) + + Blue Component + 0.21176470588235294 + Color Space + sRGB + Green Component + 0.16862745098039217 + Red Component + 0.0 + + Background Image Location + + Badge Color + + Alpha Component + 0.5 + Blue Component + 0.11610633058398889 + Color Space + sRGB + Green Component + 0.11610633058398889 + Red Component + 0.74613857269287109 + + Badge Color (Dark) + + Alpha Component + 0.5 + Blue Component + 0.13960540294647217 + Color Space + P3 + Green Component + 0.25479039549827576 + Red Component + 0.92929404973983765 + + Badge Color (Light) + + Alpha Component + 0.5 + Blue Component + 0.13960540294647217 + Color Space + P3 + Green Component + 0.25479039549827576 + Red Component + 0.92929404973983765 + + Blinking Cursor + + Blur + + Bold Color + + Alpha Component + 1 + Blue Component + 0.062745098039215685 + Color Space + sRGB + Green Component + 0.062745098039215685 + Red Component + 0.062745098039215685 + + Bold Color (Dark) + + Blue Component + 0.63137254901960782 + Color Space + sRGB + Green Component + 0.63137254901960782 + Red Component + 0.57647058823529407 + + Bold Color (Light) + + Blue Component + 0.63137254901960782 + Color Space + sRGB + Green Component + 0.63137254901960782 + Red Component + 0.57647058823529407 + + Brighten Bold Text + + Brighten Bold Text (Dark) + + Brighten Bold Text (Light) + + Character Encoding + 4 + Close Sessions On End + + Columns + 80 + Command + + Cursor Boost + 0.0 + Cursor Boost (Dark) + 0.0 + Cursor Boost (Light) + 0.0 + Cursor Color + + Alpha Component + 1 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.0 + Red Component + 0.0 + + Cursor Color (Dark) + + Blue Component + 0.58823529411764708 + Color Space + sRGB + Green Component + 0.58039215686274515 + Red Component + 0.51372549019607838 + + Cursor Color (Light) + + Blue Component + 0.58823529411764708 + Color Space + sRGB + Green Component + 0.58039215686274515 + Red Component + 0.51372549019607838 + + Cursor Guide Color + + Alpha Component + 0.25 + Blue Component + 0.85319280624389648 + Color Space + sRGB + Green Component + 0.77217718629089516 + Red Component + 0.52338262643729649 + + Cursor Guide Color (Dark) + + Alpha Component + 0.25 + Blue Component + 0.99125725030899048 + Color Space + P3 + Green Component + 0.92047786712646484 + Red Component + 0.7486259937286377 + + Cursor Guide Color (Light) + + Alpha Component + 0.25 + Blue Component + 0.99125725030899048 + Color Space + P3 + Green Component + 0.92047786712646484 + Red Component + 0.7486259937286377 + + Cursor Text Color + + Alpha Component + 1 + Blue Component + 1 + Color Space + sRGB + Green Component + 1 + Red Component + 1 + + Cursor Text Color (Dark) + + Blue Component + 0.25882352941176473 + Color Space + sRGB + Green Component + 0.21176470588235294 + Red Component + 0.027450980392156862 + + Cursor Text Color (Light) + + Blue Component + 0.25882352941176473 + Color Space + sRGB + Green Component + 0.21176470588235294 + Red Component + 0.027450980392156862 + + Custom Command + No + Custom Directory + No + Default Bookmark + No + Description + Default + Disable Window Resizing + + Faint Text Alpha + 0.5 + Faint Text Alpha (Dark) + 0.5 + Faint Text Alpha (Light) + 0.5 + Flashing Bell + + Foreground Color + + Alpha Component + 1 + Blue Component + 0.062745098039215685 + Color Space + sRGB + Green Component + 0.062745098039215685 + Red Component + 0.062745098039215685 + + Foreground Color (Dark) + + Blue Component + 0.58823529411764708 + Color Space + sRGB + Green Component + 0.58039215686274515 + Red Component + 0.51372549019607838 + + Foreground Color (Light) + + Blue Component + 0.58823529411764708 + Color Space + sRGB + Green Component + 0.58039215686274515 + Red Component + 0.51372549019607838 + + Guid + DC379BB9-FF36-4714-A6B6-F8733C90E251 + Horizontal Spacing + 1 + Idle Code + 0 + Jobs to Ignore + + rlogin + ssh + slogin + telnet + + Keyboard Map + + 0x2d-0x40000 + + Action + 11 + Text + 0x1f + + 0x32-0x40000 + + Action + 11 + Text + 0x00 + + 0x33-0x40000 + + Action + 11 + Text + 0x1b + + 0x34-0x40000 + + Action + 11 + Text + 0x1c + + 0x35-0x40000 + + Action + 11 + Text + 0x1d + + 0x36-0x40000 + + Action + 11 + Text + 0x1e + + 0x37-0x40000 + + Action + 11 + Text + 0x1f + + 0x38-0x40000 + + Action + 11 + Text + 0x7f + + 0xf700-0x220000 + + Action + 10 + Text + [1;2A + + 0xf700-0x240000 + + Action + 10 + Text + [1;5A + + 0xf700-0x260000 + + Action + 10 + Text + [1;6A + + 0xf700-0x280000 + + Action + 11 + Text + 0x1b 0x1b 0x5b 0x41 + + 0xf701-0x220000 + + Action + 10 + Text + [1;2B + + 0xf701-0x240000 + + Action + 10 + Text + [1;5B + + 0xf701-0x260000 + + Action + 10 + Text + [1;6B + + 0xf701-0x280000 + + Action + 11 + Text + 0x1b 0x1b 0x5b 0x42 + + 0xf702-0x220000 + + Action + 10 + Text + [1;2D + + 0xf702-0x240000 + + Action + 10 + Text + [1;5D + + 0xf702-0x260000 + + Action + 10 + Text + [1;6D + + 0xf702-0x280000 + + Action + 11 + Text + 0x1b 0x1b 0x5b 0x44 + + 0xf703-0x220000 + + Action + 10 + Text + [1;2C + + 0xf703-0x240000 + + Action + 10 + Text + [1;5C + + 0xf703-0x260000 + + Action + 10 + Text + [1;6C + + 0xf703-0x280000 + + Action + 11 + Text + 0x1b 0x1b 0x5b 0x43 + + 0xf704-0x20000 + + Action + 10 + Text + [1;2P + + 0xf705-0x20000 + + Action + 10 + Text + [1;2Q + + 0xf706-0x20000 + + Action + 10 + Text + [1;2R + + 0xf707-0x20000 + + Action + 10 + Text + [1;2S + + 0xf708-0x20000 + + Action + 10 + Text + [15;2~ + + 0xf709-0x20000 + + Action + 10 + Text + [17;2~ + + 0xf70a-0x20000 + + Action + 10 + Text + [18;2~ + + 0xf70b-0x20000 + + Action + 10 + Text + [19;2~ + + 0xf70c-0x20000 + + Action + 10 + Text + [20;2~ + + 0xf70d-0x20000 + + Action + 10 + Text + [21;2~ + + 0xf70e-0x20000 + + Action + 10 + Text + [23;2~ + + 0xf70f-0x20000 + + Action + 10 + Text + [24;2~ + + 0xf729-0x20000 + + Action + 10 + Text + [1;2H + + 0xf729-0x40000 + + Action + 10 + Text + [1;5H + + 0xf72b-0x20000 + + Action + 10 + Text + [1;2F + + 0xf72b-0x40000 + + Action + 10 + Text + [1;5F + + + Link Color + + Alpha Component + 1 + Blue Component + 0.9337158203125 + Color Space + sRGB + Green Component + 0.55789834260940552 + Red Component + 0.19802422821521759 + + Link Color (Dark) + + Alpha Component + 1 + Blue Component + 0.70932406187057495 + Color Space + P3 + Green Component + 0.35333043336868286 + Red Component + 0.1451396644115448 + + Link Color (Light) + + Alpha Component + 1 + Blue Component + 0.70932406187057495 + Color Space + P3 + Green Component + 0.35333043336868286 + Red Component + 0.1451396644115448 + + Match Background Color + + Alpha Component + 1 + Blue Component + 0.32116127014160156 + Color Space + P3 + Green Component + 0.98600882291793823 + Red Component + 0.99697154760360718 + + Match Background Color (Dark) + + Alpha Component + 1 + Blue Component + 0.0 + Color Space + P3 + Green Component + 1 + Red Component + 1 + + Match Background Color (Light) + + Alpha Component + 1 + Blue Component + 0.0 + Color Space + P3 + Green Component + 1 + Red Component + 1 + + Minimum Contrast + 0.0 + Minimum Contrast (Dark) + 0.0 + Minimum Contrast (Light) + 0.0 + Mouse Reporting + + Name + Default + Non Ascii Font + Sarasa-Fixed-SC-Nerd-Font-Regular 16 + Non-ASCII Anti Aliased + + Normal Font + FiraCode-Regular 16 + Option Key Sends + 0 + Prompt Before Closing 2 + + Right Option Key Sends + 0 + Rows + 25 + Screen + -1 + Scrollback Lines + 1000 + Selected Text Color + + Alpha Component + 1 + Blue Component + 0.0 + Color Space + sRGB + Green Component + 0.0 + Red Component + 0.0 + + Selected Text Color (Dark) + + Blue Component + 0.63137254901960782 + Color Space + sRGB + Green Component + 0.63137254901960782 + Red Component + 0.57647058823529407 + + Selected Text Color (Light) + + Blue Component + 0.63137254901960782 + Color Space + sRGB + Green Component + 0.63137254901960782 + Red Component + 0.57647058823529407 + + Selection Color + + Alpha Component + 1 + Blue Component + 1 + Color Space + sRGB + Green Component + 0.84313726425170898 + Red Component + 0.70196080207824707 + + Selection Color (Dark) + + Blue Component + 0.25882352941176473 + Color Space + sRGB + Green Component + 0.21176470588235294 + Red Component + 0.027450980392156862 + + Selection Color (Light) + + Blue Component + 0.25882352941176473 + Color Space + sRGB + Green Component + 0.21176470588235294 + Red Component + 0.027450980392156862 + + Send Code When Idle + + Shortcut + + Silence Bell + + Smart Cursor Color + + Smart Cursor Color (Dark) + + Smart Cursor Color (Light) + + Sync Title + + Tags + + Terminal Type + xterm-256color + Transparency + 0.0 + Unicode Version + 9 + Unlimited Scrollback + + Use Bold Font + + Use Bright Bold + + Use Bright Bold (Dark) + + Use Bright Bold (Light) + + Use Cursor Guide + + Use Cursor Guide (Dark) + + Use Cursor Guide (Light) + + Use Italic Font + + Use Non-ASCII Font + + Use Selected Text Color + + Use Selected Text Color (Dark) + + Use Selected Text Color (Light) + + Use Separate Colors for Light and Dark Mode + + Use Tab Color + + Use Tab Color (Dark) + + Use Tab Color (Light) + + Use Underline Color + + Use Underline Color (Dark) + + Use Underline Color (Light) + + Vertical Spacing + 1 + Visual Bell + + Window Type + 0 + Working Directory + /Users/laily + + + PointerActions + + Button,1,1,, + + Action + kContextMenuPointerAction + + Button,2,1,, + + Action + kPasteFromClipboardPointerAction + + Gesture,ThreeFingerSwipeDown,, + + Action + kPrevWindowPointerAction + + Gesture,ThreeFingerSwipeLeft,, + + Action + kPrevTabPointerAction + + Gesture,ThreeFingerSwipeRight,, + + Action + kNextTabPointerAction + + Gesture,ThreeFingerSwipeUp,, + + Action + kNextWindowPointerAction + + + SoundForEsc + + VisualIndicatorForEsc + + + diff --git a/iterm2/load.sh b/iterm2/load.sh new file mode 100644 index 0000000..42bdea0 --- /dev/null +++ b/iterm2/load.sh @@ -0,0 +1,2 @@ +defaults write com.googlecode.iterm2.plist LoadPrefsFromCustomFolder -bool true + diff --git a/iterm2/set-config-dir.sh b/iterm2/set-config-dir.sh new file mode 100644 index 0000000..389b854 --- /dev/null +++ b/iterm2/set-config-dir.sh @@ -0,0 +1,3 @@ +#/bin/bash +defaults write com.googlecode.iterm2.plist PrefsCustomFolder -string "~/.dotfile/iterm2" +# then open iterm2, Preferences->General->Settings, Mark 'load preferences from xxx' diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index ac0d857..cb60e37 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,73 +1,66 @@ { "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LazyVim": { "branch": "main", "commit": "fe72424e77cb9c953084bbcaaa0eb7fe8056dc70" }, - "LuaSnip": { "branch": "master", "commit": "f3b3d3446bcbfa62d638b1903ff00a78b2b730a1" }, - "SchemaStore.nvim": { "branch": "main", "commit": "9bc9a3a19dc6047d79d6073082f3b0deb7002c99" }, - "barbar.nvim": { "branch": "master", "commit": "dd852401ee902745b67fc09a83d113b3fe82a96f" }, - "bufferline.nvim": { "branch": "main", "commit": "b15c6daf5a64426c69732b31a951f4e438cb6590" }, - "catppuccin": { "branch": "main", "commit": "c0de3b46811fe1ce3912e2245a9dfbea6b41c300" }, + "LazyVim": { "branch": "main", "commit": "704c29110d578186f0ca3eac67b753ddf52541fc" }, + "SchemaStore.nvim": { "branch": "main", "commit": "a7ad1f6205500d1369382e2e43df4e60eeae7cb6" }, + "barbar.nvim": { "branch": "master", "commit": "53b5a2f34b68875898f0531032fbf090e3952ad7" }, + "bufferline.nvim": { "branch": "main", "commit": "5cc447cb2b463cb499c82eaeabbed4f5fa6a0a44" }, + "catppuccin": { "branch": "main", "commit": "637d99e638bc6f1efedac582f6ccab08badac0c6" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "cmp-emoji": { "branch": "main", "commit": "e8398e2adf512a03bb4e1728ca017ffeac670a9f" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "192a6d2ddace343f1840a8f72efe2315bd392243" }, - "dashboard-nvim": { "branch": "master", "commit": "413442b12d85315fc626c44a0ce4929b213ef604" }, + "conform.nvim": { "branch": "master", "commit": "023f795dbcf32d4351b6a9ed2e613d471b5bb812" }, + "dashboard-nvim": { "branch": "master", "commit": "ae309606940d26d8c9df8b048a6e136b6bbec478" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" }, - "flash.nvim": { "branch": "main", "commit": "48817af25f51c0590653bbc290866e4890fe1cbe" }, - "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, - "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, - "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, - "lazy.nvim": { "branch": "main", "commit": "28126922c9b54e35a192ac415788f202c3944c9f" }, - "lsp_signature.nvim": { "branch": "master", "commit": "fed2c8389c148ff1dfdcdca63c2b48d08a50dea0" }, - "lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" }, - "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, - "mini.ai": { "branch": "main", "commit": "ee9446a17c160aba6a04ff22097389c41872c878" }, - "mini.bufremove": { "branch": "main", "commit": "931a3bb514147d9e812767275c4beba6b779b1d3" }, - "mini.comment": { "branch": "main", "commit": "a4b7e46deb9ad2feb8902cc5dbf087eced112ee5" }, - "mini.indentscope": { "branch": "main", "commit": "cf07f19e718ebb0bcc5b00999083ce11c37b8d40" }, - "mini.pairs": { "branch": "main", "commit": "04f58f2545ed80ac3b52dd4826e93f33e15b2af6" }, - "mini.surround": { "branch": "main", "commit": "a1b590cc3b676512de507328d6bbab5e43794720" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "f3941c57ec85d7bdb44fa53fd858fd80f159018f" }, - "neoconf.nvim": { "branch": "main", "commit": "98980b5300e7a5e7f93e8dbf81c98cc3daa55df7" }, - "neodev.nvim": { "branch": "main", "commit": "84e0290f5600e8b89c0dfcafc864f45496a53400" }, - "neotest": { "branch": "master", "commit": "4440cc2227894c2ae9b0673a30e6cc6f1836e8c2" }, - "neotest-go": { "branch": "main", "commit": "6a2f996d89fe4631942e035b1c114544ee045043" }, - "neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" }, - "noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" }, - "nui.nvim": { "branch": "main", "commit": "c3c7fd618dcb5a89e443a2e1033e7d11fdb0596b" }, - "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, - "nvim-dap": { "branch": "master", "commit": "5a2f7121869394502521c52b2bc581ab22c69447" }, - "nvim-dap-go": { "branch": "main", "commit": "5faf165f5062187320eaf9d177c3c1f647adc22e" }, - "nvim-dap-ui": { "branch": "master", "commit": "b7267003ba4dd860350be86f75b9d9ea287cedca" }, - "nvim-dap-virtual-text": { "branch": "master", "commit": "3e8e207513e6ef520894950acd76b79902714103" }, - "nvim-lint": { "branch": "master", "commit": "4dade85ff26e4bad40f895a6cc6762b7036237f4" }, - "nvim-lspconfig": { "branch": "master", "commit": "9553725789be682ecd945a527ec552e489ea8534" }, - "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, - "nvim-spectre": { "branch": "master", "commit": "3712ff0cdf4f9f877d9ca708d835a877d9a0abaf" }, - "nvim-tree.lua": { "branch": "master", "commit": "d52fdeb0a300ac42b9cfa65ae0600a299f8e8677" }, - "nvim-treesitter": { "branch": "master", "commit": "4a8901b0d5398b45e075fcdbf9b8fe546349cc14" }, - "nvim-treesitter-context": { "branch": "master", "commit": "b8d1ffe58a88e0356da56b167373e89c4579ce15" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "95933e762e28f9d38b572d65e7e4da9d2f4d90cb" }, - "nvim-ts-autotag": { "branch": "main", "commit": "531f48334c422222aebc888fd36e7d109cb354cd" }, - "nvim-ts-context-commentstring": { "branch": "main", "commit": "7ab799a9792f7cf3883cf28c6a00ad431f3d382a" }, - "nvim-web-devicons": { "branch": "master", "commit": "0bb67ef952ea3eb7b1bac9c011281471d99a27bc" }, - "persistence.nvim": { "branch": "main", "commit": "4982499c1636eac254b72923ab826ee7827b3084" }, + "dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" }, + "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, + "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, + "gitsigns.nvim": { "branch": "main", "commit": "ac5aba6dce8c06ea22bea2c9016f51a2dbf90dc7" }, + "grug-far.nvim": { "branch": "main", "commit": "9a2f78219390b47d67795ab09390d7f092e23976" }, + "indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" }, + "lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" }, + "lazydev.nvim": { "branch": "main", "commit": "d5800897d9180cea800023f2429bce0a94ed6064" }, + "lsp_signature.nvim": { "branch": "master", "commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b" }, + "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, + "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "cab00668464d2914d0752b86168b4a431cc93eb2" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, + "mini.ai": { "branch": "main", "commit": "31c149067d38b97720d2a179619f7745a0006ecc" }, + "mini.icons": { "branch": "main", "commit": "54686be7d58807906cb2c8c2216e0bf9c044f19a" }, + "mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" }, + "neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, + "neotest": { "branch": "master", "commit": "6d3d22cdad49999ef774ebe1bc250a4994038964" }, + "neotest-golang": { "branch": "main", "commit": "df6e3f34ae65f2520db798481a9d3f97581899b7" }, + "noice.nvim": { "branch": "main", "commit": "2626b4a49340e4eae24a388468ac98680fc24532" }, + "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, + "nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" }, + "nvim-dap": { "branch": "master", "commit": "29d1f8814fa4fcc194ec574de998a42a22ebbe4a" }, + "nvim-dap-go": { "branch": "main", "commit": "6aa88167ea1224bcef578e8c7160fe8afbb44848" }, + "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "76d80c3d171224315b61c006502a1e30c213a9ab" }, + "nvim-lint": { "branch": "master", "commit": "36da8dd0ddc4f88e0beae234c20e75397326f143" }, + "nvim-lspconfig": { "branch": "master", "commit": "f012c1b176f0e3c71f40eb309bdec0316689462e" }, + "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, + "nvim-snippets": { "branch": "main", "commit": "56b4052f71220144689caaa2e5b66222ba5661eb" }, + "nvim-tree.lua": { "branch": "master", "commit": "f7c65e11d695a084ca10b93df659bb7e68b71f9f" }, + "nvim-treesitter": { "branch": "master", "commit": "37427012d1c77c544356bfff0c9acc88fd3256bc" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "3e450cd85243da99dc23ebbf14f9c70e9a0c26a4" }, + "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, + "nvim-web-devicons": { "branch": "master", "commit": "e87554285f581047b1bf236794b0eb812b444b87" }, + "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, - "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "snacks.nvim": { "branch": "main", "commit": "063525196a43fd0a4a03bd67edce1b72e4f1c20b" }, "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, - "telescope-file-browser.nvim": { "branch": "master", "commit": "48ffb8de688a22942940f50411d5928631368848" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, - "telescope.nvim": { "branch": "master", "commit": "d5c4d9856320a07d04607c9b3a0523bd3f373328" }, - "todo-comments.nvim": { "branch": "main", "commit": "833d8dd8b07eeda37a09e99460f72a02616935cb" }, - "tokyonight.nvim": { "branch": "main", "commit": "610179f7f12db3d08540b6cc61434db2eaecbcff" }, - "trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" }, - "vim-illuminate": { "branch": "master", "commit": "305bf07b919ac526deb5193280379e2f8b599926" }, - "vim-startuptime": { "branch": "master", "commit": "308b0088a864c4711a96e45b6734cf9294074f65" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "626998e5c1b71c130d8bc6cf7abb6709b98287bb" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, + "telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" }, + "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, + "tokyonight.nvim": { "branch": "main", "commit": "9758827c3b380ba89da4a2212b6255d01afbcf08" }, + "trouble.nvim": { "branch": "main", "commit": "3dc00c0447c016cd43e03054c3d49436a1f2076d" }, + "ts-comments.nvim": { "branch": "main", "commit": "2002692ad1d3f6518d016550c20c2a890f0cbf0e" }, "vim-vsnip": { "branch": "master", "commit": "02a8e79295c9733434aab4e0e2b8c4b7cea9f3a9" }, - "vim-vsnip-integ": { "branch": "master", "commit": "1914e72cf3de70df7f5dde476cd299aba2440aef" }, - "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } -} \ No newline at end of file + "vim-vsnip-integ": { "branch": "master", "commit": "90ae474e8b05ed41e36d6f58382a9fbfb4b672c4" }, + "which-key.nvim": { "branch": "main", "commit": "68e37e12913a66b60073906f5d3f14dee0de19f2" } +} diff --git a/nvim/lazyvim.json b/nvim/lazyvim.json index 8daa38a..9eba7b2 100644 --- a/nvim/lazyvim.json +++ b/nvim/lazyvim.json @@ -4,7 +4,7 @@ "lazyvim.plugins.extras.lang.go" ], "news": { - "NEWS.md": "2123" + "NEWS.md": "7107" }, - "version": 2 + "version": 7 } \ No newline at end of file diff --git a/nvim/lua/config/autocmds.lua b/nvim/lua/config/autocmds.lua index 00a871d..881274f 100644 --- a/nvim/lua/config/autocmds.lua +++ b/nvim/lua/config/autocmds.lua @@ -7,12 +7,12 @@ vim.api.nvim_create_autocmd("InsertLeave", { -- Disable the concealing in some file formats -- The default conceallevel is 3 in LazyVim vim.api.nvim_create_autocmd("FileType", { - pattern = {"js","tsx","ts", "json", "jsonc", "markdown","md","css","html" }, + pattern = { "js", "tsx", "ts", "json", "jsonc", "markdown", "md", "css", "html" }, callback = function() vim.opt.conceallevel = 0 vim.bo.tabstop = 2 vim.bo.softtabstop = 2 vim.bo.shiftwidth = 2 - vim.bo.expand = true + -- vim.bo.expand = true end, }) diff --git a/nvim/lua/plugins/gitsigns.lua b/nvim/lua/plugins/gitsigns.lua index 614d56a..0d08d37 100644 --- a/nvim/lua/plugins/gitsigns.lua +++ b/nvim/lua/plugins/gitsigns.lua @@ -3,18 +3,21 @@ return { "lewis6991/gitsigns.nvim", opts = { signs = { - -- TODO add hl to colorscheme - add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, - change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, - delete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, - topdelete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" }, - changedelete = { - hl = "GitSignsChange", - text = "▎", - numhl = "GitSignsChangeNr", - linehl = "GitSignsChangeLn", - }, - }, + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, + signs_staged = { + add = { text = '┃' }, + change = { text = '┃' }, + delete = { text = '_' }, + topdelete = { text = '‾' }, + changedelete = { text = '~' }, + untracked = { text = '┆' }, + }, numhl = false, linehl = false, watch_gitdir = { diff --git a/nvim/lua/plugins/neotest.lua b/nvim/lua/plugins/neotest.lua index c81221f..d84bed4 100644 --- a/nvim/lua/plugins/neotest.lua +++ b/nvim/lua/plugins/neotest.lua @@ -1,22 +1,24 @@ return { - { "nvim-neotest/neotest-plenary" }, { - "nvim-neotest/neotest", - dependencies= { - "nvim-lua/plenary.nvim", - "antoinemadec/FixCursorHold.nvim", - "nvim-treesitter/nvim-treesitter", - "nvim-neotest/neotest-go", - }, - opts = { - adapters = { - require("neotest-go")({ - experimental = { - test_table = true, - }, - args = { "-gcflags=all=-l", "-count=1", "-timeout=60s" } + "nvim-neotest/neotest", + dependencies = { + "nvim-neotest/nvim-nio", + "nvim-lua/plenary.nvim", + "antoinemadec/FixCursorHold.nvim", + "nvim-treesitter/nvim-treesitter", + "fredrikaverpil/neotest-golang", -- Installation + }, + config = function() + require("neotest").setup({ + adapters = { + require("neotest-golang"), -- Registration + }, + output = { + enabled = true, + open_on_run = true, + }, }) - } - }, + end, }, - } \ No newline at end of file +} + diff --git a/nvim/lua/plugins/nvim-lspconfig.lua b/nvim/lua/plugins/nvim-lspconfig.lua index ca573a6..2479d84 100644 --- a/nvim/lua/plugins/nvim-lspconfig.lua +++ b/nvim/lua/plugins/nvim-lspconfig.lua @@ -1,8 +1,10 @@ return { -- lsp servers { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", "neovim/nvim-lspconfig", - event = { 'BufReadPre', 'BufReadPost', 'BufNewFile' }, + event = { "BufReadPre", "BufReadPost", "BufNewFile" }, opts = { inlay_hints = { enabled = false }, ---@type lspconfig.options @@ -10,12 +12,29 @@ return { cssls = {}, tailwindcss = { root_dir = function(...) - return require("lspconfig.util").root_pattern('tailwind.config.js', 'tailwind.config.cjs', 'tailwind.config.mjs', 'tailwind.config.ts', 'postcss.config.js', 'postcss.config.cjs', 'postcss.config.mjs', 'postcss.config.ts', 'package.json', 'node_modules', '.git')(...) + return require("lspconfig.util").root_pattern( + "tailwind.config.js", + "tailwind.config.cjs", + "tailwind.config.mjs", + "tailwind.config.ts", + "postcss.config.js", + "postcss.config.cjs", + "postcss.config.mjs", + "postcss.config.ts", + "package.json", + "node_modules", + ".git" + )(...) end, }, tsserver = { root_dir = function(...) - return require("lspconfig.util").root_pattern("tsconfig.json", "package.json", "jsconfig.json", ".git")(...) + return require("lspconfig.util").root_pattern( + "tsconfig.json", + "package.json", + "jsconfig.json", + ".git" + )(...) end, single_file_support = false, settings = { @@ -120,15 +139,15 @@ return { cmd = { "gopls", "serve" }, -- use cmd in path, I can update it easily settings = { gopls = { - analyses = { - nilness = true, - unusedparams = true, - unusedwrite = true, - useany = true, + analyses = { + nilness = true, + unusedparams = true, + unusedwrite = true, + useany = true, + }, + staticcheck = false, + usePlaceholders = false, }, - staticcheck = false, - usePlaceholders = false, - } }, }, pylsp = { @@ -139,11 +158,11 @@ return { checkOnType = false, diagnostics = false, inlayHints = true, - smartCompletion = true - } + smartCompletion = true, + }, }, single_file_support = true, - } + }, }, setup = {}, }, diff --git a/nvim/lua/plugins/symbols-outline.lua b/nvim/lua/plugins/symbols-outline.lua index 851128b..40e0ebe 100644 --- a/nvim/lua/plugins/symbols-outline.lua +++ b/nvim/lua/plugins/symbols-outline.lua @@ -5,6 +5,8 @@ return { cmd = "SymbolsOutline", opts = { position = "right", + width = 35, }, }, -} \ No newline at end of file +} + diff --git a/script/croncheck.sh b/script/croncheck.sh new file mode 100644 index 0000000..7fdbc47 --- /dev/null +++ b/script/croncheck.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# 检查参数数量 +if [ "$#" -lt 1 ]; then + echo "Usage: $0 [command_args...]" + exit 1 +fi + +# 获取 webhook URL +WEBHOOK_URL="https://open.feishu.cn/open-apis/bot/v2/hook/808eafd8-a79f-4af0-b730-8442cf15933b" + +# 执行命令并捕获输出 +OUTPUT=$("$@" 2>&1) +EXIT_CODE=$? + +# 如果命令失败,发送 webhook 通知 +if [ $EXIT_CODE -ne 0 ]; then + # 准备 JSON 数据 + JSON_DATA=$(cat </dev/null +sudo apt-get update + +sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin + +# add to docker group +sudo usermod -aG docker $USER diff --git a/script/fish-init.sh b/script/fish-init.sh index 19a310f..224920d 100755 --- a/script/fish-init.sh +++ b/script/fish-init.sh @@ -6,6 +6,9 @@ if [ -f "$HOME/.config/fish/config.fish" ]; then fi ln -s $HOME/.dotfile/fish/config.fish $HOME/.config/fish/config.fish +fish -c "curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher" +fish -c "fisher install jethrokuan/z" + echo 'Set fish as default shell' fishpath=$(which fish) echo $fishpath | sudo tee -a /etc/shells diff --git a/script/font-install.py b/script/font-install.py new file mode 100644 index 0000000..54acec1 --- /dev/null +++ b/script/font-install.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python3 + +import os +import sys +import platform +import subprocess +from typing import Dict, List, Optional +import urllib.request +import zipfile +import shutil + +def get_font_dir() -> str: + """根据操作系统确定字体安装目录""" + system = platform.system() + if system == "Darwin": # macOS + return os.path.expanduser("~/Library/Fonts") + elif system == "Linux": + return os.path.expanduser("~/.local/share/fonts") + else: + raise OSError(f"不支持的操作系统: {system}") + +def check_command(command: str) -> bool: + """检查命令是否存在""" + return shutil.which(command) is not None + +def download_file(url: str, dest_path: str) -> None: + """下载文件到指定路径""" + try: + urllib.request.urlretrieve(url, dest_path) + except Exception as e: + print(f"下载失败: {e}") + sys.exit(1) + +def get_top_level_dirs(zip_file: zipfile.ZipFile) -> List[str]: + """获取 ZIP 文件中的顶级目录""" + return list(set(item.split('/')[0] for item in zip_file.namelist() if '/' in item)) + +def has_single_top_dir(zip_file: zipfile.ZipFile) -> bool: + """检查 ZIP 文件是否只有一个顶级目录""" + top_dirs = get_top_level_dirs(zip_file) + return len(top_dirs) == 1 and all(name.startswith(top_dirs[0] + '/') for name in zip_file.namelist()) + + +def unzip_file(zip_path: str, font_name: str) -> None: + """解压文件到指定路径,根据 ZIP 文件结构决定是否创建顶级目录""" + with zipfile.ZipFile(zip_path, 'r') as zip_ref: + if has_single_top_dir(zip_ref): + # ZIP 文件有单一顶级目录,直接解压 + zip_ref.extractall("/tmp") + print(f"已解压 {font_name} 到现有顶级目录") + else: + # 没有单一顶级目录,创建一个以字体名命名的目录 + font_dir = os.path.join("/tmp", font_name) + os.makedirs(font_dir, exist_ok=True) + for file in zip_ref.namelist(): + if not file.startswith('__MACOSX'): # 排除 macOS 系统文件 + zip_ref.extract(file, font_dir) + print(f"已解压 {font_name} 并创建新的顶级目录") + + +def install_font(font_name: str, font_dir: str) -> None: + """安装字体到指定目录""" + # find ttf files to copy to the font_dir + ttf_files = [file for file in os.listdir(f"/tmp/{font_name}") if file.endswith(".ttf")] + for ttf_file in ttf_files: + shutil.copy(f"/tmp/{font_name}/{ttf_file}", font_dir) + print(f"已安装 {font_name} 到 {font_dir}") + +def refresh_font_cache() -> None: + """在 Linux 系统上刷新字体缓存""" + if platform.system() == "Linux" and check_command("fc-cache"): + subprocess.run(["fc-cache", "-f"]) + print("字体缓存已刷新。") + else: + print("警告:无法刷新字体缓存。您可能需要手动刷新。") + +def main() -> None: + fonts: Dict[str, str] = { + "SarasaNerd":"https://github.com/jonz94/Sarasa-Gothic-Nerd-Fonts/releases/download/v1.0.23-0/sarasa-fixed-sc-nerd-font.zip", + "FiraCode": "https://github.com/tonsky/FiraCode/releases/download/6.2/Fira_Code_v6.2.zip" + } + + try: + font_dir = get_font_dir() + except OSError as e: + print(str(e)) + sys.exit(1) + + os.makedirs(font_dir, exist_ok=True) + + for font in fonts: + print(f"正在下载和安装 {font}...") + zip_path = f"/tmp/{font}.zip" + download_file(fonts[font], zip_path) + unzip_file(zip_path, font) + install_font(font, font_dir) + os.remove(zip_path) + + refresh_font_cache() + print("安装完成。请重启您的终端或应用程序以使用新字体。") + +if __name__ == "__main__": + main() + diff --git a/script/go-install.sh b/script/go-install.sh new file mode 100644 index 0000000..f7bd31c --- /dev/null +++ b/script/go-install.sh @@ -0,0 +1,25 @@ +#!/bin/bash +set -e + +# install neovim +os_arch=$(uname -s)-$(uname -m) + +case $os_arch in + "Darwin-x86_64") + cd /usr/local + wget https://golang.google.cn/dl/go1.23.2.linux-amd64.tar.gz + tar zxvf go1.23.2.linux-amd64.tar.gz + ;; + "Linux-x86_64"|"Linux-arm64") + cd /tmp + rm -rf nvim-linux64.tar.gz + wget https://go.dev/dl/go1.23.2.linux-amd64.tar.gz + tar zxvf go1.23.2.linux-amd64.tar.gz + mv go /usr/local/ + sudo ln -s /usr/local/go/bin/go/usr/local/bin/go + ;; +esac + + + + diff --git a/script/myz-install.sh b/script/myz-install.sh deleted file mode 100755 index 307272c..0000000 --- a/script/myz-install.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!bin/sh -#git clone https://github.com/hilaily/.dotfile.git ~/.dotfile - -# 判断 zsh 是否安装 -#sudo yum update && sudo yum -y install zsh - -# 判断 oh-my-zsh 是否安装 -if [ ! -d "$HOME/.oh-my-zsh" ];then - export ZSH=$HOME/.oh-my-zsh - sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" -fi -ln -sf ~/.dotfile/.zshrc ~/ -ln -sf ~/.dotfile/laily.zsh-theme ~/.oh-my-zsh/themes/ -ln -sf ~/.dotfile/.tmux.conf ~/ -ln -sf ~/.dotfile/git/.gitconfig ~/.gitconfig - diff --git a/script/nvim-init.sh b/script/nvim-init.sh new file mode 100644 index 0000000..470ad03 --- /dev/null +++ b/script/nvim-init.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# 定义变量 +NVIM_CONFIG_DIR="$HOME/.config/nvim" +YOUR_CUSTOM_CONFIG_DIR="$HOME/.dotfile/nvim" # 请替换为您的自定义配置目录路径 + +# 检查软链接是否已经存在并指向正确的目录 +if [ -L "$NVIM_CONFIG_DIR" ] && [ "$(readlink -f "$NVIM_CONFIG_DIR")" = "$(readlink -f "$YOUR_CUSTOM_CONFIG_DIR")" ]; then + echo "软链接已经存在并指向正确的目录。无需进行任何操作。" + exit 0 +fi + +# 检查是否存在现有的 Neovim 配置 +if [ -e "$NVIM_CONFIG_DIR" ]; then + echo "检测到现有的 Neovim 配置。" + + # 如果是目录或常规文件,创建备份 + if [ -d "$NVIM_CONFIG_DIR" ] || [ -f "$NVIM_CONFIG_DIR" ]; then + BACKUP_DIR="$NVIM_CONFIG_DIR.backup.$(date +%Y%m%d%H%M%S)" + mv "$NVIM_CONFIG_DIR" "$BACKUP_DIR" + echo "已将现有配置备份到 $BACKUP_DIR" + else + # 如果是其他类型的文件(如损坏的软链接),直接删除 + rm "$NVIM_CONFIG_DIR" + echo "已删除现有的无效配置。" + fi +fi + +# 创建软链接 +ln -s "$YOUR_CUSTOM_CONFIG_DIR" "$NVIM_CONFIG_DIR" + +# 检查软链接是否创建成功 +if [ -L "$NVIM_CONFIG_DIR" ] && [ "$(readlink -f "$NVIM_CONFIG_DIR")" = "$(readlink -f "$YOUR_CUSTOM_CONFIG_DIR")" ]; then + echo "软链接创建成功。Neovim 现在将使用您的自定义配置。" +else + echo "创建软链接时出错。请检查路径和权限。" +fi + diff --git a/script/nvim-install.sh b/script/nvim-install.sh index 0d14969..b2d6e66 100755 --- a/script/nvim-install.sh +++ b/script/nvim-install.sh @@ -1,4 +1,37 @@ +#!/bin/bash + +set -e + # install neovim -cd /usr/local -wget https://github.com/neovim/neovim/releases/download/stable/nvim-macos.tar.gz -tar zxvf nvim-macos.tar.gz +os_arch=$(uname -s)-$(uname -m) +ver=v0.10.2 + +case $os_arch in +"Darwin-x86_64") + cd /tmp + rm -rf nvim-macos-x86_64.tar.gz + wget https://github.com/neovim/neovim/releases/download/$ver/nvim-macos-x86_64.tar.gz + tar zxf nvim-macos-x86_64.tar.gz + sudo mv -f /usr/local/nvim /usr/local/nvim-bak + sudo mv nvim-macos-x86_64 /usr/local/nvim + sudo ln -sf /usr/local/nvim/bin/nvim /usr/local/bin/vim + sudo ln -sf /usr/local/nvim/bin/nvim /usr/local/bin/nvim + echo "" + vim -v + ;; +"Linux-x86_64" | "Linux-arm64") + cd /tmp + rm -rf nvim-linux64.tar.gz + wget https://github.com/neovim/neovim/releases/download/$ver/nvim-linux64.tar.gz + tar zxf nvim-linux64.tar.gz + [ -e /usr/local/nvim ] && sudo mv -f /usr/local/nvim /usr/local/nvim-bak + sudo mv nvim-linux64 /usr/local/nvim + sudo ln -sf /usr/local/nvim/bin/nvim /usr/local/bin/vim + sudo ln -sf /usr/local/nvim/bin/nvim /usr/local/bin/nvim + echo "" + vim -v + ;; +esac + +# if has error "no c compile found" +# sudo apt install build-essential diff --git a/script/python-install.sh b/script/python-install.sh new file mode 100644 index 0000000..e0e6a4b --- /dev/null +++ b/script/python-install.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +set -e + +# 设置颜色 +GREEN='\033[0;32m' +RED='\033[0;31m' +NC='\033[0m' # No Color + +# 检查是否已安装 pyenv +if ! command -v pyenv &> /dev/null +then + echo -e "${RED}pyenv 未安装. 正在安装 pyenv...${NC}" + # 安装 pyenv + curl https://pyenv.run | bash + source ~/.config/fish/config.fish +else + echo -e "${GREEN}pyenv 已安装${NC}" +fi + +# 询问用户想安装的 Python 版本 +python_version=3.11.10 + +# 安装指定版本的 Python +echo -e "${GREEN}正在安装 Python $python_version...${NC}" +pyenv install $python_version + +# 设置全局 Python 版本 +pyenv global $python_version + +# 验证安装 +installed_version=$(python --version) +echo -e "${GREEN}Python 安装完成. 当前版本: $installed_version${NC}" + +# 安装一些常用的 Python 包 +echo -e "${GREEN}正在安装一些常用的 Python 包...${NC}" +pip install --upgrade pip +pip install ipython jupyter notebook pandas numpy matplotlib scikit-learn + +echo -e "${GREEN}Python 环境设置完成!${NC}" diff --git a/script/sourceit.sh b/script/sourceit.sh deleted file mode 100644 index ca0b3ec..0000000 --- a/script/sourceit.sh +++ /dev/null @@ -1,2 +0,0 @@ -#/bin/fish -source $HOME/.config/fish/config.fish diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 6f0bfb0..298636f 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -51,6 +51,7 @@ set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-sensible' set -g @plugin 'junegunn/fzf' set -g @plugin 'tmux-plugins/tmux-fzf' +set -g @plugin 'tmux-plugins/tmux-resurrect' # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run '~/.tmux/plugins/tpm/tpm'