Merge development
This commit is contained in:
parent
b8ed14cf46
commit
b8f89f17ac
19 changed files with 107 additions and 376 deletions
|
|
@ -1,2 +0,0 @@
|
||||||
alias tmux='tmux -2'
|
|
||||||
alias search='grep -inr $1 $2'
|
|
||||||
|
|
@ -6,6 +6,9 @@ set -ga terminal-overrides ",tmux-256color:Tc"
|
||||||
|
|
||||||
set -g default-shell /bin/bash
|
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 -
|
# split panes using | and -
|
||||||
bind | split-window -h
|
bind | split-window -h
|
||||||
bind - split-window -v
|
bind - split-window -v
|
||||||
|
|
|
||||||
73
.vimrc
Normal file
73
.vimrc
Normal file
|
|
@ -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\+\%#\@<!$/
|
||||||
|
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
|
||||||
|
autocmd BufWinLeave * call clearmatches()
|
||||||
|
|
||||||
|
" line numbers
|
||||||
|
set number
|
||||||
|
|
||||||
|
" changes to current directory when creating new files
|
||||||
|
set autochdir
|
||||||
|
|
||||||
|
" higlhight search
|
||||||
|
set hls
|
||||||
|
|
||||||
|
" search as characters are entered
|
||||||
|
set incsearch
|
||||||
|
|
||||||
|
" line for linewrapping
|
||||||
|
set colorcolumn=80
|
||||||
|
|
||||||
|
" wrap text instead of being on one line
|
||||||
|
set lbr
|
||||||
|
|
||||||
|
" default Colors for CursorLine
|
||||||
|
set cursorline
|
||||||
|
highlight CursorLine cterm=NONE
|
||||||
|
|
||||||
|
" activate statusbar
|
||||||
|
set laststatus=2
|
||||||
|
set statusline=\ %F\ %m%r%w\ %=\ %{hostname()}\ \ \ %{strlen(&ft)?&ft:'none'}\ %{(&bomb?\",BOM\":\"\")}\ %{&ff}\ \ %l/%L\ \ %c\ %P
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
# Setup script for vim & tmux
|
|
||||||
|
|
||||||
# Get the full path of the script
|
|
||||||
SCRIPT_PATH=`realpath $0`
|
|
||||||
|
|
||||||
# Remove the filename
|
|
||||||
DOTFILES=`dirname $SCRIPT_PATH`
|
|
||||||
|
|
||||||
mkdir $HOME/.vim
|
|
||||||
ln -sf $DOTFILES/{.bashrc,vim/.vimrc,.tmux.conf,.profile} $HOME/
|
|
||||||
ln -sf $DOTFILES/vim/colors $HOME/.vim/
|
|
||||||
12
kitty.conf
Normal file
12
kitty.conf
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
# vim:set ts=2 sw=2 et:
|
||||||
|
#
|
||||||
|
term tmux-256color
|
||||||
|
|
||||||
|
# colors
|
||||||
|
background #232627
|
||||||
|
|
||||||
|
# fonts
|
||||||
|
font_family Source Code Pro Medium
|
||||||
|
font_size 13.0
|
||||||
|
|
||||||
|
enable_audio_bell no
|
||||||
|
|
@ -1,4 +1,10 @@
|
||||||
" vim:set ts=2 sw=2 et:
|
" vim:set ts=2 sw=2 et:
|
||||||
|
"
|
||||||
|
" This configuration depends on the following plugins:
|
||||||
|
" nerdtree: https://github.com/scrooloose/nerdtree
|
||||||
|
" vim-polygot: https://github.com/sheerun/vim-polyglot
|
||||||
|
" coc: https://github.com/neoclide/coc.nvim
|
||||||
|
|
||||||
" indent, load plugin and detect filetype depending on filetype
|
" indent, load plugin and detect filetype depending on filetype
|
||||||
filetype indent plugin on
|
filetype indent plugin on
|
||||||
set autoindent
|
set autoindent
|
||||||
|
|
@ -9,21 +15,18 @@ set encoding=utf-8
|
||||||
" replace vertical split pipe character with space
|
" replace vertical split pipe character with space
|
||||||
set fillchars="vert:\ |,fold:\ "
|
set fillchars="vert:\ |,fold:\ "
|
||||||
|
|
||||||
|
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
|
||||||
|
" delays and poor user experience.
|
||||||
|
set updatetime=300
|
||||||
|
|
||||||
set splitright
|
set splitright
|
||||||
set splitbelow
|
set splitbelow
|
||||||
|
|
||||||
" colorscheme
|
|
||||||
if exists('+termguicolors')
|
|
||||||
" enable termguicolors correctly for terminals other than
|
|
||||||
" xterm-256color see https://github.com/vim/vim/issues/993
|
|
||||||
" also see :h xterm-true-color
|
|
||||||
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
|
|
||||||
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
|
|
||||||
set termguicolors
|
set termguicolors
|
||||||
|
|
||||||
|
" colorscheme
|
||||||
set background=dark
|
set background=dark
|
||||||
colorscheme space_vim_theme
|
colorscheme space_vim_theme
|
||||||
endif
|
|
||||||
|
|
||||||
" syntax on
|
" syntax on
|
||||||
syntax on
|
syntax on
|
||||||
|
|
@ -77,10 +80,6 @@ set incsearch
|
||||||
" line for linewrapping
|
" line for linewrapping
|
||||||
set colorcolumn=80
|
set colorcolumn=80
|
||||||
|
|
||||||
" remove temporary swap file
|
|
||||||
set nobackup
|
|
||||||
set noswapfile
|
|
||||||
|
|
||||||
" wrap text instead of being on one line
|
" wrap text instead of being on one line
|
||||||
set lbr
|
set lbr
|
||||||
|
|
||||||
|
|
@ -92,12 +91,6 @@ highlight CursorLine cterm=NONE
|
||||||
set laststatus=2
|
set laststatus=2
|
||||||
set statusline=\ %F\ %m%r%w\ %=\ %{hostname()}\ \ \ %{strlen(&ft)?&ft:'none'}\ %{(&bomb?\",BOM\":\"\")}\ %{&ff}\ \ %l/%L\ \ %c\ %P
|
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
|
" tab autocompletion
|
||||||
function! Tab_Or_Complete()
|
function! Tab_Or_Complete()
|
||||||
if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w'
|
if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w'
|
||||||
|
|
@ -107,22 +100,11 @@ function! Tab_Or_Complete()
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" persistent undo history
|
" open nerdtree browser
|
||||||
if !isdirectory("/tmp/vim-undo")
|
map <silent> <C-E> :NERDTreeToggle <CR>
|
||||||
call mkdir("/tmp/vim-undo", "", 0700)
|
|
||||||
endif
|
|
||||||
set undodir=/tmp/vim-undo
|
|
||||||
set undofile
|
|
||||||
|
|
||||||
" ------------ Keybindings ----------------
|
|
||||||
" paste mode toggle
|
|
||||||
set pastetoggle=<F4>
|
|
||||||
|
|
||||||
" reload file
|
|
||||||
map <F5> :e <CR>
|
|
||||||
|
|
||||||
" open netrw browser
|
|
||||||
map <silent> <C-E> :Lexplore <CR>
|
|
||||||
|
|
||||||
" tab for completion
|
" tab for completion
|
||||||
inoremap <Tab> <C-R>=Tab_Or_Complete()<CR>
|
inoremap <Tab> <C-R>=Tab_Or_Complete()<CR>
|
||||||
|
|
||||||
|
" set default coc environment path
|
||||||
|
let g:python3_host_prog = '~/.local/lib/coc/.venv/bin/python'
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
#3b3b3b
|
|
||||||
|
|
@ -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'
|
|
||||||
|
|
@ -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'
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
autocmd! Syntax <buffer> :syn keyword Keyword self
|
|
||||||
|
|
@ -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 '\<from\>'
|
|
||||||
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\.@<!<await>'
|
|
||||||
syn match pythonFunction '\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*' display contained
|
|
||||||
syn match pythonStatement '\<async\s\+def\>' nextgroup=pythonFunction skipwhite
|
|
||||||
syn match pythonStatement '\<async\s\+with\>'
|
|
||||||
syn match pythonStatement '\<async\s\+for\>'
|
|
||||||
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\.@<!<%(object|bool|int|float|tuple|str|list|dict|set|frozenset|bytearray|bytes)>'
|
|
||||||
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'
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue