From b8f89f17acf95deac06460ed4edb222a5a560e20 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Thu, 13 Aug 2020 22:14:25 +0200 Subject: [PATCH] Merge development --- .bash_aliases | 2 - .tmux.conf | 3 + .vimrc | 73 ++++++ initialize_script | 12 - kitty.conf | 12 + {vim => nvim}/colors/PaperColor.vim | 0 {vim => nvim}/colors/ayu.vim | 0 {vim => nvim}/colors/breezy.vim | 0 {vim => nvim}/colors/solarized8_low.vim | 0 {vim => nvim}/colors/space_vim_theme.vim | 0 {vim => nvim}/colors/vim-material.vim | 0 {vim => nvim}/doc/myhelp.txt | 0 {vim => nvim}/doc/tags | 0 vim/.vimrc => nvim/init.vim | 56 ++--- terminal-color | 1 - vim/.netrwhist~ | 9 - vim/.netrwhisz~ | 10 - vim/ftplugin/python.vim | 1 - vim/syntax/python.vim | 304 ----------------------- 19 files changed, 107 insertions(+), 376 deletions(-) delete mode 100644 .bash_aliases create mode 100644 .vimrc delete mode 100755 initialize_script create mode 100644 kitty.conf rename {vim => nvim}/colors/PaperColor.vim (100%) rename {vim => nvim}/colors/ayu.vim (100%) rename {vim => nvim}/colors/breezy.vim (100%) rename {vim => nvim}/colors/solarized8_low.vim (100%) rename {vim => nvim}/colors/space_vim_theme.vim (100%) rename {vim => nvim}/colors/vim-material.vim (100%) rename {vim => nvim}/doc/myhelp.txt (100%) rename {vim => nvim}/doc/tags (100%) rename vim/.vimrc => nvim/init.vim (71%) delete mode 100644 terminal-color delete mode 100644 vim/.netrwhist~ delete mode 100644 vim/.netrwhisz~ delete mode 100644 vim/ftplugin/python.vim delete mode 100644 vim/syntax/python.vim diff --git a/.bash_aliases b/.bash_aliases deleted file mode 100644 index 2d5959d..0000000 --- a/.bash_aliases +++ /dev/null @@ -1,2 +0,0 @@ -alias tmux='tmux -2' -alias search='grep -inr $1 $2' diff --git a/.tmux.conf b/.tmux.conf index 69c2f1d..a0cefcc 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -6,6 +6,9 @@ set -ga terminal-overrides ",tmux-256color:Tc" set -g default-shell /bin/bash +# see https://github.com/neovim/neovim/issues/2035 +set -sg escape-time 10 # in milliseconds + # split panes using | and - bind | split-window -h bind - split-window -v diff --git a/.vimrc b/.vimrc new file mode 100644 index 0000000..2876ecb --- /dev/null +++ b/.vimrc @@ -0,0 +1,73 @@ +" vim:set ts=2 sw=2 et: +" indent, load plugin and detect filetype depending on filetype +filetype indent plugin on +set autoindent + +" fix different locale settings when ssh'ing +set encoding=utf-8 + +" replace vertical split pipe character with space +set fillchars="vert:\ |,fold:\ " + +set splitright +set splitbelow + +" syntax on +syntax on + +" switch buffers without writing to file +set hidden + +" file specific formatting +autocmd Filetype python,bash,sh,java,php,json setlocal tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix +autocmd Filetype css,scss,html,htmldjango,javascript,yaml setlocal tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent + +" open folds by default +autocmd Syntax * normal zR + +" fold indents +set foldmethod=indent + +" search down into subfolders +" provides tab-completion for all file-related tasks +set path+=** + +" display all matching files when we tab complete +set wildmenu + +" use normal backspace behavior +set backspace=2 + +" Color trailing spaces with red color +highlight ExtraWhitespace ctermbg=green guibg=green +match ExtraWhitespace /\s\+$/ +autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ +autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@[38;2;%lu;%lu;%lum" - let &t_8b = "\[48;2;%lu;%lu;%lum" - set termguicolors +set termguicolors - set background=dark - colorscheme space_vim_theme -endif +" colorscheme +set background=dark +colorscheme space_vim_theme " syntax on syntax on @@ -77,10 +80,6 @@ set incsearch " line for linewrapping set colorcolumn=80 -" remove temporary swap file -set nobackup -set noswapfile - " wrap text instead of being on one line set lbr @@ -92,12 +91,6 @@ highlight CursorLine cterm=NONE set laststatus=2 set statusline=\ %F\ %m%r%w\ %=\ %{hostname()}\ \ \ %{strlen(&ft)?&ft:'none'}\ %{(&bomb?\",BOM\":\"\")}\ %{&ff}\ \ %l/%L\ \ %c\ %P -" netrw settings -let g:netrw_banner = 0 -let g:netrw_winsize = -30 -let g:netrw_browse_split = 4 -let g:netrw_liststyle = 3 - " tab autocompletion function! Tab_Or_Complete() if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w' @@ -107,22 +100,11 @@ function! Tab_Or_Complete() endif endfunction -" persistent undo history -if !isdirectory("/tmp/vim-undo") - call mkdir("/tmp/vim-undo", "", 0700) -endif -set undodir=/tmp/vim-undo -set undofile - -" ------------ Keybindings ---------------- -" paste mode toggle -set pastetoggle= - -" reload file -map :e - -" open netrw browser -map :Lexplore +" open nerdtree browser +map :NERDTreeToggle " tab for completion inoremap =Tab_Or_Complete() + +" set default coc environment path +let g:python3_host_prog = '~/.local/lib/coc/.venv/bin/python' diff --git a/terminal-color b/terminal-color deleted file mode 100644 index 2765ba1..0000000 --- a/terminal-color +++ /dev/null @@ -1 +0,0 @@ -#3b3b3b diff --git a/vim/.netrwhist~ b/vim/.netrwhist~ deleted file mode 100644 index 742015e..0000000 --- a/vim/.netrwhist~ +++ /dev/null @@ -1,9 +0,0 @@ -let g:netrw_dirhistmax =10 -let g:netrw_dirhist_cnt =7 -let g:netrw_dirhist_1='/home/platvoeten/dotfiles/vim/colors' -let g:netrw_dirhist_2='/home/platvoeten' -let g:netrw_dirhist_3='/home/platvoeten/OMX_GUI' -let g:netrw_dirhist_4='/home/platvoeten/dotfiles/vim/colors' -let g:netrw_dirhist_5='/home/platvoeten/OMX_GUI' -let g:netrw_dirhist_6='/home/platvoeten' -let g:netrw_dirhist_7='/home/platvoeten/.config/mpd' diff --git a/vim/.netrwhisz~ b/vim/.netrwhisz~ deleted file mode 100644 index f450cf6..0000000 --- a/vim/.netrwhisz~ +++ /dev/null @@ -1,10 +0,0 @@ -let g:netrw_dirhistmax =10 -let g:netrw_dirhist_cnt =8 -let g:netrw_dirhist_1='/home/platvoeten/dotfiles/vim/colors' -let g:netrw_dirhist_2='/home/platvoeten' -let g:netrw_dirhist_3='/home/platvoeten/OMX_GUI' -let g:netrw_dirhist_4='/home/platvoeten/dotfiles/vim/colors' -let g:netrw_dirhist_5='/home/platvoeten/OMX_GUI' -let g:netrw_dirhist_6='/home/platvoeten' -let g:netrw_dirhist_7='/home/platvoeten/.config/mpd' -let g:netrw_dirhist_8='/home/platvoeten' diff --git a/vim/ftplugin/python.vim b/vim/ftplugin/python.vim deleted file mode 100644 index 9ccf432..0000000 --- a/vim/ftplugin/python.vim +++ /dev/null @@ -1 +0,0 @@ -autocmd! Syntax :syn keyword Keyword self diff --git a/vim/syntax/python.vim b/vim/syntax/python.vim deleted file mode 100644 index 9d47734..0000000 --- a/vim/syntax/python.vim +++ /dev/null @@ -1,304 +0,0 @@ -if exists("b:current_syntax") - finish -endif - -" Keywords -" -syn keyword pythonStatement break continue del return pass yield global assert lambda with -syn keyword pythonStatement raise nextgroup=pythonExClass skipwhite -syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite -syn keyword pythonClassVar self cls -syn keyword pythonRepeat for while -syn keyword pythonConditional if elif else -syn keyword pythonException try except finally -" The standard pyrex.vim unconditionally removes the pythonInclude group, so -" we provide a dummy group here to avoid crashing pyrex.vim. -syn keyword pythonInclude import -syn keyword pythonImport import -syn match pythonRaiseFromStatement '\' -syn match pythonImport '^\s*\zsfrom\>' - - -syn keyword pythonStatement print -syn keyword pythonStatement exec -syn keyword pythonImport as -syn match pythonFunction '[a-zA-Z_][a-zA-Z0-9_]*' display contained -syn keyword pythonStatement as nonlocal -syn match pythonStatement '\v\.@' -syn match pythonFunction '\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*' display contained -syn match pythonStatement '\' nextgroup=pythonFunction skipwhite -syn match pythonStatement '\' -syn match pythonStatement '\' -syn cluster pythonExpression contains=pythonStatement,pythonRepeat,pythonConditional,pythonOperator,pythonNumber,pythonHexNumber,pythonOctNumber,pythonBinNumber,pythonFloat,pythonString,pythonBytes,pythonBoolean,pythonBuiltinObj,pythonBuiltinFunc - - -" -" Operators -" -syn keyword pythonOperator and in is not or -syn match pythonOperator '\V=\|-\|+\|*\|@\|/\|%\|&\||\|^\|~\|<\|>\|!=' -syn match pythonError '[$?]\|\([-+@%&|^~]\)\1\{1,}\|\([=*/<>]\)\2\{2,}\|\([+@/%&|^~<>]\)\3\@![-+*@/%&|^~<>]\|\*\*[*@/%&|^<>]\|=[*@/%&|^<>]\|-[+*@/%&|^~<]\|[]\+=\{2,}\|!\{2,}=\+' display - -" -" Decorators (new in Python 2.4) -" - -syn match pythonDecorator '^\s*\zs@' display nextgroup=pythonDottedName skipwhite -syn match pythonDottedName '[a-zA-Z_][a-zA-Z0-9_]*\%(\.[a-zA-Z_][a-zA-Z0-9_]*\)*' display contained -syn match pythonDottedName '\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\%(\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\)*' display contained -syn match pythonDot '\.' display containedin=pythonDottedName - -" -" 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\+[^0-9[:space:]]\+\>' display - -" Mixing spaces and tabs also may be used for pretty formatting multiline -" statements -syn match pythonIndentError '^\s*\%( \t\|\t \)\s*\S'me=e-1 display - -" Trailing space errors -syn match pythonSpaceError '\s\+$' display - -" -" Strings -" - -" Python 2 strings -syn region pythonString start=+[bB]\='+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell -syn region pythonString start=+[bB]\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell -syn region pythonString start=+[bB]\="""+ skip=+\\"+ end=+"""+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell -syn region pythonString start=+[bB]\='''+ skip=+\\'+ end=+'''+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell -" Python 3 byte strings -syn region pythonBytes start=+[bB]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonBytesError,pythonBytesContent,@Spell -syn region pythonBytes start=+[bB]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonBytesError,pythonBytesContent,@Spell -syn region pythonBytes start=+[bB]'''+ skip=+\\'+ end=+'''+ keepend contains=pythonBytesError,pythonBytesContent,pythonDocTest,pythonSpaceError,@Spell -syn region pythonBytes start=+[bB]"""+ skip=+\\"+ end=+"""+ keepend contains=pythonBytesError,pythonBytesContent,pythonDocTest2,pythonSpaceError,@Spell - -syn match pythonBytesError '.\+' display contained -syn match pythonBytesContent '[\u0000-\u00ff]\+' display contained contains=pythonBytesEscape,pythonBytesEscapeError - -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 '\\$' - -syn match pythonUniEscape '\\u\x\{4}' display contained -syn match pythonUniEscapeError '\\u\x\{,3}\X' display contained -syn match pythonUniEscape '\\U\x\{8}' display contained -syn match pythonUniEscapeError '\\U\x\{,7}\X' display contained -syn match pythonUniEscape '\\N{[A-Z ]\+}' display contained -syn match pythonUniEscapeError '\\N{[^A-Z ]\+}' display contained - -" Python 2 Unicode strings -syn region pythonUniString start=+[uU]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell -syn region pythonUniString start=+[uU]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell -syn region pythonUniString start=+[uU]'''+ skip=+\\'+ end=+'''+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell -syn region pythonUniString start=+[uU]"""+ skip=+\\"+ end=+"""+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell -" Python 3 strings -syn region pythonString start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell -syn region pythonString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell -syn region pythonString start=+'''+ skip=+\\'+ end=+'''+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell -syn region pythonString start=+"""+ skip=+\\"+ end=+"""+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell - -syn region pythonFString start=+[fF]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell -syn region pythonFString start=+[fF]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,@Spell -syn region pythonFString start=+[fF]'''+ skip=+\\'+ end=+'''+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest,pythonSpaceError,@Spell -syn region pythonFString start=+[fF]"""+ skip=+\\"+ end=+"""+ keepend contains=pythonBytesEscape,pythonBytesEscapeError,pythonUniEscape,pythonUniEscapeError,pythonDocTest2,pythonSpaceError,@Spell - -" Python 2 Unicode raw strings -syn region pythonUniRawString start=+[uU][rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell -syn region pythonUniRawString start=+[uU][rR]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonRawEscape,pythonUniRawEscape,pythonUniRawEscapeError,@Spell -syn region pythonUniRawString start=+[uU][rR]'''+ skip=+\\'+ end=+'''+ keepend contains=pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest,pythonSpaceError,@Spell -syn region pythonUniRawString start=+[uU][rR]"""+ skip=+\\"+ end=+"""+ keepend contains=pythonUniRawEscape,pythonUniRawEscapeError,pythonDocTest2,pythonSpaceError,@Spell - -syn match pythonUniRawEscape '\%([^\\]\%(\\\\\)*\)\@<=\\u\x\{4}' display contained -syn match pythonUniRawEscapeError '\%([^\\]\%(\\\\\)*\)\@<=\\u\x\{,3}\X' display contained - -" Python 2/3 raw strings -syn region pythonRawString start=+[bB]\=[rR]'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonRawEscape,@Spell -syn region pythonRawString start=+[bB]\=[rR]"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonRawEscape,@Spell -syn region pythonRawString start=+[bB]\=[rR]'''+ skip=+\\'+ end=+'''+ keepend contains=pythonDocTest,pythonSpaceError,@Spell -syn region pythonRawString start=+[bB]\=[rR]"""+ skip=+\\"+ end=+"""+ keepend contains=pythonDocTest2,pythonSpaceError,@Spell -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]'''+ skip=+\\'+ end=+'''+ keepend contains=pythonDocTest,pythonSpaceError,@Spell -syn region pythonRawString start=+[rR]"""+ skip=+\\"+ end=+"""+ keepend contains=pythonDocTest2,pythonSpaceError,@Spell - -syn region pythonRawFString start=+\%([fF][rR]\|[rR][fF]\)'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonRawEscape,@Spell -syn region pythonRawFString start=+\%([fF][rR]\|[rR][fF]\)"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonRawEscape,@Spell -syn region pythonRawFString start=+\%([fF][rR]\|[rR][fF]\)'''+ skip=+\\'+ end=+'''+ keepend contains=pythonDocTest,pythonSpaceError,@Spell -syn region pythonRawFString start=+\%([fF][rR]\|[rR][fF]\)"""+ skip=+\\"+ end=+"""+ keepend contains=pythonDocTest,pythonSpaceError,@Spell - -syn region pythonRawBytes start=+\%([bB][rR]\|[rR][bB]\)'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end=+$+ keepend contains=pythonRawEscape,@Spell -syn region pythonRawBytes start=+\%([bB][rR]\|[rR][bB]\)"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end=+$+ keepend contains=pythonRawEscape,@Spell -syn region pythonRawBytes start=+\%([bB][rR]\|[rR][bB]\)'''+ skip=+\\'+ end=+'''+ keepend contains=pythonDocTest,pythonSpaceError,@Spell -syn region pythonRawBytes start=+\%([bB][rR]\|[rR][bB]\)"""+ skip=+\\"+ end=+"""+ keepend contains=pythonDocTest2,pythonSpaceError,@Spell - -syn match pythonRawEscape +\\['"]+ display contained - -" % operator string formatting -syn match pythonStrFormatting '%\%(([^)]\+)\)\=[-#0 +]*\d*\%(\.\d\+\)\=[hlL]\=[diouxXeEfFgGcrs%]' contained containedin=pythonString,pythonUniString,pythonUniRawString,pythonRawString,pythonBytesContent -syn match pythonStrFormatting '%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)\=[hlL]\=[diouxXeEfFgGcrs%]' contained containedin=pythonString,pythonUniString,pythonUniRawString,pythonRawString,pythonBytesContent -syn match pythonStrFormatting '%\%(([^)]\+)\)\=[-#0 +]*\d*\%(\.\d\+\)\=[hlL]\=[diouxXeEfFgGcrs%]' contained containedin=pythonString,pythonRawString,pythonBytesContent -syn match pythonStrFormatting '%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)\=[hlL]\=[diouxXeEfFgGcrs%]' contained containedin=pythonString,pythonRawString,pythonBytesContent - -" str.format syntax -syn match pythonStrFormat '{{\|}}' contained containedin=pythonString,pythonUniString,pythonUniRawString,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\+\)\=[bcdeEfFgGnosxX%]\=\)\=\)\=}' contained containedin=pythonString,pythonUniString,pythonUniRawString,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\+\)\=[bcdeEfFgGnosxX%]\=\)\=\)\=}" contained containedin=pythonString,pythonRawString -syn region pythonStrInterpRegion start="{"he=e+1,rs=e+1 end="\%(![rsa]\)\=\%(:\%({\%(\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*\|\d\+\)}\|\%([^}]\=[<>=^]\)\=[ +-]\=#\=0\=\d*,\=\%(\.\d\+\)\=[bcdeEfFgGnosxX%]\=\)\=\)\=}"hs=s-1,re=s-1 extend contained containedin=pythonFString,pythonRawFString contains=pythonStrInterpRegion,@pythonExpression -syn match pythonStrFormat "{{\|}}" contained containedin=pythonString,pythonRawString,pythonFString,pythonRawFString - -" string.Template format -syn match pythonStrTemplate '\$\$' contained containedin=pythonString,pythonUniString,pythonUniRawString,pythonRawString -syn match pythonStrTemplate '\${[a-zA-Z_][a-zA-Z0-9_]*}' contained containedin=pythonString,pythonUniString,pythonUniRawString,pythonRawString -syn match pythonStrTemplate '\$[a-zA-Z_][a-zA-Z0-9_]*' contained containedin=pythonString,pythonUniString,pythonUniRawString,pythonRawString -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 - -" DocTests -syn region pythonDocTest start='^\s*>>>' skip=+\\'+ end=+'''+he=s-1 end='^\s*$' contained -syn region pythonDocTest2 start='^\s*>>>' skip=+\\"+ end=+"""+he=s-1 end='^\s*$' contained - -" -" Numbers (ints, longs, floats, complex) -" - -syn match pythonHexError '\<0[xX]\x*[g-zG-Z]\+\x*[lL]\=\>' display -syn match pythonOctError '\<0[oO]\=\o*\D\+\d*[lL]\=\>' display -syn match pythonBinError '\<0[bB][01]*\D\+\d*[lL]\=\>' display - -syn match pythonHexNumber '\<0[xX]\x\+[lL]\=\>' display -syn match pythonOctNumber '\<0[oO]\o\+[lL]\=\>' display -syn match pythonBinNumber '\<0[bB][01]\+[lL]\=\>' display - -syn match pythonNumberError '\<\d\+\D[lL]\=\>' display -syn match pythonNumber '\<\d[lL]\=\>' display -syn match pythonNumber '\<[0-9]\d\+[lL]\=\>' display -syn match pythonNumber '\<\d\+[lLjJ]\>' display - -syn match pythonOctError '\<0[oO]\=\o*[8-9]\d*[lL]\=\>' display -syn match pythonBinError '\<0[bB][01]*[2-9]\d*[lL]\=\>' 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*\D\+\d*\>' display -" pythonHexError comes after pythonOctError so that 0xffffl is pythonHexError -syn match pythonHexError '\<0[xX]\x*[g-zG-Z]\x*\>' display -syn match pythonBinError '\<0[bB][01]*\D\+\d*\>' display - -syn match pythonHexNumber '\<0[xX][_0-9a-fA-F]*\x\>' display -syn match pythonOctNumber '\<0[oO][_0-7]*\o\>' display -syn match pythonBinNumber '\<0[bB][_01]*[01]\>' display - -syn match pythonNumberError '\<\d[_0-9]*\D\>' display -syn match pythonNumberError '\<0[_0-9]\+\>' display -syn match pythonNumberError '\<0_x\S*\>' display -syn match pythonNumberError '\<0[bBxXoO][_0-9a-fA-F]*_\>' display -syn match pythonNumberError '\<\d[_0-9]*_\>' display -syn match pythonNumber '\<\d\>' display -syn match pythonNumber '\<[1-9][_0-9]*\d\>' display -syn match pythonNumber '\<\d[jJ]\>' display -syn match pythonNumber '\<[1-9][_0-9]*\d[jJ]\>' display - -syn match pythonOctError '\<0[oO]\=\o*[8-9]\d*\>' display -syn match pythonBinError '\<0[bB][01]*[2-9]\d*\>' display - -syn match pythonFloat '\.\d\%([_0-9]*\d\)\=\%([eE][+-]\=\d\%([_0-9]*\d\)\=\)\=[jJ]\=\>' display -syn match pythonFloat '\<\d\%([_0-9]*\d\)\=[eE][+-]\=\d\%([_0-9]*\d\)\=[jJ]\=\>' display -syn match pythonFloat '\<\d\%([_0-9]*\d\)\=\.\d\%([_0-9]*\d\)\=\%([eE][+-]\=\d\%([_0-9]*\d\)\=\)\=[jJ]\=' display - -" -" Builtin objects and types -" - -syn keyword pythonNone None -syn keyword pythonBoolean True False -syn keyword pythonBuiltinObj Ellipsis NotImplemented -syn match pythonBuiltinObj '\v\.@' -syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__ -syn keyword pythonBuiltinObj __loader__ __spec__ __path__ __cached__ - -" -" Builtin functions -" -syn sync minlines=2000 -" 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 - -hi link pythonStatement Statement -hi link pythonRaiseFromStatement Statement -hi link pythonImport Include -hi link pythonFunction Special -hi link pythonConditional Conditional -hi link pythonRepeat Repeat -hi link pythonException Exception -hi link pythonOperator Operator -hi link pythonDecorator Define -hi link pythonDottedName Function -hi link pythonDot Normal -hi link pythonComment Comment -hi link pythonCoding Special -hi link pythonRun Special -hi link pythonTodo Todo -hi link pythonError Error -hi link pythonIndentError Error -hi link pythonSpaceError Error -hi link pythonString String -hi link pythonRawString String -hi link pythonRawEscape Special -hi link pythonUniEscape Special -hi link pythonUniEscapeError Error -hi link pythonUniString String -hi link pythonUniRawString String -hi link pythonUniRawEscape Special -hi link pythonUniRawEscapeError Error -hi link pythonBytes String -hi link pythonRawBytes String -hi link pythonBytesContent String -hi link pythonBytesError Error -hi link pythonBytesEscape Special -hi link pythonBytesEscapeError Error -hi link pythonFString String -hi link pythonRawFString String -hi link pythonStrInterpRegion Special -hi link pythonStrFormatting Special -hi link pythonStrFormat Special -hi link pythonStrTemplate Special -hi link pythonDocTest Special -hi link pythonDocTest2 Special -hi link pythonNumber Number -hi link pythonHexNumber Number -hi link pythonOctNumber Number -hi link pythonBinNumber Number -hi link pythonFloat Float -hi link pythonNumberError Error -hi link pythonOctError Error -hi link pythonHexError Error -hi link pythonBinError Error -hi link pythonBoolean Boolean -hi link pythonNone Constant -hi link pythonBuiltinObj Structure -hi link pythonBuiltinFunc Function -hi link pythonExClass Structure -hi link pythonClassVar Identifier - -let b:current_syntax = 'python'