From 1dde6343757e4a5276469e62cd7bb1576eaf5260 Mon Sep 17 00:00:00 2001 From: ujinyoung Date: Sun, 8 Mar 2020 14:42:01 +0900 Subject: [PATCH] Add zsh, term files and setup script using stow --- setup.sh | 50 ++++++++++ term/.terminfo/78/xterm-256color | Bin 0 -> 2273 bytes term/xterm-256color.ti | 52 ++++++++++ zsh/.zshenv | 24 +++++ zsh/.zshrc | 164 +++++++++++++++++++++++++++++++ 5 files changed, 290 insertions(+) create mode 100755 setup.sh create mode 100644 term/.terminfo/78/xterm-256color create mode 100644 term/xterm-256color.ti create mode 100644 zsh/.zshenv create mode 100644 zsh/.zshrc diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..8b5dcf2 --- /dev/null +++ b/setup.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env zsh + +git submodule init +git submodule update + +#for root +#run with sudo +base=( + vim + zsh + config + term +) + + # +useronly=( +) + +stowit(){ + usr=$1 + app=$2 + # -v verbose + # -R recursive + # -t target + stow -v -R -t ${usr} ${app} +} + + +# install apps available to local users and root +echo "##### Stowing base app" +echo "" + +for app in ${base[@]}; do + echo "Stowing $app done." + stowit "${HOME}" $app +done + +# install only user space folders +echo "" +echo "##### Stowing apps for user only: $(whoami)" +echo "" +for app in ${useronly[@]}; do + if [[ $USER != "root" ]]; then + echo "Stowing $app done." + stowit "${HOME}" $app + fi +done + +echo "" +echo "##### ALL DONE" diff --git a/term/.terminfo/78/xterm-256color b/term/.terminfo/78/xterm-256color new file mode 100644 index 0000000000000000000000000000000000000000..7057de228a435b6f7765bd0b11693c58a12ab184 GIT binary patch literal 2273 zcmb7EU1(fI6h3oj(o`XoqN4VqNi}0iA<5pq-M!w}Rcmc*6F0U(YPVu)em0wIlI>=j zzuirx_C*VVC@5$jq)>z+3L;vH4^=_1h)_WkRD4i;5LEh71mSwl%D)qAGeBYdz z^Ud5d=k7Kp;V#$$1$MS&sWM)k>2`zU=v;BGTvNl2#X@DW17jU3I1j+oj{u4CMCixZ z5Nw7!Al~2s7M}nRunAY(33tPNuoHT4WeEFV0ES=~`BN}~ehOw`32I8^IXDF`z)On1 z25%z11?S*AyayNHWB3fmU&0mm7JgJK;`mR47K`IeX!LAGY%@HLx3b%q&Dz<$tc!Is zkA*D5_OQor{&BPeY?vKkBP@@6mX+B`Gf!(Z{7H6N&AiIauygEP_7S_pzF=Ro@7XUV z<9BwIT|@pii&bQ+b*t5G-D7oHUDmP{$2GLIXSF#xiR?o)x@cW$M%Pvn``o&GotgFP z){nkYIo~uhf3SYGep92X=>IZt;A>f}yp7+&xAEe)H#O=y?`PK=6a zF)ym(dGVrnS-dXRcD)gHM!YTF5g&*PnD@#5%)Jr)|60@0qGvl>MqBLMVQ7Umuye8? zOO70iWXY9dWej+Ebp3YD-G{gzjnJ&xyGC_FKirI=ezc4m6!8;5;}hXG7bCkpVb?-dhDbi<((FnCsB!3A6)f2QlIV7|A&)<oR(+lt)0k4RRVnftgeCHH{(p&58xEOv!@QO2)(y@M>>ZhgAGDD zD)L~1(8*L}ph4&WDnffJ@??Y1-UT$DT!3yA@n7XgW6<347}zPg*FlgOSqfzZZ%dA2 z)n#Po5)@0yO616hsEgFs)R84m)^MECV;^atX$omtMtEuca1+*J4~&c)JvuRw&ld_) zQ`6JM;>^tK?A%0YX@38FxsZeB8_Q-p+?kJan~{E8T2(eQBrFswRTc#Cylo1OD7d+ zOdAX}qPB{ownopOuhEG-t?g-TPiuQdTU8IWHKq-Q8c|zU7e!1>H2P*;rW98LTRGEtwZaeu$0qv>&NHkIMOH@25Vjxq&huEpGPy@ P-yq#dG#03Qe_j4RCCWdk literal 0 HcmV?d00001 diff --git a/term/xterm-256color.ti b/term/xterm-256color.ti new file mode 100644 index 0000000..6fb2327 --- /dev/null +++ b/term/xterm-256color.ti @@ -0,0 +1,52 @@ +# Reconstructed via infocmp from file: /Users/ujinyoung/.terminfo/78/xterm-256color +xterm-256color|xterm with 256 colors, + am, bce, ccc, km, mc5i, mir, msgr, npc, xenl, + colors#256, cols#80, it#8, lines#24, pairs#32767, + acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~, + bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l, + clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=^M, + csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H, + cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C, + cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A, + cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dl=\E[%p1%dM, + dl1=\E[M, ech=\E[%p1%dX, ed=\E[J, el=\E[K, el1=\E[1K, + flash=\E[?5h$<100/>\E[?5l, home=\E[H, hpa=\E[%i%p1%dG, + ht=^I, hts=\EH, ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, + ind=^J, indn=\E[%p1%dS, + initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\, + invis=\E[8m, is2=\E[!p\E[?3;4l\E[4l\E>, kDC=\E[3;2~, + kEND=\E[1;2F, kHOM=\E[1;2H, kIC=\E[2;2~, kLFT=\E[1;2D, + kNXT=\E[6;2~, kPRV=\E[5;2~, kRIT=\E[1;2C, kb2=\EOE, + kbs=\177, kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, + kcuu1=\EOA, kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, + kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf13=\E[1;2P, + kf14=\E[1;2Q, kf15=\E[1;2R, kf16=\E[1;2S, kf17=\E[15;2~, + kf18=\E[17;2~, kf19=\E[18;2~, kf2=\EOQ, kf20=\E[19;2~, + kf21=\E[20;2~, kf22=\E[21;2~, kf23=\E[23;2~, + kf24=\E[24;2~, kf25=\E[1;5P, kf26=\E[1;5Q, kf27=\E[1;5R, + kf28=\E[1;5S, kf29=\E[15;5~, kf3=\EOR, kf30=\E[17;5~, + kf31=\E[18;5~, kf32=\E[19;5~, kf33=\E[20;5~, + kf34=\E[21;5~, kf35=\E[23;5~, kf36=\E[24;5~, + kf37=\E[1;6P, kf38=\E[1;6Q, kf39=\E[1;6R, kf4=\EOS, + kf40=\E[1;6S, kf41=\E[15;6~, kf42=\E[17;6~, + kf43=\E[18;6~, kf44=\E[19;6~, kf45=\E[20;6~, + kf46=\E[21;6~, kf47=\E[23;6~, kf48=\E[24;6~, + kf49=\E[1;3P, kf5=\E[15~, kf50=\E[1;3Q, kf51=\E[1;3R, + kf52=\E[1;3S, kf53=\E[15;3~, kf54=\E[17;3~, + kf55=\E[18;3~, kf56=\E[19;3~, kf57=\E[20;3~, + kf58=\E[21;3~, kf59=\E[23;3~, kf6=\E[17~, kf60=\E[24;3~, + kf61=\E[1;4P, kf62=\E[1;4Q, kf63=\E[1;4R, kf7=\E[18~, + kf8=\E[19~, kf9=\E[20~, khome=\EOH, kich1=\E[2~, + kind=\E[1;2B, kmous=\E[M, knp=\E[6~, kpp=\E[5~, + kri=\E[1;2A, mc0=\E[i, mc4=\E[4i, mc5=\E[5i, op=\E[39;49m, + rc=\E8, rev=\E[7m, ri=\EM, rin=\E[%p1%dT, rmacs=\E(B, + rmam=\E[?7l, rmcup=\E[?1049l, rmir=\E[4l, rmkx=\E[?1l\E>, + rmm=\E[?1034l, rmso=\E[27m, rmul=\E[24m, rs1=\Ec, + rs2=\E[!p\E[?3;4l\E[4l\E>, sc=\E7, + setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m, + setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m, + sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m, + sgr0=\E(B\E[m, smacs=\E(0, smam=\E[?7h, smcup=\E[?1049h, + smir=\E[4h, smkx=\E[?1h\E=, smm=\E[?1034h, smso=\E[7m, + smul=\E[4m, tbc=\E[3g, u6=\E[%i%d;%dR, u7=\E[6n, + u8=\E[?1;2c, u9=\E[c, vpa=\E[%i%p1%dd, diff --git a/zsh/.zshenv b/zsh/.zshenv new file mode 100644 index 0000000..a1907e7 --- /dev/null +++ b/zsh/.zshenv @@ -0,0 +1,24 @@ +#!/bin/zsh + +export ZSH="/Users/ujinyoung/.oh-my-zsh" +export MYVIMRC="/Users/ujinyoung/.vimrc" +export VIMINIT=":set runtimepath^=/Users/ujinyoung/.vim|:source $MYVIMRC" + +export EDITOR="/usr/local/bin/nvim" +export VIM="/usr/local/Cellar/neovim/0.4.3/share/nvim" + +export PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}" + +export FZF_BASE="/Users/ujinyoung/.fzf.zsh" +export FZF_DEFAULT_OPTS="--height 40% --layout=reverse --preview '(highlight -O ansi {} || cat {}) 2> /dev/null | head -500'" + +export FZF_DEFAULT_COMMAND='ag -l --path-to-ignore ~/.ignore --nocolor --hidden -g' +export FZF_TMUX=1 + +export PATH="/Users/ujinyoung/.pyenv/shims:${PATH}" +export PYENV_SHELL=zsh + +export PYENV_ROOT='/Users/ujinyoung/.pyenv' +export PYENV_VERSION=3.7.6 +export PYENV_VERSION='system' + diff --git a/zsh/.zshrc b/zsh/.zshrc new file mode 100644 index 0000000..3f901f5 --- /dev/null +++ b/zsh/.zshrc @@ -0,0 +1,164 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:/usr/local/bin:$PATH + +# Path to your oh-my-zsh installation. +# export ZSH=$HOME/dotfiles/.oh-my-zsh + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time oh-my-zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="agnoster" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in ~/.oh-my-zsh/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment the following line to disable bi-weekly auto-update checks. +# DISABLE_AUTO_UPDATE="true" + +# Uncomment the following line to automatically update without prompting. +# DISABLE_UPDATE_PROMPT="true" + +# Uncomment the following line to change how often to auto-update (in days). +# export UPDATE_ZSH_DAYS=13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS=true + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in ~/.oh-my-zsh/plugins/* +# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=( + git + fzf + fasd + zsh-syntax-highlighting + zsh-autosuggestions + pyenv + nvm + osx +) + + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='mvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" + +#터미널 이름만나오게하기 +prompt_context() { + if [[ "$USER" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then + prompt_segment black default "%(!.%{%F{yellow}%}.)$USER" + fi +} +#export FZF_DEFAULT_COMMAND=’fd — type f’ +alias vim="nvim" +alias vi="nvim" +alias vimdiff="nvim -d" + +#fasd default alias +#alias a='fasd -a' # any 이동 +#alias s='fasd -si' # interactive + select +#alias d='fasd -d' # 디렉터리찾기 +#alias f='fasd -f' # 파일찾기 +#alias sd='fasd -sid' # 디렉터리 선택 +#alias z='fasd_cd -d' # 디렉터리 이동 +#alias zz='fasd_cd -d -i' # 디렉터리 선택 후 이동 + +function zle-keymap-select zle-line-init +{ + # change cursor shape in iTerm2 + case $KEYMAP in + vicmd) print -n -- "\E]50;CursorShape=0\C-G";; # block cursor + viins|main) print -n -- "\E]50;CursorShape=1\C-G";; # line cursor + esac + + zle reset-prompt + zle -R +} + +function zle-line-finish +{ + print -n -- "\E]50;CursorShape=0\C-G" # block cursor +} + +zle -N zle-line-init +zle -N zle-line-finish +zle -N zle-keymap-select + +# function zle-line-init zle-keymap-select { +# RPS1="${${KEYMAP/vicmd/-- NORMAL --}/(main|viins)/-- INSERT --}" +# RPS2=$RPS1 +# zle reset-prompt +# } + +# zle -N zle-line-init +# zle -N zle-keymap-select +#alias -s typora + +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + +fpath=(/usr/local/share/zsh-completions $fpath)