Compare commits

..

1 Commits

Author SHA1 Message Date
Gea-Suan Lin
488b5b0887 Remove ANDROID_SDK_ROOT export. We will install Android Studio. 2024-03-01 02:50:58 +08:00
12 changed files with 92 additions and 203 deletions

29
.bashrc
View File

@@ -8,12 +8,12 @@ alias ccat="pygmentize -g"
alias cd..="cd .."
alias cd...="cd ../.."
alias cls="clear"
alias cutl="cut -c -\$(tput cols)"
alias d="dir"
alias dir="ls -l"
alias f="finger"
alias g="grep --color=auto"
alias gph="git push -v --follow-tags"
alias gpl="git pull -v --all --autostash --rebase --recurse-submodules"
alias gpl="git pull -v --autostash --rebase --recurse-submodules"
alias l="last"
alias ll="ls -l"
alias lo="logout"
@@ -22,19 +22,12 @@ alias md="mkdir"
alias more="most"
alias myip="curl -s https://httpbin.org/ip | jq .origin"
alias o="xdg-open"
alias psa="ps auwwx"
alias psm="ps -O rss,vsz -U $USER -ww"
alias psa="ps awx"
alias psm="ps -O rss,vsz -U $USER"
alias psr="psu root"
alias psu="ps -ww -U"
alias psu="ps -U"
alias s="screen"
alias udac="sudo apt update; sudo apt dist-upgrade -y; sudo apt autoremove -y; sudo apt clean"
#
if command -v hpnssh > /dev/null; then
alias ssh="hpnssh -C -e none"
complete -F _ssh hpnssh
else
alias ssh="ssh -C -e none"
fi
alias ssh="ssh -C -e none"
#
if [[ -x /opt/local/bin/gtelnet ]]; then
alias "t=gtelnet"
@@ -50,7 +43,6 @@ else
fi
#
export BLOCKSIZE="k"
export GH_PAGER="less"
export GIT_PAGER="less"
export HISTTIMEFORMAT="%y/%m/%d %T "
export HOMEBREW_NO_ANALYTICS=1
@@ -59,21 +51,12 @@ export LSCOLORS="gxfxcxdxbxegedabagacad"
export PYTHONDONTWRITEBYTECODE=yes
export QUILT_PATCHES="debian/patches"
#
if [[ ! "${PATH}" =~ "(^|:)/bin(:|$)" ]]; then
export PATH="/bin:${PATH}"
fi
if [[ ! "${PATH}" =~ "(^|:)/sbin(:|$)" ]]; then
export PATH="/sbin:${PATH}"
fi
if [[ ! "${PATH}" =~ "(^|:)/usr/bin(:|$)" ]]; then
export PATH="/usr/bin:${PATH}"
fi
if [[ ! "${PATH}" =~ "(^|:)/usr/sbin(:|$)" ]]; then
export PATH="/usr/sbin:${PATH}"
fi
if [[ ! "${PATH}" =~ "(^|:)/usr/local/bin(:|$)" ]]; then
export PATH="/usr/local/bin:${PATH}"
fi
if [[ ! "${PATH}" =~ "(^|:)/usr/local/sbin(:|$)" ]]; then
export PATH="/usr/local/sbin:${PATH}"
fi

View File

@@ -1,16 +1,37 @@
#
alias c0=claude
alias c1="CLAUDE_CONFIG_DIR=~/.claude-c1 claude"
alias update="(cd ~/git; make all)"
#
[[ -s /usr/share/doc/fzf/examples/completion.bash ]] && source /usr/share/doc/fzf/examples/completion.bash
[[ -s /usr/share/doc/fzf/examples/key-bindings.bash ]] && source /usr/share/doc/fzf/examples/key-bindings.bash
#
if command -v mise > /dev/null; then
eval "$(mise activate bash)"
[[ -e "$HOME/go/bin" ]] && export PATH="${HOME}/go/bin:${PATH}"
[[ -s "$HOME/perl5/perlbrew/etc/bashrc" ]] && source "$HOME/perl5/perlbrew/etc/bashrc"
[[ -s "$HOME/.phpbrew/bashrc" ]] && source "$HOME/.phpbrew/bashrc"
[[ -s "$HOME/.cargo/env" ]] && source "$HOME/.cargo/env"
#
export PYENV_ROOT="${HOME}/.pyenv"
if [ -d "${PYENV_ROOT}" ]; then
if [[ ! "${PATH}" =~ "(^|:)${PYENV_ROOT}/bin(:|$)" ]]; then
export PATH="${PYENV_ROOT}/bin:${PATH}"
fi
if [[ ! "${PATH}" =~ "(^|:)${PYENV_ROOT}/shims(:|$)" ]]; then
export PATH="${PYENV_ROOT}/shims:${PATH}"
fi
eval "$(pyenv init - --no-rehash)"
fi
#
# Composer
if [[ -e "${HOME}/.config/composer/vendor/bin" ]]; then
export PATH="${HOME}/.config/composer/vendor/bin:${PATH}"
[ -s "${HOME}/.fnm/fnm" ] && eval "$(${HOME}/.fnm/fnm env)" && export PATH="${HOME}/.fnm:${PATH}"
#
if [ -d "${HOME}/.rbenv" ]; then
if [[ ! "${PATH}" =~ "(^|:)${HOME}/\\.rbenv/bin(:|$)" ]]; then
export PATH="${HOME}/.rbenv/bin:${PATH}"
fi
eval "$(rbenv init - --no-rehash)"
fi
#
if [ -d "${HOME}/.rvm" ]; then
if [[ ! "${PATH}" =~ "(^|:)${HOME}/\\.rvm/bin(:|$)" ]]; then
export PATH="${HOME}/.rvm/bin:${PATH}"
fi
source "${HOME}/.rvm/scripts/rvm"
fi

View File

@@ -9,8 +9,7 @@
st = status -bs
up = "!git remote update -p; git merge --ff-only @{u}"
[blame]
# cannot set to work optionally.
# ignoreRevsFile = .git-blame-ignore-revs
ignoreRevsFile = .git-blame-ignore-revs
[color]
ui = auto
[column]
@@ -18,7 +17,7 @@
[core]
preloadindex = yes
[diff]
algorithm = histogram
algorithm = minimal
[diff "sqlite3"]
binary = true
textconv = "echo '.dbconfig trusted_schema no\n.dump' | sqlite3"
@@ -27,17 +26,13 @@
[merge]
tool = vimdiff
[pull]
autoSetupRemote = true
rebase = true
[push]
autoSetupRemote = true
default = current
default = matching
[rerere]
enabled = true
[submodule]
recursive = true
[tag]
sort = version:refname
[user]
useConfigOnly = true
#

1
.npmrc
View File

@@ -1 +0,0 @@
fund=false

View File

@@ -1,2 +1,2 @@
.header on
.mode line
.mode column

View File

@@ -3,11 +3,6 @@ bind-key C-a send-prefix
set -g prefix C-a
unbind C-b
#
unbind-key -T root M-Left
unbind-key -T root M-Right
#
bind-key -n C-Enter send-keys "\e[13;5u"
#
set-option -g status-bg colour27
set-option -g status-fg white
set-option -g window-status-current-style bg=colour28

View File

@@ -1,9 +0,0 @@
[default]
options.model = o4-mini
options.temperature = 1
[gpt-4.1]
options.model = gpt-4.1
[gpt-4.1-mini]
options.model = gpt-4.1-mini

View File

