Permalink
Browse files

Move modelines to end of file

Having a vim modeline or emacs local variable line somewhere in the
middle of the file isn't really helpful.  By default, vim will only
check the first and last 5 lines of a file for a modeline (assuming the
modeline option is enabled).  Emacs is even more strict about the type
of local variable line that was in use, it will only check the first
line of the file or the second line if the first line specifies a script
interpreter (which isn't the case here).

Move the vim modeline to the end of the file so that it can actually be
found by vim but is out of the way for editing.  For emacs more work is
required, convert that to the more verbose Local Variables syntax which
emacs will look for starting 3000 characters from the end of the file.

Also there is no zsh mode for emacs (according to
zsh-users/zsh-completions#75), use the "Shell-Script" mode instead.
This seems to automatically detect that the files are for zsh.

I'm not an emacs user, so I haven't tested that portion much.  But, this
does at least improve the syntax highlighting there.
  • Loading branch information...
1 parent ebd708b commit 3f55429b0e97ff2ba57781abd9b529ac89d186b6 @aschrab aschrab committed Aug 23, 2012
Showing with 541 additions and 207 deletions.
  1. +8 −3 src/_ack
  2. +8 −3 src/_adb
  3. +8 −3 src/_android
  4. +8 −3 src/_baselayout
  5. +9 −4 src/_bpython
  6. +8 −3 src/_brew
  7. +8 −3 src/_bundle
  8. +8 −3 src/_cap
  9. +9 −4 src/_choc
  10. +8 −3 src/_coffee
  11. +7 −3 src/_cpanm
  12. +8 −3 src/_debuild
  13. +8 −3 src/_dhcpcd
  14. +8 −3 src/_ditz
  15. +8 −3 src/_emulator
  16. +8 −3 src/_eselect
  17. +8 −3 src/_fab
  18. +8 −3 src/_gcc-config
  19. +8 −3 src/_geany
  20. +8 −3 src/_gem
  21. +8 −3 src/_genlop
  22. +8 −3 src/_gentoo_packages
  23. +8 −3 src/_gentoolkit
  24. +8 −3 src/_git-flow
  25. +8 −3 src/_git-pulls
  26. +8 −3 src/_git-wtf
  27. +8 −3 src/_github
  28. +9 −4 src/_google
  29. +8 −3 src/_gradle
  30. +8 −3 src/_heroku
  31. +8 −3 src/_jmeter
  32. +8 −3 src/_jmeter-plugins
  33. +8 −3 src/_jonas
  34. +8 −3 src/_knife
  35. +8 −3 src/_language_codes
  36. +8 −3 src/_layman
  37. +8 −3 src/_lein
  38. +8 −3 src/_lunar
  39. +8 −3 src/_manage.py
  40. +8 −3 src/_mosh
  41. +8 −3 src/_mvn
  42. +9 −4 src/_node
  43. +8 −3 src/_optirun
  44. +8 −3 src/_pear
  45. +8 −3 src/_perf
  46. +8 −3 src/_periscope
  47. +8 −3 src/_pgsql_utils
  48. +8 −3 src/_pip
  49. +8 −3 src/_pkcon
  50. +8 −3 src/_play
  51. +8 −3 src/_portage
  52. +8 −3 src/_portage_utils
  53. +8 −3 src/_pygmentize
  54. +8 −3 src/_redis-cli
  55. +8 −3 src/_rvm
  56. +8 −3 src/_setup.py
  57. +8 −3 src/_showoff
  58. +9 −4 src/_smartmontools
  59. +8 −3 src/_ssh-copy-id
  60. +8 −3 src/_subliminal
  61. +8 −3 src/_symfony
  62. +8 −3 src/_teamocil
  63. +8 −3 src/_thor
  64. +9 −4 src/_tmuxinator
  65. +8 −3 src/_vagrant
  66. +8 −3 src/_virtualbox
  67. +8 −3 src/_vpnc
View
@@ -37,9 +37,6 @@
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
_ack() {
@@ -180,3 +177,11 @@ _ack_types_caching_policy() {
}
_ack "$@"
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -38,9 +38,6 @@
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
_adb() {
@@ -410,3 +407,11 @@ _adb_remote_command_default() {
}
_adb "$@"
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -38,9 +38,6 @@
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
_android() {
@@ -324,3 +321,11 @@ _android_sdk_update_filters() {
}
_android "$@"
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -42,9 +42,6 @@
# * Mamoru Komachi <usata@usata.org>
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
#<sys-apps/baselayout-1.12.11.1>
#
# Status:
@@ -161,3 +158,11 @@ case "$service" in
_rc "$@" && return 0
;;
esac
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -34,14 +34,19 @@
# * Massimiliano Torromeo <massimiliano.torromeo@gmail.com>
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
_arguments -A "-*" \
'(-h --help)'{-h,--help}'[Show help message]' \
'(-i --interactive)'{-i,--interactive}'[Drop to bpython shell after running file instead of exiting]' \
'(-q --quiet)'{-q,--quiet}"[Don't flush the output to stdout]" \
'(-V --version)'{-V,--version}'[Print version and exit]' \
'--config[Use CONFIG instead of default config file]:Config file:_files' \
- '*: :_files'
+ '*: :_files'
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -19,9 +19,6 @@
# * Erik Kastner (https://github.com/kastner)
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
_brew_all_formulae() {
@@ -99,3 +96,11 @@ case "$words[1]" in
_brew_installed_formulae
_wanted installed_formulae expl 'installed formulae' compadd -a installed_formulae ;;
esac
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -12,9 +12,6 @@
# * Bruno Michel (https://github.com/nono)
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line _gems _opts ret=1
@@ -83,3 +80,11 @@ case $state in
esac
return ret
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -12,9 +12,6 @@
# * Bruno Michel (https://github.com/nono)
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line cmds ret=1
@@ -49,3 +46,11 @@ case $state in
esac
return ret
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -37,9 +37,6 @@
# * Nicholas Penree (https://github.com/drudge)
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
@@ -52,4 +49,12 @@ _arguments -C \
'(-v --version)'{-v,--version}'[print version information]' \
'*:script or directory:_files' && ret=0
-return ret
+return ret
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -37,9 +37,6 @@
# * Mario Fernandez (https://github.com/sirech)
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
@@ -64,3 +61,11 @@ _arguments -C \
'*:script or directory:_files' && ret=0
return ret
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -14,9 +14,6 @@
# * Ryushi (https://github.com/rshhh)
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
local arguments curcontext="$curcontext"
@@ -75,3 +72,10 @@ _arguments -s $arguments \
return 1
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -39,9 +39,6 @@
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
# FIXME --noconf is only allowed in first position
@@ -58,3 +55,11 @@ _arguments \
'(-d)-D[force checking of build dependencies]' \
'--check-dirname-level[how much to check directory names]:level:((0\:never 1\:only\ if\ program\ changes\ directory\ \(default\) 2\:always))' \
'--check-dirname-regex[Perl regex defining matching directory names, the string PACKAGE will be replaced by the package name (default: '\''PACKAGE(-.+)?'\'')]:regex'
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -37,9 +37,6 @@
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
_arguments \
@@ -71,3 +68,11 @@ _arguments \
'(-R --nodns)'{-R,--nodns}'[don'\''t send DNS information to resolvconf or touch /etc/resolv.conf]' \
'(-T --test)'{-T,--test}'[on receipt of discover messages, simply print the contents of the DHCP message to the console]' \
'(-Y --nonis)'{-Y,--nonis}'[don'\''t touch /etc/yp.conf or restart the ypbind service]'
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -14,9 +14,6 @@
# * technolize (https://github.com/technolize)
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
local ME=ditz
@@ -46,3 +43,11 @@ else
;;
esac
fi
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -38,9 +38,6 @@
# * Julien Nicoulaud <julien.nicoulaud@gmail.com>
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
typeset -A opt_args
@@ -132,3 +129,11 @@ _arguments \
'-qemu[pass arguments to qemu]:arguments' \
'-verbose[same as '\''-debug-init'\'']' \
'*'{-debug,-debug-,-debug-no-}'[enable/disable specific debug messages]:tag'
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -43,9 +43,6 @@
# * Mamoru Komachi <usata@usata.org>
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
#<app-admin/eselect-1.0.11>
#
@@ -200,3 +197,11 @@ _eselect () {
}
_eselect "$@"
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
View
@@ -14,9 +14,6 @@
# * Valerii Hiora (https://github.com/vhbit)
#
# ------------------------------------------------------------------------------
-# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
-# vim: ft=zsh sw=2 ts=2 et
-# ------------------------------------------------------------------------------
local curcontext=$curcontext state line
@@ -76,3 +73,11 @@ if [[ CURRENT -ge 1 ]]; then
return
fi
+
+# Local Variables:
+# mode: Shell-Script
+# sh-indentation: 2
+# indent-tabs-mode: nil
+# sh-basic-offset: 2
+# End:
+# vim: ft=zsh sw=2 ts=2 et
Oops, something went wrong.

0 comments on commit 3f55429

Please sign in to comment.