Friday, November 30, 2018

How to auto delete removed file's undo/backup ?

Hello all,

I have setting in my .vimrc to put all the undo/backup in a specific folder. And now it has taken up too much space(around a hundred megabytes, say). Many files are no longer needed because the original file has been removed. I'm not good at scripting and all I come up with is to parse the filename and test its existence. So I'm wondering if there're easy ways to clean them up. any suggestion is welcome

Best Regards,
Linus Boyle

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Typing Persian (Farsi) in Vim

Hello,

Sorry for late reply and also taking your time on this,

Tony:
I added the configuration as you mentioned. After that when I typed Persian everything got typed as question marks and still as before every character I typed resulted in more than one character. So I still prefer to have the feature 'arabic' and 'persian' off. Sorry but thanks!

Bram:
Maybe I didn't understand you question correctly? I cloned the vim from GitHub and without any changes to the source if I build it using the 'huge' feature, it includes +arabic and +farsi. Even if I use homebrew to install it I get those features. According to this vim includes 'farsi' and 'arabic' in the 'huge' features. I don't explicitly add 'arabic' nor 'farsi' since I don't know how it's done without changing the feature and config file in the src. I hope this answered the question.

Here is the output from my vim —version installed using Homebrew without any options, just by using 'brew install vim':

VIM - Vi IMproved 8.1 (2018 May 18, compiled Nov 24 2018 19:13:03)
macOS version
Included patches: 1-500
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               +extra_search      +mouse_netterm     +tag_old_static
+arabic            +farsi             +mouse_sgr         -tag_any_white
+autocmd           +file_in_path      -mouse_sysmouse    -tcl
+autochdir         +find_in_path      +mouse_urxvt       +termguicolors
-autoservername    +float             +mouse_xterm       +terminal
-balloon_eval      +folding           +multi_byte        +terminfo
+balloon_eval_term -footer            +multi_lang        +termresponse
-browse            +fork()            -mzscheme          +textobjects
++builtin_terms    +gettext           +netbeans_intg     +timers
+byte_offset       -hangul_input      +num64             +title
+channel           +iconv             +packages          -toolbar
+cindent           +insert_expand     +path_extra        +user_commands
-clientserver      +job               +perl              +vartabs
+clipboard         +jumplist          +persistent_undo   +vertsplit
+cmdline_compl     +keymap            +postscript        +virtualedit
+cmdline_hist      +lambda            +printer           +visual
+cmdline_info      +langmap           +profile           +visualextra
+comments          +libcall           -python            +viminfo
+conceal           +linebreak         +python3           +vreplace
+cryptv            +lispindent        +quickfix          +wildignore
+cscope            +listcmds          +reltime           +wildmenu
+cursorbind        +localmap          +rightleft         +windows
+cursorshape       +lua               +ruby              +writebackup
+dialog_con        +menu              +scrollbind        -X11
+diff              +mksession         +signs             -xfontset
+digraphs          +modify_fname      +smartindent       -xim
-dnd               +mouse             +startuptime       -xpm
-ebcdic            -mouseshape        +statusline        -xsmp
+emacs_tags        +mouse_dec         -sun_workshop      -xterm_clipboard
+eval              -mouse_gpm         +syntax            -xterm_save
+ex_extra          -mouse_jsbterm     +tag_binary        
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       
Linking: clang   -L. -fstack-protector -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -lintl -framework AppKit  -L/usr/local/opt/lua/lib -llua5.3 -mmacosx-version-min=10.13 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.28.0/lib/perl5/5.28.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m -framework CoreFoundation  -lruby.2.5.3 -lobjc    


I have to say the reason I chose vim is its performance and extensibility plus ability to type RTL without hassle which is extremely rare. So I was very excited to see that RTL works in the OSX terminal out of the box.

Best,
Bahman
On 30 Nov 2018, at 01:00, Tony Mechelynck <antoine.mechelynck@gmail.com> wrote:

On Thu, Nov 29, 2018 at 11:31 PM Bram Moolenaar <Bram@moolenaar.net> wrote:
You are missing something.  You can build Vim with the Arabic and/or
Farsi feature, but so long as you don't set the 'arabic' or 'fkmap'
options then nothing should be different.  You haven't answered the
question why anything changes without setting those options.  I always
build with huge features and don't get any Arabic stuff because it's not
enabled by the option.

IIUC, the OP's problem is that mixed RTL and LTR text is not displayed
in full-bidi in Vim (which is a known limitation, but he regards it as
a major bug) but that the Mac native terminal, which calls itself
xterm-256color and not mlterm, displays full-bidi even in Vim, with
correct shaping of Arabic letters, provided that Vim is compiled with
-arabic. (I don't know how it does that, but I'm not on a Mac myself.)
"set termbidi" (which requires +arabic) apparently corrupts the
display, as shown in one of his posts earlier in this thread.

Best regards,
Tony.

Re: VIM & Eclipse

On Sunday, November 25, 2018 at 7:52:53 AM UTC-6, Andrew Long wrote:
> > On 24 Nov 2018, at 14:35, Ben Fritz <fritzophrenic@gmail.com> wrote:
> >
> > Why does Windows factor into your decision? Eclim works in Windows. The "install" just copies files into your vimfiles and eclipse plugin directories, so you may not need any help there.
> >
>
> According to the 'eclim' web site, they've withdrawn support of it on Windows; only supported on Linux & OSX.

Oh wow, ok. For about 11 months now, even. I guess I haven't checked on eclim in a while. It *was* working for me in Windows, back when it was supported. But I haven't tried updating in a long time. :-)

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: How to set noexpandtab for a specific file

