Add vim completions, written by Velko Hristov

darcs-hash:20070130004233-ac50b-5c48b940b29ac4f3c377bc88e2abf2e490e9df48.gz
This commit is contained in:
axel 2007-01-30 10:42:33 +10:00
parent ca2b2103d3
commit 76d9051605
3 changed files with 130 additions and 55 deletions

View file

@ -0,0 +1,75 @@
#completion for vim
# todo
# +[num] : Position the cursor on line number
# +/{pat} : Position the cursor on the first occurence of {pat}
# +{command} : Execute Ex command after the first file has been read
complete -c vim -n '__fish_test_arg "-"' -a - --description 'The file to edit is read from stdin. Commands are read from stderr, which should be a tty'
complete -r -c vim -s c --description 'Execute Ex command after the first file has been read'
complete -r -c vim -s S --description 'Source file after the first file has been read'
complete -r -c vim -l cmd --description 'Execute Ex command before loading any vimrc'
complete -r -c vim -s d --description 'Use device as terminal (Amiga only)'
complete -r -c vim -s i --description 'Set the viminfo file location'
complete -r -c vim -s o --description 'Open stacked windows for each file'
complete -r -c vim -s O --description 'Open side by side windows for each file'
complete -r -c vim -s p --description 'Open tab pages for each file'
complete -r -c vim -s q --description 'Start in quickFix mode'
complete -r -c vim -s r --description 'Use swap files for recovery'
complete -r -c vim -s s --description 'Source and execute script file'
complete -r -c vim -s t --description 'Set the cursor to tag'
complete -r -c vim -s T --description 'Termninal name'
complete -r -c vim -s u --description 'Use alternative vimrc'
complete -r -c vim -s U --description 'Use alternative vimrc in GUI mode'
complete -r -c vim -s w --description 'Record all typed characters'
complete -r -c vim -s W --description 'Record all typed characters (overwrite file)'
complete -c vim -s A --description 'Start in Arabic mode'
complete -c vim -s b --description 'Start in binary mode'
complete -c vim -s C --description 'Behave mostly like vi'
complete -c vim -s d --description 'Start in diff mode'
complete -c vim -s D --description 'Debugging mode'
complete -c vim -s e --description 'Start in Ex mode'
complete -c vim -s E --description 'Start in improved Ex mode'
complete -c vim -s f --description 'Start in foreground mode'
complete -c vim -s F --description 'Start in Farsi mode'
complete -c vim -s g --description 'Start in GUI mode'
complete -c vim -s h --description 'Print help message and exit'
complete -c vim -s H --description 'Start in Hebrew mode'
complete -c vim -s L --description 'List swap files'
complete -c vim -s l --description 'Start in lisp mode'
complete -c vim -s m --description 'Disable file modification'
complete -c vim -s M --description 'Disallow file modification'
complete -c vim -s N --description 'Reset compatibility mode'
complete -c vim -s n --description 'Don\'t use swap files'
complete -c vim -s R --description 'Read only mode'
complete -c vim -s r --description 'List swap files'
complete -c vim -s s --description 'Start in silent mode'
complete -c vim -s V --description 'Start in verbose mode'
complete -c vim -s v --description 'Start in vi mode'
complete -c vim -s x --description 'Use encription when writing files'
complete -c vim -s X --description 'Don\'t connect to X server'
complete -c vim -s y --description 'Start in easy mode'
complete -c vim -s Z --description 'Start in restricted mode'
complete -c vim -o nb --description 'Become an editor server for NetBeans'
complete -c vim -l no-fork --description 'Start in foreground mode'
complete -c vim -l echo-wid --description 'Echo the Window ID on stdout (GTK GUI only)'
complete -c vim -l help --description 'Print help message and exit'
complete -c vim -l literal --description 'Do not expand wildcards'
complete -c vim -l noplugin --description 'Skip loading plugins'
complete -c vim -l remote --description 'Edit files on Vim server'
complete -c vim -l remote-expr --description 'Evaluate expr on Vim server'
complete -c vim -l remote-send --description 'Send keys to Vim server'
complete -c vim -l remote-silent --description 'Edit files on Vim server'
complete -c vim -l remote-wait --description 'Edit files on Vim server'
complete -c vim -l remote-wait-silent --description 'Edit files on Vim server'
complete -c vim -l serverlist --description 'List all Vim servers that can be found'
complete -c vim -l servername --description 'Set server name'
complete -c vim -l version --description 'Print version information and exit'
complete -r -c vim -l socketid --description 'Run gvim in another window (GTK GUI only)'

