zsh

Using curly braces referencing git revisions/references fails

泄露秘密 提交于 2019-12-01 17:54:13
I am trying to checkout a single file from stash: git checkout stash@{0} -- some/file This fails with fatal: invalid reference: stash@0 Looks like the curly braces are eliminated, but I am not sure about the culprit. The stash revision is there. git stash list returns stash@{0}: WIP on X stash@{1}: WIP on Y I am using git 1.9.1 on zsh. Is there a way to prevent this brace elimination? mklement0 It is generally better to quote strings that contain {...} sequences (e.g., git checkout 'stash@{0}' ... ), because they are subject to brace expansion . (Or, for that matter, single-quote any string

How to specify a custom path for my .zshrc file?

99封情书 提交于 2019-12-01 16:25:26
问题 I'm trying to move .zshrc to a folder where I keep this kind of files synced with Github. But now whenever I start a zsh session it doesn't use that config file. Assuming I changed the file to ~/.dotfiles how can I add ~/.dotfiles/.zshrc to the PATH(?!) to make zsh start with that config? Doing source ~./dotfiles/.zshrc only works for that session. Doesn't work anymore if I close the terminal. 回答1: You can symlink : ln -s /path/to/original /path/to/symlink For the zshrc you can do something

Zshell aliases like !gst inside vim?

雨燕双飞 提交于 2019-12-01 15:39:42
问题 Is there a way to run my zshell aliases inside vim, with the output going to a new split? I'm using oh-my-zsh's git aliases like gst , and I am unable to do :!gst inside vim. Thanks 回答1: Try :set shell=zsh\ -l And put the alias setting to ~/.zshenv Here is the similar question terminal vim not loading .zshrc. 回答2: @tim-green is right! As the man page says: Commands are then read from $ZDOTDIR/.zshenv. If the shell is a login shell, commands are read from /etc/zprofile and then $ZDOTDIR/

zsh not re-computing my shell prompt

怎甘沉沦 提交于 2019-12-01 15:07:26
This might be a bit fringe, but I recently moved to zsh and am having a problem customizing my shell prompt. Part of my .zshrc looks like this: # keeping this simple right now by just printing the date, but imagine this function would look for something specific when moving to a new directory each time function parse_special { print $(date) } autoload -U colors && colors PS1="%{$fg[green]%}%n@%m %{$fg[blue]%}%c %{$fg[yellow]%}%{$(parse_special)%} %{$reset_color%}%# " When I launch terminal, everything looks good; my prompt is what I expect: me@someHost ~ Wed Aug 8 22:56:22 PDT 2012 % But when

zsh not re-computing my shell prompt

半世苍凉 提交于 2019-12-01 14:01:48
问题 This might be a bit fringe, but I recently moved to zsh and am having a problem customizing my shell prompt. Part of my .zshrc looks like this: # keeping this simple right now by just printing the date, but imagine this function would look for something specific when moving to a new directory each time function parse_special { print $(date) } autoload -U colors && colors PS1="%{$fg[green]%}%n@%m %{$fg[blue]%}%c %{$fg[yellow]%}%{$(parse_special)%} %{$reset_color%}%# " When I launch terminal,

MAC bash和zsh切换

China☆狼群 提交于 2019-12-01 10:05:37
bash和zsh切换 切换到bash chsh -s /bin/bash 切换到zsh chsh -s /bin/zsh 记得输入切换命令后,要重新打开终端terminal才生效哦! 大功告成! 来源: https://www.cnblogs.com/brianlai/p/11678542.html

终极 Shell——ZSH

∥☆過路亽.° 提交于 2019-12-01 07:11:30
https://zhuanlan.zhihu.com/p/19556676 在开始今天的 MacTalk 之前,先问两个问题吧: 1、相对于其他系统,Mac 的主要优势是什么? 2、你们平时用哪种 Shell? …… 第一个童靴可以坐下了,Mac 的最大优势是 GUI 和命令行的完美结合,不要把所有注意力放在 Mac 性感的腰身和明媚的显示屏上好吧,这不是妹纸!第二个童靴你可以出去面壁了,讲了这么多期 MacTalk 你告诉我还在用 Windows 的 cmd, 你让 Mac 君情何以堪?哪怕你就说在用 Linux 的 Bash 我也就原谅你了,踢飞! 上次在「如何学习一门编程语言」里提到了 Shell,也有读者问到 Shell 的问题,所以这次给大家说说 Shell 的事。 我在「趣谈个人建站」里介绍过一点 Shell,自己的东西借用下不丢人,把扯淡的拿掉,干货留下,就是如下内容: Shell是Linux/Unix的一个外壳,你理解成衣服也行。它负责外界与Linux内核的交互,接收用户或其他应用程序的命令,然后把这些命令转化成内核能理解的语言,传给内核,内核是真正干活的,干完之后再把结果返回用户或应用程序。 Linux/Unix提供了很多种Shell,为毛要这么多Shell?难道用来炒着吃么?那我问你,你同类型的衣服怎么有那么多件?花色,质地还不一样。写程序比买衣服复杂多了

macOS Catalina 的zsh升级

余生颓废 提交于 2019-12-01 07:11:02
MacOS最近做了一个大版本升级,这次升级中对开发者有个很大的更新是,模式的shell变成了zsh,官方提供了升级配置文档: https://support.apple.com/zh-cn/HT208050 不过这个文档中的配置文件升级方法并不是很好用,用了下面的命令 [[ -e ~/.profile ]] && emulate sh -c 'source ~/.profile' 之后,nvm启动有问题: command not found: complete 最后简单用copy文件的方式转移配置,启动正常。 来源: https://www.cnblogs.com/dhcn/p/11666814.html

Alt+number+dot and Alt+comma in Zsh and Bash

久未见 提交于 2019-12-01 05:18:08
In Bash, we can use Alt + number + . to select the n th argument of previous commands, and Alt + , to select the previous commands. They cycles through the history. For example: $ ls 1 2 $ echo 10 20 Now press and hold Alt, and press 0 then dot, it will show "echo". Without releasing Alt , press . again, it will show "ls". Use 1 in the same operation will show 10 and 1, etc. Pressing Alt and comma shows the whole command line in the history. Also Alt and . show the last argument of the commands in history. Note that all of these operations just insert the argument (or whole command line) to

Manjaro折腾记

…衆ロ難τιáo~ 提交于 2019-12-01 05:09:10
本菜货复活了(雾 前段时间因为中考,导致LYOI二队的大多数成员博客都半死不活了 当然也包括我的 扯回正题 最近在折腾Manjaro 然后自闭了 这篇文章主要记录下自己踩的坑 省的以后再重装又得费事(雾 重装了大概三四次 第一次是手贱改了HOME目录下的目录名还没改配置文件,登陆界面卡住进不去了 第二次是语言选成英文结果换中文还提示更新系统,懒得折腾 第三次说来话长 因为要用VSCode,所以装了个electron,然后发现有个 libicu***.so.64 文件找不到 然后直接上 archive.archlinux.org 下了个icu-64在根目录解压了 code 也能用了 但是软件包更新的时候提示错误,说是在目录下找到了那几个文件,所以无法更新(鬼畜设定 于是就想着删那几个文件 本来应该是 1 (/usr/bin) mv ./*.64 ~/Tmp/ 不慎手滑, 1 (/usr/bin) mv ./* ~/Tmp/ 遂卒 不要用Ultra ISO 用Rufus,选DD模式 其他的按照默认来就好 安装 进启动界面 用方向键把焦点移到 lang=en_US 上,按回车,找到最后的 zh_CN ,按2次回车 driver 选 nonfree (闭源硬件驱动)更好 移到 Boot ,回车 进系统后,把那个向导关上,联网,单击左上角的 Install Manjaro ,选好语言