On Saturday, November 24, 2018 at 3:20:32 PM UTC-6, Bradley Bell wrote:
> I have the following two lines in my .vimrc:
> :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab
> set modeline
>
> On the first line of a file called automake.am, I have
> # vim: set noexpandtab:
>
> When I open automake.am and enter a tab I spaces instead of tabs.
>
> How do I set noexpandtab for automake.am automatically, so I do
> not forget to enter it every time I edit that file ?

Is your 'modeline' option set? Some Linux distros disable modelines in a system vimrc, for security reasons. If 'modeline' is not turned on, then your method will not work.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

mappings when in vim from terminal not the same

Hi,

Perhaps a bit circular, but I live in vim terminal a lot and when I start vim to edit a file from a terminal shell some of my mappings do not work as they do when starting vim outside of terminal (as from a standard zsh).

For example I have this:
nnoremap <silent> <C-LeftMouse> <LeftMouse>viW

When in vim from terminal this does not work.
Anyone have an idea ?
Could some tmaps cause conflicts ??
Note this mapping does work ok if in normal mode from terminal.
It just does not work inside vim when its started from terminal.

thx always for the wonderful vim universe,
-m

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Thursday, November 29, 2018

Re: Typing Persian (Farsi) in Vim

On Thu, Nov 29, 2018 at 11:31 PM Bram Moolenaar <Bram@moolenaar.net> wrote:
> You are missing something. You can build Vim with the Arabic and/or
> Farsi feature, but so long as you don't set the 'arabic' or 'fkmap'
> options then nothing should be different. You haven't answered the
> question why anything changes without setting those options. I always
> build with huge features and don't get any Arabic stuff because it's not
> enabled by the option.

IIUC, the OP's problem is that mixed RTL and LTR text is not displayed
in full-bidi in Vim (which is a known limitation, but he regards it as
a major bug) but that the Mac native terminal, which calls itself
xterm-256color and not mlterm, displays full-bidi even in Vim, with
correct shaping of Arabic letters, provided that Vim is compiled with
-arabic. (I don't know how it does that, but I'm not on a Mac myself.)
"set termbidi" (which requires +arabic) apparently corrupts the
display, as shown in one of his posts earlier in this thread.

Best regards,
Tony.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Typing Persian (Farsi) in Vim

Bahman Eslami wrote:

> On Wednesday, November 28, 2018 at 8:39:04 PM UTC+1, Bram Moolenaar wrote:
> > Bahman Eslami wrote:
> >
> > > > On 27 Nov 2018, at 23:17, Bram Moolenaar <Bram@moolenaar.net> wrote:
> > > >
> > > >>
> > > >> On Monday, April 30, 2018 at 9:58:54 AM UTC+2, Bram Moolenaar wrote:
> > > >>> Felipe Vieira wrote:
> > > >>>
> > > >>>> I have tried the above solution and the following:
> > > >>>>
> > > >>>> http://vim.1045645.n5.nabble.com/arabic-font-td1161759.html
> > > >>>>
> > > >>>> Still can't get Farsi to work. I get those "<200d>" characters.
> > > >>>>
> > > >>>> I have tried gvim with
> > > >>>>
> > > >>>> :set guifont=Courier\ New\ 10
> > > >>>>
> > > >>>> For instance.
> > > >>>>
> > > >>>> Website for example:
> > > >>>>
> > > >>>> http://www.unics.uni-hannover.de/nhtcapri/persian-alphabet.html
> > > >>>>
> > > >>>> It displays nicely on my firefox.
> > > >>>
> > > >>> The Farsi support in Vim is outdated. It doesn't work with Unicode.
> > > >>> We are waiting for someone to re-implement it, or merge it with the
> > > >>> Arabic support.
> > > >>
> > > >> I also wonder why there is no option to disable farsi or arabic on vim
> > > >> compile. The terminal I use supports bidi text, so in order to build
> > > >> the vim correctly for my terminal, I have to change config and
> > > >> features file in the source to disable farsi and arabic, which is
> > > >> inconvenient if I want to keep updating the vim.
> > > >
> > > > What do you mean? There are both options and features to enable/disable
> > > > Arabic and Farsi. E.g. there is FEAT_ARABIC and the 'arabic' option.
> > > >
> > >
> > > I mean while compiling there is no flag for disabling 'farsi' or 'arabic'. I know I can change the source code for FEAT_ARABIC (which is how I do it now) but that's not the way to go for long run in a case vim gets updated. The reason I want to disable them using flags is because I use the 'huge' flag for building the vim from the source. Actually someone suggested this flag a year ago using a patch but it didn't went through:
> > >
> > > https://github.com/vim/vim/pull/1867 <https://github.com/vim/vim/pull/1867>
> >
> > That patch has slipped down in the todo list, I'll move it up a bit.
> >
> > > I think adding the disable flag for these features would be helpful
> > > since many text engines do the bidi rendering nowadays and enabling
> > > these features is just useless and for my case destructive.
> >
> > I don't see how disabling the feature at build time is required. If you
> > don't set 'arabic' then that is the same, right? If not, please explain
> > what goes wrong with just building with FEAT_ARABIC.
>
> Hey Bram,
>
> In a case a user doesn't want to have arabic nor faris in the vim, they
> can build the vim with the 'normal' feature flag but they would miss
> other features like langmap, but if they want to build it with langmap
> feature, they need the 'huge' feature flag which also includes the
> arabic. There is also no flag to disable nor enable arabic while
> building the vim. So the only way to disable them is to change the
> source which is how I do it.

