mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-25 21:16:38 +03:00
rc conf: treat ini files as conf if they contain a #-comment
*.ini files traditionally use ; but for example the "foot" terminal's foot.ini uses #. Add a hack to treat ini files as "conf" filetype if they contain a #-comment (very slim chance of false positives). This requires to explicitly set comment_line to the default #, because we set the "ini" filetype earlier.
This commit is contained in:
parent
cc6fe5ae61
commit
3a856ef57b
@ -2,6 +2,13 @@ hook global BufCreate .+\.(repo|cfg|properties|desktop) %{
|
|||||||
set-option buffer filetype conf
|
set-option buffer filetype conf
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hook global WinCreate .+\.ini %{
|
||||||
|
try %{
|
||||||
|
execute-keys /^\h*#<ret>
|
||||||
|
set-option buffer filetype conf
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
hook global WinSetOption filetype=conf %{
|
hook global WinSetOption filetype=conf %{
|
||||||
require-module conf
|
require-module conf
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,10 @@ hook global BufSetOption filetype=coffee %{
|
|||||||
set-option buffer comment_block_end '###'
|
set-option buffer comment_block_end '###'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hook global BufSetOption filetype=conf %{
|
||||||
|
set-option buffer comment_line '#'
|
||||||
|
}
|
||||||
|
|
||||||
hook global BufSetOption filetype=css %{
|
hook global BufSetOption filetype=css %{
|
||||||
set-option buffer comment_line ''
|
set-option buffer comment_line ''
|
||||||
set-option buffer comment_block_begin '/*'
|
set-option buffer comment_block_begin '/*'
|
||||||
|
Loading…
Reference in New Issue
Block a user