zsh

How can I change the color of my prompt in zsh (different from normal text)?

。_饼干妹妹 提交于 2019-12-17 21:39:40
问题 To recognize better the start and the end of output on a commandline, I want to change the color of my prompt, so that it is visibly different from the programs output. As I use zsh, can anyone give me a hint? 回答1: Here's an example of how to set a red prompt: PS1=$'\e[0;31m$ \e[0m' The magic is the \e[0;31m (turn on red foreground) and \e[0m (turn off character attributes). These are called escape sequences. Different escape sequences give you different results, from absolute cursor

How can I change the color of my prompt in zsh (different from normal text)?

元气小坏坏 提交于 2019-12-17 21:28:16
问题 To recognize better the start and the end of output on a commandline, I want to change the color of my prompt, so that it is visibly different from the programs output. As I use zsh, can anyone give me a hint? 回答1: Here's an example of how to set a red prompt: PS1=$'\e[0;31m$ \e[0m' The magic is the \e[0;31m (turn on red foreground) and \e[0m (turn off character attributes). These are called escape sequences. Different escape sequences give you different results, from absolute cursor

E185: Cannot find color scheme solarized

穿精又带淫゛_ 提交于 2019-12-17 18:33:28
问题 I have Solarized installed via pathogen and it's been working fine in both terminal and MacVim on my Mac. Today, I tried setting up an Ubuntu box on Linode. I just cloned my dotfiles and symlinked to my .vim and .vimrc folders (this is the same setup as I use on my local machine. Whenever I try to run vim on the Ubuntu box I get an error Error detected while processing /root/.vimrc: line 43: E185: Cannot find color scheme solarized Press ENTER or type command to continue I can tell my .vimrc

How do I delete a shell function?

末鹿安然 提交于 2019-12-17 17:27:14
问题 I have done this: $ z() { echo 'hello world'; } How do I get rid of it? 回答1: unset -f z Will unset the function named z. A couple people have answered with: unset z but if you have a function and a variable named z only the variable will be unset, not the function. 来源: https://stackoverflow.com/questions/245406/how-do-i-delete-a-shell-function

Can a Bash tab-completion script be used in zsh?

早过忘川 提交于 2019-12-17 17:24:28
问题 I have a Bash tab-completion script for Apache's Hadoop. Normally, I use zsh as my day-to-day shell. It tends to be pretty bash-like when I need it to be, but it looks like the tab-completion systems are radically different between them. Is there a simple way to "convert" the existing bash-tab-completion definitions to work in zsh? I don't want to invest a ton of time in this, but if it's easy I'd save a moderate amount of effort. 回答1: From this page (dated 2010/01/05): Zsh can handle bash

【Ubuntu】美化

旧时模样 提交于 2019-12-17 10:45:55
美化终端 安装zsh sudo apt-get install -y zsh 安装好了zsh之后,安装oh-my-ssh,官网https://ohmyz.sh/ 在安装 oh-my-zsh之前需要安装git sudo apt-get install git 可以通过curl和wget安装。 --curl: sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" --wget sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" 安装好之后会显示是否要设置zsh为默认。不设置的话,可以输入zsh来打开,在zsh中输入bash也可以打开系统默认的bash      更换oh-my-zsh的主题 这里列出了所有的主题名字,只需要在oh-my-zsh的配置文件中改为主题的名字,就能应用了。 这里推荐一个主题 agnoster 安装这个主题,需要用到一些特殊字符,需要先安装字体库: sudo apt-get install fonts-powerline 然后修改~/.zshrc文件 此处修改为主题名字即可   修改默认终端 chsh -s

Mac OS 终端利器 iTerm2

天大地大妈咪最大 提交于 2019-12-16 18:26:36
之前一直使用 Mac OS 自带的终端,用起来虽然有些不太方便,但总体来说还是可以接受的,是有想换个终端的想法,然后今天偶然看到一个终端利器 iTerm2,发现真的很强大,也非常的好用,按照网上配置了主题什么的,还是有些坑的,这边再记录下,以便后面查阅。 1. 安装 iTerm2 下载地址:https://www.iterm2.com/downloads.html 下载的是压缩文件,解压后是执行程序文件,你可以直接双击,或者直接将它拖到 Applications 目录下。 或者你可以直接使用 Homebrew 进行安装: $ brew cask install iterm2 2. 配置 iTerm2 主题 iTerm2 最常用的主题是 Solarized Dark theme,下载地址:http://ethanschoonover.com/solarized 下载的是压缩文件,你先解压一下,然后打开 iTerm2,按 Command + , 键,打开 Preferences 配置界面,然后 Profiles -> Colors -> Color Presets -> Import ,选择刚才解压的 solarized->iterm2-colors-solarized->Solarized Dark.itermcolors 文件,导入成功,最后选择 Solarized Dark 主题

解决zsh中无法正常使用home和end等键的问题

巧了我就是萌 提交于 2019-12-16 00:52:58
在.zshrc中添加: # key bindings bindkey "\e[1~" beginning-of-line bindkey "\e[4~" end-of-line bindkey "\e[5~" beginning-of-history bindkey "\e[6~" end-of-history bindkey "\e[3~" delete-char bindkey "\e[2~" quoted-insert bindkey "\e[5C" forward-word bindkey "\eOc" emacs-forward-word bindkey "\e[5D" backward-word bindkey "\eOd" emacs-backward-word bindkey "\ee[C" forward-word bindkey "\ee[D" backward-word bindkey "^H" backward-delete-word # for rxvt bindkey "\e[8~" end-of-line bindkey "\e[7~" beginning-of-line # for non RH/Debian xterm, can't hurt for RH/DEbian xterm bindkey "\eOH" beginning-of-line

Ubuntu的一些笔记

白昼怎懂夜的黑 提交于 2019-12-14 21:39:21
离线联网 以Ubuntu 18.04 LTS为例 下载链接 中文下载链接 英文下载链接 解压镜像文件找到pool文件 根据路径 pool->restricted->b->bcmwl 找到文件 bcmwl-kernel-source_6.30.223.248+bdcom-0ubuntu8_amd64.deb 打开切换到该位置执行 ` sudo dpkg -i bcmwl-kernel-source_6.30.223.248+bdcom-0ubuntu8_amd64.deb 这时候一般会提示缺少依赖 缺少的依赖在pool文件目录下都有 参照上面的方法执行安装 装完依赖再执行安装 bcmwl-kernel-source_6.30.223.248+bdcom-0ubuntu8_amd64.deb 就可以连接WiFi啦 安装 sudo apt update Vim sudo apt - get install vim Git sudo apt - get install git Curl sudo apt - get install curl 终端(Terminal)美化 通过命令查看shell: cat / etc / shells 当前shell: echo $SHELL 安装zsh sudo apt - get install zsh 切换shell chsh - s / bin /

我的 .zshrc 配置备份

﹥>﹥吖頭↗ 提交于 2019-12-14 09:20:16
# If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:/usr/local/bin:$PATH alias log_project_neibu = "ssh -t log_dev_143 'cd /tol/logs/kooup-dubbo-project-neibu; bash'" alias log_pc_student_neibu = "ssh -t log_dev_143 'cd /tol/logs/kooup-webapp-student-neibu; bash'" alias log_mobi_student_neibu = "ssh -t log_dev_143 'cd /tol/logs/kooup-webapp-mobile-student-neibu; bash'" export M2_HOME = /Users/yakuiguo/dev/mvn/maven export PATH = $PATH : $M2_HOME /bin # Path to your oh-my-zsh installation. export ZSH = "/Users/yakuiguo/.oh-my-zsh" # Set name of the theme to load