@@ -13,7 +13,7 @@ set incsearch
set laststatus=2
set lazyredraw
set list
set listchars=tab:»\ ,trail
set listchars=tab:▷⋅,trail
set mouse=
set nobomb
set nocompatible
@@ -25,9 +25,6 @@ set shiftwidth=4
set showmatch
set smartcase
set t_Co=256
if !has('nvim')
set ttymouse=
endif
set visualbell
set wrap
set wildmenu
@@ -37,16 +34,16 @@ endif
"
let g:DisableAutoPHPFolding = 1
let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*']
let g:copilot_enabled = v:false
let g:indent_guides_auto_colors = 0
let g:indent_guides_enable_on_vim_startup = 1
let g:llama_config = {'keymap_accept_full':'<Right>','n_predict':256}
autocmd VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=8
autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd ctermbg=236
hi IndentGuidesEven ctermbg=8
hi IndentGuidesOdd ctermbg=236
"
" mapping
cnoremap <expr> <Down> pumvisible() ? "\<C-n>" : "\<Down>"
cnoremap <expr> <Up> pumvisible() ? "\<C-p>" : "\<Up>"
map <C-c> :LlamaToggle<CR>
map <C-c> :Copilot enable<CR>
nmap <Esc>[Z <C-w>W
nmap <F8> :TagbarToggle<CR>
nmap <Tab> <C-w>w
@@ -60,12 +57,6 @@ filetype off
let g:lightline = {'component':{'lineinfo':'%3l:%-2v'}}
let g:polyglot_disabled = ["autoindent", "sensible"]
let g:snipMate = {'snippet_version': 1}
let g:vim_ai_roles_config_file = '~/.vim/vim-ai/roles.ini'
"
" Local
if filereadable(expand("~/.vim/vimrc-preplug.local"))
source ~/.vim/vimrc-preplug.local
endif
"
call plug#begin('~/.vim/plugged')
Plug 'DataWraith/auto_mkdir'
@@ -74,37 +65,27 @@ Plug 'bonsaiben/bootstrap-snippets'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'editorconfig/editorconfig-vim'
Plug 'garbas/vim-snipmate'
Plug 'github/copilot.vim', { 'tag': 'v1.13.0' }
Plug 'godlygeek/csapprox'
Plug 'honza/vim-snippets'
Plug 'itchyny/lightline.vim'
Plug 'luochen1990/rainbow'
Plug 'joshdick/onedark.vim'
Plug 'majutsushi/tagbar'
Plug 'motus/pig.vim'
Plug 'preservim/vim-indent-guides'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'scrooloose/nerdtree'
Plug 'sheerun/vim-polyglot'
Plug 'terryma/vim-expand-region'
Plug 'tomasr/molokai'
Plug 'tomtom/tlib_vim'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'wuelnerdotexe/vim-astro'
if v:version >= 901 || has('nvim-0.8.0')
Plug 'ggml-org/llama.vim'
Plug 'nvim-lua/plenary.nvim'
endif
if has('python3')
Plug 'madox2/vim-ai'
endif
call plug#end()
"
" color schema
set background=dark
colo slate
"
" syntax
colo onedark
highlight Search cterm=none ctermbg=blue
syntax on
autocmd BufEnter * syntax sync fromstart
"
filetype plugin indent on
let g:ctrlp_use_caching = 0
@@ -122,12 +103,13 @@ au BufNewFile,BufRead *.vue set filetype=html
au BufNewFile,BufRead GNUmakefile set noexpandtab
au BufNewFile,BufRead Makefile set noexpandtab
au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif
au FileType css,dart,html,javascript,javascriptreact,json,ruby,typescript,typescriptreact,yaml set shiftwidth=2
au FileType dart,html,javascript,javascriptreact,json,ruby,typescript,yaml set shiftwidth=2
au FileType go set noexpandtab shiftwidth=4 tabstop=4
autocmd BufEnter * silent! lcd %:p:h
autocmd BufReadPost COMMIT_EDITMSG exe "normal! gg"
map <C-n> :NERDTreeToggle<CR>
"
" Local
if filereadable(expand("~/.vim/vimrc-post.local"))
source ~/.vim/vimrc-post.local
if filereadable("~/.vim/vimrc.local")
source ~/.vim/vimrc.local
endif

View File

@@ -1,65 +0,0 @@
--
local wezterm = require 'wezterm'
local act = wezterm.action
local config = wezterm.config_builder()
config.check_for_updates = false
config.color_scheme = 'Tango (terminal.sexy)'
config.enable_csi_u_key_encoding = true
config.font = wezterm.font_with_fallback({'Cousine', 'Noto Color Emoji', 'Noto Sans CJK JP'})
config.font_size = 18.0
config.hide_mouse_cursor_when_typing = false
config.initial_cols = 132
config.initial_rows = 43
config.line_height = 1.0
config.keys = {
{
key = 'Enter',
mods = 'CTRL',
action = act.SendString '\x1b[13;5u',
},
{
key = 'Insert',
mods = 'SHIFT',
action = act.PasteFrom 'Clipboard',
},
}
config.mouse_bindings = {
{
event = {Up = {streak = 1, button = 'Left'}},
mods = 'NONE',
action = act.CompleteSelection 'ClipboardAndPrimarySelection',
},
{
event = {Down = {streak = 1, button = 'Middle'}},
mods = 'NONE',
action = act.Nop,
},
{
event = {Up = {streak = 1, button = 'Middle'}},
mods = 'NONE',
action = act.OpenLinkAtMouseCursor,
},
{
event = {Up = {streak = 1, button = 'Right'}},
mods = 'NONE',
action = act.PasteFrom 'Clipboard',
},
}
config.selection_word_boundary = " \t\n{}[]()<>\"'`"
config.window_padding = {
bottom = 0,
left = 0,
right = 0,
top = 0,
}
wezterm.on('format-tab-title', function(tab, tabs, panes, config, hover, max_width)
return 'Tab ' .. tab.tab_index
end)
wezterm.on('format-window-title', function(tab, pane, tabes, panes, config)
return 'WezTerm ' .. wezterm.version
end)
return config

35
.zshrc
View File

@@ -2,40 +2,30 @@
umask 022
cd "$HOME"
#
autoload -Uz compinit
compinit
#
alias "SYNC=sync;sync;sync"
alias "c=clear"
alias "ccat=pygmentize -g"
alias "cd..=cd .."
alias "cd...=cd ../.."
alias "cls=clear"
alias "cutl=cut -c -$(tput cols)"
alias "d=ls -l"
alias "dir=ls -l"
alias "f=finger"
alias "g=grep --color=auto"
alias "gph=git push -v --follow-tags"
alias "gpl=git pull -v --all --autostash --rebase --recurse-submodules"
alias "gpl=git pull -v --autostash --rebase --recurse-submodules"
alias "l=last"
alias "ll=ls -l"
alias "lo=logout"
alias "m=more"
alias "more=most"
alias "myip=curl -s https://httpbin.org/ip | jq .origin"
alias "psa=ps auwwx"
alias "psm=ps -O rss,vsz -U $USER -ww"
alias "psa=ps aux"
alias "psm=ps -O rss,vsz -U $USER"
alias "psr=psu root"
alias "psu=ps -ww -U"
alias "psu=ps -U"
alias "s=screen"
alias "udac=sudo apt update; sudo apt dist-upgrade -y; sudo apt autoremove -y; sudo apt clean"
#
if command -v hpnssh > /dev/null; then
alias "ssh=hpnssh -C -e none"
compdef hpnssh=ssh
else
alias "ssh=ssh -C -e none"
fi
alias "ssh=ssh -C -e none"
#
if [[ -x /opt/local/bin/gtelnet ]]; then
alias "t=gtelnet"
@@ -127,7 +117,6 @@ else
fi
#
export BLOCKSIZE="k"
export GH_PAGER="less"
export GIT_PAGER="less"
export HISTFILE="$HOME/.history"
export HISTSIZE=2000
@@ -138,21 +127,12 @@ export PYTHONDONTWRITEBYTECODE=yes
export QUILT_PATCHES="debian/patches"
export SAVEHIST=2000
#
if [[ ! "${PATH}" =~ "(^|:)/bin(:|$)" ]]; then
export PATH="/bin:${PATH}"
fi
if [[ ! "${PATH}" =~ "(^|:)/sbin(:|$)" ]]; then
export PATH="/sbin:${PATH}"
fi
if [[ ! "${PATH}" =~ "(^|:)/usr/bin(:|$)" ]]; then
export PATH="/usr/bin:${PATH}"
fi
if [[ ! "${PATH}" =~ "(^|:)/usr/sbin(:|$)" ]]; then
export PATH="/usr/sbin:${PATH}"
fi
if [[ ! "${PATH}" =~ "(^|:)/usr/local/bin(:|$)" ]]; then
export PATH="/usr/local/bin:${PATH}"
fi
if [[ ! "${PATH}" =~ "(^|:)/usr/local/sbin(:|$)" ]]; then
export PATH="/usr/local/sbin:${PATH}"
fi
@@ -180,7 +160,6 @@ setopt prompt_subst
#
zstyle ':completion:*' menu select
#
[[ -s "$HOME/git/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ]] && . "$HOME/git/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
[[ -s "$HOME/git/zsh-autosuggestions/zsh-autosuggestions.zsh" ]] && . "$HOME/git/zsh-autosuggestions/zsh-autosuggestions.zsh"
[[ -s "$HOME/git/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ]] && . "$HOME/git/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ]]
#
[[ -s "$HOME/.zshrc.local" ]] && . "$HOME/.zshrc.local"

View File

@@ -1,20 +1,39 @@
#
if ! whence compinit >/dev/null; then
autoload -Uz compinit && compinit
compinit
fi
autoload -Uz compinit
compinit
[[ -s /usr/share/doc/fzf/examples/completion.zsh ]] && source /usr/share/doc/fzf/examples/completion.zsh
[[ -s /usr/share/doc/fzf/examples/key-bindings.zsh ]] && source /usr/share/doc/fzf/examples/key-bindings.zsh
#
alias "c0=claude"
alias "c1=CLAUDE_CONFIG_DIR=~/.claude-c1 claude"
alias "update=(cd ~/git; make all)"
#
if command -v mise > /dev/null; then
eval "$(mise activate zsh)"
[[ -e "$HOME/go/bin" ]] && export PATH="${HOME}/go/bin:${PATH}"
[[ -s "$HOME/perl5/perlbrew/etc/bashrc" ]] && source "$HOME/perl5/perlbrew/etc/bashrc"
[[ -s "$HOME/.phpbrew/bashrc" ]] && source "$HOME/.phpbrew/bashrc"
[[ -s "$HOME/.cargo/env" ]] && source "$HOME/.cargo/env"
#
export PYENV_ROOT="${HOME}/.pyenv"
if [ -d "${PYENV_ROOT}" ]; then
if [[ ! "${PATH}" =~ "(^|:)${PYENV_ROOT}/bin(:|$)" ]]; then
export PATH="${PYENV_ROOT}/bin:${PATH}"
fi
if [[ ! "${PATH}" =~ "(^|:)${PYENV_ROOT}/shims(:|$)" ]]; then
export PATH="${PYENV_ROOT}/shims:${PATH}"
fi
eval "$(pyenv init - --no-rehash)"
fi
#
# Composer
if [[ -e "${HOME}/.config/composer/vendor/bin" ]]; then
export PATH="${HOME}/.config/composer/vendor/bin:${PATH}"
[ -s "${HOME}/.fnm/fnm" ] && eval "$(${HOME}/.fnm/fnm env)" && export PATH="${HOME}/.fnm:${PATH}"
#
if [ -d "${HOME}/.rbenv" ]; then
if [[ ! "${PATH}" =~ "(^|:)${HOME}/\\.rbenv/bin(:|$)" ]]; then
export PATH="${HOME}/.rbenv/bin:${PATH}"
fi
eval "$(rbenv init - --no-rehash)"
fi
#
if [ -d "${HOME}/.rvm" ]; then
if [[ ! "${PATH}" =~ "(^|:)${HOME}/\\.rvm/bin(:|$)" ]]; then
export PATH="${HOME}/.rvm/bin:${PATH}"
fi
source "${HOME}/.rvm/scripts/rvm"
fi

View File

@@ -36,22 +36,17 @@ if [ ! -e ~/.gitconfig.local ]; then
cp ${BASEDIR}/.gitconfig.local ~/
fi
#
if [ ! -e ~/.npmrc ]; then
cp ${BASEDIR}/.npmrc ~/
fi
#
cp ${BASEDIR}/.gdbinit ~/
#
cp ${BASEDIR}/.psqlrc ~/
cp ${BASEDIR}/.wgetrc ~/
#
cp ${BASEDIR}/.sqliterc ~/
#
cp ${BASEDIR}/.wgetrc ~/
cp ${BASEDIR}/.psqlrc ~/
# nvim
mkdir -p ~/.config || true
@@ -61,12 +56,7 @@ ln -fs ../.vim ~/.config/nvim
mkdir -p ~/.vim/ || true
rsync -a ${BASEDIR}/.vim/ ~/.vim/
chmod 700 ~/.vim/
if command -v nvim > /dev/null; then
nvim +PlugUpdate +PlugClean\! +q +q
else
vim +PlugUpdate +PlugClean\! +q +q
fi
vim +PlugUpdate +PlugClean\! +q +q
#
diff -ruN --color .bashrc.local ~/.bashrc.local
diff -ruN --color .zshrc.local ~/.zshrc.local