first commit
This commit is contained in:
commit
205faf4224
5471 changed files with 973850 additions and 0 deletions
21
config/zsh/plugins/zsh-bat/LICENSE
Normal file
21
config/zsh/plugins/zsh-bat/LICENSE
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2020 Fabian Dellwing
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
22
config/zsh/plugins/zsh-bat/README.md
Normal file
22
config/zsh/plugins/zsh-bat/README.md
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# zsh-bat
|
||||
|
||||
[oh-my-zsh plugin](https://github.com/robbyrussell/oh-my-zsh) for easy integration with [bat](https://github.com/sharkdp/bat).
|
||||
|
||||
## Prerequisites
|
||||
|
||||
You should have `bat` installed, this plugin will do nothing otherwise.
|
||||
|
||||
## Install
|
||||
|
||||
Create a new directory in `$ZSH_CUSTOM/plugins` called `zsh-bat` and clone this repo into that directory.
|
||||
```
|
||||
git clone https://github.com/fdellwing/zsh-bat.git $ZSH_CUSTOM/plugins/zsh-bat
|
||||
```
|
||||
|
||||
Add `zsh-bat` to your plugin list in `~/.zshrc`.
|
||||
|
||||
## Usage
|
||||
|
||||
This plugin will replace `cat` with `bat`. To run the real `cat` command, you can use `rcat`. It will also enable syntax highlighting for the `man` command.
|
||||
|
||||
For usage help with `bat`, see [sharkdp/bat](https://github.com/sharkdp/bat).
|
||||
19
config/zsh/plugins/zsh-bat/zsh-bat.plugin.zsh
Normal file
19
config/zsh/plugins/zsh-bat/zsh-bat.plugin.zsh
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
if command -v batcat >/dev/null 2>&1; then
|
||||
# Save the original system `cat` under `rcat`
|
||||
alias rcat="$(which cat)"
|
||||
|
||||
# For Ubuntu and Debian-based `bat` packages
|
||||
# the `bat` program is named `batcat` on these systems
|
||||
alias cat="$(which batcat)"
|
||||
export MANPAGER="sh -c 'col -bx | batcat -l man -p'"
|
||||
export MANROFFOPT="-c"
|
||||
elif command -v bat >/dev/null 2>&1; then
|
||||
# Save the original system `cat` under `rcat`
|
||||
alias rcat="$(which cat)"
|
||||
|
||||
# For all other systems
|
||||
alias cat="$(which bat)"
|
||||
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
|
||||
export MANROFFOPT="-c"
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue