Sunday, August 20, 2023

SOLVED: Re: Vim error message when opening .ini file

OK!  This works! 
I've replaced the old dosini.vim file with yours posted above. 

Using this file now as my /usr/share/vim/vim90/syntax/dosini.vim file, I can open a .ini file WITHOUT getting any error messages.

Thank you, Christian!  

One question: should I be seeing some syntax coloring in a .ini file like the one I've opened in Vim?  Here is the file, which appears in "black & white": 

  1 127.0.0.53             localhost                                                                                                                 2 4.2.2.2                   b.resolvers.level3.net
  3 4.2.2.4                   d.resolvers.level3.net
  4 4.2.2.6                   f.resolvers.level3.net
  5 64.69.98.35           spr-resolv3-sun.onecommunications.net
  6 64.80.255.251       ··· no official Internet DNS name ···
  7 64.215.98.148       dns1.lon.gblx.net
  8 66.6.65.5               ··· no official Internet DNS name ···
  9 66.28.0.45             res1.dns.cogentco.com
 10 66.92.159.2          dns.wdc1.speakeasy.net
 11 66.109.229.4        dns3.dejazzd.com
 12 66.153.50.66        dns1-nyc.paetec.net
 13 68.237.161.12      nsnyny01.verizon.net
 14 74.82.42.42          ordns.he.net
 15 129.250.35.250    x.ns.gin.ntt.net
 16 129.250.35.251    y.ns.gin.ntt.net
 17 151.197.0.37        world4.bellatlantic.net
 18 151.198.0.38        nsnwrk.bellatlantic.net
 19 151.198.0.39        home5.bellatlantic.net
 20 151.201.0.38        nspitt.bellatlantic.net

On Sunday, August 20, 2023 at 12:31:25 PM UTC-4 Christian Brabandt wrote:

On So, 20 Aug 2023, Melvin Q. Watchpocket wrote:

> --> patch --dry-run -ruN NEW-dosini.vim < the-patch
> checking file NEW-dosini.vim
> patch: **** malformed patch at line 6: finish
>
> I'm likely not applying the patch correctly.  I've never applied a patch
> before.  What am I doing wrong?

You are likely running vim in compatible mode. Try the following syntax
file instead:

,----
| " Vim syntax file
| " Language: Configuration File (ini file) for MSDOS/MS Windows
| " Version: 2.3
| " Original Author: Sean M. McKee <mc...@misslink.net>
| " Previous Maintainer: Nima Talebi <ni...@it.net.au>
| " Current Maintainer: Hong Xu <ho...@topbug.net>
| " Homepage: http://www.vim.org/scripts/script.php?script_id=3747
| " Repository: https://github.com/xuhdev/syntax-dosini.vim
| " Last Change: 2023 Aug 20
|
|
| " quit when a syntax file was already loaded
| if exists("b:current_syntax")
| finish
| endif
|
| " using of line-continuation requires cpo&vim
| let s:cpo_save = &cpo
| set cpo&vim
|
| " shut case off
| syn case ignore
|
| syn match dosiniLabel "^.\{-}\ze\s*=" nextgroup=dosiniNumber,dosiniValue
| syn match dosiniValue "=\zs.*"
| syn match dosiniNumber "=\zs\s*\d\+\s*$"
| syn match dosiniNumber "=\zs\s*\d*\.\d\+\s*$"
| syn match dosiniNumber "=\zs\s*\d\+e[+-]\=\d\+\s*$"
| syn region dosiniHeader start="^\s*\[" end="\]"
| syn match dosiniComment "^[#;].*$"
| syn region dosiniSection start="\s*\[.*\]" end="\ze\s*\[.*\]" fold
| \ contains=dosiniLabel,dosiniValue,dosiniNumber,dosiniHeader,dosiniComment
|
| " Define the default highlighting.
| " Only when an item doesn't have highlighting yet
|
| hi def link dosiniNumber Number
| hi def link dosiniHeader Special
| hi def link dosiniComment Comment
| hi def link dosiniLabel Type
| hi def link dosiniValue String
|
|
| let b:current_syntax = "dosini"
|
| let &cpo = s:cpo_save
| unlet s:cpo_save
|
| " vim: sts=2 sw=2 et
`----

Filed at https://github.com/xuhdev/syntax-dosini.vim/pull/6

Once this is approved and you confirm it works, I guess we can
merge it into the runtime files.



Best,
Christian
--
Harris's Lament:
All the good ones are taken.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/62e1ee08-bdbf-4f4d-b9bf-a876905d4179n%40googlegroups.com.

No comments:

Post a Comment