├── LICENSE ├── README.md ├── bin ├── capture.fish ├── capture.xonsh └── capture.zsh ├── denops └── @ddc-sources │ └── shell_native.ts ├── doc └── ddc-source-shell_native.txt └── tests └── zshrc /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Shougo Matsushita , Koichi Shiraishi, Vincent Breitmoser 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ddc-source-shell_native 2 | 3 | Shell native completion for ddc.vim 4 | 5 | ## Required 6 | 7 | ### denops.vim 8 | 9 | https://github.com/vim-denops/denops.vim 10 | 11 | ### ddc.vim 12 | 13 | https://github.com/Shougo/ddc.vim 14 | 15 | ### shell 16 | 17 | One of the followings 18 | 19 | - fish 20 | - xonsh 21 | - zsh and zsh/zpty module 22 | 23 | ## Configuration 24 | 25 | ```vim 26 | call ddc#custom#patch_global('sources', ['shell_native']) 27 | call ddc#custom#patch_global('sourceOptions', #{ 28 | \ shell_native: #{ mark: 'fish' }, 29 | \ }) 30 | call ddc#custom#patch_global('sourceParams', #{ 31 | \ shell_native: #{ shell: 'fish' }, 32 | \ }) 33 | ``` 34 | 35 | ## Original code 36 | 37 | It includes 38 | [zsh-capture-completion](https://github.com/Valodim/zsh-capture-completion) and 39 | [deoplete-zsh](https://github.com/deoplete-plugins/deoplete-zsh) 40 | -------------------------------------------------------------------------------- /bin/capture.fish: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env fish 2 | 3 | function main 4 | while true 5 | read --local user_input 6 | 7 | if test -n "$user_input" 8 | # Only process non-empty input 9 | complete -C "$user_input" 10 | end 11 | 12 | echo "EOF" >&2 13 | end 14 | end 15 | 16 | main 17 | -------------------------------------------------------------------------------- /bin/capture.xonsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env xonsh 2 | 3 | import sys 4 | import xonsh.completer 5 | 6 | def main(): 7 | completer = xonsh.completer.Completer() 8 | while True: 9 | try: 10 | multiline_text = input() 11 | 12 | completions = completer.complete( 13 | "", "", 0, 0, {}, 14 | multiline_text=multiline_text, 15 | cursor_index=len(multiline_text) 16 | )[0] 17 | 18 | for completion in completions: 19 | print(completion) 20 | print("EOF", file=sys.stderr) 21 | except KeyboardInterrupt: 22 | print("\nExiting...") 23 | break 24 | 25 | if __name__ == "__main__": 26 | main() 27 | -------------------------------------------------------------------------------- /bin/capture.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | zmodload zsh/zpty || { echo 'error: missing module zsh/zpty' >&2; exit 1 } 4 | 5 | # Function to initialize the zpty shell with completion settings 6 | initialize_shell() { 7 | 8 | # Spawn shell 9 | zpty z zsh -f -i 10 | 11 | # Line buffer for pty output 12 | local line 13 | 14 | setopt rcquotes 15 | 16 | () { 17 | zpty -w z source $1 18 | repeat 4; do 19 | zpty -r z line 20 | [[ $line == ok* ]] && return 21 | done 22 | echo 'error initializing.' >&2 23 | exit 2 24 | } =( <<< ' 25 | typeset -gx CACHE_DIR=${XDG_CACHE_HOME:-"$HOME/.cache"}/ddc-source-shell_native 26 | 27 | mkdir -p "$CACHE_DIR" 28 | 29 | # No prompt! 30 | PROMPT= 31 | 32 | # Load completion system 33 | autoload -U compinit; compinit -C 34 | compinit -d "$CACHE_DIR/compdump" 35 | 36 | # Never run commands 37 | bindkey ''^M'' undefined 38 | bindkey ''^J'' undefined 39 | bindkey ''^I'' complete-word 40 | 41 | # Send a line with null-byte at the end before and after completions are output 42 | null-line () { 43 | echo -E - $''\0'' 44 | } 45 | compprefuncs=( null-line ) 46 | comppostfuncs=( null-line exit ) 47 | 48 | # Never group stuff! 49 | zstyle '':completion:*'' list-grouped false 50 | zstyle '':completion:*'' force-list always 51 | # Don''t insert tab when attempting completion on empty line 52 | zstyle '':completion:*'' insert-tab false 53 | # No list separator, this saves some stripping later on 54 | zstyle '':completion:*'' list-separator '''' 55 | # for list even if too many 56 | zstyle '':completion:*'' list-prompt '''' 57 | zstyle '':completion:*'' select-prompt '''' 58 | zstyle '':completion:*'' menu true 59 | 60 | # We use zparseopts 61 | zmodload zsh/zutil 62 | 63 | # Override compadd (this our hook) 64 | compadd () { 65 | 66 | # Check if any of -O, -A or -D are given 67 | if [[ ${@[1,(i)(-|--)]} == *-(O|A|D)\ * ]]; then 68 | # If that is the case, just delegate and leave 69 | builtin compadd "$@" 70 | return $? 71 | fi 72 | 73 | # OK, this concerns us! 74 | # echo -E - got this: "$@" 75 | 76 | # Be careful with namespacing here, we don''t want to mess with stuff 77 | # that should be passed to compadd! 78 | typeset -a __hits __dscr __tmp 79 | 80 | # Do we have a description parameter? 81 | # NOTE: we don''t use zparseopts here because of combined option 82 | # parameters with arguments like -default- confuse it. 83 | if (( $@[(I)-d] )); then # kind of a hack, $+@[(r)-d] doesn''t work because of line noise overload 84 | # next param after -d 85 | __tmp=${@[$[${@[(i)-d]}+1]]} 86 | # description can be given as an array parameter name, or inline () array 87 | if [[ $__tmp == \(* ]]; then 88 | eval "__dscr=$__tmp" 89 | else 90 | __dscr=( "${(@P)__tmp}" ) 91 | fi 92 | fi 93 | 94 | # Capture completions by injecting -A parameter into the compadd call. 95 | # This takes care of matching for us. 96 | builtin compadd -A __hits -D __dscr "$@" 97 | 98 | # JESUS CHRIST IT TOOK ME FOREVER TO FIGURE OUT THIS OPTION WAS SET AND WAS MESSING WITH MY SHIT HERE 99 | setopt localoptions norcexpandparam extendedglob 100 | 101 | # Extract prefixes and suffixes from compadd call. we can''t do zsh''s cool 102 | # -r remove-func magic, but it''s better than nothing. 103 | typeset -A apre hpre hsuf asuf 104 | zparseopts -E P:=apre p:=hpre S:=asuf s:=hsuf 105 | 106 | # Append / to directories? we are only emulating -f in a half-assed way 107 | # here, but it''s better than nothing. 108 | integer dirsuf=0 109 | # don''t be fooled by -default- >.> 110 | if [[ -z $hsuf && "${${@//-default-/}% -# *}" == *-[[:alnum:]]#f* ]]; then 111 | dirsuf=1 112 | fi 113 | 114 | # Just drop 115 | [[ -n $__hits ]] || return 116 | 117 | # This is the point where we have all matches in $__hits and all 118 | # descriptions in $__dscr! 119 | 120 | # Display all matches 121 | local dsuf dscr 122 | for i in {1..$#__hits}; do 123 | 124 | # Add a dir suffix? 125 | (( dirsuf )) && [[ -d $__hits[$i] ]] && dsuf=/ || dsuf= 126 | # Description to be displayed afterwards 127 | (( $#__dscr >= $i )) && dscr=" -- ${${__dscr[$i]}##$__hits[$i] #}" || dscr= 128 | 129 | echo -E - $IPREFIX$apre$hpre$__hits[$i]$dsuf$hsuf$asuf$dscr 130 | 131 | done 132 | } 133 | 134 | # signal success! 135 | echo ok') 136 | } 137 | 138 | # Main loop to read from stdin and process completion 139 | while true; do 140 | # Initialize shell settings before processing 141 | initialize_shell 142 | 143 | # Read input from stdin 144 | IFS= read -r input || break 145 | 146 | # Trigger completion and send it to the pty 147 | zpty -w z "$input"$'\t' 148 | 149 | integer tog=0 150 | # Read and parse output from the pty 151 | while zpty -r z; do :; done | while IFS= read -r line; do 152 | if [[ $line == *$'\0\r' ]]; then 153 | (( tog++ )) && break || continue 154 | fi 155 | # Display completion output between toggles 156 | (( tog )) && echo -E - $line 157 | done 158 | 159 | echo "EOF" >&2 160 | 161 | # Clean up the zpty process after the loop exits 162 | zpty -d z 163 | done 164 | -------------------------------------------------------------------------------- /denops/@ddc-sources/shell_native.ts: -------------------------------------------------------------------------------- 1 | import type { Context, DdcGatherItems } from "jsr:@shougo/ddc-vim@~9.4.0/types"; 2 | import { BaseSource } from "jsr:@shougo/ddc-vim@~9.4.0/source"; 3 | 4 | import type { Denops } from "jsr:@denops/core@~7.0.0"; 5 | import * as fn from "jsr:@denops/std@~7.5.0/function"; 6 | import * as op from "jsr:@denops/std@~7.5.0/option"; 7 | import * as vars from "jsr:@denops/std@~7.5.0/variable"; 8 | 9 | import { TextLineStream } from "jsr:@std/streams@~1.0.3/text-line-stream"; 10 | 11 | type Params = { 12 | envs: Record; 13 | shell: string; 14 | }; 15 | 16 | export class Source extends BaseSource { 17 | #completer?: (cmdline: string) => Promise; 18 | 19 | override async onInit(args: { 20 | denops: Denops; 21 | sourceParams: Params; 22 | }) { 23 | const shell = args.sourceParams.shell; 24 | if (shell === "" || await fn.executable(args.denops, shell) === 0) { 25 | return; 26 | } 27 | 28 | const runtimepath = await op.runtimepath.getGlobal(args.denops); 29 | const captures = await args.denops.call( 30 | "globpath", 31 | runtimepath, 32 | `bin/capture.${shell}`, 33 | 1, 34 | 1, 35 | ) as string[]; 36 | 37 | const proc = new Deno.Command( 38 | args.sourceParams.shell, 39 | { 40 | args: [captures[0]], 41 | stdout: "piped", 42 | stderr: "piped", 43 | stdin: "piped", 44 | cwd: await fn.getcwd(args.denops) as string, 45 | env: args.sourceParams.envs, 46 | }, 47 | ).spawn(); 48 | 49 | const outputBuffer: string[] = []; 50 | let eofWaiter: PromiseWithResolvers | undefined; 51 | 52 | const stdout = proc.stdout 53 | .pipeThrough(new TextDecoderStream()) 54 | .pipeThrough(new TextLineStream()) 55 | .pipeTo( 56 | new WritableStream({ 57 | write: (chunk: string) => { 58 | // Collect output lines 59 | outputBuffer.push(chunk); 60 | }, 61 | }), 62 | ); 63 | 64 | const stderr = proc.stderr 65 | .pipeThrough(new TextDecoderStream()) 66 | .pipeThrough(new TextLineStream()) 67 | .pipeTo( 68 | new WritableStream({ 69 | write: (chunk: string) => { 70 | // Wait until "EOF" 71 | if (chunk === "EOF") { 72 | // Move out buffered output lines 73 | const output = outputBuffer.splice(0); 74 | eofWaiter?.resolve(output); 75 | } 76 | }, 77 | }), 78 | ); 79 | 80 | const { writable, readable } = new TextEncoderStream(); 81 | readable.pipeTo(proc.stdin); 82 | const cmdlineWriter = writable.getWriter(); 83 | 84 | this.#completer = async (cmdline: string): Promise => { 85 | if (!this.#completer) { 86 | return []; 87 | } 88 | 89 | // Wait for the previous completion to finish 90 | await eofWaiter?.promise; 91 | 92 | const { promise } = eofWaiter = Promise.withResolvers(); 93 | cmdlineWriter.write(cmdline + "\n"); 94 | return await promise; 95 | }; 96 | 97 | // Clean up resources after the process ends 98 | Promise.allSettled([proc.status, stdout, stderr]) 99 | .finally(() => { 100 | this.#completer = undefined; 101 | eofWaiter?.resolve([]); 102 | eofWaiter = undefined; 103 | }); 104 | } 105 | 106 | override getCompletePosition(args: { 107 | context: Context; 108 | }): Promise { 109 | const matchPos = args.context.input.search(/\S*$/); 110 | let completePos = matchPos !== null ? matchPos : -1; 111 | 112 | const completeStr = args.context.input.slice(completePos); 113 | // For ":!" completion in command line 114 | if (args.context.mode === "c" && completeStr.startsWith("!")) { 115 | completePos += 1; 116 | } 117 | 118 | return Promise.resolve(completePos); 119 | } 120 | 121 | override async gather(args: { 122 | denops: Denops; 123 | context: Context; 124 | completeStr: string; 125 | sourceParams: Params; 126 | }): Promise { 127 | const completer = this.#completer; 128 | if (!completer) { 129 | return []; 130 | } 131 | 132 | let input = args.context.input; 133 | if (args.context.mode !== "c") { 134 | const filetype = await op.filetype.getLocal(args.denops); 135 | const existsDeol = await fn.exists(args.denops, "*deol#get_input"); 136 | if (filetype === "deol" && existsDeol) { 137 | input = await args.denops.call("deol#get_input") as string; 138 | } 139 | 140 | const uiName = await vars.b.get(args.denops, "ddt_ui_name", ""); 141 | const existsDdt = await fn.exists(args.denops, "*ddt#get_input"); 142 | if (uiName.length > 0 && existsDdt) { 143 | input = await args.denops.call("ddt#get_input", uiName) as string; 144 | } 145 | } 146 | 147 | // For ":!" completion in command line 148 | if (args.context.mode === "c" && input.startsWith("!")) { 149 | input = input.slice(1); 150 | } 151 | 152 | const delimiter = { 153 | zsh: " -- ", 154 | fish: "\t", 155 | }[args.sourceParams.shell] ?? ""; 156 | 157 | // Process collected lines 158 | const items = (await completer(input)).map((line) => { 159 | line = line.replace(/\/\/$/, "/"); // Replace the last // 160 | if (delimiter === "") { 161 | return { word: line }; 162 | } 163 | const pieces = line.split(delimiter); 164 | return pieces.length <= 1 165 | ? { word: line } 166 | : { word: pieces[0], info: pieces[1] }; 167 | }); 168 | 169 | return items; 170 | } 171 | 172 | override params(): Params { 173 | return { 174 | envs: {}, 175 | shell: "", 176 | }; 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /doc/ddc-source-shell_native.txt: -------------------------------------------------------------------------------- 1 | *ddc-source-shell_native.txt* Native shell completion for ddc.vim 2 | 3 | Author: Shougo 4 | License: MIT license 5 | 6 | CONTENTS *ddc-source-shell_native-contents* 7 | 8 | Introduction |ddc-source-shell_native-introduction| 9 | Install |ddc-source-shell_native-install| 10 | Params |ddc-source-shell_native-params| 11 | Examples |ddc-source-shell_native-examples| 12 | 13 | 14 | ============================================================================== 15 | INTRODUCTION *ddc-source-shell_native-introduction* 16 | 17 | This source captures items from native completion of shells (fish, xonsh, or 18 | zsh). 19 | 20 | 21 | ============================================================================== 22 | INSTALL *ddc-source-shell_native-install* 23 | 24 | Please install both "ddc.vim" and "denops.vim". 25 | 26 | https://github.com/Shougo/ddc.vim 27 | https://github.com/vim-denops/denops.vim 28 | 29 | You also need one of fish, xonsh, or zsh. 30 | NOTE: Zsh also requires enable "zsh/zpty" module. 31 | > 32 | zmodload zsh/zpty 33 | < 34 | 35 | ============================================================================== 36 | PARAMS *ddc-source-shell_native-params* 37 | 38 | *ddc-source-shell_native-param-shell* 39 | shell (string) 40 | A required parameter to specify the shell to be used. 41 | Supported values are fish, xonsh, and zsh. 42 | 43 | NOTE: Zsh saves compdump file in `$XDG_CACHE_HOME` or 44 | `$HOME/cache` directory. 45 | 46 | Default: "" 47 | 48 | *ddc-source-shell_native-param-envs* 49 | envs (Record) 50 | The environment variables to be passed to 51 | |ddc-source-shell_native-param-shell|. 52 | 53 | Default: {} 54 | 55 | 56 | ============================================================================== 57 | EXAMPLES *ddc-source-shell_native-examples* 58 | >vim 59 | call ddc#custom#patch_global('sources', ['shell_native']) 60 | call ddc#custom#patch_global('sourceOptions', #{ 61 | \ shell_native: #{ mark: 'fish' }, 62 | \ }) 63 | call ddc#custom#patch_global('sourceParams', #{ 64 | \ shell_native: #{ shell: 'fish' }, 65 | \ }) 66 | < 67 | 68 | ============================================================================== 69 | vim:tw=78:ts=8:ft=help:norl:noet:fen:noet: 70 | -------------------------------------------------------------------------------- /tests/zshrc: -------------------------------------------------------------------------------- 1 | # 2 | # Example .zshrc file for zsh 4.0 3 | # 4 | # .zshrc is sourced in interactive shells. It 5 | # should contain commands to set up aliases, functions, 6 | # options, key bindings, etc. 7 | # 8 | 9 | # THIS FILE IS NOT INTENDED TO BE USED AS /etc/zshrc, NOR WITHOUT EDITING 10 | return 0 # Remove this line after editing this file as appropriate 11 | 12 | # Search path for the cd command 13 | cdpath=(.. ~ ~/src ~/zsh) 14 | 15 | # Use hard limits, except for a smaller stack and no core dumps 16 | unlimit 17 | limit stack 8192 18 | limit core 0 19 | limit -s 20 | 21 | umask 022 22 | 23 | # Set up aliases 24 | alias mv='nocorrect mv' # no spelling correction on mv 25 | alias cp='nocorrect cp' # no spelling correction on cp 26 | alias mkdir='nocorrect mkdir' # no spelling correction on mkdir 27 | alias j=jobs 28 | alias pu=pushd 29 | alias po=popd 30 | alias d='dirs -v' 31 | alias h=history 32 | alias grep=egrep 33 | alias ll='ls -l' 34 | alias la='ls -a' 35 | 36 | # List only directories and symbolic 37 | # links that point to directories 38 | alias lsd='ls -ld *(-/DN)' 39 | 40 | # List only file beginning with "." 41 | alias lsa='ls -ld .*' 42 | 43 | # Shell functions 44 | setenv() { typeset -x "${1}${1:+=}${(@)argv[2,$#]}" } # csh compatibility 45 | freload() { while (( $# )); do; unfunction $1; autoload -U $1; shift; done } 46 | 47 | # Where to look for autoloaded function definitions 48 | fpath=($fpath ~/.zfunc) 49 | 50 | # Autoload all shell functions from all directories in $fpath (following 51 | # symlinks) that have the executable bit on (the executable bit is not 52 | # necessary, but gives you an easy way to stop the autoloading of a 53 | # particular shell function). $fpath should not be empty for this to work. 54 | for func in $^fpath/*(N-.x:t); autoload $func 55 | 56 | # automatically remove duplicates from these arrays 57 | typeset -U path cdpath fpath manpath 58 | 59 | # Global aliases -- These do not have to be 60 | # at the beginning of the command line. 61 | alias -g M='|more' 62 | alias -g H='|head' 63 | alias -g T='|tail' 64 | 65 | manpath=($X11HOME/man /usr/man /usr/lang/man /usr/local/man) 66 | export MANPATH 67 | 68 | # Hosts to use for completion (see later zstyle) 69 | hosts=(`hostname` ftp.math.gatech.edu prep.ai.mit.edu wuarchive.wustl.edu) 70 | 71 | # Set prompts 72 | PROMPT='%m%# ' # default prompt 73 | RPROMPT=' %~' # prompt for right side of screen 74 | 75 | # Some environment variables 76 | export MAIL=/var/spool/mail/$USERNAME 77 | export LESS=-cex3M 78 | export HELPDIR=/usr/share/zsh/$ZSH_VERSION/help # directory for run-help function to find docs 79 | unalias run-help && autoload -Uz run-help 80 | 81 | MAILCHECK=300 82 | HISTSIZE=200 83 | DIRSTACKSIZE=20 84 | 85 | # Watch for my friends 86 | #watch=( $(<~/.friends) ) # watch for people in .friends file 87 | watch=(notme) # watch for everybody but me 88 | LOGCHECK=300 # check every 5 min for login/logout activity 89 | WATCHFMT='%n %a %l from %m at %t.' 90 | 91 | # Set/unset shell options 92 | setopt notify globdots correct pushdtohome cdablevars autolist 93 | setopt correctall autocd recexact longlistjobs 94 | setopt autoresume histignoredups pushdsilent noclobber 95 | setopt autopushd pushdminus extendedglob rcquotes mailwarning 96 | unsetopt bgnice autoparamslash 97 | 98 | # Autoload zsh modules when they are referenced 99 | zmodload -a zsh/zpty zpty 100 | zmodload -a zsh/zprof zprof 101 | zmodload -ap zsh/mapfile mapfile 102 | # stat(1) is now commonly an external command, so just load zstat 103 | zmodload -aF zsh/stat b:zstat 104 | 105 | # Some nice key bindings 106 | #bindkey '^X^Z' universal-argument ' ' magic-space 107 | #bindkey '^X^A' vi-find-prev-char-skip 108 | #bindkey '^Xa' _expand_alias 109 | #bindkey '^Z' accept-and-hold 110 | #bindkey -s '\M-/' \\\\ 111 | #bindkey -s '\M-=' \| 112 | 113 | # bindkey -v # vi key bindings 114 | 115 | bindkey -e # emacs key bindings 116 | bindkey ' ' magic-space # also do history expansion on space 117 | bindkey '^I' complete-word # complete on tab, leave expansion to _expand 118 | 119 | # Setup new style completion system. To see examples of the old style (compctl 120 | # based) programmable completion, check Misc/compctl-examples in the zsh 121 | # distribution. 122 | autoload -Uz compinit 123 | compinit 124 | 125 | # Completion Styles 126 | 127 | # list of completers to use 128 | zstyle ':completion:*::::' completer _expand _complete _ignored _approximate 129 | 130 | # allow one error for every three characters typed in approximate completer 131 | zstyle -e ':completion:*:approximate:*' max-errors \ 132 | 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )' 133 | 134 | # insert all expansions for expand completer 135 | zstyle ':completion:*:expand:*' tag-order all-expansions 136 | 137 | # formatting and messages 138 | zstyle ':completion:*' verbose yes 139 | zstyle ':completion:*:descriptions' format '%B%d%b' 140 | zstyle ':completion:*:messages' format '%d' 141 | zstyle ':completion:*:warnings' format 'No matches for: %d' 142 | zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b' 143 | zstyle ':completion:*' group-name '' 144 | 145 | # match uppercase from lowercase 146 | zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' 147 | 148 | # offer indexes before parameters in subscripts 149 | zstyle ':completion:*:*:-subscript-:*' tag-order indexes parameters 150 | 151 | # command for process lists, the local web server details and host completion 152 | #zstyle ':completion:*:processes' command 'ps -o pid,s,nice,stime,args' 153 | #zstyle ':completion:*:urls' local 'www' '/var/www/htdocs' 'public_html' 154 | zstyle '*' hosts $hosts 155 | 156 | # Filename suffixes to ignore during completion (except after rm command) 157 | zstyle ':completion:*:*:(^rm):*:*files' ignored-patterns '*?.o' '*?.c~' \ 158 | '*?.old' '*?.pro' 159 | # the same for old style completion 160 | #fignore=(.o .c~ .old .pro) 161 | 162 | # ignore completion functions (until the _ignored completer) 163 | zstyle ':completion:*:functions' ignored-patterns '_*' 164 | 165 | --------------------------------------------------------------------------------