zsh

oh my zsh showing weird character '?' on terminal

只愿长相守 提交于 2019-12-03 10:52:32
I have installed iTerm2 and Oh-my-zsh. However there is a weird question mark that is coming ever since I have changed ZSH-THEME to "agnoster". Attaching the screenshot for the same. I thought powerline would help but that doesn't seem to happen. Can can anyone help me with this? Installing a powerline patched font will solve this. This official documentation provides description about installing poweline fonts. There are two ways to enable powerline patched font in iTerm2. Set a powerline patched font as default. Set a powerline patched font for only Non-ASCII characters and use another font

Make zsh complete arguments from a file

烈酒焚心 提交于 2019-12-03 10:43:07
问题 zsh is great but its completion system is very diverse. And the documentation lacks good examples. Is there a template for completing for a specific application. The completion would get its match data from a file, separated by newlines? I tried modifying an older example of mine that takes match data "live": ~ % cat .zsh/completers/_jazzup #compdef jazz_up _arguments "2: :(`mpc lsplaylists|sed -e 's# #\\\\ #g'`)" I could supply cat my_file there instead of mpc invocation and so on but would

RVM can't set ruby as default

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have no idea why but RVM can't seem to change the default Ruby. I'm using Oh My Zsh and tried everything I've found but nothing seems to work. Now the Ruby is set as default but RVM doesn't load it as "current", which means it does not load the gemsets that are affiliated to it. I have no .bashrc nor .bash_profile . There is no RVM reference in my .zprofile and here is my .zshrc : # Path to your oh-my-zsh configuration. ZSH=$HOME/.oh-my-zsh # Set name of the theme to load. ZSH_THEME="robbyrussell" DEFAULT_USER="anahkiasen" # Uncomment

Why can't I get the cobalt2 zsh theme to work on my iTerm2?

匿名 (未验证) 提交于 2019-12-03 09:58:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to install this ZSH theme . I downloaded both the iTerm2 and ZSH themes. The iTerm theme was imported through the preferences. The ZSH theme was inserted into ~/.oh-my-zsh/themes along with all the other ZSH themes. When I open my .zshrc and change ZSH_THEME="bobbyrussell" to ZSH_THEME="cobalt2" nothing happens. I restart iTerm but the colors are not changed. Updated with Details: ~ echo $ZSH_THEME cobalt2 ~ echo $PROMPT %/ ~ File: ~/.zshrc # Path to your oh-my-zsh installation. export ZSH=/Users/username/.oh-my-zsh # Set name of the

用CentOS 7打造合适的科研环境

偶尔善良 提交于 2019-12-03 09:54:57
转载:http://seisman.info/linux-environment-for-seismology-research.html#flash 这篇博文记录了我用CentOS 7搭建 地震学科研环境 的过程,供我个人在未来重装系统时参考。对于其他地震学科研人员,也许有借鉴意义。 阅读须知: 本文适用于个人电脑,不适用于服务器; 不推荐刚接触Linux的人使用CentOS发行版; 本文尽量写的浅显易懂,但要求读者掌握Linux基础知识; 本文所有操作均在CentOS 7下完成,其他发行版或多或少与CentOS 7不同,因而仅供参考; 本文所安装的软件纯粹出于个人习惯及喜好,读者应自己判断,按需安装; 安装CentOS CentOS 7的安装与其他Linux发行版的安装差不多,个别地方稍有不同。 准备工作 准备材料 U盘:容量700M以上,用于制作U盘启动盘,因为在制作启动盘时会格式化U盘,所以U盘内不要包含重要资料 CentOS 7.0 LiveCD ISO镜像文件 Universal USB installer :Windows下的U盘启动盘制作工具 一个已安装Windows的电脑:用于制作U盘启动盘 运行Universal USB installer并制作U盘启动盘 将U盘插入计算机,重启,进入BIOS选择从U盘启动,即可进入CentOS的LiveCD 进入LiveCD后

zsh zshrc 默认的提示内容

℡╲_俬逩灬. 提交于 2019-12-03 09:37:54
# 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="/root/.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" # Set list of themes to pick from when loading at random # Setting this variable when ZSH_THEME=random will cause zsh to load # a theme from

zsh: use completions for command X when I type command Y

白昼怎懂夜的黑 提交于 2019-12-03 09:36:17
问题 In zsh, I have a function called g which acts like this: with no arguments, call git status with one or more arguments, delegate to git with all given arguments - i.e. call git $@ I would like the tab completions for g to be exactly the same as for git . I can achieve this with alias g=git , but that doesn't allow me to call status by default (the first point above). How can I delegate to the completion for git ? In bash, I simply did complete -F _git g which re-uses git's completion function

Fish-style Autosuggestion in Zsh?

送分小仙女□ 提交于 2019-12-03 09:11:38
问题 Is there a way to do the type of auto-suggestion Fish does in Zsh? 回答1: https://github.com/tarruda/zsh-autosuggestions does exactly what I wanted. If you want fish-style autopredictions in zsh, use that. 回答2: Zsh has predict , run the commands below this and then hit Ctrl-X 1 or just type predict-on to give it a try #-*-shell-script-*- autoload predict-on autoload predict-off # you may also wish to bind it to some keys... zle -N predict-on zle -N predict-off bindkey '^X1' predict-on bindkey '

Zsh: command not found: webpack

人盡茶涼 提交于 2019-12-03 08:51:14
问题 I'm learning React and installed webpack through npm to my project directory but zsh is not finding the command even though I can see webpack installed in my project. I used npm init --yes followed by npm install --save webpack 回答1: Easy way. Install it globally. npm i -g webpack If you will work with webpack, install webpack-dev-server too npm i -g webpack-dev-server I recommend you first learn a bit about npm and then webpack . 回答2: There is no need to install webpack globally. Try my way:

zsh prompt and hostname

匿名 (未验证) 提交于 2019-12-03 08:48:34
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use the following prompt in .zshrc: PROMPT="%{$fg[magenta]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%1~ %{$reset_color%}%# " When I open terminal I see this prompt: zoltan@zoltan-Macbook-Pro ~ % Is it possible to drop the text "zoltan" in the hostname? I would like to make it look like this: zoltan@Macbook-Pro ~ % Any suggestion would be greatly appreciated. Thank you! 回答1: It's a bit of a mess, but you can pretend the %m is a parameter and use parameter expansion to strip the zoltan from the host name: PROMPT="...${${(%):-%m}#1}