summaryrefslogtreecommitdiff
path: root/rc/core/python.kak
diff options
context:
space:
mode:
authorFrank LENORMAND <lenormf@gmail.com>2016-03-14 18:29:11 +0200
committerFrank LENORMAND <lenormf@gmail.com>2016-03-14 18:29:11 +0200
commit3079d2a7e328309e3d2b298d573020c6bf5b0aca (patch)
tree84fcaedef1eae6e4e2faf95186015ecb3e5242ab /rc/core/python.kak
parent98594cf6df600eefe4fc5913685f6a43aeb76055 (diff)
Replace non-POSIX inline character replacement in shell scripts
Diffstat (limited to 'rc/core/python.kak')
-rw-r--r--rc/core/python.kak18
1 files changed, 9 insertions, 9 deletions
diff --git a/rc/core/python.kak b/rc/core/python.kak
index 8f482f4d..380c43c4 100644
--- a/rc/core/python.kak
+++ b/rc/core/python.kak
@@ -28,14 +28,14 @@ addhl -group /python/comment fill comment
%sh{
# Grammar
- values="True:False:None"
- meta="import:from"
+ values="True|False|None"
+ meta="import|from"
# Keyword list is collected using `keyword.kwlist` from `keyword`
- keywords="and:as:assert:break:class:continue:def:del:elif:else:except:exec:finally:for:global:if:in:is:lambda:not:or:pass:print:raise:return:try:while:with:yield"
- types="bool:buffer:bytearray:complex:dict:file:float:frozenset:int:list:long:memoryview:object:set:str:tuple:unicode:xrange"
+ keywords="and|as|assert|break|class|continue|def|del|elif|else|except|exec|finally|for|global|if|in|is|lambda|not|or|pass|print|raise|return|try|while|with|yield"
+ types="bool|buffer|bytearray|complex|dict|file|float|frozenset|int|list|long|memoryview|object|set|str|tuple|unicode|xrange"
# Add the language's grammar to the static completion list
- echo "hook global WinSetOption filetype=python %{
+ sed 's,|,:,g' <<< "hook global WinSetOption filetype=python %{
set window static_words '${values}'
set -add window static_words '${meta}'
set -add window static_words '${keywords}'
@@ -44,13 +44,13 @@ addhl -group /python/comment fill comment
# Highlight keywords
echo "
- addhl -group /python/code regex '\<(${values//:/|})\>' 0:value
- addhl -group /python/code regex '\<(${meta//:/|})\>' 0:meta
- addhl -group /python/code regex '\<(${keywords//:/|})\>' 0:keyword
+ addhl -group /python/code regex '\<(${values})\>' 0:value
+ addhl -group /python/code regex '\<(${meta})\>' 0:meta
+ addhl -group /python/code regex '\<(${keywords})\>' 0:keyword
"
# Highlight types, when they are not used as constructors
- echo "addhl -group /python/code regex '\<(${types//:/|})\>[^(]' 1:type"
+ echo "addhl -group /python/code regex '\<(${types})\>[^(]' 1:type"
}
# Commands