Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share my .zshrc for Rime, make it easier to change theme #1

Open
nullmax opened this issue Oct 8, 2023 · 0 comments
Open

Share my .zshrc for Rime, make it easier to change theme #1

nullmax opened this issue Oct 8, 2023 · 0 comments

Comments

@nullmax
Copy link

nullmax commented Oct 8, 2023

Put all theme names in ~/.rimetheme_args and then press Tab:

image

export RIME_DIR="$HOME/Library/Rime"
alias rime-install="bash $RIME_DIR/plum/rime-install"

theme_file="$RIME_DIR/squirrel.custom.yaml"
function rimetheme(){
        theme=" style/color_scheme: $1  # 配色方案"
        scheme_line=`awk '/color_scheme:/{print NR}' ${theme_file}`
        gsed -i "${scheme_line}c\ ${theme}" ${theme_file}
        echo "更新配色方案: $1"
        Squirrel --reload
}

_rimetheme()
{
    local cur=${COMP_WORDS[COMP_CWORD]}
    COMPREPLY=( $(grep "$cur" ~/.rimetheme_args) )
}
complete -F _rimetheme rimetheme

alias rt=rimetheme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant