From ff49789f0a49fd1957919511c1a198334d135850 Mon Sep 17 00:00:00 2001 From: dave Date: Sat, 14 Feb 2009 22:47:12 -0600 Subject: [PATCH 1/6] experimental completions for man --- zsh/completion | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zsh/completion b/zsh/completion index 49ad5e7..4e49a82 100755 --- a/zsh/completion +++ b/zsh/completion @@ -4,6 +4,10 @@ zstyle ':completion:*' menu select=1 # change the order up zstyle ':completion:*:(cd|mv|cp):*' tag-order local-directories directory-stack named-directories path-directories +# man page completion +zstyle ':completion:*:manuals' separate-sections true +zstyle ':completion:*:manuals.*' insert-sections true + # neat-o new features zstyle ':completion:*' completer _expand _complete _prefix _correct _match _approximate @@ -106,4 +110,5 @@ zstyle ':completion:*:ls:*' ignore-line yes zstyle ':completion:*:rm:*' ignore-line yes zstyle ':completion:*:scp:*' ignore-line yes zstyle ':completion:*:diff:*' ignore-line yes +zstyle ':completion:*:kill:*' ignore-line yes From 95d230ad64342017c0ad53aaf841ffa10ab0cd31 Mon Sep 17 00:00:00 2001 From: dave Date: Sat, 14 Feb 2009 22:47:44 -0600 Subject: [PATCH 2/6] defensive prompt/logcheck, this should make bad programs play nice --- zsh/prompt | 8 ++++---- zshrc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/zsh/prompt b/zsh/prompt index 5a1ab0b..ffd604b 100755 --- a/zsh/prompt +++ b/zsh/prompt @@ -1,9 +1,9 @@ # prompt if [ -z "${SSH_TTY}" ] ; then - PROMPT=$'%{\e[01;32m%}%n@%m %{\e[01;34m%}%~ %(?..%{\e[01;31m%})%(!.#.$) %{\e[00;00m%}' - RPROMPT=$'%1(j.%{\e[00;36m%}[%j].)%{\e[01;33m%}[%t]%{\e[00;00m%}' + PROMPT=$'%{\e[00;00m%}%{\e[01;32m%}%n@%m %{\e[01;34m%}%~ %(?..%{\e[01;31m%})%(!.#.$) %{\e[00;00m%}' + RPROMPT=$'%{\e[00;00m%}%1(j.%{\e[00;36m%}[%j].)%{\e[01;33m%}[%t]%{\e[00;00m%}' else - PROMPT=$'%{\e[01;36m%}%n %(?..%{\e[01;31m%})%(!.#.$) %{\e[00;00m%}' - RPROMPT=$'%{\e[01;33m%}%m %{\e[01;32m%}%~%{\e[00;00m%}' + PROMPT=$'%{\e[00;00m%}%{\e[01;36m%}%n %(?..%{\e[01;31m%})%(!.#.$) %{\e[00;00m%}' + RPROMPT=$'%{\e[00;00m%}%{\e[01;33m%}%m %{\e[01;32m%}%~%{\e[00;00m%}' fi diff --git a/zshrc b/zshrc index a1247e2..88a21a0 100644 --- a/zshrc +++ b/zshrc @@ -19,7 +19,7 @@ zle -N edit-command-line # Keep track of other people accessing the box watch=( all ) export LOGCHECK=30 -export WATCHFMT=$'\e[01;36m'" -- %n@%m has %(a.Logged In.Logged out) --"$'\e[00;00m' +export WATCHFMT=$'\e[00;00m\e[01;36m'" -- %n@%m has %(a.Logged In.Logged out) --"$'\e[00;00m' # directory hashes if [ -d "${HOME}/sandbox" ] ; then From 37e047e10576b7c8e5dd011be71369b9f59e0406 Mon Sep 17 00:00:00 2001 From: dmajnem2 Date: Tue, 10 Mar 2009 04:26:50 +0000 Subject: [PATCH 3/6] test --- foo | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 foo diff --git a/foo b/foo new file mode 100644 index 0000000..e69de29 From 4c573969175342cd7b9181e75614061b7a621cd3 Mon Sep 17 00:00:00 2001 From: dmajnem2 Date: Tue, 10 Mar 2009 04:27:03 +0000 Subject: [PATCH 4/6] fixed --- foo | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 foo diff --git a/foo b/foo deleted file mode 100644 index e69de29..0000000 From d2bd5f0658cd3820406b486e10d1c3fd782cbaee Mon Sep 17 00:00:00 2001 From: Adrian Kreher Date: Tue, 10 Mar 2009 14:00:56 -0500 Subject: [PATCH 5/6] trivial change --- zshrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zshrc b/zshrc index 88a21a0..e0db595 100644 --- a/zshrc +++ b/zshrc @@ -19,7 +19,7 @@ zle -N edit-command-line # Keep track of other people accessing the box watch=( all ) export LOGCHECK=30 -export WATCHFMT=$'\e[00;00m\e[01;36m'" -- %n@%m has %(a.Logged In.Logged out) --"$'\e[00;00m' +export WATCHFMT=$'\e[00;00m\e[01;36m'" -- %n@%m has %(a.logged in.logged out) --"$'\e[00;00m' # directory hashes if [ -d "${HOME}/sandbox" ] ; then From fc7a3c1dad1524df9c9ffe751cf1c2fcb420dcad Mon Sep 17 00:00:00 2001 From: Adrian Kreher Date: Tue, 10 Mar 2009 14:42:34 -0500 Subject: [PATCH 6/6] Adding scala ftdetect and highlighting code --- vim/ftdetect/scala.vim | 3 + vim/syntax/scala.vim | 153 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 vim/ftdetect/scala.vim create mode 100644 vim/syntax/scala.vim diff --git a/vim/ftdetect/scala.vim b/vim/ftdetect/scala.vim new file mode 100644 index 0000000..f1f3e83 --- /dev/null +++ b/vim/ftdetect/scala.vim @@ -0,0 +1,3 @@ +" $URL: https://lampsvn.epfl.ch/svn-repos/scala/scala-tool-support/trunk/src/vim/ftdetect/scala.vim $ + +au BufRead,BufNewFile *.scala set filetype=scala diff --git a/vim/syntax/scala.vim b/vim/syntax/scala.vim new file mode 100644 index 0000000..9c85c88 --- /dev/null +++ b/vim/syntax/scala.vim @@ -0,0 +1,153 @@ +" Vim syntax file +" Language : Scala (http://scala-lang.org/) +" Maintainers: Stefan Matthias Aust, Julien Wetterwald +" Last Change: 2007 June 13 +" Revision : $Id: scala.vim 15234 2008-05-29 21:54:59Z stepancheg $ +" $URL: https://lampsvn.epfl.ch/svn-repos/scala/scala-tool-support/trunk/src/vim/syntax/scala.vim $ + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +syn case match +syn sync minlines=50 + +" most Scala keywords +syn keyword scalaKeyword abstract case catch do else extends final finally for forSome if implicit lazy match new null override private protected requires return sealed super this throw try type while with yield +syn match scalaKeyword "=>" +syn match scalaKeyword "<-" +syn match scalaKeyword "_" + +syn match scalaOperator ":\{2,\}" "this is not a type + +" package and import statements +syn keyword scalaPackage package nextgroup=scalaFqn skipwhite +syn keyword scalaImport import nextgroup=scalaFqn skipwhite +syn match scalaFqn "\<[._$a-zA-Z0-9,]*" contained nextgroup=scalaFqnSet +syn region scalaFqnSet start="{" end="}" contained + +" boolean literals +syn keyword scalaBoolean true false + +" definitions +syn keyword scalaDef def nextgroup=scalaDefName skipwhite +syn keyword scalaVal val nextgroup=scalaValName skipwhite +syn keyword scalaVar var nextgroup=scalaVarName skipwhite +syn keyword scalaClass class nextgroup=scalaClassName skipwhite +syn keyword scalaObject object nextgroup=scalaClassName skipwhite +syn keyword scalaTrait trait nextgroup=scalaClassName skipwhite +syn match scalaDefName "[^ =:;([]\+" contained nextgroup=scalaDefSpecializer skipwhite +syn match scalaValName "[^ =:;([]\+" contained +syn match scalaVarName "[^ =:;([]\+" contained +syn match scalaClassName "[^ =:;(\[]\+" contained nextgroup=scalaClassSpecializer skipwhite +syn region scalaDefSpecializer start="\[" end="\]" contained contains=scalaDefSpecializer +syn region scalaClassSpecializer start="\[" end="\]" contained contains=scalaClassSpecializer + +" type constructor (actually anything with an uppercase letter) +syn match scalaConstructor "\<[A-Z][_$a-zA-Z0-9]*\>" nextgroup=scalaConstructorSpecializer +syn region scalaConstructorSpecializer start="\[" end="\]" contained contains=scalaConstructorSpecializer + +" method call +syn match scalaRoot "\<[a-zA-Z][_$a-zA-Z0-9]*\."me=e-1 +syn match scalaMethodCall "\.[a-z][_$a-zA-Z0-9]*"ms=s+1 + +" type declarations in val/var/def +syn match scalaType ":\s*\(=>\s*\)\?[._$a-zA-Z0-9]\+\(\[[^]]*\]\+\)\?\(\s*\(<:\|>:\|#\|=>\)\s*[._$a-zA-Z0-9]\+\(\[[^]]*\]\+\)*\)*"ms=s+1 + +" comments +syn match scalaTodo "[tT][oO][dD][oO]" contained +syn match scalaLineComment "//.*" contains=scalaTodo +syn region scalaComment start="/\*" end="\*/" contains=scalaTodo +syn case ignore +syn include @scalaHtml syntax/html.vim +unlet b:current_syntax +syn case match +syn region scalaDocComment start="/\*\*" end="\*/" contains=scalaDocTags,scalaTodo,@scalaHtml keepend +syn region scalaDocTags start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}" contained +syn match scalaDocTags "@[a-z]\+" contained + +syn match scalaEmptyString "\"\"" + +" multi-line string literals +syn region scalaMultiLineString start="\"\"\"" end="\"\"\"" contains=scalaUnicode +syn match scalaUnicode "\\u[0-9a-fA-F]\{4}" contained + +" string literals with escapes +syn region scalaString start="\"[^"]" skip="\\\"" end="\"" contains=scalaStringEscape " TODO end \n or not? +syn match scalaStringEscape "\\u[0-9a-fA-F]\{4}" contained +syn match scalaStringEscape "\\[nrfvb\\\"]" contained + +" symbol and character literals +syn match scalaSymbol "'[_a-zA-Z0-9][_a-zA-Z0-9]*\>" +syn match scalaChar "'[^'\\]'\|'\\.'\|'\\u[0-9a-fA-F]\{4}'" + +" number literals +syn match scalaNumber "\<\(0[0-7]*\|0[xX]\x\+\|\d\+\)[lL]\=\>" +syn match scalaNumber "\(\<\d\+\.\d*\|\.\d\+\)\([eE][-+]\=\d\+\)\=[fFdD]\=" +syn match scalaNumber "\<\d\+[eE][-+]\=\d\+[fFdD]\=\>" +syn match scalaNumber "\<\d\+\([eE][-+]\=\d\+\)\=[fFdD]\>" + +" xml literals +syn match scalaXmlTag "<[a-zA-Z]\_[^>]*/>" contains=scalaXmlQuote,scalaXmlEscape,scalaXmlString +syn region scalaXmlString start="\"" end="\"" contained +syn match scalaXmlStart "<[a-zA-Z]\_[^>]*>" contained contains=scalaXmlQuote,scalaXmlEscape,scalaXmlString +syn region scalaXml start="<\([a-zA-Z]\_[^>]*\_[^/]\|[a-zA-Z]\)>" matchgroup=scalaXmlStart end="]\+>" contains=scalaXmlEscape,scalaXmlQuote,scalaXml,scalaXmlStart,scalaXmlComment +syn region scalaXmlEscape matchgroup=scalaXmlEscapeSpecial start="{" matchgroup=scalaXmlEscapeSpecial end="}" contained contains=TOP +syn match scalaXmlQuote "&[^;]\+;" contained +syn match scalaXmlComment "" contained + +syn sync fromstart + +" map Scala groups to standard groups +hi link scalaKeyword Keyword +hi link scalaPackage Include +hi link scalaImport Include +hi link scalaBoolean Boolean +hi link scalaOperator Normal +hi link scalaNumber Number +hi link scalaEmptyString String +hi link scalaString String +hi link scalaChar String +hi link scalaMultiLineString String +hi link scalaStringEscape Special +hi link scalaSymbol Special +hi link scalaUnicode Special +hi link scalaComment Comment +hi link scalaLineComment Comment +hi link scalaDocComment Comment +hi link scalaDocTags Special +hi link scalaTodo Todo +hi link scalaType Type +hi link scalaTypeSpecializer scalaType +hi link scalaXml String +hi link scalaXmlTag Include +hi link scalaXmlString String +hi link scalaXmlStart Include +hi link scalaXmlEscape Normal +hi link scalaXmlEscapeSpecial Special +hi link scalaXmlQuote Special +hi link scalaXmlComment Comment +hi link scalaDef Keyword +hi link scalaVar Keyword +hi link scalaVal Keyword +hi link scalaClass Keyword +hi link scalaObject Keyword +hi link scalaTrait Keyword +hi link scalaDefName Function +hi link scalaDefSpecializer Function +hi link scalaClassName Special +hi link scalaClassSpecializer Special +hi link scalaConstructor Special +hi link scalaConstructorSpecializer scalaConstructor + +let b:current_syntax = "scala" + +" you might like to put these lines in your .vimrc +" +" customize colors a little bit (should be a different file) +" hi scalaNew gui=underline +" hi scalaMethodCall gui=italic +" hi scalaValName gui=underline +" hi scalaVarName gui=underline