diff --git a/zsh/_fedit b/zsh/_fedit index 76d8768..b8d9680 100644 --- a/zsh/_fedit +++ b/zsh/_fedit @@ -1,24 +1,4 @@ #compdef fedit -# Fuzzy find a file and then edit it - -# ========== Shortcuts ========== -_fedit() { - /usr/bin/fedit - zle reset-prompt -} - -_etcedit() { - /usr/bin/fedit --etc - zle reset-prompt -} - -zle -N fedit -bindkey -M viins '^o' _fedit - -zle -N _etcedit -bindkey -M viins '^e' _etcedit - -# ========== Completions ========== local arguments arguments=( diff --git a/zsh/_fuzzy_cd b/zsh/plugins/cf.zsh similarity index 74% rename from zsh/_fuzzy_cd rename to zsh/plugins/cf.zsh index 01e6257..c5aa1b6 100644 --- a/zsh/_fuzzy_cd +++ b/zsh/plugins/cf.zsh @@ -1,4 +1,3 @@ -#compdef fcd # Fuzzy cd from anywhere # Dependencies # * fzf @@ -21,13 +20,3 @@ cf() { } autoload -Uz cf - -# ========== Completions ========== -local arguments - -arguments=( -$argument_list - '*:filename:_files' -) - -_arguments -s $arguments diff --git a/zsh/plugins/fedit.zsh b/zsh/plugins/fedit.zsh new file mode 100644 index 0000000..5fe47b2 --- /dev/null +++ b/zsh/plugins/fedit.zsh @@ -0,0 +1,17 @@ +# Fuzzy find a file and then edit it + +_fedit() { + /usr/bin/fedit + zle reset-prompt +} + +_etcedit() { + /usr/bin/fedit --etc + zle reset-prompt +} + +zle -N _fedit +bindkey -M viins '^o' _fedit + +zle -N _etcedit +bindkey -M viins '^e' _etcedit diff --git a/zsh/_fless b/zsh/plugins/fless.zsh similarity index 65% rename from zsh/_fless rename to zsh/plugins/fless.zsh index 10b8cab..0ae4ff3 100644 --- a/zsh/_fless +++ b/zsh/plugins/fless.zsh @@ -1,6 +1,4 @@ -#compdef fless - -# ========== Shortcuts ========== +# Fuzzy-find a file and open it in less fless() { /usr/bin/fless zle reset-prompt diff --git a/zsh/_mkcd b/zsh/plugins/mkcd.zsh similarity index 75% rename from zsh/_mkcd rename to zsh/plugins/mkcd.zsh index 06dae18..a3896a0 100644 --- a/zsh/_mkcd +++ b/zsh/plugins/mkcd.zsh @@ -1,7 +1,5 @@ -#compdef mkcd # Make a directory, then change into it -# ========== Shortcuts ========== mkcd() { [[ ! -d "${1}" ]] && mkdir --parents -- "${1}" cd "${1}" || exit