fisher/docs/zh-CN/README.md

170 lines
3.4 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
2016-05-14 07:17:27 +02:00
[fish]: https://github.com/fish-shell/fish-shell
2016-04-22 07:21:31 +02:00
[fisherman]: http://fisherman.sh
[online]: http://fisherman.sh/#search
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]
2016-05-14 07:17:27 +02:00
# [fisherman]
2016-05-14 10:17:54 +02:00
fisherman 是 [fish] 的插件管理器。
2016-04-21 19:16:53 +02:00
## 安装
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-05-17 19:48:02 +02:00
fisher sol
2016-04-21 19:16:53 +02:00
```
从多个源安装插件。
```
2016-05-14 07:17:27 +02:00
fisher z fzf edc/bass omf/thefuck
2016-04-21 19:16:53 +02:00
```
从 Gist 安装插件。
```
fisher https://gist.github.com/username/1f40e1c6e0551b2666b2
```
从本地目录安装插件。
```sh
2016-05-14 07:17:27 +02:00
fisher ~/plugin
2016-04-21 19:16:53 +02:00
```
使用 [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-05-14 10:17:54 +02:00
$EDITOR fishfile
2016-04-21 19:16:53 +02:00
fisher
```
查看以安装的插件。
2016-04-27 18:11:48 +02:00
```ApacheConf
2016-04-21 19:16:53 +02:00
fisher ls
2016-05-14 07:17:27 +02:00
@ plugin # 该插件是一个本地插件
2016-05-17 19:48:02 +02:00
* sol # 该插件是当前的命令行提示符插件
2016-04-21 19:16:53 +02:00
bass
fzf
grc
thefuck
z
```
2016-04-29 10:59:10 +02:00
列出远程插件。
2016-05-14 10:17:54 +02:00
```
fisher ls-remote
```
2016-04-29 10:59:10 +02:00
2016-05-14 10:17:54 +02:00
更新所有插件。
2016-04-21 19:16:53 +02:00
```
fisher up
```
更新指定的插件。
```
fisher up bass z fzf thefuck
```
移除指定的插件。
```
2016-05-14 07:17:27 +02:00
fisher rm thefuck
2016-04-21 19:16:53 +02:00
```
移除所有的插件。
```
fisher ls | fisher rm
```
查看插件帮助。
```
fisher help z
```
2016-05-14 10:17:54 +02:00
卸载 fisherman
```
fisher self-uninstall
```
2016-04-21 19:16:53 +02:00
## 常见疑问解答
2016-05-14 07:17:27 +02:00
### fish 的版本要求多少?
2016-04-21 19:16:53 +02:00
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
```
2016-05-14 07:17:27 +02:00
### fisherman 兼容已有的 fish 主题和插件吗?
2016-04-21 19:16:53 +02:00
是的。
2016-05-14 07:17:27 +02:00
### fisherman 把数据放到哪里了?
2016-04-21 19:16:53 +02:00
2016-05-05 18:22:24 +02:00
fisherman 的位置在 *~/.config/fish/functions/fisher.fish*
缓存和插件配置被分别存在 *~/.cache/fisherman**~/.config/fisherman*
fishfile 位置在 *~/.config/fish/fishfile*
2016-04-21 19:16:53 +02:00
2016-05-14 07:17:27 +02:00
### 什么是 fishfile 以及如何使用它?
2016-04-21 19:16:53 +02:00
2016-05-05 18:22:24 +02:00
fishfile *~/.config/fish/fishfile* 列出了所有已安装的插件。
2016-04-21 19:16:53 +02:00
fisherman 安装插件时,会自动写入这个文件,或者你可以手动写入你想装的插件,然后运行 `fisher` 来安装插件
```
2016-05-17 19:48:02 +02:00
fisherman/sol
2016-04-21 19:16:53 +02:00
fisherman/z
omf/thefuck
omf/grc
```
这个文件只会记录插件和一些依赖。如果你想卸载插件,可以使用 `fisher rm`来替代。
2016-05-14 07:17:27 +02:00
### 什么是一个插件?
2016-04-21 19:16:53 +02:00
一个插件是:
2016-05-05 18:22:24 +02:00
1. 一个目录或者一个在项目根目录有 *.fish* 文件或者 *functions* 目录的git仓库
2016-04-21 19:16:53 +02:00
2016-05-05 18:22:24 +02:00
2. 一个主题或者命令行提示符,比如 `fish-prompt.fish`, *fish_right_prompt.fish*
2016-04-21 19:16:53 +02:00
2016-05-05 18:22:24 +02:00
3. 一些代码片段,比如一个或多个在 *conf.d*目录下的 *.fish* 文件,并且它们会在 shell 启动时执行。
2016-04-21 19:16:53 +02:00
2016-05-14 07:17:27 +02:00
### 如何把这些插件作为我自己插件的依赖?
2016-04-21 19:16:53 +02:00
2016-05-05 18:22:24 +02:00
在项目的顶层目录创建一个新的 *fishfile* 文件,并写下你的依赖。
2016-04-21 19:16:53 +02:00
```fish
owner/repo
2016-05-02 20:02:48 +02:00
https://github.com/owner/repo
2016-05-05 18:22:24 +02:00
https://gist.github.com/owner/c256586044fea832e62f02bc6f6daf32
2016-04-25 09:53:04 +02:00
```