You are missing something. You can build Vim with the Arabic and/or
Farsi feature, but so long as you don't set the 'arabic' or 'fkmap'
options then nothing should be different. You haven't answered the
question why anything changes without setting those options. I always
build with huge features and don't get any Arabic stuff because it's not
enabled by the option.


--
"I know that there are people who don't love their fellow man,
and I hate those people!" - Tom Lehrer

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: vim should reset indent size settings when changing file types

On Thu, Nov 29, 2018 at 11:14 AM David Demelier <markand@malikania.fr> wrote:
>
> Hello,
>
> I'm not sure if there is way to fix that, but I actually would like to
> use tabs of size 8 for every file except html.
>
> So basically I create a ~/.vim/ftplugin.html file with:
>
> set ts=4
> set sts=4
> set sw=4
> set noet
>
> Then, runnin `vim foo.html` will set ts, sts and sw correctly. But then,
> if I open a new file different from html directly from vim, it keeps
> those settings.
>
> Example:
>
> vim foo.html
> :e CMakeLists.txt <- ts, sts and sw is still 4
>
> However, starting vim directly to edit a CMake file will use the
> defaults a size of 8.
>
> This means that I should create a ftplugin file for *every* kind of
> filetype or to quit vim and re-open.
>
> Correct me if I'm wrong but I think all settings that came from a
> ~/.vim/ftplugin should be removed once you switch filetype. Or perhaps I
> miss an option that already does this?
>
> What are you recommendations?
>
> Regards
>
> --
> David

This question is covered by the online help.

See :help undo_ftplugin

Best regards,
Tony.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: vim should reset indent size settings when changing file types

Le 29/11/2018 à 11:37, Erik Christiansen a écrit :
>> Then, runnin `vim foo.html` will set ts, sts and sw correctly. But then, if
>> I open a new file different from html directly from vim, it keeps those
>> settings.
>
> If you use setlocal instead of set, that should do it.

Oh, that was so easy. I wonder how can I miss that.

Thanks!

--
David

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: vim should reset indent size settings when changing file types

On 29.11.18 11:14, David Demelier wrote:
> I'm not sure if there is way to fix that, but I actually would like to use
> tabs of size 8 for every file except html.
>
> So basically I create a ~/.vim/ftplugin.html file with:
>
> set ts=4
> set sts=4
> set sw=4
> set noet
>
> Then, runnin `vim foo.html` will set ts, sts and sw correctly. But then, if
> I open a new file different from html directly from vim, it keeps those
> settings.

If you use setlocal instead of set, that should do it.

Erik

--
--
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.
For more options, visit https://groups.google.com/d/optout.

vim should reset indent size settings when changing file types

Hello,

I'm not sure if there is way to fix that, but I actually would like to
use tabs of size 8 for every file except html.

So basically I create a ~/.vim/ftplugin.html file with:

set ts=4
set sts=4
set sw=4
set noet

Then, runnin `vim foo.html` will set ts, sts and sw correctly. But then,
if I open a new file different from html directly from vim, it keeps
those settings.

Example:

vim foo.html
:e CMakeLists.txt <- ts, sts and sw is still 4

However, starting vim directly to edit a CMake file will use the
defaults a size of 8.

This means that I should create a ftplugin file for *every* kind of
filetype or to quit vim and re-open.

Correct me if I'm wrong but I think all settings that came from a
~/.vim/ftplugin should be removed once you switch filetype. Or perhaps I
miss an option that already does this?

What are you recommendations?

Regards

--
David

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Wednesday, November 28, 2018

Re: Typing Persian (Farsi) in Vim

On Wed, Nov 28, 2018 at 11:19 PM Bahman Eslami <eslami.bahman@gmail.com> wrote:
>
> On Wednesday, November 28, 2018 at 11:04:29 PM UTC+1, Tony Mechelynck wrote:
> > On Wed, Nov 28, 2018 at 10:23 PM Bahman Eslami <eslami.bahman@gmail.com> wrote:
> > > In a case a user doesn't want to have arabic nor faris in the vim, they can build the vim with the 'normal' feature flag but they would miss other features like langmap, but if they want to build it with langmap feature, they need the 'huge' feature flag which also includes the arabic. There is also no flag to disable nor enable arabic while building the vim. So the only way to disable them is to change the source which is how I do it. Now I give you an example what goes wrong with the arabic enabled.
> >
> > > I use the native terminal app in OSX which supports bidi text perfectly even when it comes to selecting text.
> >
> > What is the $TERM setting when you run Console Vim (not gvim) in that
> > terminal? Depending on its value, there are variant ways to tell Vim
> > that the terminal has full-bidi capabilities:
> >
> > * Possibility 1: $TERM is 'mlterm'
> > o Do nothing. Vim knows that mlterm is a full-bidi terminal.
> > * Possibility 2: $TERM is another unambiguously recognisable name,
> > let's say (for the sake of argument) 'system-bidi'.
> > o Add near the top of yout vimrc the following snippet:
> > if &term == 'system-bidi' && has('arabic')
> > set termbidi
> > endif
> > * Possibility 3: $TERM is not unambiguously recognizable, let's say it
> > is 'xterm' which too many fake-xterm terminals use nowadays:
> > o Start Vim (when running in that terminal) as:
> > vim --cmd 'silent! set termbidi'
> > If your shell supports aliases, you can define the following
> > alias (as I would do it for bash, which is an alias-supporting shell)
> > alias vim='/usr/local/bin/vim --cmd "silent! set termbidi"'
> > Replace /usr/local/bin/vim by the path to your Vim executable
> > if it is something else, of course.
>
> Tony,
>
> Thanks for the explanation. When I echo the $TERM in vim I get: xterm-256color. So I used your solution to add 'set termbidi' with the vim build that includes the arabic feature but I still get incorrect Arabic shaping. I also get very abnormal behavior. If I type the following text or even paste it:
>
> نوتشن فارسی
>
> I get the following result in vim, which even in length does not match the input:
>
> ?~F?~Hشت?~F ?~Aارس?~L
>
> I guess it didn't do much for my case.
>
> Thanks,
> Bahman

