mirror of
https://github.com/tomru/DotfilesOld.git
synced 2026-03-03 06:27:21 +01:00
initial commit
This commit is contained in:
1227
vim/doc/NERD_tree.txt
Normal file
1227
vim/doc/NERD_tree.txt
Normal file
File diff suppressed because it is too large
Load Diff
160
vim/doc/tags
Normal file
160
vim/doc/tags
Normal file
@@ -0,0 +1,160 @@
|
||||
'Tlist_Auto_Highlight_Tag' taglist.txt /*'Tlist_Auto_Highlight_Tag'*
|
||||
'Tlist_Auto_Open' taglist.txt /*'Tlist_Auto_Open'*
|
||||
'Tlist_Auto_Update' taglist.txt /*'Tlist_Auto_Update'*
|
||||
'Tlist_Close_On_Select' taglist.txt /*'Tlist_Close_On_Select'*
|
||||
'Tlist_Compact_Format' taglist.txt /*'Tlist_Compact_Format'*
|
||||
'Tlist_Ctags_Cmd' taglist.txt /*'Tlist_Ctags_Cmd'*
|
||||
'Tlist_Display_Prototype' taglist.txt /*'Tlist_Display_Prototype'*
|
||||
'Tlist_Display_Tag_Scope' taglist.txt /*'Tlist_Display_Tag_Scope'*
|
||||
'Tlist_Enable_Fold_Column' taglist.txt /*'Tlist_Enable_Fold_Column'*
|
||||
'Tlist_Exit_OnlyWindow' taglist.txt /*'Tlist_Exit_OnlyWindow'*
|
||||
'Tlist_File_Fold_Auto_Close' taglist.txt /*'Tlist_File_Fold_Auto_Close'*
|
||||
'Tlist_GainFocus_On_ToggleOpen' taglist.txt /*'Tlist_GainFocus_On_ToggleOpen'*
|
||||
'Tlist_Highlight_Tag_On_BufEnter' taglist.txt /*'Tlist_Highlight_Tag_On_BufEnter'*
|
||||
'Tlist_Inc_Winwidth' taglist.txt /*'Tlist_Inc_Winwidth'*
|
||||
'Tlist_Max_Submenu_Items' taglist.txt /*'Tlist_Max_Submenu_Items'*
|
||||
'Tlist_Max_Tag_Length' taglist.txt /*'Tlist_Max_Tag_Length'*
|
||||
'Tlist_Process_File_Always' taglist.txt /*'Tlist_Process_File_Always'*
|
||||
'Tlist_Show_Menu' taglist.txt /*'Tlist_Show_Menu'*
|
||||
'Tlist_Show_One_File' taglist.txt /*'Tlist_Show_One_File'*
|
||||
'Tlist_Sort_Type' taglist.txt /*'Tlist_Sort_Type'*
|
||||
'Tlist_Use_Horiz_Window' taglist.txt /*'Tlist_Use_Horiz_Window'*
|
||||
'Tlist_Use_Right_Window' taglist.txt /*'Tlist_Use_Right_Window'*
|
||||
'Tlist_Use_SingleClick' taglist.txt /*'Tlist_Use_SingleClick'*
|
||||
'Tlist_WinHeight' taglist.txt /*'Tlist_WinHeight'*
|
||||
'Tlist_WinWidth' taglist.txt /*'Tlist_WinWidth'*
|
||||
:NERDTree NERD_tree.txt /*:NERDTree*
|
||||
:NERDTreeFromBookmark NERD_tree.txt /*:NERDTreeFromBookmark*
|
||||
:NERDTreeToggle NERD_tree.txt /*:NERDTreeToggle*
|
||||
:Snippet snippets_emu.txt /*:Snippet*
|
||||
:TlistAddFiles taglist.txt /*:TlistAddFiles*
|
||||
:TlistAddFilesRecursive taglist.txt /*:TlistAddFilesRecursive*
|
||||
:TlistClose taglist.txt /*:TlistClose*
|
||||
:TlistDebug taglist.txt /*:TlistDebug*
|
||||
:TlistHighlightTag taglist.txt /*:TlistHighlightTag*
|
||||
:TlistLock taglist.txt /*:TlistLock*
|
||||
:TlistMessages taglist.txt /*:TlistMessages*
|
||||
:TlistOpen taglist.txt /*:TlistOpen*
|
||||
:TlistSessionLoad taglist.txt /*:TlistSessionLoad*
|
||||
:TlistSessionSave taglist.txt /*:TlistSessionSave*
|
||||
:TlistShowPrototype taglist.txt /*:TlistShowPrototype*
|
||||
:TlistShowTag taglist.txt /*:TlistShowTag*
|
||||
:TlistToggle taglist.txt /*:TlistToggle*
|
||||
:TlistUndebug taglist.txt /*:TlistUndebug*
|
||||
:TlistUnlock taglist.txt /*:TlistUnlock*
|
||||
:TlistUpdate taglist.txt /*:TlistUpdate*
|
||||
CreateBundleSnippet snippets_emu.txt /*CreateBundleSnippet*
|
||||
CreateSnippet snippets_emu.txt /*CreateSnippet*
|
||||
NERDChristmasTree NERD_tree.txt /*NERDChristmasTree*
|
||||
NERDTree NERD_tree.txt /*NERDTree*
|
||||
NERDTree-! NERD_tree.txt /*NERDTree-!*
|
||||
NERDTree-? NERD_tree.txt /*NERDTree-?*
|
||||
NERDTree-B NERD_tree.txt /*NERDTree-B*
|
||||
NERDTree-C NERD_tree.txt /*NERDTree-C*
|
||||
NERDTree-D NERD_tree.txt /*NERDTree-D*
|
||||
NERDTree-F NERD_tree.txt /*NERDTree-F*
|
||||
NERDTree-H NERD_tree.txt /*NERDTree-H*
|
||||
NERDTree-J NERD_tree.txt /*NERDTree-J*
|
||||
NERDTree-K NERD_tree.txt /*NERDTree-K*
|
||||
NERDTree-O NERD_tree.txt /*NERDTree-O*
|
||||
NERDTree-P NERD_tree.txt /*NERDTree-P*
|
||||
NERDTree-R NERD_tree.txt /*NERDTree-R*
|
||||
NERDTree-T NERD_tree.txt /*NERDTree-T*
|
||||
NERDTree-U NERD_tree.txt /*NERDTree-U*
|
||||
NERDTree-X NERD_tree.txt /*NERDTree-X*
|
||||
NERDTree-c-j NERD_tree.txt /*NERDTree-c-j*
|
||||
NERDTree-c-k NERD_tree.txt /*NERDTree-c-k*
|
||||
NERDTree-contents NERD_tree.txt /*NERDTree-contents*
|
||||
NERDTree-e NERD_tree.txt /*NERDTree-e*
|
||||
NERDTree-f NERD_tree.txt /*NERDTree-f*
|
||||
NERDTree-go NERD_tree.txt /*NERDTree-go*
|
||||
NERDTree-gtab NERD_tree.txt /*NERDTree-gtab*
|
||||
NERDTree-m NERD_tree.txt /*NERDTree-m*
|
||||
NERDTree-o NERD_tree.txt /*NERDTree-o*
|
||||
NERDTree-p NERD_tree.txt /*NERDTree-p*
|
||||
NERDTree-q NERD_tree.txt /*NERDTree-q*
|
||||
NERDTree-r NERD_tree.txt /*NERDTree-r*
|
||||
NERDTree-t NERD_tree.txt /*NERDTree-t*
|
||||
NERDTree-tab NERD_tree.txt /*NERDTree-tab*
|
||||
NERDTree-u NERD_tree.txt /*NERDTree-u*
|
||||
NERDTree-x NERD_tree.txt /*NERDTree-x*
|
||||
NERDTreeAuthor NERD_tree.txt /*NERDTreeAuthor*
|
||||
NERDTreeAutoCenter NERD_tree.txt /*NERDTreeAutoCenter*
|
||||
NERDTreeAutoCenterThreshold NERD_tree.txt /*NERDTreeAutoCenterThreshold*
|
||||
NERDTreeBookmarkCommands NERD_tree.txt /*NERDTreeBookmarkCommands*
|
||||
NERDTreeBookmarkTable NERD_tree.txt /*NERDTreeBookmarkTable*
|
||||
NERDTreeBookmarks NERD_tree.txt /*NERDTreeBookmarks*
|
||||
NERDTreeBookmarksFile NERD_tree.txt /*NERDTreeBookmarksFile*
|
||||
NERDTreeCaseSensitiveSort NERD_tree.txt /*NERDTreeCaseSensitiveSort*
|
||||
NERDTreeChDirMode NERD_tree.txt /*NERDTreeChDirMode*
|
||||
NERDTreeChangelog NERD_tree.txt /*NERDTreeChangelog*
|
||||
NERDTreeCredits NERD_tree.txt /*NERDTreeCredits*
|
||||
NERDTreeFilesysMenu NERD_tree.txt /*NERDTreeFilesysMenu*
|
||||
NERDTreeFunctionality NERD_tree.txt /*NERDTreeFunctionality*
|
||||
NERDTreeGlobalCommands NERD_tree.txt /*NERDTreeGlobalCommands*
|
||||
NERDTreeHighlightCursorline NERD_tree.txt /*NERDTreeHighlightCursorline*
|
||||
NERDTreeIgnore NERD_tree.txt /*NERDTreeIgnore*
|
||||
NERDTreeInvalidBookmarks NERD_tree.txt /*NERDTreeInvalidBookmarks*
|
||||
NERDTreeLicense NERD_tree.txt /*NERDTreeLicense*
|
||||
NERDTreeMappings NERD_tree.txt /*NERDTreeMappings*
|
||||
NERDTreeMouseMode NERD_tree.txt /*NERDTreeMouseMode*
|
||||
NERDTreeOptionDetails NERD_tree.txt /*NERDTreeOptionDetails*
|
||||
NERDTreeOptionSummary NERD_tree.txt /*NERDTreeOptionSummary*
|
||||
NERDTreeOptions NERD_tree.txt /*NERDTreeOptions*
|
||||
NERDTreePublicFunctions NERD_tree.txt /*NERDTreePublicFunctions*
|
||||
NERDTreeQuitOnOpen NERD_tree.txt /*NERDTreeQuitOnOpen*
|
||||
NERDTreeShowBookmarks NERD_tree.txt /*NERDTreeShowBookmarks*
|
||||
NERDTreeShowFiles NERD_tree.txt /*NERDTreeShowFiles*
|
||||
NERDTreeShowHidden NERD_tree.txt /*NERDTreeShowHidden*
|
||||
NERDTreeShowLineNumbers NERD_tree.txt /*NERDTreeShowLineNumbers*
|
||||
NERDTreeSortOrder NERD_tree.txt /*NERDTreeSortOrder*
|
||||
NERDTreeTodo NERD_tree.txt /*NERDTreeTodo*
|
||||
NERDTreeWinPos NERD_tree.txt /*NERDTreeWinPos*
|
||||
NERDTreeWinSize NERD_tree.txt /*NERDTreeWinSize*
|
||||
NERD_tree.txt NERD_tree.txt /*NERD_tree.txt*
|
||||
Tlist_Get_Tag_Prototype_By_Line() taglist.txt /*Tlist_Get_Tag_Prototype_By_Line()*
|
||||
Tlist_Get_Tagname_By_Line() taglist.txt /*Tlist_Get_Tagname_By_Line()*
|
||||
Tlist_Set_App() taglist.txt /*Tlist_Set_App()*
|
||||
Tlist_Update_File_Tags() taglist.txt /*Tlist_Update_File_Tags()*
|
||||
basic-snippet snippets_emu.txt /*basic-snippet*
|
||||
creating-snippets snippets_emu.txt /*creating-snippets*
|
||||
loaded_nerd_tree NERD_tree.txt /*loaded_nerd_tree*
|
||||
named-tags snippets_emu.txt /*named-tags*
|
||||
snip-advanced-tag-commands snippets_emu.txt /*snip-advanced-tag-commands*
|
||||
snip-buffer-specific snippets_emu.txt /*snip-buffer-specific*
|
||||
snip-bundles snippets_emu.txt /*snip-bundles*
|
||||
snip-contact-details snippets_emu.txt /*snip-contact-details*
|
||||
snip-contributors snippets_emu.txt /*snip-contributors*
|
||||
snip-detailed-explanations snippets_emu.txt /*snip-detailed-explanations*
|
||||
snip-elem-delimiter snippets_emu.txt /*snip-elem-delimiter*
|
||||
snip-ftplugin snippets_emu.txt /*snip-ftplugin*
|
||||
snip-limitations snippets_emu.txt /*snip-limitations*
|
||||
snip-menu snippets_emu.txt /*snip-menu*
|
||||
snip-remap-key snippets_emu.txt /*snip-remap-key*
|
||||
snip-snippet-commands snippets_emu.txt /*snip-snippet-commands*
|
||||
snip-special-vars snippets_emu.txt /*snip-special-vars*
|
||||
snip-start-end-tags snippets_emu.txt /*snip-start-end-tags*
|
||||
snip-tag-name-syntax snippets_emu.txt /*snip-tag-name-syntax*
|
||||
snippet-commands snippets_emu.txt /*snippet-commands*
|
||||
snippets_emu-bugs snippets_emu.txt /*snippets_emu-bugs*
|
||||
snippets_emu-features snippets_emu.txt /*snippets_emu-features*
|
||||
snippets_emu-options snippets_emu.txt /*snippets_emu-options*
|
||||
snippets_emu-troubleshooting snippets_emu.txt /*snippets_emu-troubleshooting*
|
||||
snippets_emu.txt snippets_emu.txt /*snippets_emu.txt*
|
||||
taglist-commands taglist.txt /*taglist-commands*
|
||||
taglist-debug taglist.txt /*taglist-debug*
|
||||
taglist-extend taglist.txt /*taglist-extend*
|
||||
taglist-faq taglist.txt /*taglist-faq*
|
||||
taglist-functions taglist.txt /*taglist-functions*
|
||||
taglist-install taglist.txt /*taglist-install*
|
||||
taglist-internet taglist.txt /*taglist-internet*
|
||||
taglist-intro taglist.txt /*taglist-intro*
|
||||
taglist-keys taglist.txt /*taglist-keys*
|
||||
taglist-license taglist.txt /*taglist-license*
|
||||
taglist-menu taglist.txt /*taglist-menu*
|
||||
taglist-options taglist.txt /*taglist-options*
|
||||
taglist-requirements taglist.txt /*taglist-requirements*
|
||||
taglist-session taglist.txt /*taglist-session*
|
||||
taglist-todo taglist.txt /*taglist-todo*
|
||||
taglist-using taglist.txt /*taglist-using*
|
||||
taglist.txt taglist.txt /*taglist.txt*
|
||||
58
vim/ftplugin/python.vim
Normal file
58
vim/ftplugin/python.vim
Normal file
@@ -0,0 +1,58 @@
|
||||
python << EOF
|
||||
def SetBreakpoint():
|
||||
import re
|
||||
nLine = int( vim.eval( 'line(".")'))
|
||||
|
||||
strLine = vim.current.line
|
||||
strWhite = re.search( '^(\s*)', strLine).group(1)
|
||||
|
||||
vim.current.buffer.append(
|
||||
"%(space)spdb.set_trace() %(mark)s Breakpoint %(mark)s" %
|
||||
{'space':strWhite, 'mark': '#' * 30}, nLine - 1)
|
||||
|
||||
for strLine in vim.current.buffer:
|
||||
if strLine == "import pdb":
|
||||
break
|
||||
else:
|
||||
vim.current.buffer.append( 'import pdb', 0)
|
||||
vim.command( 'normal j1')
|
||||
|
||||
vim.command( 'map <f7> :py SetBreakpoint()<cr>')
|
||||
|
||||
def RemoveBreakpoints():
|
||||
import re
|
||||
|
||||
nCurrentLine = int( vim.eval( 'line(".")'))
|
||||
|
||||
nLines = []
|
||||
nLine = 1
|
||||
for strLine in vim.current.buffer:
|
||||
if strLine == 'import pdb' or strLine.lstrip()[:15] == 'pdb.set_trace()':
|
||||
nLines.append( nLine)
|
||||
nLine += 1
|
||||
|
||||
nLines.reverse()
|
||||
|
||||
for nLine in nLines:
|
||||
vim.command( 'normal %dG' % nLine)
|
||||
vim.command( 'normal dd')
|
||||
if nLine < nCurrentLine:
|
||||
nCurrentLine -= 1
|
||||
|
||||
vim.command( 'normal %dG' % nCurrentLine)
|
||||
|
||||
vim.command( 'map <s-f7> :py RemoveBreakpoints()<cr>')
|
||||
EOF
|
||||
|
||||
set makeprg=python\ -c\ \"import\ py_compile,sys;\ sys.stderr=sys.stdout;\ py_compile.compile(r'%')\"
|
||||
set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
|
||||
|
||||
"PEP 8 Friendly
|
||||
setlocal tabstop=4
|
||||
setlocal softtabstop=4
|
||||
setlocal shiftwidth=4
|
||||
setlocal textwidth=80
|
||||
setlocal smarttab
|
||||
setlocal expandtab
|
||||
setlocal smartindent
|
||||
|
||||
3530
vim/plugin/NERD_tree.vim
Normal file
3530
vim/plugin/NERD_tree.vim
Normal file
File diff suppressed because it is too large
Load Diff
357
vim/syntax/python.vim
Normal file
357
vim/syntax/python.vim
Normal file
@@ -0,0 +1,357 @@
|
||||
" Vim syntax file
|
||||
" Language: Python
|
||||
" Maintainer: Dmitry Vasiliev <dima@hlabs.spb.ru>
|
||||
" URL: http://www.hlabs.spb.ru/vim/python3.0.vim
|
||||
" Last Change: 2008-12-07
|
||||
" Filenames: *.py
|
||||
" Version: 3.0.0
|
||||
"
|
||||
" Based on python.vim (from Vim 6.1 distribution)
|
||||
" by Neil Schemenauer <nas@python.ca>
|
||||
"
|
||||
" Thanks:
|
||||
"
|
||||
" Jeroen Ruigrok van der Werven
|
||||
" for the idea to highlight erroneous operators
|
||||
" Pedro Algarvio
|
||||
" for the patch to enable spell checking only for the right spots
|
||||
" (strings and comments)
|
||||
" John Eikenberry
|
||||
" for the patch fixing small typo
|
||||
|
||||
"
|
||||
" Options:
|
||||
"
|
||||
" For set option do: let OPTION_NAME = 1
|
||||
" For clear option do: let OPTION_NAME = 0
|
||||
"
|
||||
" Option names:
|
||||
"
|
||||
" For highlight builtin functions:
|
||||
" python_highlight_builtins
|
||||
"
|
||||
" For highlight standard exceptions:
|
||||
" python_highlight_exceptions
|
||||
"
|
||||
" For highlight string formatting:
|
||||
" python_highlight_string_formatting
|
||||
"
|
||||
" For highlight str.format syntax:
|
||||
" python_highlight_string_format
|
||||
"
|
||||
" For highlight string.Template syntax:
|
||||
" python_highlight_string_templates
|
||||
"
|
||||
" For highlight indentation errors:
|
||||
" python_highlight_indent_errors
|
||||
"
|
||||
" For highlight trailing spaces:
|
||||
" python_highlight_space_errors
|
||||
"
|
||||
" For highlight doc-tests:
|
||||
" python_highlight_doctests
|
||||
"
|
||||
" If you want all Python highlightings above:
|
||||
" python_highlight_all
|
||||
" (This option not override previously set options)
|
||||
"
|
||||
" For fast machines:
|
||||
" python_slow_sync
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
if exists("python_highlight_all") && python_highlight_all != 0
|
||||
" Not override previously set options
|
||||
if !exists("python_highlight_builtins")
|
||||
let python_highlight_builtins = 1
|
||||
endif
|
||||
if !exists("python_highlight_exceptions")
|
||||
let python_highlight_exceptions = 1
|
||||
endif
|
||||
if !exists("python_highlight_string_formatting")
|
||||
let python_highlight_string_formatting = 1
|
||||
endif
|
||||
if !exists("python_highlight_string_format")
|
||||
let python_highlight_string_format = 1
|
||||
endif
|
||||
if !exists("python_highlight_string_templates")
|
||||
let python_highlight_string_templates = 1
|
||||
endif
|
||||
if !exists("python_highlight_indent_errors")
|
||||
let python_highlight_indent_errors = 1
|
||||
endif
|
||||
if !exists("python_highlight_space_errors")
|
||||
let python_highlight_space_errors = 1
|
||||
endif
|
||||
if !exists("python_highlight_doctests")
|
||||
let python_highlight_doctests = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
" Keywords
|
||||
syn keyword pythonStatement break continue del
|
||||
syn keyword pythonStatement exec return as
|
||||
syn keyword pythonStatement pass raise
|
||||
syn keyword pythonStatement global assert
|
||||
syn keyword pythonStatement lambda yield
|
||||
syn keyword pythonStatement with nonlocal
|
||||
syn keyword pythonStatement False None True
|
||||
syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite
|
||||
syn match pythonFunction "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
|
||||
syn keyword pythonRepeat for while
|
||||
syn keyword pythonConditional if elif else
|
||||
syn keyword pythonImport import from
|
||||
syn keyword pythonException try except finally
|
||||
syn keyword pythonOperator and in is not or
|
||||
|
||||
" Decorators (new in Python 2.4)
|
||||
syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite
|
||||
|
||||
" Comments
|
||||
syn match pythonComment "#.*$" display contains=pythonTodo,@Spell
|
||||
syn match pythonRun "\%^#!.*$"
|
||||
syn match pythonCoding "\%^.*\%(\n.*\)\?#.*coding[:=]\s*[0-9A-Za-z-_.]\+.*$"
|
||||
syn keyword pythonTodo TODO FIXME XXX contained
|
||||
|
||||
" Errors
|
||||
" syn match pythonError "\<\d\+\D\+\>" display
|
||||
syn match pythonError "[$?]" display
|
||||
syn match pythonError "[&|]\{2,}" display
|
||||
syn match pythonError "[=]\{3,}" display
|
||||
|
||||
syn match pythonError "^\s*def\s\+\w\+(.*)\s*$" display
|
||||
syn match pythonError "^\s*class\s\+\w\+(.*)\s*$" display
|
||||
syn match pythonError "^\s*for\s.*[^:]$" display
|
||||
syn match pythonError "^\s*except\s*$" display
|
||||
syn match pythonError "^\s*finally\s*$" display
|
||||
syn match pythonError "^\s*try\s*$" display
|
||||
syn match pythonError "^\s*else\s*$" display
|
||||
syn match pythonError "^\s*else\s*[^:].*" display
|
||||
syn match pythonError "^\s*if\s.*[^\:]$" display
|
||||
syn match pythonError "^\s*except\s.*[^\:]$" display
|
||||
syn match pythonError "[;]$" display
|
||||
syn keyword pythonError do
|
||||
|
||||
" TODO: Mixing spaces and tabs also may be used for pretty formatting multiline
|
||||
" statements. For now I don't know how to work around this.
|
||||
if exists("python_highlight_indent_errors") && python_highlight_indent_errors != 0
|
||||
syn match pythonIndentError "^\s*\%( \t\|\t \)\s*\S"me=e-1 display
|
||||
endif
|
||||
|
||||
" Trailing space errors
|
||||
if exists("python_highlight_space_errors") && python_highlight_space_errors != 0
|
||||
syn match pythonSpaceError "\s\+$" display
|
||||
endif
|
||||
|
||||
" Strings
|
||||
syn region pythonString start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonEscape,pythonEscapeError,@Spell
|
||||
syn region pythonString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonEscape,pythonEscapeError,@Spell
|
||||
syn region pythonString start=+"""+ end=+"""+ keepend contains=pythonEscape,pythonEscapeError,pythonDocTest2,pythonSpaceError,@Spell
|
||||
syn region pythonString start=+'''+ end=+'''+ keepend contains=pythonEscape,pythonEscapeError,pythonDocTest,pythonSpaceError,@Spell
|
||||
|
||||
syn match pythonEscape +\\[abfnrtv'"\\]+ display contained
|
||||
syn match pythonEscape "\\\o\o\=\o\=" display contained
|
||||
syn match pythonEscapeError "\\\o\{,2}[89]" display contained
|
||||
syn match pythonEscape "\\x\x\{2}" display contained
|
||||
syn match pythonEscapeError "\\x\x\=\X" display contained
|
||||
syn match pythonEscape "\\$"
|
||||
syn match pythonEscape "\\u\x\{4}" display contained
|
||||
syn match pythonEscapeError "\\u\x\{,3}\X" display contained
|
||||
syn match pythonEscape "\\U\x\{8}" display contained
|
||||
syn match pythonEscapeError "\\U\x\{,7}\X" display contained
|
||||
syn match pythonEscape "\\N{[A-Z ]\+}" display contained
|
||||
syn match pythonEscapeError "\\N{[^A-Z ]\+}" display contained
|
||||
|
||||
" Raw strings
|
||||
syn region pythonRawString start=+[rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonRawEscape,@Spell
|
||||
syn region pythonRawString start=+[rR]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonRawEscape,@Spell
|
||||
syn region pythonRawString start=+[rR]"""+ end=+"""+ keepend contains=pythonDocTest2,pythonSpaceError,@Spell
|
||||
syn region pythonRawString start=+[rR]'''+ end=+'''+ keepend contains=pythonDocTest,pythonSpaceError,@Spell
|
||||
|
||||
syn match pythonRawEscape +\\['"]+ display transparent contained
|
||||
|
||||
" Bytes
|
||||
syn region pythonBytes start=+[bB]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonBytesContent,pythonBytesError,pythonBytesEscape,pythonBytesEscapeError,@Spell
|
||||
syn region pythonBytes start=+[bB]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonBytesContent,pythonBytesError,pythonBytesEscape,pythonBytesEscapeError,@Spell
|
||||
syn region pythonBytes start=+[bB]"""+ end=+"""+ keepend contains=pythonBytesContent,pythonBytesError,pythonBytesEscape,pythonBytesEscapeError,pythonDocTest2,pythonSpaceError,@Spell
|
||||
syn region pythonBytes start=+[bB]'''+ end=+'''+ keepend contains=pythonBytesContent,pythonBytesError,pythonBytesEscape,pythonBytesEscapeError,pythonDocTest,pythonSpaceError,@Spell
|
||||
|
||||
syn match pythonBytesContent "[\u0001-\u007f]\+" display contained
|
||||
syn match pythonBytesError "[^\u0001-\u007f]\+" display contained
|
||||
|
||||
syn match pythonBytesEscape +\\[abfnrtv'"\\]+ display contained
|
||||
syn match pythonBytesEscape "\\\o\o\=\o\=" display contained
|
||||
syn match pythonBytesEscapeError "\\\o\{,2}[89]" display contained
|
||||
syn match pythonBytesEscape "\\x\x\{2}" display contained
|
||||
syn match pythonBytesEscapeError "\\x\x\=\X" display contained
|
||||
syn match pythonBytesEscape "\\$"
|
||||
|
||||
if exists("python_highlight_string_formatting") && python_highlight_string_formatting != 0
|
||||
" String formatting
|
||||
syn match pythonStrFormatting "%\%(([^)]\+)\)\=[-#0 +]*\d*\%(\.\d\+\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonRawString
|
||||
syn match pythonStrFormatting "%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)\=[hlL]\=[diouxXeEfFgGcrs%]" contained containedin=pythonString,pythonRawString
|
||||
endif
|
||||
|
||||
if exists("python_highlight_string_format") && python_highlight_string_format != 0
|
||||
" str.format syntax
|
||||
syn match pythonStrFormat "{{\|}}" contained containedin=pythonString,pythonRawString
|
||||
syn match pythonStrFormat "{\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)\%(\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_*\)\|\[\%(\d\+\|[^!:\}]\+\)\]\)*\%(![rsa]\)\=\%(:\%({\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)}\|\%([^}]\=[<>=^]\)\=[ +-]\=#\=0\=\d*\%(\.\d\+\)\=[bcdeEfFgGnoxX%]\=\)\=\)\=}" contained containedin=pythonString,pythonRawString
|
||||
endif
|
||||
|
||||
if exists("python_highlight_string_templates") && python_highlight_string_templates != 0
|
||||
" String templates
|
||||
syn match pythonStrTemplate "\$\$" contained containedin=pythonString,pythonRawString
|
||||
syn match pythonStrTemplate "\${[a-zA-Z_][a-zA-Z0-9_]*}" contained containedin=pythonString,pythonRawString
|
||||
syn match pythonStrTemplate "\$[a-zA-Z_][a-zA-Z0-9_]*" contained containedin=pythonString,pythonRawString
|
||||
endif
|
||||
|
||||
if exists("python_highlight_doctests") && python_highlight_doctests != 0
|
||||
" DocTests
|
||||
syn region pythonDocTest start="^\s*>>>" end=+'''+he=s-1 end="^\s*$" contained
|
||||
syn region pythonDocTest2 start="^\s*>>>" end=+"""+he=s-1 end="^\s*$" contained
|
||||
endif
|
||||
|
||||
" Numbers (ints, longs, floats, complex)
|
||||
syn match pythonHexError "\<0[xX]\x*[g-zG-Z]\x*\>" display
|
||||
|
||||
syn match pythonHexNumber "\<0[xX]\x\+\>" display
|
||||
syn match pythonOctNumber "\<0[oO]\o\+\>" display
|
||||
syn match pythonBinNumber "\<0[bB][01]\+\>" display
|
||||
|
||||
syn match pythonNumber "\<\d\>" display
|
||||
syn match pythonNumber "\<[1-9]\d\+\>" display
|
||||
syn match pythonNumber "\<\d\+[jJ]\>" display
|
||||
syn match pythonNumberError "\<0\d\+\>" display
|
||||
|
||||
syn match pythonFloat "\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>" display
|
||||
syn match pythonFloat "\<\d\+[eE][+-]\=\d\+[jJ]\=\>" display
|
||||
syn match pythonFloat "\<\d\+\.\d*\%([eE][+-]\=\d\+\)\=[jJ]\=" display
|
||||
|
||||
syn match pythonOctError "\<0[oO]\=\o*[8-9]\d*\>" display
|
||||
syn match pythonBinError "\<0[bB][01]*[2-9]\d*\>" display
|
||||
|
||||
if exists("python_highlight_builtins") && python_highlight_builtins != 0
|
||||
" Builtin functions, types and objects
|
||||
syn keyword pythonBuiltinObj Ellipsis NotImplemented
|
||||
syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__
|
||||
|
||||
syn keyword pythonBuiltinFunc __import__ abs all any ascii
|
||||
syn keyword pythonBuiltinFunc bin bool bytearray bytes
|
||||
syn keyword pythonBuiltinFunc chr classmethod cmp compile complex
|
||||
syn keyword pythonBuiltinFunc delattr dict dir divmod enumerate eval
|
||||
syn keyword pythonBuiltinFunc exec filter float format frozenset getattr
|
||||
syn keyword pythonBuiltinFunc globals hasattr hash hex id
|
||||
syn keyword pythonBuiltinFunc input int isinstance
|
||||
syn keyword pythonBuiltinFunc issubclass iter len list locals map max
|
||||
syn keyword pythonBuiltinFunc memoryview min next object oct open ord
|
||||
syn keyword pythonBuiltinFunc pow print property range
|
||||
syn keyword pythonBuiltinFunc repr reversed round set setattr
|
||||
syn keyword pythonBuiltinFunc slice sorted staticmethod str sum super tuple
|
||||
syn keyword pythonBuiltinFunc type vars zip
|
||||
endif
|
||||
|
||||
if exists("python_highlight_exceptions") && python_highlight_exceptions != 0
|
||||
" Builtin exceptions and warnings
|
||||
syn keyword pythonExClass BaseException
|
||||
syn keyword pythonExClass Exception ArithmeticError
|
||||
syn keyword pythonExClass LookupError EnvironmentError
|
||||
|
||||
syn keyword pythonExClass AssertionError AttributeError BufferError EOFError
|
||||
syn keyword pythonExClass FloatingPointError GeneratorExit IOError
|
||||
syn keyword pythonExClass ImportError IndexError KeyError
|
||||
syn keyword pythonExClass KeyboardInterrupt MemoryError NameError
|
||||
syn keyword pythonExClass NotImplementedError OSError OverflowError
|
||||
syn keyword pythonExClass ReferenceError RuntimeError StopIteration
|
||||
syn keyword pythonExClass SyntaxError IndentationError TabError
|
||||
syn keyword pythonExClass SystemError SystemExit TypeError
|
||||
syn keyword pythonExClass UnboundLocalError UnicodeError
|
||||
syn keyword pythonExClass UnicodeEncodeError UnicodeDecodeError
|
||||
syn keyword pythonExClass UnicodeTranslateError ValueError VMSError
|
||||
syn keyword pythonExClass WindowsError ZeroDivisionError
|
||||
|
||||
syn keyword pythonExClass Warning UserWarning BytesWarning DeprecationWarning
|
||||
syn keyword pythonExClass PendingDepricationWarning SyntaxWarning
|
||||
syn keyword pythonExClass RuntimeWarning FutureWarning
|
||||
syn keyword pythonExClass ImportWarning UnicodeWarning
|
||||
endif
|
||||
|
||||
if exists("python_slow_sync") && python_slow_sync != 0
|
||||
syn sync minlines=2000
|
||||
else
|
||||
" This is fast but code inside triple quoted strings screws it up. It
|
||||
" is impossible to fix because the only way to know if you are inside a
|
||||
" triple quoted string is to start from the beginning of the file.
|
||||
syn sync match pythonSync grouphere NONE "):$"
|
||||
syn sync maxlines=200
|
||||
endif
|
||||
|
||||
if version >= 508 || !exists("did_python_syn_inits")
|
||||
if version <= 508
|
||||
let did_python_syn_inits = 1
|
||||
command -nargs=+ HiLink hi link <args>
|
||||
else
|
||||
command -nargs=+ HiLink hi def link <args>
|
||||
endif
|
||||
|
||||
HiLink pythonStatement Statement
|
||||
HiLink pythonImport Statement
|
||||
HiLink pythonFunction Function
|
||||
HiLink pythonConditional Conditional
|
||||
HiLink pythonRepeat Repeat
|
||||
HiLink pythonException Exception
|
||||
HiLink pythonOperator Operator
|
||||
|
||||
HiLink pythonDecorator Define
|
||||
|
||||
HiLink pythonComment Comment
|
||||
HiLink pythonCoding Special
|
||||
HiLink pythonRun Special
|
||||
HiLink pythonTodo Todo
|
||||
|
||||
HiLink pythonError Error
|
||||
HiLink pythonIndentError Error
|
||||
HiLink pythonSpaceError Error
|
||||
|
||||
HiLink pythonString String
|
||||
HiLink pythonRawString String
|
||||
HiLink pythonEscape Special
|
||||
HiLink pythonEscapeError Error
|
||||
|
||||
HiLink pythonBytes String
|
||||
HiLink pythonBytesContent String
|
||||
HiLink pythonBytesError Error
|
||||
HiLink pythonBytesEscape Special
|
||||
HiLink pythonBytesEscapeError Error
|
||||
|
||||
HiLink pythonStrFormatting Special
|
||||
HiLink pythonStrFormat Special
|
||||
HiLink pythonStrTemplate Special
|
||||
|
||||
HiLink pythonDocTest Special
|
||||
HiLink pythonDocTest2 Special
|
||||
|
||||
HiLink pythonNumber Number
|
||||
HiLink pythonHexNumber Number
|
||||
HiLink pythonOctNumber Number
|
||||
HiLink pythonBinNumber Number
|
||||
HiLink pythonFloat Float
|
||||
HiLink pythonNumberError Error
|
||||
HiLink pythonOctError Error
|
||||
HiLink pythonHexError Error
|
||||
HiLink pythonBinError Error
|
||||
|
||||
HiLink pythonBuiltinObj Structure
|
||||
HiLink pythonBuiltinFunc Function
|
||||
|
||||
HiLink pythonExClass Structure
|
||||
|
||||
delcommand HiLink
|
||||
endif
|
||||
|
||||
let b:current_syntax = "python"
|
||||
Reference in New Issue
Block a user