zsh

【Linux】(一)美化Linux终端之oh-my-zsh开源项目(Linux终端主题)

大兔子大兔子 提交于 2020-07-28 01:57:10
目录 1、查看系统是否装了zsh 2、安装zsh(系统没有查到zsh,则安装) 3、切换shell为zsh 4、重启Linux 5、安装oh my zsh 6、到此就安装完成 7、更换主题 8、生效主题 使用开源项目oh-my-zsh,让你的终端界面炫酷。配置简单。 1、查看系统是否装了zsh //查看当前使用的shell echo $SHELL //查看系统是否装了zsh cat /etc/shells 2、安装zsh(系统没有查到zsh,则安装) yum -y install zsh 或者 sudo apt-get install zsh 3、切换shell为zsh chsh -s /bin/zsh 4、重启Linux //查看当前shell,如果显示/bin/zsh,则配置成功 echo $SHELL 5、安装oh my zsh sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)" 6、到此就安装完成 此时你可以看到终端的主题和以前不一样(此时新增了这个目录:~/.oh-my-zsh) 7、更换主题 vim ~/.zshrc #更改ZSH_THEME="robbyrussell"中双引号主题,本人使用的主题:ZSH_THEME="pygmalion" oh-my

真 ● 禁秘技 ● 奥义 ● 终端美化

点点圈 提交于 2020-07-26 00:06:47
1 概述 作为一个程序员,可以没钱,没车,没房,没老婆,没女朋友。 但是,一定要有一个漂亮骚气的终端。 没错,大骚特骚。 说什么大实话。 先来看看原生的终端: 真漂亮啊。 再看看美化过的: 这才叫终端嘛。 美化过的就是不一样。 如果您也想要这样的终端,那这篇文章要仔细看,同时顺手点个赞。 文章讲述了如何使用zsh+oh-my-zsh,配合主题Powerlevel9k/Powerlevel10k(以下简称p9k/p10k)进行终端美化的过程,不废话了,进入正题。 2 环境 笔者环境: Manjaro 20.0 Xfce 自带的Xfce terminal 其他linux基本适用,安装zsh+oh-my-zsh即可,mac用户可以通过homebrew安装zsh+p9k/p10k,至于win用户,自行搜索吧。 3 准备工作 安装zsh+oh-my-zsh。 3.1 zsh Manjaro/Arch: sudo pacman -S zsh Debian系: sudo apt install zsh RedHat系: sudo yum install -y zsh 其他可以来到官方github安装, 戳这里 。 设为默认shell: chsh -s $(which zsh) 再把原来的别名复制到 ~/.zshrc 3.2 oh-my-zsh 通过脚本安装即可,使用curl或wget: sh

Rename directories recursively from pascal or camel case to kebab case

邮差的信 提交于 2020-07-22 05:11:09
问题 It would be best if I could just use the rename command. But I think we have to use two regex. The sed command that is working is % echo MyExPression | sed --expression 's/\([A-Z]\)/-\L\1/g' --expression 's/^-//' my-ex-pression % echo myExPression | sed --expression 's/\([A-Z]\)/-\L\1/g' --expression 's/^-//' my-ex-pression I figured out that we can use for file in ./* ; do mv "$file" "$(echo $file|sed -e 's/\([A-Z]\)/-\L\1/g' -e 's/^.\/-//')" ; done But this command has multiple problems. It

Shuffle output of find with fixed seed

亡梦爱人 提交于 2020-07-15 15:19:50
问题 I would like to shuffle output of find BUT with a fixed seed, so that every time I run the command I get the same output. Here's how I shuffle: find . -name '*.wav' | shuf The issue is that every time we have a new seed -> new order. My attempt to fix it: find . -name '*.wav' | shuf --random-source=<(echo 42) That works only on occasions (i.e. just a few cases, in a deterministic way). Most of the time it fails with: shuf: ‘/proc/self/fd/12’: end of file Same error is produced by e.g. seq 1

Somehow I can’t instal Homebrew

假装没事ソ 提交于 2020-07-10 10:26:29
问题 As described on the homebrew site (https://brew.sh/) this should be pretty straightforward, just open the terminal, paste and run. However, somehow it is not working for me and now a couple of hours in, I am getting very frustrated. I am a rookie and suspect this is some easy fix thing, so I would appreciate some help. I am on macOS Catalina, using zsh , and when I paste and run nothing happens, the cursor goes to the next line, and I can type, but nothing runs, no feedback. Which I

Somehow I can’t instal Homebrew

本小妞迷上赌 提交于 2020-07-10 10:26:23
问题 As described on the homebrew site (https://brew.sh/) this should be pretty straightforward, just open the terminal, paste and run. However, somehow it is not working for me and now a couple of hours in, I am getting very frustrated. I am a rookie and suspect this is some easy fix thing, so I would appreciate some help. I am on macOS Catalina, using zsh , and when I paste and run nothing happens, the cursor goes to the next line, and I can type, but nothing runs, no feedback. Which I

npm global install commands not found on zsh

安稳与你 提交于 2020-07-05 10:57:07
问题 I just installed the package live-server using npm install -g live server I checked and the package is currently installed at /Users/username/.npm-global/lib/node_modules/live-server/live-server.js However, when I try to run live-server from the command line I get the error zsh: command not found: live-server What do I need to do to be able to run live-server? I have oh-my-zsh installed and I'm worried that may be causing my issue. I understand it should have something to do with setting my

WARNING: this script is deprecated, please see git-completion.zsh

廉价感情. 提交于 2020-07-05 05:23:24
问题 I'm using oh-my-zsh and I get this error every time I open terminal: WARNING: this script is deprecated, please see git-completion.zsh is there any solution to that? 回答1: Might seems silly, but make sure that you source your ~/.zshrc file (create one if it does not exists). On OSX I completely forgot that I had switched to zsh, and got the error you mentioned because I was doing source ~/.bashrc The easiest way to get auto-completion working is to install it through Homebrew with brew install

WARNING: this script is deprecated, please see git-completion.zsh

℡╲_俬逩灬. 提交于 2020-07-05 05:22:49
问题 I'm using oh-my-zsh and I get this error every time I open terminal: WARNING: this script is deprecated, please see git-completion.zsh is there any solution to that? 回答1: Might seems silly, but make sure that you source your ~/.zshrc file (create one if it does not exists). On OSX I completely forgot that I had switched to zsh, and got the error you mentioned because I was doing source ~/.bashrc The easiest way to get auto-completion working is to install it through Homebrew with brew install

Shortening my prompt in Zsh

放肆的年华 提交于 2020-06-24 08:24:05
问题 I'm having a lot of trouble getting zsh to shorten my prompt. I'm currently using zsh with the agnoster theme and oh-my-zsh package manager. My prompt currently gets annoyingly long during work, usually around 110 characters, taking up the entire length of my terminal, which is just not very aesthetically pleasing. I've looked at a few other people's .zshrc's and attempts to modify their prompt, but nothing seems to work in mine. I've tried copying many, many things into my .zshrc and have