Weird. My guess is that there is an encoding misunderstanding, but I
could be wrong about that. AFAIK, the +arabic feature works best when
Vim uses UTF-8 'encoding'. Try adding the following (with the
comments, meant to help you understand it even later on) near the top
of your vimrc:

if has('multi_byte')
if &enc !~? '^u'
if &tenc == ""
let &tenc = &enc
endif
set enc=utf-8
endif
scriptencoding utf-8 " see note 1
" set fencs=ucs-bom,utf-8,default,latin1 " see note 2
setg fenc=utf-8
" setg bomb " see note 3
endif
" Notes:
" 1. :scriptencoding utf-8 means that this vimrc is encoded in UTF-8.
" Anything in ASCII is expressed byte-by-byte identically in
" UTF-8 anyway. The difference is only felt when using
" characters not present in Latin1 or characters whose Latin1
" representation is > 0x7F.
" 2. 'fileencodings' (plural) defines the heuristic used when opening
" an existing file. The value (commented-out) here is Vim's
" Unicode default. Other values can be used depending on
" the language(s) used most on this installation. The actual
" value used should start with "ucs-bom,utf-8" in that order,
" and the last comma-separated field (and _only_ the last one)
" should be an 8-bit charset, which will be used as fallback if
" everything else fails.
" 3. :setg bomb sets the default 'bomb' setting to TRUE when
" creating a new Unicode file. It has its pluses and minuses.
" If the other settings above work the way they should,
" we can try uncommenting that line to see if we prefer
" running Vim with or without it.


Best regards,
Tony.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Typing Persian (Farsi) in Vim

On 2018-11-28, Bahman Eslami wrote:

> In a case a user doesn't want to have arabic nor faris in the vim,
> they can build the vim with the 'normal' feature flag but they
> would miss other features like langmap, but if they want to build
> it with langmap feature, they need the 'huge' feature flag which
> also includes the arabic. There is also no flag to disable nor
> enable arabic while building the vim. So the only way to disable
> them is to change the source which is how I do it.

Not true. You can use the environment variable CFLAGS to enable
features for which there is not a configure option. For example,
I don't need all the features in the huge build, but I do want
+conceal and +mouse_sgr, so I execute these before configuring:

$ export CONF_OPT_FEAT='--with-features=normal'
$ export CFLAGS='-DFEAT_CONCEAL -DFEAT_MOUSE_SGR'

You might be able to use -U to disable a feature, but I don't know
how the configure and make commands prioritize conflicting settings
and I haven't tried that.

Regards,
Gary

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Typing Persian (Farsi) in Vim

On Wednesday, November 28, 2018 at 11:04:29 PM UTC+1, Tony Mechelynck wrote:
> On Wed, Nov 28, 2018 at 10:23 PM Bahman Eslami <eslami.bahman@gmail.com> wrote:
> > In a case a user doesn't want to have arabic nor faris in the vim, they can build the vim with the 'normal' feature flag but they would miss other features like langmap, but if they want to build it with langmap feature, they need the 'huge' feature flag which also includes the arabic. There is also no flag to disable nor enable arabic while building the vim. So the only way to disable them is to change the source which is how I do it. Now I give you an example what goes wrong with the arabic enabled.
>
> > I use the native terminal app in OSX which supports bidi text perfectly even when it comes to selecting text.
>
> What is the $TERM setting when you run Console Vim (not gvim) in that
> terminal? Depending on its value, there are variant ways to tell Vim
> that the terminal has full-bidi capabilities:
>
> * Possibility 1: $TERM is 'mlterm'
> o Do nothing. Vim knows that mlterm is a full-bidi terminal.
> * Possibility 2: $TERM is another unambiguously recognisable name,
> let's say (for the sake of argument) 'system-bidi'.
> o Add near the top of yout vimrc the following snippet:
> if &term == 'system-bidi' && has('arabic')
> set termbidi
> endif
> * Possibility 3: $TERM is not unambiguously recognizable, let's say it
> is 'xterm' which too many fake-xterm terminals use nowadays:
> o Start Vim (when running in that terminal) as:
> vim --cmd 'silent! set termbidi'
> If your shell supports aliases, you can define the following
> alias (as I would do it for bash, which is an alias-supporting shell)
> alias vim='/usr/local/bin/vim --cmd "silent! set termbidi"'
> Replace /usr/local/bin/vim by the path to your Vim executable
> if it is something else, of course.

Tony,

Thanks for the explanation. When I echo the $TERM in vim I get: xterm-256color. So I used your solution to add 'set termbidi' with the vim build that includes the arabic feature but I still get incorrect Arabic shaping. I also get very abnormal behavior. If I type the following text or even paste it:

نوتشن فارسی

I get the following result in vim, which even in length does not match the input:

?~F?~Hشت?~F ?~Aارس?~L

I guess it didn't do much for my case.

Thanks,
Bahman

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Typing Persian (Farsi) in Vim

On Wed, Nov 28, 2018 at 10:23 PM Bahman Eslami <eslami.bahman@gmail.com> wrote:
> In a case a user doesn't want to have arabic nor faris in the vim, they can build the vim with the 'normal' feature flag but they would miss other features like langmap, but if they want to build it with langmap feature, they need the 'huge' feature flag which also includes the arabic. There is also no flag to disable nor enable arabic while building the vim. So the only way to disable them is to change the source which is how I do it. Now I give you an example what goes wrong with the arabic enabled.

> I use the native terminal app in OSX which supports bidi text perfectly even when it comes to selecting text.

What is the $TERM setting when you run Console Vim (not gvim) in that
terminal? Depending on its value, there are variant ways to tell Vim
that the terminal has full-bidi capabilities:

* Possibility 1: $TERM is 'mlterm'
o Do nothing. Vim knows that mlterm is a full-bidi terminal.
* Possibility 2: $TERM is another unambiguously recognisable name,
let's say (for the sake of argument) 'system-bidi'.
o Add near the top of yout vimrc the following snippet:
if &term == 'system-bidi' && has('arabic')
set termbidi
endif
* Possibility 3: $TERM is not unambiguously recognizable, let's say it
is 'xterm' which too many fake-xterm terminals use nowadays:
o Start Vim (when running in that terminal) as:
vim --cmd 'silent! set termbidi'
If your shell supports aliases, you can define the following
alias (as I would do it for bash, which is an alias-supporting shell)
alias vim='/usr/local/bin/vim --cmd "silent! set termbidi"'
Replace /usr/local/bin/vim by the path to your Vim executable
if it is something else, of course.

> So if you take the below text sampe which contains bidi text and put it in the vim you can see that the result is correct only when the arabic is disabled. I can't say for other terminals or environments if it works correctly but any user can compare the rendering from their web browser which supports bidi text as you can see in the following line:
>
> English text متن فارسی another text
>
> So if the vim rendering of the top text example matches the rendering of your browser, then it's correct. I've also attached two sample images which one uses the vim with arabic enabled and one with arabic disabled and you can see the incorrect rendering of text using the arabic enabled. Even selecting the text is wrong with arabic enabled. I can also confirm that macvim also shows incorrect result with arabic enabled even though it's using a gui font.
>
> Best,
> Bahman

Best regards,
Tony.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Typing Persian (Farsi) in Vim

I also have to add iTerm in OSX doesn't support bidi text (see this), so bidi text in vim, with or without 'arabic' or 'farsi' feature will be rendered incorrectly. I suppose this goes for other environments where the bidi text is not supported. But of course I can't confirm it since I don't use Windows or Linux.

Best,
Bahman

On 28 Nov 2018, at 22:23, Bahman Eslami <eslami.bahman@gmail.com> wrote:

On Wednesday, November 28, 2018 at 8:39:04 PM UTC+1, Bram Moolenaar wrote:
Bahman Eslami wrote:

On 27 Nov 2018, at 23:17, Bram Moolenaar <Bram@moolenaar.net> wrote:


On Monday, April 30, 2018 at 9:58:54 AM UTC+2, Bram Moolenaar wrote:
Felipe Vieira wrote:

I have tried the above solution and the following:

http://vim.1045645.n5.nabble.com/arabic-font-td1161759.html

Still can't get Farsi to work. I get those "<200d>" characters.

I have tried gvim with

  :set guifont=Courier\ New\ 10

For instance.

Website for example:

http://www.unics.uni-hannover.de/nhtcapri/persian-alphabet.html

It displays nicely on my firefox.

The Farsi support in Vim is outdated.  It doesn't work with Unicode.
We are waiting for someone to re-implement it, or merge it with the
Arabic support.

I also wonder why there is no option to disable farsi or arabic on vim
compile. The terminal I use supports bidi text, so in order to build
the vim correctly for my terminal, I have to change config and
features file in the source to disable farsi and arabic, which is
inconvenient if I want to keep updating the vim.

What do you mean?  There are both options and features to enable/disable
Arabic and Farsi.  E.g. there is FEAT_ARABIC and the 'arabic' option.


I mean while compiling there is no flag for disabling 'farsi' or 'arabic'. I know I can change the source code for FEAT_ARABIC (which is how I do it now) but that's not the way to go for long run in a case vim gets updated. The reason I want to disable them using flags is because I use the 'huge' flag for building the vim from the source. Actually someone suggested this flag a year ago using a patch but it didn't went through:

https://github.com/vim/vim/pull/1867 <https://github.com/vim/vim/pull/1867>

That patch has slipped down in the todo list, I'll move it up a bit.

I think adding the disable flag for these features would be helpful
since many text engines do the bidi rendering nowadays and enabling
these features is just useless and for my case destructive.

I don't see how disabling the feature at build time is required.  If you
don't set 'arabic' then that is the same, right?  If not, please explain
what goes wrong with just building with FEAT_ARABIC.

Hey Bram,

In a case a user doesn't want to have arabic nor faris in the vim, they can build the vim with the 'normal' feature flag but they would miss other features like langmap, but if they want to build it with langmap feature, they need the 'huge' feature flag which also includes the arabic. There is also no flag to disable nor enable arabic while building the vim. So the only way to disable them is to change the source which is how I do it. Now I give you an example what goes wrong with the arabic enabled. I use the native terminal app in OSX which supports bidi text perfectly even when it comes to selecting text. So if you take the below text sampe which contains bidi text and put it in the vim you can see that the result is correct only when the arabic is disabled. I can't say for other terminals or environments if it works correctly but any user can compare the rendering from their web browser which supports bidi text as you can see in the following line:

English text متن فارسی another text

So if the vim rendering of the top text example matches the rendering of your browser, then it's correct. I've also attached two sample images which one uses the vim with arabic enabled and one with arabic disabled and you can see the incorrect rendering of text using the arabic enabled. Even selecting the text is wrong with arabic enabled. I can also confirm that macvim also shows incorrect result with arabic enabled even though it's using a gui font.

Best,
Bahman

-- 
-- 
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.
For more options, visit https://groups.google.com/d/optout.
<vim-without-arabic-in-osx-terminal.png><vim-with-arabic-in-osx-terminal.png>

Re: Typing Persian (Farsi) in Vim

On Wednesday, November 28, 2018 at 8:39:04 PM UTC+1, Bram Moolenaar wrote:
> Bahman Eslami wrote:
>
> > > On 27 Nov 2018, at 23:17, Bram Moolenaar <Bram@moolenaar.net> wrote:
> > >
> > >>
> > >> On Monday, April 30, 2018 at 9:58:54 AM UTC+2, Bram Moolenaar wrote:
> > >>> Felipe Vieira wrote:
> > >>>
> > >>>> I have tried the above solution and the following:
> > >>>>
> > >>>> http://vim.1045645.n5.nabble.com/arabic-font-td1161759.html
> > >>>>
> > >>>> Still can't get Farsi to work. I get those "<200d>" characters.
> > >>>>
> > >>>> I have tried gvim with
> > >>>>
> > >>>> :set guifont=Courier\ New\ 10
> > >>>>
> > >>>> For instance.
> > >>>>
> > >>>> Website for example:
> > >>>>
> > >>>> http://www.unics.uni-hannover.de/nhtcapri/persian-alphabet.html
> > >>>>
> > >>>> It displays nicely on my firefox.
> > >>>
> > >>> The Farsi support in Vim is outdated. It doesn't work with Unicode.
> > >>> We are waiting for someone to re-implement it, or merge it with the
> > >>> Arabic support.
> > >>
> > >> I also wonder why there is no option to disable farsi or arabic on vim
> > >> compile. The terminal I use supports bidi text, so in order to build
> > >> the vim correctly for my terminal, I have to change config and
> > >> features file in the source to disable farsi and arabic, which is
> > >> inconvenient if I want to keep updating the vim.
> > >
> > > What do you mean? There are both options and features to enable/disable
> > > Arabic and Farsi. E.g. there is FEAT_ARABIC and the 'arabic' option.
> > >
> >
> > I mean while compiling there is no flag for disabling 'farsi' or 'arabic'. I know I can change the source code for FEAT_ARABIC (which is how I do it now) but that's not the way to go for long run in a case vim gets updated. The reason I want to disable them using flags is because I use the 'huge' flag for building the vim from the source. Actually someone suggested this flag a year ago using a patch but it didn't went through:
> >
> > https://github.com/vim/vim/pull/1867 <https://github.com/vim/vim/pull/1867>
>
> That patch has slipped down in the todo list, I'll move it up a bit.
>
> > I think adding the disable flag for these features would be helpful
> > since many text engines do the bidi rendering nowadays and enabling
> > these features is just useless and for my case destructive.
>
> I don't see how disabling the feature at build time is required. If you
> don't set 'arabic' then that is the same, right? If not, please explain
> what goes wrong with just building with FEAT_ARABIC.

Hey Bram,

In a case a user doesn't want to have arabic nor faris in the vim, they can build the vim with the 'normal' feature flag but they would miss other features like langmap, but if they want to build it with langmap feature, they need the 'huge' feature flag which also includes the arabic. There is also no flag to disable nor enable arabic while building the vim. So the only way to disable them is to change the source which is how I do it. Now I give you an example what goes wrong with the arabic enabled. I use the native terminal app in OSX which supports bidi text perfectly even when it comes to selecting text. So if you take the below text sampe which contains bidi text and put it in the vim you can see that the result is correct only when the arabic is disabled. I can't say for other terminals or environments if it works correctly but any user can compare the rendering from their web browser which supports bidi text as you can see in the following line:

English text متن فارسی another text

So if the vim rendering of the top text example matches the rendering of your browser, then it's correct. I've also attached two sample images which one uses the vim with arabic enabled and one with arabic disabled and you can see the incorrect rendering of text using the arabic enabled. Even selecting the text is wrong with arabic enabled. I can also confirm that macvim also shows incorrect result with arabic enabled even though it's using a gui font.

Best,
Bahman

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Typing Persian (Farsi) in Vim

Bahman Eslami wrote:

> > On 27 Nov 2018, at 23:17, Bram Moolenaar <Bram@moolenaar.net> wrote:
> >
> >>
> >> On Monday, April 30, 2018 at 9:58:54 AM UTC+2, Bram Moolenaar wrote:
> >>> Felipe Vieira wrote:
> >>>
> >>>> I have tried the above solution and the following:
> >>>>
> >>>> http://vim.1045645.n5.nabble.com/arabic-font-td1161759.html
> >>>>
> >>>> Still can't get Farsi to work. I get those "<200d>" characters.
> >>>>
> >>>> I have tried gvim with
> >>>>
> >>>> :set guifont=Courier\ New\ 10
> >>>>
> >>>> For instance.
> >>>>
> >>>> Website for example:
> >>>>
> >>>> http://www.unics.uni-hannover.de/nhtcapri/persian-alphabet.html
> >>>>
> >>>> It displays nicely on my firefox.
> >>>
> >>> The Farsi support in Vim is outdated. It doesn't work with Unicode.
> >>> We are waiting for someone to re-implement it, or merge it with the
> >>> Arabic support.
> >>
> >> I also wonder why there is no option to disable farsi or arabic on vim
> >> compile. The terminal I use supports bidi text, so in order to build
> >> the vim correctly for my terminal, I have to change config and
> >> features file in the source to disable farsi and arabic, which is
> >> inconvenient if I want to keep updating the vim.
> >
> > What do you mean? There are both options and features to enable/disable
> > Arabic and Farsi. E.g. there is FEAT_ARABIC and the 'arabic' option.
> >
>
> I mean while compiling there is no flag for disabling 'farsi' or 'arabic'. I know I can change the source code for FEAT_ARABIC (which is how I do it now) but that's not the way to go for long run in a case vim gets updated. The reason I want to disable them using flags is because I use the 'huge' flag for building the vim from the source. Actually someone suggested this flag a year ago using a patch but it didn't went through:
>
> https://github.com/vim/vim/pull/1867 <https://github.com/vim/vim/pull/1867>

That patch has slipped down in the todo list, I'll move it up a bit.

> I think adding the disable flag for these features would be helpful
> since many text engines do the bidi rendering nowadays and enabling
> these features is just useless and for my case destructive.

I don't see how disabling the feature at build time is required. If you
don't set 'arabic' then that is the same, right? If not, please explain
what goes wrong with just building with FEAT_ARABIC.

--
There are only two hard things in programming: Cache invalidation,
naming things and off-by-one errors.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Tuesday, November 27, 2018

Re: Typing Persian (Farsi) in Vim



On 27 Nov 2018, at 23:17, Bram Moolenaar <Bram@moolenaar.net> wrote:


On Monday, April 30, 2018 at 9:58:54 AM UTC+2, Bram Moolenaar wrote:
Felipe Vieira wrote:

I have tried the above solution and the following:

http://vim.1045645.n5.nabble.com/arabic-font-td1161759.html

Still can't get Farsi to work. I get those "<200d>" characters.

I have tried gvim with

   :set guifont=Courier\ New\ 10

For instance.

Website for example:

http://www.unics.uni-hannover.de/nhtcapri/persian-alphabet.html

It displays nicely on my firefox.

The Farsi support in Vim is outdated.  It doesn't work with Unicode.
We are waiting for someone to re-implement it, or merge it with the
Arabic support.

I also wonder why there is no option to disable farsi or arabic on vim
compile. The terminal I use supports bidi text, so in order to build
the vim correctly for my terminal, I have to change config and
features file in the source to disable farsi and arabic, which is
inconvenient if I want to keep updating the vim.

What do you mean?  There are both options and features to enable/disable
Arabic and Farsi.  E.g. there is FEAT_ARABIC and the 'arabic' option.


I mean while compiling there is no flag for disabling 'farsi' or 'arabic'. I know I can change the source code for FEAT_ARABIC (which is how I do it now) but that's not the way to go for long run in a case vim gets updated. The reason I want to disable them using flags is because I use the 'huge' flag for building the vim from the source. Actually someone suggested this flag a year ago using a patch but it didn't went through:


I think adding the disable flag for these features would be helpful since many text engines do the bidi rendering nowadays and enabling these features is just useless and for my case destructive.

Bahman


Re: Typing Persian (Farsi) in Vim

> On Monday, April 30, 2018 at 9:58:54 AM UTC+2, Bram Moolenaar wrote:
> > Felipe Vieira wrote:
> >
> > > I have tried the above solution and the following:
> > >
> > > http://vim.1045645.n5.nabble.com/arabic-font-td1161759.html
> > >
> > > Still can't get Farsi to work. I get those "<200d>" characters.
> > >
> > > I have tried gvim with
> > >
> > > :set guifont=Courier\ New\ 10
> > >
> > > For instance.
> > >
> > > Website for example:
> > >
> > > http://www.unics.uni-hannover.de/nhtcapri/persian-alphabet.html
> > >
> > > It displays nicely on my firefox.
> >
> > The Farsi support in Vim is outdated. It doesn't work with Unicode.
> > We are waiting for someone to re-implement it, or merge it with the
> > Arabic support.
>
> I also wonder why there is no option to disable farsi or arabic on vim
> compile. The terminal I use supports bidi text, so in order to build
> the vim correctly for my terminal, I have to change config and
> features file in the source to disable farsi and arabic, which is
> inconvenient if I want to keep updating the vim.

What do you mean? There are both options and features to enable/disable
Arabic and Farsi. E.g. there is FEAT_ARABIC and the 'arabic' option.

--
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Typing Persian (Farsi) in Vim

On Di, 27 Nov 2018, Bahman Eslami wrote:

>
> I also wonder why there is no option to disable farsi or arabic on vim
> compile. The terminal I use supports bidi text, so in order to build
> the vim correctly for my terminal, I have to change config and
> features file in the source to disable farsi and arabic, which is
> inconvenient if I want to keep updating the vim.

If you can create a patch that makes this feature configurable via a
configure switch, I am pretty sure this would be appreciated.

Best,
Christian
--
Ich sei, gewährt mir die Bitte, in eurem Bunde der Dritte.
-- Friedrich Johann Christoph Schiller (Die Bürgschaft)

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Re: Typing Persian (Farsi) in Vim