View file

@ -4,61 +4,52 @@ function __fish_complete_xterm_encoding -d "Complete encoding information for xt
iconv --list|sed -e 's|//||'
end
function __fish_test_plus_switch --description "Test if the token under the cursor begins with a '+'"
switch (commandline -ct)
case '+*'
return 0
end
return 1
end
complete -c xterm -n '__fish_test_plus_switch' -a +ah --description 'Never highlight the text cursor'
complete -c xterm -n '__fish_test_plus_switch' -a +ai --description 'Enable active icon support'
complete -c xterm -n '__fish_test_plus_switch' -a +aw --description 'Disallow auto wraparound'
complete -c xterm -n '__fish_test_plus_switch' -a +bc --description 'Turn off cursor blinking'
complete -c xterm -n '__fish_test_plus_switch' -a +bdc --description 'Enable the display of bold characters'
complete -c xterm -n '__fish_test_plus_switch' -a +cb --description 'Set the vt100 resource cutToBeginningOfLine to \'true\''
complete -c xterm -n '__fish_test_plus_switch' -a +cjk_width --description 'Set the cjkWidth resource to \'false\''
complete -c xterm -n '__fish_test_plus_switch' -a +cm --description 'Enable recognition of ANSI color-change escape sequences'
complete -c xterm -n '__fish_test_plus_switch' -a +cn --description 'Cut newlines in line-mode selections'
complete -c xterm -n '__fish_test_plus_switch' -a +cu --description 'Don\'t workaround the bug in more(1)'
complete -c xterm -n '__fish_test_plus_switch' -a +dc --description 'Disable dynamic color changing'
complete -c xterm -n '__fish_test_plus_switch' -a +fbb --description 'Don\'t ensure compatibilty between normal and bold fonts bounding boxes'
complete -c xterm -n '__fish_test_plus_switch' -a +fbx --description 'Normal and bold fonts have VT100 line-drawing characters'
complete -c xterm -n '__fish_test_plus_switch' -a +hf --description 'Don\'t generate HP Function Key escape codes for function keys'
complete -c xterm -n '__fish_test_plus_switch' -a +hold --description 'Close xterm\'s window after the shell exits'
complete -c xterm -n '__fish_test_plus_switch' -a +ie --description 'Don\'t use pseudo-terminal\'s sense of the stty erase value'
complete -c xterm -n '__fish_test_plus_switch' -a +im --description 'Don\'t force insert mode'
complete -c xterm -n '__fish_test_plus_switch' -a +j --description 'Don\'t use jump scrolling'
complete -c xterm -n '__fish_test_plus_switch' -a +k8 --description 'Don\'t treat C1 control characters as printable'
complete -c xterm -n '__fish_test_plus_switch' -a +l --description 'Turn off logging'
complete -c xterm -n '__fish_test_plus_switch' -a +lc --description 'Turn off support for encodings according the locale setting'
complete -c xterm -n '__fish_test_plus_switch' -a +ls --description 'The shell in xterm\'s window will not be login shell'
complete -c xterm -n '__fish_test_plus_switch' -a +mb --description 'Don\'t ring bell if the user types near the end of line'
complete -c xterm -n '__fish_test_plus_switch' -a +mesg --description 'Allow write access to the terminal'
complete -c xterm -n '__fish_test_plus_switch' -a +mk_width --description 'Don\'t use builtin version for the wide-character calculation'
complete -c xterm -n '__fish_test_plus_switch' -a +nul --description 'Enable underlining'
complete -c xterm -n '__fish_test_plus_switch' -a +pc --description 'Disable PC style bold colors'
complete -c xterm -n '__fish_test_plus_switch' -a +pob --description 'Don\'t raise window on Control-G'
complete -c xterm -n '__fish_test_plus_switch' -a +rvc --description 'Enable characters with reverse attribute as color'
complete -c xterm -n '__fish_test_plus_switch' -a +rw --description 'Disable reverse-wraparound'
complete -c xterm -n '__fish_test_plus_switch' -a +s --description 'Turn off asynchronous scrolling'
complete -c xterm -n '__fish_test_plus_switch' -a +samename --description 'Send title/icon change requests always'
complete -c xterm -n '__fish_test_plus_switch' -a +sb --description 'Don\'t display scrollbar'
complete -c xterm -n '__fish_test_plus_switch' -a +sf --description 'Don\'t generate Sun Function Key escape codes for function keys'
complete -c xterm -n '__fish_test_plus_switch' -a +si --description 'Move the screen to the bottom on input'
complete -c xterm -n '__fish_test_plus_switch' -a +sk --description 'Don\'t move the screen to the bottom on key press while scrolling'
complete -c xterm -n '__fish_test_plus_switch' -a +sm --description 'Don\'t setup session manager callbacks'
complete -c xterm -n '__fish_test_plus_switch' -a +sp --description 'Don\'t assume Sun/PC keyboard'
complete -c xterm -n '__fish_test_plus_switch' -a +t --description 'VT102 mode'
complete -c xterm -n '__fish_test_plus_switch' -a +tb --description 'Don\'t display toolbar or menubar'
complete -c xterm -n '__fish_test_plus_switch' -a +u8 --description 'Don\'t use UTF-8'
complete -c xterm -n '__fish_test_plus_switch' -a +ulc --description 'Display characters with underline attribute as color'
complete -c xterm -n '__fish_test_plus_switch' -a +ut --description 'Write to the system utmp log file'
complete -c xterm -n '__fish_test_plus_switch' -a +vb --description 'Don\'t use visual bell insead of audio bell'
complete -c xterm -n '__fish_test_plus_switch' -a +wc --description 'Don\'t use wide characters'
complete -c xterm -n '__fish_test_plus_switch' -a +wf --description 'Don\'t wait the first time for the window to be mapped'
complete -c xterm -n '__fish_test_arg "+*"' -a +ah --description 'Never highlight the text cursor'
complete -c xterm -n '__fish_test_arg "+*"' -a +ai --description 'Enable active icon support'
complete -c xterm -n '__fish_test_arg "+*"' -a +aw --description 'Disallow auto wraparound'
complete -c xterm -n '__fish_test_arg "+*"' -a +bc --description 'Turn off cursor blinking'
complete -c xterm -n '__fish_test_arg "+*"' -a +bdc --description 'Enable the display of bold characters'
complete -c xterm -n '__fish_test_arg "+*"' -a +cb --description 'Set the vt100 resource cutToBeginningOfLine to \'true\''
complete -c xterm -n '__fish_test_arg "+*"' -a +cjk_width --description 'Set the cjkWidth resource to \'false\''
complete -c xterm -n '__fish_test_arg "+*"' -a +cm --description 'Enable recognition of ANSI color-change escape sequences'
complete -c xterm -n '__fish_test_arg "+*"' -a +cn --description 'Cut newlines in line-mode selections'
complete -c xterm -n '__fish_test_arg "+*"' -a +cu --description 'Don\'t workaround the bug in more(1)'
complete -c xterm -n '__fish_test_arg "+*"' -a +dc --description 'Disable dynamic color changing'
complete -c xterm -n '__fish_test_arg "+*"' -a +fbb --description 'Don\'t ensure compatibilty between normal and bold fonts bounding boxes'
complete -c xterm -n '__fish_test_arg "+*"' -a +fbx --description 'Normal and bold fonts have VT100 line-drawing characters'
complete -c xterm -n '__fish_test_arg "+*"' -a +hf --description 'Don\'t generate HP Function Key escape codes for function keys'
complete -c xterm -n '__fish_test_arg "+*"' -a +hold --description 'Close xterm\'s window after the shell exits'
complete -c xterm -n '__fish_test_arg "+*"' -a +ie --description 'Don\'t use pseudo-terminal\'s sense of the stty erase value'
complete -c xterm -n '__fish_test_arg "+*"' -a +im --description 'Don\'t force insert mode'
complete -c xterm -n '__fish_test_arg "+*"' -a +j --description 'Don\'t use jump scrolling'
complete -c xterm -n '__fish_test_arg "+*"' -a +k8 --description 'Don\'t treat C1 control characters as printable'
complete -c xterm -n '__fish_test_arg "+*"' -a +l --description 'Turn off logging'
complete -c xterm -n '__fish_test_arg "+*"' -a +lc --description 'Turn off support for encodings according the locale setting'
complete -c xterm -n '__fish_test_arg "+*"' -a +ls --description 'The shell in xterm\'s window will not be login shell'
complete -c xterm -n '__fish_test_arg "+*"' -a +mb --description 'Don\'t ring bell if the user types near the end of line'
complete -c xterm -n '__fish_test_arg "+*"' -a +mesg --description 'Allow write access to the terminal'
complete -c xterm -n '__fish_test_arg "+*"' -a +mk_width --description 'Don\'t use builtin version for the wide-character calculation'
complete -c xterm -n '__fish_test_arg "+*"' -a +nul --description 'Enable underlining'
complete -c xterm -n '__fish_test_arg "+*"' -a +pc --description 'Disable PC style bold colors'
complete -c xterm -n '__fish_test_arg "+*"' -a +pob --description 'Don\'t raise window on Control-G'
complete -c xterm -n '__fish_test_arg "+*"' -a +rvc --description 'Enable characters with reverse attribute as color'
complete -c xterm -n '__fish_test_arg "+*"' -a +rw --description 'Disable reverse-wraparound'
complete -c xterm -n '__fish_test_arg "+*"' -a +s --description 'Turn off asynchronous scrolling'
complete -c xterm -n '__fish_test_arg "+*"' -a +samename --description 'Send title/icon change requests always'
complete -c xterm -n '__fish_test_arg "+*"' -a +sb --description 'Don\'t display scrollbar'
complete -c xterm -n '__fish_test_arg "+*"' -a +sf --description 'Don\'t generate Sun Function Key escape codes for function keys'
complete -c xterm -n '__fish_test_arg "+*"' -a +si --description 'Move the screen to the bottom on input'
complete -c xterm -n '__fish_test_arg "+*"' -a +sk --description 'Don\'t move the screen to the bottom on key press while scrolling'
complete -c xterm -n '__fish_test_arg "+*"' -a +sm --description 'Don\'t setup session manager callbacks'
complete -c xterm -n '__fish_test_arg "+*"' -a +sp --description 'Don\'t assume Sun/PC keyboard'
complete -c xterm -n '__fish_test_arg "+*"' -a +t --description 'VT102 mode'
complete -c xterm -n '__fish_test_arg "+*"' -a +tb --description 'Don\'t display toolbar or menubar'
complete -c xterm -n '__fish_test_arg "+*"' -a +u8 --description 'Don\'t use UTF-8'
complete -c xterm -n '__fish_test_arg "+*"' -a +ulc --description 'Display characters with underline attribute as color'
complete -c xterm -n '__fish_test_arg "+*"' -a +ut --description 'Write to the system utmp log file'
complete -c xterm -n '__fish_test_arg "+*"' -a +vb --description 'Don\'t use visual bell insead of audio bell'
complete -c xterm -n '__fish_test_arg "+*"' -a +wc --description 'Don\'t use wide characters'
complete -c xterm -n '__fish_test_arg "+*"' -a +wf --description 'Don\'t wait the first time for the window to be mapped'
complete -c xterm -o version --description 'Print version number to the standard output'
complete -c xterm -o help --description 'Print out a verbose message describing the options'

View file

@ -0,0 +1,9 @@
function __fish_test_arg --description "Test if the token under the cursor matches the specified wildcard"
switch (commandline -ct)
case $argv
return 0
end
return 1
end