欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

[Mac]terminal

程序员文章站 2024-03-13 09:13:09
...

下载了个iterm2

顺道把现在terminal的配置记录一下。

xxxx之类的是记得要替换一下。

#~/.bashrc
export PYENV_ROOT="${HOME}/.pyenv"
if [ -d "${PYENV_ROOT}" ]; then
    export PATH=${PYENV_ROOT}/bin:$PATH
    eval "$(pyenv init -)"
fi

PATH=/Users/xxx/Library/Python/2.7/bin:$PATH
complete -C '/Users/xxx/Library/Python/2.7/bin/aws_completer' aws

########to connect to servers
alias conS1='ssh -p 222 [email protected]'
alias conS3='ssh -p 22  [email protected]'
alias conS4='ssh -p 222 [email protected]'

######to change color
if [ $UID -eq 0 ]; then
    PS1="\[\033[31m\]\[email protected]\h\[\033[00m\]:\[\033[01m\]\w\[\033[00m\]\\$ "
else
    PS1="\[\033[36m\]\[email protected]\h\[\033[00m\]:\[\033[01m\]\w\[\033[00m\]\\$ "
fi
alias ls='ls -FG'
alias ll='ls -alFG'
###############

vim ~/.bash_profile


if [ -f ~/.bashrc ]; then
  . ~/.bashrc
fi
# added by Anaconda3 2018.12 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/anaconda3/etc/profile.d/conda.sh"
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<

########### iTerm-Color
#enables colorin the terminal bash shell export
#export CLICOLOR=1
#setsup thecolor scheme for list export
#export LSCOLORS=gxfxcxdxbxegedabagacad
#sets up theprompt color (currently a green similar to linux terminal)
#export PS1='\[\033[01;32m\]\[email protected]\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$     '
#enables colorfor iTerm
#export TERM=xterm-256color
#######################
#~/.vimrc
#这样vim就有颜色了
filetype plugin indent on
syntax on

:set tabstop=4
:set shiftwidth=4
# /.ssh/config
Host    S2
    HostName    xxx.xx.55.8
    Port        22
    User        na.xxxx
    #IdentifyFile   ~/.ssh/id_rsa
    ProxyCommand    ssh -W %h:%p S1
    ServerAliveInterval 60
    ServerAliveCountMax     100000
    LocalCommand        "cd /dynamicpop/"

Host    S1
    HostName    xx.xxx.51.220
    Port        222
    User        na.xxxx
    IdentityFile    ~/.ssh/id_rsa
    ServerAliveInterval 60
    ServerAliveCountMax 100000

Host    D1
    HostName    xx.xxx.51.220
    Port        222
    User        na.xxxx
    IdentityFile    ~/.ssh/id_rsa
    LocalForward    15439 redshift-xxxxxxxxxxx.com:15439
    ServerAliveInterval    60
    ServerAliveCountMax    100000

iterm2

install

brew cask install iterm2

setting

Set hot-key to open and close the terminal to command + option + i

preferences -> keys -> Hotkey(show/hide all windows with a system-wide hotkey)

配置颜色

https://www.jianshu.com/p/6e964940139c
(他让改bash_profile那里就不要改了)
下载https://iterm2colorschemes.com (tar.gz)
iTerm2 的 Preferences >> Profiles >> Colors >> 右下角的 ColorPresets…>> import… >> 刚才解压的那个文件的"schemes"