切換Python環境 linux終端命令行 zsh


切換Python環境

conda info -e // 查看有什么環境

source activate env //切換環境

linux終端分屏 terminator 

https://www.jianshu.com/p/5d1999d05d36
安裝 : sudo apt-get install terminator

[ ctrl+alt+E垂直分屏, ctrl + alt+O水平分屏, ctrl + alt + D : close [右鍵也可以] ,Ctrl+Shift+X 當前分割的窗口最大化]

Ctrl+Shift+N  或者  Ctrl+Tab

在分割的不同窗口之間切換(向后)

Ctrl+Shift+P

在分割的不同窗口之間切換(向前)

Alt+A

將所有分割terminator同步

Alt+O

關閉分割terminator同步

美化配置:

修改或者創建.config/terminator/config文件,添加如下配置

[global_config]
  title_font = Ubuntu Mono 11[keybindings]
[layouts]
  [[default]]
    [[[child1]]]
      parent = window0
      type = Terminal
    [[[window0]]]
      parent = ""
      type = Window
[plugins]
[profiles]
  [[default]]
    background_color = "#002b36"
    background_darkness = 1
    background_image = None
    background_type = transparent
    font = Ubuntu Mono 11
    foreground_color = "#e0f0f1"
    use_system_font = False
    show_titlebar = False

 

linux 自動補全插件

轉自: https://blog.csdn.net/w5688414/article/details/83036991

https://www.jianshu.com/p/c987e6632bc4

zsh是一個類似余linux上原生bash shell的一個shell,是原生的bash shell的拓展,我們在敲擊命令的時候,歷史命令都會經常的被用到,如果terminal能夠提示,就大大減少了我們的敲擊歷史命令的時間了,這樣能夠提高效率,但是原生的shell並沒有提供這種功能,我這里用zsh解決。

1. oh-my-zsh安裝

這種自動安裝方式可能不能成功

    sudo apt-get update
    sudo apt-get install zsh
    sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"  

然后termianl關閉,然后重新登陸就可以啟用zsh啦

手動安裝oh-my-zsh

 

  • sudo apt-get update
  • sudo apt-get install zsh
為root用戶修改默認shell為zsh,安裝完成后設置當前用戶使用 zsh:chsh -s /bin/zsh,根據提示輸入當前用戶的密碼就可以了。

安裝oh-my-zsh

git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc

 

2.zsh-autosuggestions安裝 [自動補全歷史命令」

    git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
    source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh

然后你會驚奇的發現,你在敲擊一些命令的時候,會自動提示你的歷史命令,是不是很好用。zsh的更多功能,請參考我的參考文獻哈。

但是這樣重新打開terminal的時候,你會發現沒有提示了,這個時候我們需要在zshrc中加入source操作

    vim ~/.zshrc
     
    找個空地方把下面的配置添加上去

    # Load zsh-autosuggestions.
    source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh

:wq保存退出,然后重新打開的時候就可以自動提示了

 

3、安裝高亮:

下載:

cd ~/.oh-my-zsh/custom/plugins

git clone git://github.com/zsh-users/zsh-syntax-highlighting.git

配置:

sudo vim .zshrc

添加 zsh-autosuggestions

plugins=(

git

zsh-syntax-highlighting

)

保存退出!
然后source ~/.zshrc

 

 

卸載:uninstall_oh_my_zsh


我的zshrc文件配置為:

 # 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/wu/.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/robbyrussell/oh-my-zsh/wiki/Themes
    ZSH_THEME="robbyrussell"
     
     
    plugins=(
      git
    )
     
     
    # Load zsh-autosuggestions.
    source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh
     
     
    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"
     
    # ssh
    # export SSH_KEY_PATH="~/.ssh/rsa_id"
     
    # 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"
Ctrl+Shift+N 在分割的不同窗口之間切換(向后)
Ctrl+Shift+P 在分割的不同窗口之間切換(向前)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM