5 prism_languages: [fish]
12 | Shortcut | Description |
14 | `Alt ←` _/_ `Alt →` | Move word |
15 | `^U` | Delete to beginning |
16 | `^W` | Delete to previous `/` |
17 | `^D` | Delete next character |
18 | `Alt D` | Delete next word |
19 | `^C` | Cancel line |
20 | `Alt P` | Page output |
22 | `Alt ↑` _/_ `Alt ↓` | Previous _/_ next arguments |
23 | `Alt E` _/_ `Alt V` | Open in external editor |
24 | `^L` | Repaint screen |
29 | `Alt H` | Help on word (man) |
30 | `Alt W` | Help on word (short descriptions) |
31 | `Alt L` | List directory on cursor |
39 function my_function --description "My description"
49 else if test -f bar.txt
59 if test -f foo.txt && test -f bar.txt
63 if test -f foo.txt -a -f bar.txt
67 if test \( -f foo.txt \) -a -f \( bar.txt \)
81 function myhook --on-event my_event
86 This lets you hook onto events, such as `fish_prompt`.
90 ### Creating completions
92 #### ~/.fish/completions/mycommand.fish
95 complete -c mycommand ...
96 complete -c mycommand ...
97 complete -c mycommand ...
107 -r, --require-parameter
109 -x # exclusive (-r -f)
110 -n '__fish_use_subcommand' # condition
118 -n '__fish_use_subcommand' \
125 | Condition | Description
127 | `-n __fish_complete_directories STRING DESCRIPTION` | performs path completion on STRING, allowing only directories, and giving them the description DESCRIPTION.
128 | `-n __fish_complete_path STRING DESCRIPTION` | performs path completion on STRING, giving them the description DESCRIPTION.
129 | `-n __fish_complete_groups` | prints a list of all user groups with the groups members as description.
130 | `-n __fish_complete_pids` | prints a list of all processes IDs with the command name as description.
131 | `-n __fish_complete_suffix SUFFIX` | performs file completion allowing only files ending in SUFFIX. The mimetype database is used to find a suitable description.
132 | `-n __fish_complete_users` | prints a list of all users with their full name as description.
133 | `-n __fish_print_filesystems` | prints a list of all known file systems. Currently, this is a static list, and not dependent on what file systems the host operating system actually understands.
134 | `-n __fish_print_hostnames` | prints a list of all known hostnames. This functions searches the fstab for nfs servers, ssh for known hosts and checks the /etc/hosts file.
135 | `-n __fish_print_interfaces` | prints a list of all known network interfaces.
136 | `-n __fish_print_packages` | prints a list of all installed packages. This function currently handles Debian, rpm and Gentoo packages.
137 | `-n __fish_use_subcommand` |
138 | `-n __fish_seen_subcommand_from init` |
143 complete -c ruby -s X -x -a '(__fish_complete_directories (commandline -ct))' --description 'Directory'
148 Start each example with `complete -c cmdname`
152 # no filename completion
156 -s d -x -a "read skip"
176 -a "(cat /etc/passwd | cut -d : -f 1)"
177 # first argument as filename