zsh

tmux — disable echo of last run command?

狂风中的少年 提交于 2019-12-24 01:14:39
问题 I started using tmux recently and things are good except for the fact that tmux prints out my last run command before output, e.g.: ~ $ pwd pwd/Users/me You can see that it put "pwd" before the directory there, which is annoying. My shell(zsh) doesn't do this when I run commands outside of tmux. show-environment -g doesn't reveal any weird options being passed to zsh or anything: SHELL=/bin/zsh I read through the manpage and Googled around but I can't find anything. Thanks for any help! 回答1:

How to debug Shell command after customization

你离开我真会死。 提交于 2019-12-24 00:49:14
问题 I spent some time on customizing my configuration like many people do. Basically I symlink all my dotfiles (.zshrc, .vimrc,...) from a git repository then I changed a lot of stuff. I'm on Mac OS X and my configuration works very well. However when I use the same dotfiles on Linux (Ubuntu) I get some differences. Most of them are minor differences but on is VERY annoying. I use ZSH and prezto When I do cd I get this message 20:17 ~ ❯ cd Projects script: invalid option -- 'G' Usage: script

Is it possible to copy the tab completion of a command for my linux function?

早过忘川 提交于 2019-12-23 22:28:53
问题 Let's say I have a bash shell function named magic . I want to define a tab completion function _magic which would allow magic to piggyback on the tab completion functions of any given command (if available). In other words, I want magic to be able to do something like this: ~ $ magic git ... <search for _git and use it if found> ~ $ magic cd ... <search for _cd and use it if found> ~ $ magic some-cmd ... <search for _some-cmd and use it if found> I can't seem to find anything online that

Use wildcard expansion to echo all variables in zsh

旧时模样 提交于 2019-12-23 17:59:41
问题 With multiple variables beginning with the same pattern can a wildcard be used to echo all matched patterns? when zzz1=test1; zzz_A=test2; zzza=test3 What is the best way to match all variables starting with zzz. Where something like echo $zzz* or for i in $zzz*; do echo $i; done would output: test1 test2 test3 回答1: So to directly answer based on comments above... No, zsh cannot expand and echo variables using a wildcard, but typeset can provide the desired result. typeset -m 'zzz*' outputs:

In zsh, how do I pass anonymous arrays into functions?

放肆的年华 提交于 2019-12-23 11:46:47
问题 In zsh, how do I pass anonymous arrays into functions? e.g. looking for something like: foo() { echo ${1[2]} '\n'; } a=(abc def ghi) foo $a --> def Or ideally: foo (abc def ghi) 回答1: You can't. Functions take positional parameters like any other command. Note also that your workaround doesn't allow any of the "array" elements to contain whitespace. The cleanest thing I can think of is to require that the caller create a local array, then read it from the function: $ foo() { for element in

NVM cannot load default node with default alias set

↘锁芯ラ 提交于 2019-12-23 03:46:22
问题 My problem is almost the same as this one but i already set the default alias. Once i open a new console nvm does not load the default node, this problem is also present with some SublimeText3 plugins (eslint, jscs for example). The only way to make it work is to add nvm use default after loading nvm but i thik i am doing something wrong. How can i make it work without the hack? My configuration brew 0.9.5 nvm 0.26.0 (installed using brew) zsh (with oh-my-zsh) I have nvm sourced in .zshenv

惠普战66AMD版Manjaro安装体验

时间秒杀一切 提交于 2019-12-22 14:43:44
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 其实早就有要将日常工作和娱乐都搬到Linux平台的想法,毕竟是吃饭的手艺。但是一直不知道哪个发行版适合做日常工作就一直搁置,直到在B站看到一位up主推荐的Manjaro—— 最全Linux装机配置教程 ,就一直心心念念想要试一下。七八月份入了一台笔记本打算做日常学习用,型号为惠普战66AMD升级版——又称HP ProBook 445R G6,CPU为R5 3500U。后来又去了其他城市寻求安身,也就一直没有时间去折腾。 时间步入12月,此时工作已经稳定,心中的欲望抬头,开始折腾手上这台战66了。耗时一周多,总算能日常使用了。 如今写下这篇教程,对自己的热爱做一个总结,希望能帮助到有需要的同学,也希望将来自己能为Linux做出一点贡献. 安装 在 Majaro官网 上下载最新镜像,第一次下的是kde版,界面很精致,整体风格和Windows比较类似,不过在战66这台机子上对触控板的驱动支持似乎不是很好,默认设置中不支持触控板点按模式,需要去设置中更改。因为不喜欢它的风格,第二天立马就换了gnome版本,符合自己的审美,又喜欢它开箱即有的雨滴声效。 下载 rufus ,这里有一个坑,镜像需要选择“dd模式”写入,否则会无法进入安装界面。 进入安装界面后又有一坑,默认的boot设置中 driver=free ,需要改成

OS X终端中是否有任何方法可以逐字移动光标?

回眸只為那壹抹淺笑 提交于 2019-12-22 14:24:40
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 我知道组合Ctrl + A跳转到当前命令的开头,而Ctrl + E跳转到结尾。 但有没有办法逐字逐句跳转,比如Alt + ← / →在Cocoa应用程序中呢? #1楼 实际上有一个更好的方法。 按住选项 (某些键盘上的alt )并按向左或向右箭头键按字键移动。 就那么简单。 选项 ← 选项 → 此外, ctrl e将带您到行尾,而ctrl a将带您到头。 #2楼 在 iterm2 的 Preferences> Profile> Keys下 ,单击 Key Mappings 下面的 + 并记录一个新的快捷方式。 对于 Action ,选择 Send Escape Sequence 并分别向后和向前键入 b 或 f 。 当我尝试为( Ctrl + ← )录制一个时,我在 键盘快捷键 字段中注意到箭头从未出现过。 事实证明我必须首先禁用默认mac的 系统偏好设置>键盘>快捷方式>任务控制 shorcuts以使事情正常工作,因为它们将覆盖iterm2的默认快捷方式。 对于标准终端应用程序也应如此。 #3楼 在Mac OS X上 - 以下键盘快捷键默认工作。 请注意,您必须使 Option 键像终端首选项中的 Meta 一样(在键盘选项卡下) alt(⌥) + F用单词跳转 F 前进 alt(⌥) + B用一个单词跳转

Unable to find a substitute command for Bash's complete in Zsh

一个人想着一个人 提交于 2019-12-22 10:35:17
问题 I put the newest git-completion.bash to my .zshrc and I get /Users/Masi/bin/shells/git/git-completion.bash:2116: command not found: complete /Users/Masi/bin/shells/git/git-completion.bash:2118: command not found: complete The lines are complete -o bashdefault -o default -o nospace -F _git git 2>/dev/null \ || complete -o default -o nospace -F _git git complete -o bashdefault -o default -o nospace -F _gitk gitk 2>/dev/null \ || complete -o default -o nospace -F _gitk gitk Which command is a

How does one override an existing zsh keyboard completion?

自古美人都是妖i 提交于 2019-12-22 09:37:00
问题 I would like to enable zsh to autocomplete modules for yast2 (an OpenSuSE control panel), but it seems to already have some things defined. I can run compctl -k "(hello world)" nonexistantprogram just fine, but compctl -k "(hello world)" yast2 doesn't work at all. Some things for yast2 seem to be already defined, namely the "-" options: --fullscreen, --geometry, --list [submodules], etc. Even if for those who don't use OpenSuSE: Are there any flags to compctl to make it override previous