zsh

在MAC下安装Go环境和beego

微笑、不失礼 提交于 2020-04-21 18:45:00
在MAC下安装Go环境和beego 博客说明 文章所涉及的资料来自互联网整理和个人总结,意在于个人学习和经验汇总,如有什么地方侵权,请联系本人删除,谢谢! 说明 在写一个博客系统需要用到beego,但是电脑有重装了一次,所以这次重新安装一下go的环境 下载go 给出一个下载地址 https://golang.google.cn/dl/ mac电脑使用这个版本的就好了 下载之后我们按照步骤安装即可 测试 go version 配置环境变量 创建GOPATH 系统自己建了一个go的目录,在我们的用户目录下 修改环境变量配置文件 vim ~/.bash_profile 添加配置 export GOPATH=${HOME}/go export PATH=${PATH}:${GOPATH}/bin 应用配置文件 source ~/.bash_profile 安装beego go get github.com/astaxie/beego 输入这个命令之后感觉等待了一万年 解决go get 很慢问题 解决这个问题,打开hosts文件,加上这两段 192.30.253.112 github.com 151.101.185.194 github.global.ssl.fastly.net 安装bee go get github.com/beego/bee 测试 bee version 感谢

Restricting zstyle completion to functions in a zsh plugin

巧了我就是萌 提交于 2020-04-18 05:44:17
问题 I want to add smart completion to a custom Oh My Zsh plugin. Presently, the plugin contains >150 functions like this: qq-enum-dns-txfr-host qq-enum-dns-brute-rev qq-enum-dns-tcpdump qq-enum-web-php-lfi-logfile qq-enum-smb-tcpdump qq-enum-web-php-ffuf-common-php qq-enum-ftp-tcpdump This answer helpfully explained how to get e.g. qq-tcp Tab to complete to the three tcpdump options. This works: zstyle ':completion:*' matcher-list 'r:|[-]=**' However, setting this in the plugin overwrites the

OhMyZsh: override Git plugin aliases with custom multi-line aliases / functions

我只是一个虾纸丫 提交于 2020-04-17 22:49:25
问题 tl;dr - I want to override OhMyZsh's Git aliases with multi-line aliases / functions. I'm trying to make the switch over from bash to zsh and migrate my aliases. I'm able to override Git aliases from OhMyZsh via this (example): alias grs="git restore --staged ." However, when I try to use zsh functions (for aliases that already exist in OhMyZsh): grs() { if [ $# -eq 0 ] then git restore --staged . else git restore --staged "$@" fi } it results in this error: /Users/StevenChoi/.aliases/.zsh

OhMyZsh: override Git plugin aliases with custom multi-line aliases / functions

℡╲_俬逩灬. 提交于 2020-04-17 22:42:23
问题 tl;dr - I want to override OhMyZsh's Git aliases with multi-line aliases / functions. I'm trying to make the switch over from bash to zsh and migrate my aliases. I'm able to override Git aliases from OhMyZsh via this (example): alias grs="git restore --staged ." However, when I try to use zsh functions (for aliases that already exist in OhMyZsh): grs() { if [ $# -eq 0 ] then git restore --staged . else git restore --staged "$@" fi } it results in this error: /Users/StevenChoi/.aliases/.zsh

centos默认终端bash美化、颜色设置

南楼画角 提交于 2020-04-11 10:55:55
centos默认终端bash是一个很简单的界面,又无法通过像zsh一样直接安装主题和代码高亮插件,但是我们可以在bashrc的配置文件中通过代码实现一部分功能: 1、代码介绍: 这里推荐一篇大佬的文章: http://blog.sina.com.cn/s/blog_6d0cbb0301019egu.html 里面有详细的介绍,也可跟着他的思路进行配置 有一点注意: 我不推荐文章中的省略路径的设置,路径过长可通过 ‘\n’ 代码段换行,这样更实用 2、全局配置颜色: 打开配置文件: sudo vim ~/.bashrc 在最后加一行: PS1= ' [\[\e[33;40m\]\u@\h \w \t]$ ' 然后使之生效: source ~/.bashrc 注意: 这个更省事,但是同时你需要自己去终端首选项中调整合适的主题颜色让代码行不突兀,不太推荐。 3、懒人专用推荐配置代码段: 这里引用了大佬的配置: https://blog.csdn.net/lixiangyong123/article/details/52205073 差不多的步骤: 打开配置文件: sudo vim ~/.bashrc 在最后加上: PS1= ' ${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[00m\]@\h: \[\033[01;36m

面试资源、公共API、多样化学习路径,这10个GitHub库开发者必看

本小妞迷上赌 提交于 2020-04-10 10:25:57
本文介绍了十个适合软件工程师的 GitHub 库。 选自Medium,作者:Simon Holdorf,机器之心编译,参与:魔王。 GitHub 是共享各种技术、框架、库和集合的头号平台,越来越多的人到该平台寻找最有用的库。本文作者全栈工程师 Simon Holdorf 列举了十个能够为所有软件工程师提供巨大价值的 GitHub 库。这些库均具备大量 GitHub 星数,显示其关联性、流行性和效用。 其中一些库可以帮助大家学习新知识,还有的可以帮助构建很酷的东西,不论如何所有库都能够帮助你成为更好的软件工程师。 1. Build Your Own X GitHub 星数:61,300 GitHub 地址: https:// github.com/danistefanov ic/build-your-own-x 该库囊括了大量教程,教你如何构建自己的技术。同时,这里还有关于如何构建命令行工具、操作系统、搜索引擎、3D 渲染器等的示例。 想创建自己的编程语言,或属于自己的 Docker、Git 吗?这个库是你的不错选择。 2. Free Programming Books GitHub 星数:139,000 GitHub 地址: https:// github.com/EbookFoundat ion/free-programming-books 尽管该库的名字是 Free

Command not found go — on Mac after installing Go

僤鯓⒐⒋嵵緔 提交于 2020-04-07 21:57:14
问题 I want to use golang, but I'm having trouble running the go command. I installed go1.5.2 darwin/amd64, but when I run the command go version , I get an error in the terminal zsh: command not found: go . I added the path export PATH=$PATH:/usr/local/go/bin to the bash profile, but I still get the error (I restarted the terminal btw). I uninstalled and reinstalled, but no luck. Can anybody help me troubleshoot this? I'm not sure if there was an error in the installation, but it downloaded ok. I

Command not found go — on Mac after installing Go

半城伤御伤魂 提交于 2020-04-07 21:54:10
问题 I want to use golang, but I'm having trouble running the go command. I installed go1.5.2 darwin/amd64, but when I run the command go version , I get an error in the terminal zsh: command not found: go . I added the path export PATH=$PATH:/usr/local/go/bin to the bash profile, but I still get the error (I restarted the terminal btw). I uninstalled and reinstalled, but no luck. Can anybody help me troubleshoot this? I'm not sure if there was an error in the installation, but it downloaded ok. I

提升你的 Vim 技能的 5 个方法 | Linux 中国

三世轮回 提交于 2020-04-06 14:02:04
通过一些有趣的小技巧使你的文本编辑器更上一层楼。 -- Detlef Johnson(作者) Vim 是最受欢迎的文本编辑器之一,因此绝对值得你花时间去学习如何使用它。就算你只是学习使用这个无处不在的 Vi(m) 命令行文本编辑器打开文件、输入和编辑一些文本、保存编辑的文件并退出程序,你都会受益匪浅。 你会发现,使用 Vim 非常方便的的场景几乎总是涉及到运行远程 Shell 操作的任务。如果你时不时地使用 ssh,比如 $ ssh user@hostname.provider.com 并在虚拟专用服务器(VPS)或本地虚拟化容器中工作,那么就可以从这些强大的 Vim 技能中受益匪浅。 将 Vim 设置为默认的文本编辑器 几乎所有的现代 Linux(或 BSD)发行版中,都可以在终端仿真器的 shell 命令提示符下使用 Vim。一旦在你的用户 shell 程序中将 Vim 定义为默认编辑器后,那么就可以使用熟悉的 Vim 键绑定来在内置的实用程序(例如 man )中导航。我将说明如何使用 Bash 和 Z shell(zsh)来实现此目的,zsh 现在是 macOS 用户的默认 shell(自 Catalina 起)。 在 Bash 中将 Vim 设置为默认 Bash 通过点文件的组合来管理设置。最常见的的做法将你的编辑器添加到主目录中的 .bashrc 文件中

WSL安装oh-my-zsh并配置插件

試著忘記壹切 提交于 2020-04-06 02:08:23
安装WSL 进入 设置 -> 更新和安全 -> 开发者选项 , 勾选启用 开发者模式 . 进入 控制面板 -> 程序和功能 -> 启用或关闭Windows功能 , 勾选启用 适用于Linux的Windows子系统 . 前往微软商店, 搜索 Ubuntu 安装 Ubuntu 18.04 LTS , 完成后设置默认账户与密码. 备份WSL的源, 配置为清华大学Ubuntu源, 参考 清华大学开源软件镜像站 执行 sudo apt-get update 与 sudo apt-get upgrade , 升级软件. 安装zsh 执行 sudo apt-get install zsh , 安装zsh. 安装oh-my-zsh 执行 sudo sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" 安装oh-my-zsh. 执行 echo "bash -c zsh" >> ~/.bashrc , 用户登录时启动zsh. 安装 Menlo-for-Powerline 字体, 否则zsh会有乱码. 配置oh-my-zsh插件 执行 git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM