Bug 245760

Summary: editors/vim-tiny: Unable to turn off syntax highlighting
Product: Ports & Packages Reporter: bourne.identity <bourne.identity>
Component: Individual Port(s)Assignee: Adam Weinberger <adamw>
Status: Closed Not A Bug    
Severity: Affects Some People CC: adamw, fernape, obrien
Priority: --- Flags: koobs: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   

Description bourne.identity@hotmail.com 2020-04-20 09:12:04 UTC
Hi,

I do a lot of console work under vim, for which I prefer the package vim-tiny. The vim command packaged in vim-tiny runs into a nasty problem trying to disable syntax highlighting (with the vim command `:syn off`). vim reports that it was unable to find the file nosyntax.vim (under its data directory, probably under /usr/local/share).

Could the nosyntax.vim file be kindly inserted into the vim-tiny package so that the user can resort to distraction-free no-syntax environment when required ?

Thanks.
Manish Jain
Comment 1 Adam Weinberger freebsd_committer 2020-04-21 14:56:22 UTC
vim-tiny doesn't install any syntax highlighting files in the first place. In what context are you getting syntax highlighting that you want to disable? Can you show me how to reproduce the highlighting that you want to disable?
Comment 2 bourne.identity@hotmail.com 2020-04-21 16:37:31 UTC
I am not sure there is any pre-existing syntax highlighting with vim-tiny. The problem I run into is with vim-tiny parsing my .vimrc which has the following line as the last line :

:syn off

That line gets vim to throw the error that the file nosyntax.vim was not found. Since there is no pre-existing syntax highlighting with vim-tiny, it should be nice to pre-package nosyntax.vim into the vim-tiny package so that `:syn off` is interpreted normally, rather than yielding an unexpected error message.


Thanks.
Manish Jain
Comment 3 Adam Weinberger freebsd_committer 2020-04-21 16:54:24 UTC
The problem is that the same is true of indent configs. And macros, keymaps, spell files, colors, filetype plugins, compiler plugins, etc.

The alternative that I'd go with is try/catch. In fact, I use it extensively in my own vimrc for precisely the same reason you brought up here.

try
  syn off
catch
endtry
Comment 4 bourne.identity@hotmail.com 2020-04-21 22:56:53 UTC
Ah ! I was not aware of try/catch mechanism. That should solve my problem.

Perhaps you can close this bug.

And thanks a lot.
Manish Jain