On Monday, April 30, 2018 at 9:58:54 AM UTC+2, Bram Moolenaar wrote:
> Felipe Vieira wrote:
>
> > I have tried the above solution and the following:
> >
> > http://vim.1045645.n5.nabble.com/arabic-font-td1161759.html
> >
> > Still can't get Farsi to work. I get those "<200d>" characters.
> >
> > I have tried gvim with
> >
> > :set guifont=Courier\ New\ 10
> >
> > For instance.
> >
> > Website for example:
> >
> > http://www.unics.uni-hannover.de/nhtcapri/persian-alphabet.html
> >
> > It displays nicely on my firefox.
>
> The Farsi support in Vim is outdated. It doesn't work with Unicode.
> We are waiting for someone to re-implement it, or merge it with the
> Arabic support.
>
> --
> Eight Megabytes And Continually Swapping.
>
> /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
> /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
> \\\ an exciting new programming language -- http://www.Zimbu.org ///
> \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

I also wonder why there is no option to disable farsi or arabic on vim compile. The terminal I use supports bidi text, so in order to build the vim correctly for my terminal, I have to change config and features file in the source to disable farsi and arabic, which is inconvenient if I want to keep updating the vim.

Thanks,
Bahman

--
--
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.
For more options, visit https://groups.google.com/d/optout.

Monday, November 26, 2018

Re: errors when setting filetype in modeline

On Tue, Nov 27, 2018 at 1:00 AM <pseyfert.mathphys@gmail.com> wrote:
>
> Hi,
>
> I get errors from vim in files that set the filetype through modeline.
[...]
> prompt> vim --version
> VIM - Vi IMproved 8.1 (2018 May 18, compiled Nov 22 2018 19:40:14)
> Included patches: 1-542

This problem is supposed to have been fixed at patchlevel 8.1.0544.
Please compile a newer Vim, or if you can't, wait until someone does
it for you.

Best regards,
Tony.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

errors when setting filetype in modeline

Hi,

I get errors from vim in files that set the filetype through modeline.

Reproducer: A single file with only one line
```
# vim:ft=perl
```

upon opening vim, these error messages get printed:
```
"/tmp/test" 1L, 14C
Error detected while processing /usr/share/vim/vim81/ftplugin/perl.vim:
line 18:
E523: Not allowed here: keywordprg=perldoc\ -f
line 50:
E12: Command not allowed from exrc/vimrc in current dir or tag search
Error detected while processing function <SNR>13_LoadFTPlugin:
line 17:
E170: Missing :endfor
```

When manipulating the line, such that it is not a valid modeline, I see that filetype gets set to conf by:
```
filetype=conf
Last set from /usr/share/vim/vim81/filetype.vim line 2134
```

I see this behaviour in the vim from arch linux without `.vimrc` file or `.vim` directory.

```
prompt> vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Nov 22 2018 19:40:14)
Included patches: 1-542
Compiled by Arch Linux
Huge version without GUI. Features included (+) or not (-):
+acl +extra_search +mouse_netterm +tag_old_static
+arabic +farsi +mouse_sgr -tag_any_white
+autocmd +file_in_path -mouse_sysmouse +tcl/dyn
+autochdir +find_in_path +mouse_urxvt +termguicolors
-autoservername +float +mouse_xterm +terminal
-balloon_eval +folding +multi_byte +terminfo
+balloon_eval_term -footer +multi_lang +termresponse
-browse +fork() -mzscheme +textobjects
++builtin_terms +gettext +netbeans_intg +timers
+byte_offset -hangul_input +num64 +title
+channel +iconv +packages -toolbar
+cindent +insert_expand +path_extra +user_commands
-clientserver +job +perl/dyn +vartabs
-clipboard +jumplist +persistent_undo +vertsplit
+cmdline_compl +keymap +postscript +virtualedit
+cmdline_hist +lambda +printer +visual
+cmdline_info +langmap +profile +visualextra
+comments +libcall +python/dyn +viminfo
+conceal +linebreak +python3/dyn +vreplace
+cryptv +lispindent +quickfix +wildignore
+cscope +listcmds +reltime +wildmenu
+cursorbind +localmap +rightleft +windows
+cursorshape +lua/dyn +ruby/dyn +writebackup
+dialog_con +menu +scrollbind -X11
+diff +mksession +signs -xfontset
+digraphs +modify_fname +smartindent -xim
-dnd +mouse +startuptime -xpm
-ebcdic -mouseshape +statusline -xsmp
+emacs_tags +mouse_dec -sun_workshop -xterm_clipboard
+eval +mouse_gpm +syntax -xterm_save
+ex_extra -mouse_jsbterm +tag_binary
system vimrc file: "/etc/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.28/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -L/usr/local/lib -Wl,--as-needed -o vim -lm -ltinfo -lelf -lnsl -lacl -lattr -lgpm -ldl -Wl,-E -Wl,-rpath,/usr/lib/perl5/5.28/core_perl/CORE -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -fstack-protector-strong -L/usr/local/lib -L/usr/lib/perl5/5.28/core_perl/CORE -lperl -lpthread -ldl -lm -lcrypt -lutil -lc -L/usr/lib -ltclstub8.6 -ldl -lz -lpthread -lm
```

A friend could reproduce the errors on Arch.

I do *not* see the bahaviour on debian testing (vim 8.1, patches 1-320)

So this looks like a bug in vim / the runtime files to me though would
appreciate confirmation or hints what else is wrong.

Thanks in advance,
Paul

--
--
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.
For more options, visit https://groups.google.com/d/optout.