mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-25 01:47:25 +08:00
Compare commits
5 Commits
87edf16e05
...
708ea42384
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
708ea42384 | ||
|
|
415be382ca | ||
|
|
dc59c661ac | ||
|
|
50dc4ab357 | ||
|
|
28ee5846bb |
@ -1,7 +1,7 @@
|
|||||||
# fixme - the load process here seems a bit bizarre
|
# fixme - the load process here seems a bit bizarre
|
||||||
zmodload -i zsh/complist
|
zmodload -i zsh/complist
|
||||||
|
|
||||||
WORDCHARS=''
|
WORDCHARS='_-'
|
||||||
|
|
||||||
unsetopt menu_complete # do not autoselect the first completion entry
|
unsetopt menu_complete # do not autoselect the first completion entry
|
||||||
unsetopt flowcontrol
|
unsetopt flowcontrol
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
|
# If ZSH is not defined, use the current script's directory.
|
||||||
|
[[ -z "$ZSH" ]] && export ZSH="${${(%):-%x}:a:h}"
|
||||||
|
|
||||||
# Set ZSH_CACHE_DIR to the path where cache files should be created
|
# Set ZSH_CACHE_DIR to the path where cache files should be created
|
||||||
# or else we will use the default cache/
|
# or else we will use the default cache/
|
||||||
if [[ -z "$ZSH_CACHE_DIR" ]]; then
|
if [[ -z "$ZSH_CACHE_DIR" ]]; then
|
||||||
|
|||||||
@ -55,15 +55,15 @@ if is-at-least 4.2.0; then
|
|||||||
# open browser on urls
|
# open browser on urls
|
||||||
if [[ -n "$BROWSER" ]]; then
|
if [[ -n "$BROWSER" ]]; then
|
||||||
_browser_fts=(htm html de org net com at cx nl se dk)
|
_browser_fts=(htm html de org net com at cx nl se dk)
|
||||||
for ft in $_browser_fts; do alias -s $ft=$BROWSER; done
|
for ft in $_browser_fts; do alias -s $ft='$BROWSER'; done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex)
|
_editor_fts=(cpp cxx cc c hh h inl asc txt TXT tex)
|
||||||
for ft in $_editor_fts; do alias -s $ft=$EDITOR; done
|
for ft in $_editor_fts; do alias -s $ft='$EDITOR'; done
|
||||||
|
|
||||||
if [[ -n "$XIVIEWER" ]]; then
|
if [[ -n "$XIVIEWER" ]]; then
|
||||||
_image_fts=(jpg jpeg png gif mng tiff tif xpm)
|
_image_fts=(jpg jpeg png gif mng tiff tif xpm)
|
||||||
for ft in $_image_fts; do alias -s $ft=$XIVIEWER; done
|
for ft in $_image_fts; do alias -s $ft='$XIVIEWER'; done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
_media_fts=(ape avi flv m4a mkv mov mp3 mpeg mpg ogg ogm rm wav webm)
|
_media_fts=(ape avi flv m4a mkv mov mp3 mpeg mpg ogg ogm rm wav webm)
|
||||||
|
|||||||
@ -2,18 +2,32 @@
|
|||||||
|
|
||||||
This plugin enables [junegunn's fzf](https://github.com/junegunn/fzf) fuzzy auto-completion and key bindings
|
This plugin enables [junegunn's fzf](https://github.com/junegunn/fzf) fuzzy auto-completion and key bindings
|
||||||
|
|
||||||
|
To use it, add `fzf` to the plugins array in your zshrc file:
|
||||||
|
```zsh
|
||||||
|
plugins=(... fzf)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Settings
|
||||||
|
|
||||||
|
Add these before the `plugins=()` line in your zshrc file:
|
||||||
|
|
||||||
```zsh
|
```zsh
|
||||||
# Set fzf installation directory path
|
# Set fzf installation directory path
|
||||||
export FZF_BASE=/path/to/fzf/install/dir
|
# export FZF_BASE=/path/to/fzf/install/dir
|
||||||
|
|
||||||
|
# Uncomment to set the FZF_DEFAULT_COMMAND
|
||||||
|
# export FZF_DEFAULT_COMMAND='<your fzf default commmand>'
|
||||||
|
|
||||||
# Uncomment the following line to disable fuzzy completion
|
# Uncomment the following line to disable fuzzy completion
|
||||||
# export DISABLE_FZF_AUTO_COMPLETION="true"
|
# DISABLE_FZF_AUTO_COMPLETION="true"
|
||||||
|
|
||||||
# Uncomment the following line to disable key bindings (CTRL-T, CTRL-R, ALT-C)
|
# Uncomment the following line to disable key bindings (CTRL-T, CTRL-R, ALT-C)
|
||||||
# export DISABLE_FZF_KEY_BINDINGS="true"
|
# DISABLE_FZF_KEY_BINDINGS="true"
|
||||||
|
|
||||||
plugins=(
|
|
||||||
...
|
|
||||||
fzf
|
|
||||||
)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
| Setting | Example value | Description |
|
||||||
|
|-----------------------------|----------------------------|-------------------------------------------------------------|
|
||||||
|
| FZF_BASE | `/path/to/fzf/install/dir` | Set fzf installation directory path (**export**) |
|
||||||
|
| FZF_DEFAULT_COMMAND | `fd --type f` | Set default command to use when input is tty (**export**) |
|
||||||
|
| DISABLE_FZF_AUTO_COMPLETION | `true` | Set whether to load fzf auto-completion |
|
||||||
|
| DISABLE_FZF_KEY_BINDINGS | `true` | Set whether to disable key bindings (CTRL-T, CTRL-R, ALT-C) |
|
||||||
|
|||||||
@ -98,3 +98,13 @@ function indicate_error() {
|
|||||||
setup_using_debian_package || setup_using_base_dir || indicate_error
|
setup_using_debian_package || setup_using_base_dir || indicate_error
|
||||||
|
|
||||||
unset -f setup_using_debian_package setup_using_base_dir indicate_error
|
unset -f setup_using_debian_package setup_using_base_dir indicate_error
|
||||||
|
|
||||||
|
if [[ -z "$FZF_DEFAULT_COMMAND" ]]; then
|
||||||
|
if (( $+commands[rg] )); then
|
||||||
|
export FZF_DEFAULT_COMMAND='rg --files --hidden'
|
||||||
|
elif (( $+commands[fd] )); then
|
||||||
|
export FZF_DEFAULT_COMMAND='fd --type f --hidden --exclude .git'
|
||||||
|
elif (( $+commands[ag] )); then
|
||||||
|
export FZF_DEFAULT_COMMAND='ag -l --hidden -g ""'
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|||||||
@ -37,9 +37,11 @@ alias stn=create_project
|
|||||||
_sublime_paths=(
|
_sublime_paths=(
|
||||||
"/usr/local/bin/subl"
|
"/usr/local/bin/subl"
|
||||||
"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
|
"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
|
||||||
|
"/Applications/Sublime Text 4.app/Contents/SharedSupport/bin/subl"
|
||||||
"/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
|
"/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
|
||||||
"/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
|
"/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
|
||||||
"$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
|
"$HOME/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"
|
||||||
|
"$HOME/Applications/Sublime Text 4.app/Contents/SharedSupport/bin/subl"
|
||||||
"$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
|
"$HOME/Applications/Sublime Text 3.app/Contents/SharedSupport/bin/subl"
|
||||||
"$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
|
"$HOME/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl"
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user