Skip to content

Instantly share code, notes, and snippets.

@showsky
Created May 9, 2024 17:21
Show Gist options
  • Save showsky/31877e1b588870faca10caa8f4c14b6f to your computer and use it in GitHub Desktop.
Save showsky/31877e1b588870faca10caa8f4c14b6f to your computer and use it in GitHub Desktop.
install.sh
#!/bin/bash
sudo apt update
sudo apt install -y zsh screen git tig
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
sed -i 's/git/git zsh-autosuggestions/g' ~/.zshrc
sed -i 's/robbyrussell/candy/g' ~/.zshrc
cat << EOF > ~/.vimrc
" 檔案編碼
set encoding=utf-8
set fileencodings=utf-8,cp950
" 編輯喜好設定
syntax on " 語法上色顯示
set nocompatible " VIM 不使用和 VI 相容的模式
" set ai " 自動縮排
set shiftwidth=4 " 設定縮排寬度 = 4
set tabstop=4 " tab 的字元數
set softtabstop=4
set expandtab " 用 space 代替 tab
set ruler " 顯示右下角設定值
set backspace=2 " 在 insert 也可用 backspace
set ic " 設定搜尋忽略大小寫
set ru " 第幾行第幾個字
set hlsearch " 設定高亮度顯示搜尋結果
set incsearch " 在關鍵字還沒完全輸入完畢前就顯示結果
set smartindent " 設定 smartindent
set confirm " 操作過程有衝突時,以明確的文字來詢問
set history=100 " 保留 100 個使用過的指令
set cursorline " 顯示目前的游標位置
set laststatus=2
set statusline=%4*%<\%m%<[%f\%r%h%w]\ [%{&ff},%{&fileencoding},%Y]%=\[Position=%l,%v,%p%%]
colorscheme torte
EOF
cat << EOF > ~/.screenrc
startup_message off
# if we accidentally hangup, don't be all attached when we come back.
autodetach on
# more scrollbacks!
defscrollback 10000
# disable use of the "alternate" terminal
# thus allowing scrollbars to function as normal in
# many terminal emulators! <3 it
termcapinfo xterm* ti@:te@
# have screen update terminal emulators titlebar
termcapinfo xterm* 'hs:ts=\E]0;:fs=\007:ds=\E]0;\007'
defhstatus "screen ^E (^Et) | $USER@^EH"
# but dont print i.e. "bell in window 0" status craps
#hardstatus off
shelltitle "$ |bash"
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]'
defflow off
#rvm needs this
shell -${SHELL}
EOF
source ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment