fisher/docs/zh-CN/README.md

220 lines
4.5 KiB
Markdown
Raw Normal View History

[slack-link]: https://fisherman-wharf.herokuapp.com/
2016-04-23 19:24:39 +02:00
[slack-badge]: https://fisherman-wharf.herokuapp.com/badge.svg
Ahoy my mateys! fisherman 2.0.0 (beta) is here. A lot has changed, in fact, fisherman as you knew it, is no longer with us. Let me explain. The new fisherman, is in fact a rewired clone of ``fin´´, a short-lived 2 week experiment that started because it was easier to rewrite everything than moving fisherman forward. Let me explain. I was longing for a lightweight, simpler fisherman with minimal maintanance cost. This fin lad is one of the most pragmatic pieces of code I've ever written, but attempting to maintain two drastically different plugin managers was not a sane decision. fin's goal was to get out of my way and let me be productive with fish and it did. Now fin is fisherman and fisherman is fin. The most notable change is that fisherman no longer depends on an index, so like fin, it's neutral and agnostic to what plugins you use. No index means fisherman completions are no longer as clever as to show you description of plugins, but you will still get enough information to know whether the plugin is a theme or not. I hope you always check the plugin's README / online docs before installing anything anyway. With the index gone, we had no use for ``search``, so this command is also gone. If you were using search often or depended on the removed features above, I am afraid they are gone *gone*, but trust me it's all for the very best. Now, with this out of the way, it's all unicorns and dartfish. Almost. To upgrade to fisherman 2.0.0 you need to REMOVE your current version of fisherman: 1. ```rm -rf "$fisher_home" "$fisher_config"``` 2. Open your config.fish and remove the fisherman initialization code. 3. ```exec fish < /dev/tty``` to reload the session. 4. Run `curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs git.io/fisherman` That's it. Probably. The new fisherman brings a lot more stability and maturity to the project and we need this change in order to move forward. I will be actively fixing any bugs that may have sneaked in during the ```fin->fisherman``` rewiring, but please do ping me: @bucaran on GitHub or directly to my email j@bucaran.me if you find anything out of place. Feel free and invited to go wild with issues in order to get this into shape ASAP. Cheers!
2016-04-21 17:34:06 +02:00
[travis-link]: https://travis-ci.org/fisherman/fisherman
2016-04-23 19:32:07 +02:00
[travis-badge]: https://img.shields.io/travis/fisherman/fisherman.svg
2016-04-22 07:21:31 +02:00
[organization]: https://github.com/fisherman
[fish shell]: https://github.com/fish-shell/fish-shell
[fisherman]: http://fisherman.sh
[online]: http://fisherman.sh/#search
[English]: ../../README.md
[Español]: ../es-ES
[日本語]: ../jp-JA
[Русский]: ../ru-RU
2016-04-25 09:53:04 +02:00
[한국어]: ../ko-KR
2016-04-22 07:21:31 +02:00
Ahoy my mateys! fisherman 2.0.0 (beta) is here. A lot has changed, in fact, fisherman as you knew it, is no longer with us. Let me explain. The new fisherman, is in fact a rewired clone of ``fin´´, a short-lived 2 week experiment that started because it was easier to rewrite everything than moving fisherman forward. Let me explain. I was longing for a lightweight, simpler fisherman with minimal maintanance cost. This fin lad is one of the most pragmatic pieces of code I've ever written, but attempting to maintain two drastically different plugin managers was not a sane decision. fin's goal was to get out of my way and let me be productive with fish and it did. Now fin is fisherman and fisherman is fin. The most notable change is that fisherman no longer depends on an index, so like fin, it's neutral and agnostic to what plugins you use. No index means fisherman completions are no longer as clever as to show you description of plugins, but you will still get enough information to know whether the plugin is a theme or not. I hope you always check the plugin's README / online docs before installing anything anyway. With the index gone, we had no use for ``search``, so this command is also gone. If you were using search often or depended on the removed features above, I am afraid they are gone *gone*, but trust me it's all for the very best. Now, with this out of the way, it's all unicorns and dartfish. Almost. To upgrade to fisherman 2.0.0 you need to REMOVE your current version of fisherman: 1. ```rm -rf "$fisher_home" "$fisher_config"``` 2. Open your config.fish and remove the fisherman initialization code. 3. ```exec fish < /dev/tty``` to reload the session. 4. Run `curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs git.io/fisherman` That's it. Probably. The new fisherman brings a lot more stability and maturity to the project and we need this change in order to move forward. I will be actively fixing any bugs that may have sneaked in during the ```fin->fisherman``` rewiring, but please do ping me: @bucaran on GitHub or directly to my email j@bucaran.me if you find anything out of place. Feel free and invited to go wild with issues in order to get this into shape ASAP. Cheers!
2016-04-21 17:34:06 +02:00
[![Build Status][travis-badge]][travis-link]
[![Slack][slack-badge]][slack-link]
Ahoy my mateys! fisherman 2.0.0 (beta) is here. A lot has changed, in fact, fisherman as you knew it, is no longer with us. Let me explain. The new fisherman, is in fact a rewired clone of ``fin´´, a short-lived 2 week experiment that started because it was easier to rewrite everything than moving fisherman forward. Let me explain. I was longing for a lightweight, simpler fisherman with minimal maintanance cost. This fin lad is one of the most pragmatic pieces of code I've ever written, but attempting to maintain two drastically different plugin managers was not a sane decision. fin's goal was to get out of my way and let me be productive with fish and it did. Now fin is fisherman and fisherman is fin. The most notable change is that fisherman no longer depends on an index, so like fin, it's neutral and agnostic to what plugins you use. No index means fisherman completions are no longer as clever as to show you description of plugins, but you will still get enough information to know whether the plugin is a theme or not. I hope you always check the plugin's README / online docs before installing anything anyway. With the index gone, we had no use for ``search``, so this command is also gone. If you were using search often or depended on the removed features above, I am afraid they are gone *gone*, but trust me it's all for the very best. Now, with this out of the way, it's all unicorns and dartfish. Almost. To upgrade to fisherman 2.0.0 you need to REMOVE your current version of fisherman: 1. ```rm -rf "$fisher_home" "$fisher_config"``` 2. Open your config.fish and remove the fisherman initialization code. 3. ```exec fish < /dev/tty``` to reload the session. 4. Run `curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs git.io/fisherman` That's it. Probably. The new fisherman brings a lot more stability and maturity to the project and we need this change in order to move forward. I will be actively fixing any bugs that may have sneaked in during the ```fin->fisherman``` rewiring, but please do ping me: @bucaran on GitHub or directly to my email j@bucaran.me if you find anything out of place. Feel free and invited to go wild with issues in order to get this into shape ASAP. Cheers!
2016-04-21 17:34:06 +02:00
# [fisherman] - fish shell plugin manager
2016-04-21 19:16:53 +02:00
fisherman 是一款零配置,并发的 [fish shell] 插件管理器。
2016-04-25 09:53:04 +02:00
选择不同语言版本的文档: [Español], [日本語], [English], [한국어], [Русский]。
2016-04-21 19:16:53 +02:00
##为什么使用fisherman
* 零配置
* 零依赖
* 不影响 shell 启动速度
* 类似 [vundle](https://github.com/VundleVim/Vundle.vim) 的交互下载功能
* 实现了最核心的功能: 安装、更新、移除和查询插件
## 安装
2016-04-24 07:52:04 +02:00
使用curl。
2016-04-21 19:16:53 +02:00
```sh
curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs git.io/fisherman
```
2016-04-24 07:52:04 +02:00
使用npm。
2016-04-23 15:18:24 +02:00
```
npm i -g fisherman
2016-04-23 15:18:24 +02:00
```
2016-04-21 19:16:53 +02:00
## 功能
安装插件。
```
fisher simple
```
从多个源安装插件。
```
fisher z fzf omf/{grc,thefuck}
```
从 URL 安装插件。
```
fisher https://github.com/edc/bass
```
从 Gist 安装插件。
```
fisher https://gist.github.com/username/1f40e1c6e0551b2666b2
```
从本地目录安装插件。
```sh
fisher ~/my_aliases
```
使用 [vundle](https://github.com/VundleVim/Vundle.vim) 的方式安装插件,编辑你的 fishfile 并运行 `fisher` 去安装插件。
2016-04-21 19:16:53 +02:00
> [什么是 fishfile 以及如何使用它?](#6-什么是-fishfile-以及如何使用它)
2016-04-21 19:16:53 +02:00
```sh
2016-04-24 07:52:04 +02:00
$EDITOR fishfile # 添加插件
2016-04-21 19:16:53 +02:00
fisher
```
查看以安装的插件。
```
fisher ls
@ my_aliases # 该插件是一个本地插件
* simple # 该插件是当前的命令行提示符插件
bass
fzf
grc
thefuck
z
```
更新所有。
```
fisher up
```
更新指定的插件。
```
fisher up bass z fzf thefuck
```
移除指定的插件。
```
fisher rm simple
```
移除所有的插件。
```
fisher ls | fisher rm
```
查看插件帮助。
```
fisher help z
```
## 常见疑问解答
### 1. fish 的版本要求多少?
2016-04-24 07:52:04 +02:00
fisherman 要求 2.3.0 及以上版本的 fish。如果正在使用 2.2.0 版本,你可以写入以下[代码片段](#8-什么是一个插件)到你的 `~/.config/fish/config.fish`
2016-04-21 19:16:53 +02:00
```fish
for file in ~/.config/fish/conf.d/*.fish
source $file
end
```
### 2. 如何让 fish 作为我默认的 shell ?
2016-04-21 19:16:53 +02:00
Add fish to the list of login shells in `/etc/shells` and make it your default shell.
把 fish 加入到 `/etc/shells` 并令 fish 成为默认 shell。
```sh
echo "/usr/local/bin/fish" | sudo tee -a /etc/shells
chsh -s /usr/local/bin/fish
```
### 3. 如何卸载 fisherman
2016-04-21 19:16:53 +02:00
运行以下命令。
```fish
fisher self-uninstall
```
2016-04-24 07:52:04 +02:00
或者
```fish
npm un -g fisherman
```
### 4. fisherman 兼容已有的 fish 主题和插件吗?
2016-04-21 19:16:53 +02:00
是的。
### 5. fisherman 把数据放到哪里了?
2016-04-21 19:16:53 +02:00
fisherman 的位置在 `~/.config/fish/functions/fisher.fish`
缓存和插件配置被分别存在 `~/.cache/fisherman``~/.config/fisherman`
fishfile 位置在 `~/.config/fish/fishfile`
### 6. 什么是 fishfile 以及如何使用它?
2016-04-21 19:16:53 +02:00
fishfile `~/.config/fish/fishfile` 列出了所有已安装的插件。
fisherman 安装插件时,会自动写入这个文件,或者你可以手动写入你想装的插件,然后运行 `fisher` 来安装插件
```
fisherman/simple
fisherman/z
omf/thefuck
omf/grc
```
这个文件只会记录插件和一些依赖。如果你想卸载插件,可以使用 `fisher rm`来替代。
### 7. 去哪里可以找到插件?
2016-04-21 19:16:53 +02:00
看看这个 [organization] 或者使用这个 [online] 来搜索。
### 8. 什么是一个插件?
2016-04-21 19:16:53 +02:00
一个插件是:
1. 一个目录或者一个在项目根目录有 `.fish` 文件或者 `functions` 目录的git仓库
2. 一个主题或者命令行提示符,比如 `fish-prompt.fish`, `fish_right_prompt.fish`
2016-04-24 07:52:04 +02:00
3. 一些代码片段,比如一个或多个在 `conf.d`目录下的 `.fish` 文件,并且它们会在 shell 启动时执行。
2016-04-21 19:16:53 +02:00
### 9. 如何把这些插件作为我自己插件的依赖?
2016-04-21 19:16:53 +02:00
在项目的顶层目录创建一个新的 `fishfile` 文件,并写下你的依赖。
```fish
owner/repo
https://github.com/dude/sweet
https://gist.github.com/bucaran/c256586044fea832e62f02bc6f6daf32
2016-04-25 09:53:04 +02:00
```