zsh

git url as a command

六月ゝ 毕业季﹏ 提交于 2020-08-06 07:13:03
问题 When I enter a git repo url in terminal it says: % https://github.com/chmln/sd.git zsh: no such file or directory: https://github.com/chmln/sd.git I want https://github.com/chmln/sd.git to act as a command which will git clone https://github.com/chmln/sd.git cd sd How can I do that? 回答1: OP provides more detail on use case. Worth addressing this use case specifically. When a command (git clone in this case) should be assumed, consider ERR trap with the BASH_COMMAND (or $_) trap 'try_gc' ERR

git url as a command

喜欢而已 提交于 2020-08-06 07:11:09
问题 When I enter a git repo url in terminal it says: % https://github.com/chmln/sd.git zsh: no such file or directory: https://github.com/chmln/sd.git I want https://github.com/chmln/sd.git to act as a command which will git clone https://github.com/chmln/sd.git cd sd How can I do that? 回答1: OP provides more detail on use case. Worth addressing this use case specifically. When a command (git clone in this case) should be assumed, consider ERR trap with the BASH_COMMAND (or $_) trap 'try_gc' ERR

MAC下出现HAXM acceleration support is not installed on this host

时光毁灭记忆、已成空白 提交于 2020-08-06 06:13:20
MAC下出现HAXM acceleration support is not installed on this host 博客说明 文章所涉及的资料来自互联网整理和个人总结,意在于个人学习和经验汇总,如有什么地方侵权,请联系本人删除,谢谢! 原因 在网上看资料是因为模拟器的一个sdk缺少 解决 下载和安装HAXM 使用Andorid SDK Manager https://developer.android.google.cn/studio 安装好了之后会要我们安装SDK,在安装sdk的时候会安装HAXM 在我们同意之后就可以啦 查看安装是否成功,查看正在运行 kextstat | grep intel 开启 sudo kextload –b com.intel.kext.intelhaxm 关闭 sudo kextunload –b com.intel.kext.intelhaxm 感谢 万能的网络 以及勤劳的自己 来源: oschina 链接: https://my.oschina.net/guizimo/blog/4277071

[ERROR]: gitstatus failed to initialize.

邮差的信 提交于 2020-08-05 11:23:59
1 问题描述 Manjaro升级后,zsh的主题p10k出现的问题。 Your git prompt may disappear or become slow. Run the following command to retry with extra diagnostics: GITSTATUS_ENABLE_LOGGING=1 gitstatus_start -s 1 -u 1 -d 1 -m -1 POWERLEVEL9K OUTPUT: [ERROR]: gitstatus failed to initialize. ...... 2 解决方法 来自gitstatus官方issue, 戳这里 ,其实就是把p10k主题更新到最新版本就好了,用 pacman -Qi zsh-theme-powerlevel10k 查看版本,若不是最新版本,不要使用自带的软件包升级: pcaman -S zsh-theme-powerlevel10k 官方说这是旧的,不要使用: 因此先把配置文件备份: sudo cp ~/.p10k.zsh ~/Desktop 再卸载掉,然后clone安装: pacman -R zsh-theme-powerlevel10k git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $

使用Composer安装TP5.1出现zsh: no matches found: 5.1.*

余生长醉 提交于 2020-08-05 06:21:24
使用Composer安装TP5.1出现zsh: no matches found: 5.1.* 博客说明 文章所涉及的资料来自互联网整理和个人总结,意在于个人学习和经验汇总,如有什么地方侵权,请联系本人删除,谢谢! 问题提示 zsh: no matches found: 5.1.* 问题解决 在之前还是可以执行的,现在新建的时候出现了现在的问题 解决办法是不使用这个版本模糊的命令,直接确定版本 composer create-project topthink/think=5.1.31 sight 感谢 万能的网络 以及勤劳的自己 关注公众号: 归子莫,获取更多的资料,还有更长的学习计划 来源: oschina 链接: https://my.oschina.net/u/4312205/blog/4336741

Filtering zsh array by wildcard

谁说胖子不能爱 提交于 2020-08-04 15:29:47
问题 Given a Zsh array myarray, I can make out of it a subset array set -A subarray for el in $myarray do if [[ $el =~ *x*y* ]] then subarray+=($el) fi done which, in this example, contains all elements from myarray which have somewhere an x and an y , in that order. Question: Given the plethora of array operations available in zsh, is there an easier way to achieve this? I checked the man page and the zsh-lovers page, but couldn't find anything suitable. 回答1: This should do the trick subarray=(${

How can I check the available shells in Mac OSX?

自作多情 提交于 2020-08-02 05:12:05
问题 How can I check all the different shells that I can use in OSX Terminal application? The default one is bash, and I know zsh because I tried and it worked. I wonder how can I check if there are any more than this two. 回答1: The easy way is go to /etc and check the shells file. The content is the list of shells available in Mac OSX. The included by default are: /bin/bash /bin/csh /bin/ksh /bin/sh /bin/tcsh /bin/zsh Alternatively, you can check their binaries by going to /bin and recognising

mac下的/etc/bash_profile不执行的问题

我与影子孤独终老i 提交于 2020-07-29 07:56:45
最近入手一台新mac, 在设置环境时,发现~/.bashrc不执行,然后发现/etc/profile也不执行, 真是大写的尴尬。 原因: zsh和bash有别, zsh不执行上述脚本,需要改为bash后,才执行。 至于zsh和bash之间的相互切换,网上一搜一大推,故不赘述。 来源: oschina 链接: https://my.oschina.net/u/4419100/blog/4337115

如何高效回退到特定层级目录?

走远了吗. 提交于 2020-07-28 20:32:36
Linux 下如果我们进入到了一个比较长的路径,比如: /home/alvin/projects/blogdemos/linux-system-programming/thread /home/alvin/projects/blogdemos/diff /home/harry/study/亚洲文化/日本文化/中日交流/影视业/动作片 如果我们想要回退到一个特定的父目录,那么我们通常的做法是这样敲: $ cd ../../../ 如果层级比较少,那这样勉强还可以接受,但如果层级很深,那可能就会 cd 到你怀疑人生了。 本文将介绍一个工具,它能帮你快速进入到某一个特定的父目录,而无需一路 cd 。你可以直接指定回退的层级数,或者要回退的目标目录,非常方便。 更重要的是,它甚至还支持 tab 键,而且在不重复的情况下,你也可以指定目标目录的前几个字母即可,大大增加了工作效率。 这个工具其实就是个 shell 脚本,名字是 up.sh ,除了支持 bash 外,对 zsh 和 fish shell 的支持也很好。 up 脚本的安装 这个脚本是第三方人员开发的,所以需要我们人为安装到我们的系统。 首先,我们需要先将 up.sh 下载到我们本地,然后再使能这个脚本: $ curl --create-dirs -o ~/.config/up/up.sh https://raw

homestead安装zsh,解决oh-my-zsh安装失败问题

删除回忆录丶 提交于 2020-07-28 08:04:33
homestead安装zsh提高终端使用体验 zsh是辅助工具,提高用户体验,有非常便捷的提示,很多好用的插件,小编也是折腾好久,跳了好多坑,最终才安装成功的。这里把我安装过程及爬坑经过和大家分享一下,希望小伙伴不会再掉到坑里边浪费时间。 下面正式开始。 首先启动homestead homestead up 等待启动成功之后,ssh进行登录 homestead ssh 然后进入虚拟机中。 安装zsh 官方提供的homestead盒子是ubuntu系统,使用命令安装 # 安装zsh sudo apt install zsh # 查看版本号,检测安装是否成功 zsh --version # 设置默认shell chsh -s $(which zsh) # 注销帐号后执行,查看当前shell是否是zsh echo $SHELL 如果出现上图的效果说明成功了。 接下来就要安装oh-my-zsh 这里是个大坑,好多次安装不上去,发现官网给的地址不对,访问不了,然后搜集很多资料发现正确安装命令如下: sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" 或者 sh -c "$(wget https://raw.githubusercontent.com