diff options
Diffstat (limited to '.local/src/blesh/doc/contrib')
-rw-r--r-- | .local/src/blesh/doc/contrib/LICENSE | 28 | ||||
-rw-r--r-- | .local/src/blesh/doc/contrib/README-ja.md | 97 | ||||
-rw-r--r-- | .local/src/blesh/doc/contrib/README.md | 172 |
3 files changed, 297 insertions, 0 deletions
diff --git a/.local/src/blesh/doc/contrib/LICENSE b/.local/src/blesh/doc/contrib/LICENSE new file mode 100644 index 0000000..074fea0 --- /dev/null +++ b/.local/src/blesh/doc/contrib/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2020-2021, K. Murase @akinomyoga <myoga.murase@gmail.com>, +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/.local/src/blesh/doc/contrib/README-ja.md b/.local/src/blesh/doc/contrib/README-ja.md new file mode 100644 index 0000000..fb6b492 --- /dev/null +++ b/.local/src/blesh/doc/contrib/README-ja.md @@ -0,0 +1,97 @@ +\[ Language: [English](README.md) | **日本語** ] + +# blesh-contrib +[akinomyoga/ble.sh](https://github.com/akinomyoga/ble.sh)向けの設定 + +特に指定のない限りこのリポジトリのファイルは [3条項 BSD ライセンス](LICENSE) で提供されます。 +サブディレクトリ `airline` 以下のファイルは MIT ライセンスで提供されます。 + +<sup>〔訳註: これは[2020年5月20日(日本標準時)時点のREADME.md](https://github.com/akinomyoga/blesh-contrib/blob/8d89d469bd46d9d1158ab5295cd48a3df6942074/README.md) (8d89d46)の,技術的内容を変更しない日本語訳です〕</sup> + +## :pencil: fzfとの統合 + +### 選択肢その1: `~/.fzf.bash`内で設定する + +fzfを`ble.sh`と共に用いたい場合,`.fzf.bash`を次のように書き直します(`/path/to/fzf`は fzf ディレクトリへのパスに置き換えてください。※fzf バイナリではなくて **fzf ディレクトリ**へのパスです)。 + +```bash +# fzf.bash + +# fzfの設定 +# --------- + +_ble_contrib_fzf_base=/path/to/fzf +if [[ ! "$PATH" == *"$_ble_contrib_fzf_base/bin"* ]]; then + export PATH="${PATH:+${PATH}:}/path/to/fzf/bin" +fi + +# 自動補完 +# --------------- +if [[ ${BLE_VERSION-} ]]; then + ble-import -d contrib/fzf-completion +else + [[ $- == *i* ]] && source "$_ble_contrib_fzf_base/shell/completion.bash" 2> /dev/null +fi + +# キー束縛 +# ------------ +if [[ ${BLE_VERSION-} ]]; then + ble-import -d contrib/fzf-key-bindings +else + source "$_ble_contrib_fzf_base/shell/key-bindings.bash" +fi +``` + +### 選択肢その2: `~/.blerc`内で設定する + +別の方法として,`blerc`において次のように直接設定を書くこともできます(`/path/to/fzf`は各人のfzfへのパスに置き換えてください)。 +この場合,`.fzf.bash`を`.bashrc`の中で呼び出さ(`source`コマンドを用い)ないでください。 + +```bash +# blerc + +# fzfの設定 +_ble_contrib_fzf_base=/path/to/fzf +ble-import -d contrib/fzf-completion +ble-import -d contrib/fzf-key-bindings +``` + +## :pencil: fzf-git + +[fzf-git](https://gist.github.com/junegunn/8b572b8d4b5eddd8b85e5f4d40f17236)での設定を`ble.sh`と共に用いるには,次のように設定してください。 + +```bash +# bashrc / fzf.bash +if [[ ${BLE_VERSION-} ]]; then + _ble_contrib_fzf_base=/path/to/fzf + _ble_contrib_fzf_git_config=key-binding:sabbrev:arpeggio + ble-import -d contrib/fzf-git +fi +``` + +または,`~/.blerc`内でも構成できます: + +```bash +# blerc +_ble_contrib_fzf_base=/path/to/fzf +_ble_contrib_fzf_git_config=key-binding:sabbrev:arpeggio +ble-import -d contrib/fzf-git +``` + +シェル変数`$_ble_contrib_fzf_git_config`には,有効にする束縛の種別をコロン区切りで列挙します。 +`key-binding`という値で,次の形式のキー束縛を有効にします: <kbd>C-g C-f</kbd>, <kbd>C-g C-b</kbd>, <kbd>C-g C-t</kbd>, <kbd>C-g C-h</kbd>及び<kbd>C-g C-r</kbd>。 +`sabbrev`という値で,次の語に対する静的略語展開を有効にします: `gf`, `gb`, `gt`, `gh`及び`gr`。 +`arpeggio`という値で,次のキーの組み合わせを同時に押下できるようにします: <kbd>g f</kbd>, <kbd>g b</kbd>, <kbd>g t</kbd>, <kbd>g h</kbd>及び<kbd>g r</kbd>。 + +## :pencil: プロンプトにおける特殊指定 + +### `\q{contrib/vim-mode}` + +この指定はVimのモード名に展開されます。 + +```bash +# blerc(例) +ble-import contrib/prompt-vim-mode +PS1='[\u@\h \W]\q{contrib/vim-mode}\$ ' # PS1にモード名を表示 +bleopt keymap_vi_mode_show:= # モード行を表示しない +``` diff --git a/.local/src/blesh/doc/contrib/README.md b/.local/src/blesh/doc/contrib/README.md new file mode 100644 index 0000000..dc1bc80 --- /dev/null +++ b/.local/src/blesh/doc/contrib/README.md @@ -0,0 +1,172 @@ +[ Languages: **English** | [日本語](README-ja.md) (Japanese) ] + +# blesh-contrib +Settings for [akinomyoga/ble.sh](https://github.com/akinomyoga/ble.sh) + +Unless otherwise specified, files in this repository is licensed by [BSD 3-clause license](LICENSE). +The files in `airline` are licensed by the MIT License. + +## :pencil: fzf integration + +Source: [`fzf-completion.bash`](https://github.com/akinomyoga/blesh-contrib/blob/master/fzf-completion.bash), + [`fzf-key-bindings.bash`](https://github.com/akinomyoga/blesh-contrib/blob/master/fzf-key-bindings.bash) + +Note: If you would like to integrate `fzf-completion` with `bash-completion`, `bash-completion` needs to be loaded before `fzf-completion` is loaded. + +### Option 1: Setup in `~/.fzf.bash` + +If you would like to use fzf with `ble.sh`, you can rewrite your `.fzf.bash` in the following way (please replace `/path/to/fzf` by your fzf path, the path to the **fzf directory** but not the fzf binary): + +```bash +# fzf.bash + +# Setup fzf +# --------- +_ble_contrib_fzf_base=/path/to/fzf +if [[ ! "$PATH" == *"$_ble_contrib_fzf_base/bin"* ]]; then + export PATH="${PATH:+${PATH}:}/path/to/fzf/bin" +fi + +# Auto-completion +# --------------- +if [[ ${BLE_VERSION-} ]]; then + ble-import -d contrib/fzf-completion +else + [[ $- == *i* ]] && source "$_ble_contrib_fzf_base/shell/completion.bash" 2> /dev/null +fi + +# Key bindings +# ------------ +if [[ ${BLE_VERSION-} ]]; then + ble-import -d contrib/fzf-key-bindings +else + source "$_ble_contrib_fzf_base/shell/key-bindings.bash" +fi +``` + +### Option 2: Setup in `~/.blerc` + +Or, you can directly write settings in your `blerc` as follows (please replace `/path/to/fzf` by your fzf path). +In this case do not source `.fzf.bash` in your `.bashrc`. + +```bash +# blerc + +# Setup fzf +_ble_contrib_fzf_base=/path/to/fzf +ble-import -d contrib/fzf-completion +ble-import -d contrib/fzf-key-bindings +``` + +## :pencil: `contrib/fzf-git` + +Source: [`fzf-git.bash`](https://github.com/akinomyoga/blesh-contrib/blob/master/fzf-git.bash) + +You can use [fzf-git](https://gist.github.com/junegunn/8b572b8d4b5eddd8b85e5f4d40f17236) settings for `ble.sh` with the following settings. + +```bash +# bashrc / fzf.bash +if [[ ${BLE_VERSION-} ]]; then + _ble_contrib_fzf_base=/path/to/fzf + _ble_contrib_fzf_git_config=key-binding:sabbrev:arpeggio + ble-import -d contrib/fzf-git +fi +``` + +Or you can configure it in `~/.blerc`: + +```bash +# blerc +_ble_contrib_fzf_base=/path/to/fzf +_ble_contrib_fzf_git_config=key-binding:sabbrev:arpeggio +ble-import -d contrib/fzf-git +``` + +The shell variable `_ble_contrib_fzf_git_config` is a colon-separated list of the enabled types of bindings. +The value `key-binding` enables the key bindings of the form <kbd>C-g C-f</kbd>, <kbd>C-g C-b</kbd>, <kbd>C-g C-t</kbd>, <kbd>C-g C-h</kbd> and <kbd>C-g C-r</kbd>. +The value `sabbrev` enables the sabbrev expansion for the words `gf`, `gb`, `gt`, `gh` and `gr`. +The value `arpeggio` enables the simultaneous key combinations of <kbd>g f</kbd>, <kbd>g b</kbd>, <kbd>g t</kbd>, <kbd>g h</kbd> and <kbd>g r</kbd>. + +# ⚙ Prompt sequences + +## :pencil: `contrib/prompt-vim-mode` + +Source: [`prompt-vim-mode.bash`](https://github.com/akinomyoga/blesh-contrib/blob/master/prompt-vim-mode.bash) + +### `\q{contrib/vim-mode}` + +This prompt sequence expands to the vim mode name. + +```bash +# blerc (example) + +ble-import contrib/prompt-vim-mode +PS1='[\u@\h \W]\q{contrib/vim-mode}\$ ' # show mode name in PS1 +bleopt keymap_vi_mode_show:= # hide mode line +``` + +## :pencil: `contrib/prompt-git` + +Source: [`prompt-git.bash`](https://github.com/akinomyoga/blesh-contrib/blob/master/prompt-git.bash) + +```bash +# blerc (example) + +ble-import contrib/prompt-git +bleopt prompt_rps1='\q{contrib/git-info}' +``` + +### `\q{contrib/git-info}` + +This expands to a string that explains the current git status. + +### `\q{contrib/git-name}` + +This expands to the directory name of the repository. + +### `\q{contrib/git-hash N}` + +This expands to the commit hash. +The hash is truncated to the length `N`. +The default value for `N` is `7`. + +### `\q{contrib/git-branch}` + +This expands to the branch name (or tag name or hash) of `HEAD`. + +### `\q{contrib/git-path}` + +This expands to the current path relative to the root directory of the repository. + +## :pencil: `contrib/prompt-elapsed` + +Source: [`prompt-elapsed.bash`](https://github.com/akinomyoga/blesh-contrib/blob/master/prompt-elapsed.bash) + +Measures the time of the previous command execution. + +```bash +# blerc (example) + +ble-import contrib/prompt-elapsed +bleopt prompt_rps1='\g{fg=69,italic}\q{contrib/elapsed}' +``` + +### `\q{contrib/elapsed}` + +This expands to the high-resolution elapsed time for the command execution. + +### `\q{contrib/elapsed-real}` + +This expands to the `real` time of `time`. + +### `\q{contrib/elapsed-user}` + +This expands to the `user` time of `time`. + +### `\q{contrib/elapsed-sys}` + +This expands to the `sys` time of `time`. + +### `\q{contrib/elapsed-cpu}` + +This expands to the average cpu usage. |