...
코드 블럭 |
---|
language | bash |
---|
theme | Emacs |
---|
linenumbers | true |
---|
|
# do the following on root (sudo)
sudo -s
#centos
yum -y install vim git zsh tmux sqlite
#ubuntu
apt -y install vim git zsh tmux tree sqlite3
ZSH=/oh-my-zsh
sudo git clone https://github.com/ohmyzsh/ohmyzsh $ZSH
ZSH_CUSTOM=$ZSH/custom
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
echo 'ASSET=""' >> $ZSH/themes/dallas.zsh-theme
echo '[[ -f /etc/asset ]] && ASSET=$(echo "[$(cat /etc/asset)]")' >> $ZSH/themes/dallas.zsh-theme
echo 'PROMPT="[!%!]$DALLAS$ASSET$DALLAS_CURRENT_TIME_\$(ruby_prompt_info)$DALLAS_CURRENT_MACH_$DALLAS_CURRENT_LOCA_ $DALLAS_CURRENT_USER_$DALLAS_PROMPT_CHAR_ "' >> $ZSH/themes/dallas.zsh-theme
ZSHRC=$ZSH/templates/zshrc.zsh-template
sed -i $ZSHRC -e 's#^export ZSH=$HOME/.oh-my-zsh#export ZSH=/oh-my-zsh#g'
sed -i $ZSHRC -e 's/^ZSH_THEME="robbyrussell"/ZSH_THEME="dallas"/g'
sed -i $ZSHRC -e 's/^plugins=.git.$/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/g'
sed -i $ZSHRC -e 's/^# DISABLE_AUTO_UPDATE="true"/DISABLE_AUTO_UPDATE="true"/g'
cat << EOL >> $ZSHRC
#alias ls='ls --color=tty --time-style=long-iso'
alias ls='ls --color=tty --time-style="+%Y-%m-%d %a %H:%M:%S"'
alias vi='vim'
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
EOL |
...
Convert Bash History → Zsh History (if needed)
https://gist.github.com/muendelezaji/c14722ab66b505a49861b8a74e52b274
코드 블럭 |
---|
language | bash |
---|
theme | Emacs |
---|
linenumbers | true |
---|
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is how I used it:
# $ catmv ~/.bashbazh_history | python bash-to-zsh-hist.py >> ~/.zsh_history
import sys
import time
def main():
timestamp = None
for line in sys.stdin.readlines():
line = line.rstrip('\n')
if line.startswith('#') and timestamp is None:
t = line[1:]
if t.isdigit():
timestamp = t
continue
else:
sys.stdout.write(': %s:0;%s\n' % (timestamp or time.time(), line))
timestamp = None
if __name__ == '__main__':
main() |