Monday, October 31, 2016

Re: Coo-Coo fix for my spell file error

My spell file seems to be right where its supposed to be, in the current install directory `vim80`. The problem appears to be that VIMRUNTIME points to `vim74`. Since this is sorted during install, I'm guessing this needs to be sorted at the OS level or with the Archlinux community?

--
--
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: usual VIM backup settings in linux

> Do you *need* those backup files? I have configured Vim to save
> backups in ~/.vimbackup, but cannot remember last time I actually used
> this feature: normally I have other options (persistent undo, VCS,
> regular backups done by rsnapshot: depending on what I actually need).
>
Thank you for the answer,
when I think back, all two years about I am happy to have such backup files.

Have done as you adviced

Now my settings in /etv/vimrc

set backupdir=~/.vimbackup
set backup
set writebackup
set backupcopy=yes

and not forgotten
to
mkdir ${HOME}/.vimbackup
mkdir /root/.vimbackup

Erhy
with OpenSUSE in VirtualBox

--
--
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: Coo-Coo fix for my spell file error

2016-10-31 18:20 GMT+03:00 Xtian Simon <xtiansimon@gmail.com>:
> I'm a longtime user of Vim on Linux (archlinux). Every time I open the app, I get an error about the spelling file.
>
> $ vim
> Warning: Cannot find word list "en.utf-8.spl" or "en.ascii.spl"
> Warning: Cannot find word list "en.utf-8.spl" or "en.ascii.spl"
> Warning: Cannot find word list "en.utf-8.spl" or "en.ascii.spl"
> Press ENTER or type command to continue
>
> My copy of Vim is up to date,
>
> $ vim --version
> VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 15 2016 10:11:05)
> Included patches: 1-5
> Compiled by Arch Linux
>
> $ sudo pacman -Ss vim | grep installed
> extra/vim 8.0.0005-1 [installed]
> extra/vim-runtime 8.0.0005-1 [installed]
> community/ranger 1.7.2-1 [installed]
>
> I posted this question on the new StackExchange site vi/vim[1], where a comment posted a link to a blog post suggesting I copy the spell file into my `~/.vim/spell` directory (I tried a soft link instead).
>
> Sure enough, this worked. However, this raises the larger issue, is this right? I'm not a Vim developer, so take my comment with a grain of salt, but isn't the user's home directory of `.vim` supposed to be just for user files? Shouldn't the global spell file be loaded (and findable) at the application level?
>
>
> [1]: http://vi.stackexchange.com/questions/10025/error-warning-cannot-find-word-list-is-this-a-user-or-package-error
> [2]: http://abhipandey.com/2015/10/vim-cannot-find-word-list/

Blog post author is utterly wrong in how he edits the runtimepath: it
must not point to the spell folder, it must point to the *parent* of
the spell folder. Unfortunately, logging in there to comment with
Google does not work.

Wondering where is *yours* spell file initial location.

>
> --
> --
> 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.

--
--
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: Coo-Coo fix for my spell file error

```
$echo $VIMRUNTIME
/usr/share/vim/vim74
```

Yikes! There's the problem. It's looking for an old version, VIM 7.

--
--
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: Coo-Coo fix for my spell file error

On 2016-10-31, Xtian Simon wrote:
> I'm a longtime user of Vim on Linux (archlinux). Every time I open
> the app, I get an error about the spelling file.
>
> $ vim
> Warning: Cannot find word list "en.utf-8.spl" or "en.ascii.spl"
> Warning: Cannot find word list "en.utf-8.spl" or "en.ascii.spl"
> Warning: Cannot find word list "en.utf-8.spl" or "en.ascii.spl"
> Press ENTER or type command to continue

It looks like your 'runtimepath' and/or your $VIMRUNTIME variable
might be corrupt.

> My copy of Vim is up to date,
>
> $ vim --version
> VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 15 2016 10:11:05)
> Included patches: 1-5
> Compiled by Arch Linux
>
> $ sudo pacman -Ss vim | grep installed
> extra/vim 8.0.0005-1 [installed]
> extra/vim-runtime 8.0.0005-1 [installed]
> community/ranger 1.7.2-1 [installed]
>
> I posted this question on the new StackExchange site vi/vim[1],
> where a comment posted a link to a blog post suggesting I copy the
> spell file into my `~/.vim/spell` directory (I tried a soft link
> instead).

Since you know where your Vim runtime files reside, execute

:echo $VIMRUNTIME

and verify that its value matches your installation's runtime
directory (usually /usr/share/vim/vim80). Your spell files should
be visible with this command:

:!ls $VIMRUNTIME/spell

Then execute

:set rtp?

and verify that it contains the value of $VIMRUNTIME. The
'runtimepath' value might be easier to read with this command:

:echo substitute(&rtp, ',', '\n', 'g')

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.

Coo-Coo fix for my spell file error

I'm a longtime user of Vim on Linux (archlinux). Every time I open the app, I get an error about the spelling file.

$ vim
Warning: Cannot find word list "en.utf-8.spl" or "en.ascii.spl"
Warning: Cannot find word list "en.utf-8.spl" or "en.ascii.spl"
Warning: Cannot find word list "en.utf-8.spl" or "en.ascii.spl"
Press ENTER or type command to continue

My copy of Vim is up to date,

$ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 15 2016 10:11:05)
Included patches: 1-5
Compiled by Arch Linux

$ sudo pacman -Ss vim | grep installed
extra/vim 8.0.0005-1 [installed]
extra/vim-runtime 8.0.0005-1 [installed]
community/ranger 1.7.2-1 [installed]

I posted this question on the new StackExchange site vi/vim[1], where a comment posted a link to a blog post suggesting I copy the spell file into my `~/.vim/spell` directory (I tried a soft link instead).

Sure enough, this worked. However, this raises the larger issue, is this right? I'm not a Vim developer, so take my comment with a grain of salt, but isn't the user's home directory of `.vim` supposed to be just for user files? Shouldn't the global spell file be loaded (and findable) at the application level?


[1]: http://vi.stackexchange.com/questions/10025/error-warning-cannot-find-word-list-is-this-a-user-or-package-error
[2]: http://abhipandey.com/2015/10/vim-cannot-find-word-list/

--
--
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: patch for perl.vim to follow pod.vim's instructions

Am 2016-10-31 06:48, schrieb L. A. Walsh:
> ---
> I submitted an issue in their issue tracker over a week ago on
> some other issue and noted that there was no response and that the
> project
> seemed dead. Is that not the case?
>
> --

I don't know, as I am no vim-perl user. However the latest activity is
from August,
so it doesn't look particular bad.

Best,
Christian

--
--
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.

Sunday, October 30, 2016

Re: patch for perl.vim to follow pod.vim's instructions

Christian Brabandt wrote:
> I believe, github.com/vim-perl/vim-perl is the upstream repository for
> perl runtime files.
>
---
I submitted an issue in their issue tracker over a week ago on
some other issue and noted that there was no response and that the project
seemed dead. Is that not the case?

--
--
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: usual VIM backup settings in linux

2016-10-31 0:43 GMT+03:00 Erhy <erhard.glueck.austria@gmail.com>:
> Hello!
> After many years I start again with Linux
> I'm not satisfied with my experiments.
> I feel good if files are saved before overwriting them with a new version.
>
> But I don't want to see backup files conspicuously
> in normal work with bash.
>
> With .dir_colors I can hide them, if I choose
> set backupext=.~
>
> But if I edit bash scripts
> the execute mode bits are also set in the backup scripts.
> So these stick out again.
>
> Please tell me the usual way to handle it

Do you *need* those backup files? I have configured Vim to save
backups in ~/.vimbackup, but cannot remember last time I actually used
this feature: normally I have other options (persistent undo, VCS,
regular backups done by rsnapshot: depending on what I actually need).

>
> Erhy
>
> --
> --
> 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.

--
--
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.

usual VIM backup settings in linux

Hello!
After many years I start again with Linux
I'm not satisfied with my experiments.
I feel good if files are saved before overwriting them with a new version.

But I don't want to see backup files conspicuously
in normal work with bash.

With .dir_colors I can hide them, if I choose
set backupext=.~

But if I edit bash scripts
the execute mode bits are also set in the backup scripts.
So these stick out again.

Please tell me the usual way to handle it

Erhy

--
--
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: Setting dynamic value to colorcolumn

On 2016-10-30, Fabien Meghazi wrote:
> Hi,
>
> I'm sorry for my vimL ignorance but how can I append a value to colorcolumn ?
>
>     :let &colorcolumn+=getcurpos()[4]
>
> gives me
>
>      Wrong variable type for +=
>
> I guess it's because I should add a list to a list but I don't know how to
> express it.

'colorcolumn' is string containing a comma-separated list of column
numbers. It is not a list in the sense of ":help 41.8".

In the context of the :let command, += means to arithmetically add,
not add to a list or append to a string, so your command is
attempting to increment the vaule of a string. Try this instead:

:let &colorcolumn.=','.getcurpos()[4]

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.

Setting dynamic value to colorcolumn

Hi,

I'm sorry for my vimL ignorance but how can I append a value to colorcolumn ?

    :let &colorcolumn+=getcurpos()[4]

gives me

     Wrong variable type for +=

I guess it's because I should add a list to a list but I don't know how to express it.

--

--
--
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.

Saturday, October 29, 2016

Re: How gVIM can handle UTF like notepad

On Sat, Oct 29, 2016 at 11:35 PM, Ben Fritz <fritzophrenic@gmail.com> wrote:
> On Tuesday, October 11, 2016 at 5:17:33 AM UTC-5, Gabriele wrote:
>> On 10/10/2016 17.42, Ben Fritz wrote:
>> > To detect this automatically, be sure that you have "set
>> > encoding=utf-8", "setglobal bomb", and "set
>> > fileencodings=ucs-bomb,utf-8,latin1" or similar in your .vimrc.
>> > http://vim.wikia.com/wiki/Working_with_Unicode
>>
>> Can you tell me if you intentionally used "setglobal" for "bomb", or you
>> just copied what's in that wiki?
>> On my system the global bomb setting is not used if I don't also add
>> "setlocal bomb<" or "set bomb<".
>>
>> It is likely that on that wiki "setglobal" was used just by chance,
>> because that's what was used for fileencoding, see
>> http://vim.wikia.com/wiki/Working_with_Unicode?diff=29876&oldid=29794 .
>>
>
> I'm sure I intentionally used "setglobal bomb". When I experiment with "gvim -N -u NONE -i NONE" and then ":set encoding=utf-8" and ":setglobal bomb", any new buffer I create *after* this via ":new" will automatically get 'bomb' set. If I omit the ":setglobal bomb" then new buffers do NOT get 'bomb' set by default.
>
> Note that the initial buffer created on Vim startup will not have 'bomb' set from the setglobal command. If you need that first buffer to also have 'bomb' set then yes, you will need a setlocal or set command as well.

I also use "setglobal bomb", intentionally, in my vimrc; but beware
that not all programs, and in particular (on Unix/Linux) not the
script loader (y'know, whatever it is that recognises the #! shebang
at the start of a script) will recognize (and discard) 0xEF 0xBB 0xBF
(i.e., a UTF-8 BOM) at the start of a supposedly ASCII script — so
shell scripts (probably among others) need "setlocal nobomb" done
either manually or in a filetype-plugin (in an after-plugin since the
default $VIMRUNTIME/ftplugin/sh.vim doesn't set 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: How gVIM can handle UTF like notepad

On Tuesday, October 11, 2016 at 5:17:33 AM UTC-5, Gabriele wrote:
> On 10/10/2016 17.42, Ben Fritz wrote:
> > To detect this automatically, be sure that you have "set
> > encoding=utf-8", "setglobal bomb", and "set
> > fileencodings=ucs-bomb,utf-8,latin1" or similar in your .vimrc.
> > http://vim.wikia.com/wiki/Working_with_Unicode
>
> Can you tell me if you intentionally used "setglobal" for "bomb", or you
> just copied what's in that wiki?
> On my system the global bomb setting is not used if I don't also add
> "setlocal bomb<" or "set bomb<".
>
> It is likely that on that wiki "setglobal" was used just by chance,
> because that's what was used for fileencoding, see
> http://vim.wikia.com/wiki/Working_with_Unicode?diff=29876&oldid=29794 .
>

I'm sure I intentionally used "setglobal bomb". When I experiment with "gvim -N -u NONE -i NONE" and then ":set encoding=utf-8" and ":setglobal bomb", any new buffer I create *after* this via ":new" will automatically get 'bomb' set. If I omit the ":setglobal bomb" then new buffers do NOT get 'bomb' set by default.

Note that the initial buffer created on Vim startup will not have 'bomb' set from the setglobal command. If you need that first buffer to also have 'bomb' set then yes, you will need a setlocal or set command as well.

--
--
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.

Friday, October 28, 2016

Re: patch for perl.vim to follow pod.vim's instructions

Hi L.!

On Do, 27 Okt 2016, L. A. Walsh wrote:

> Is this the way to submit updates for problems?
>
> syntax/pod.vim shows how to include pod sections and says to
> put the option "contained" in each region defined
> in an "including" language.
>
> syntax/perl.vim doesn't do this.
>
> Result -- when I have pod in my perl.vim file, the pod can turn off
> syntax highlighting for perl-code that follows. I've put together
> a patch that seems to address the problem (?)
> Note, I do have "perl_include_pod" set to 1.

I believe, github.com/vim-perl/vim-perl is the upstream repository for
perl runtime files.

Best,
Christian
--
Es gibt keine schüchternen Lehrlinge mehr, es gibt nur noch
schüchterne Meister.
-- Marie von Ebner-Eschenbach

--
--
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, October 27, 2016

patch for perl.vim to follow pod.vim's instructions

Is this the way to submit updates for problems?

syntax/pod.vim shows how to include pod sections and says to
put the option "contained" in each region defined
in an "including" language.

syntax/perl.vim doesn't do this.

Result -- when I have pod in my perl.vim file, the pod can turn off
syntax highlighting for perl-code that follows. I've put together
a patch that seems to address the problem (?)
Note, I do have "perl_include_pod" set to 1.



This patch adds the "contained" option at the at the end
of the 6 perlPOD regions defined:

--- syntax/perl.vim 2016-10-27 18:55:35.000000000 -0700
+++ syntax/perl.vim 2016-10-27 18:59:03.842586040 -0700
@@ -50,18 +50,18 @@
syn include @Pod syntax/pod.vim
unlet b:current_syntax
if exists("perl_fold")
- syn region perlPOD start="^=[\I]" end="^=cut" contains=@Pod,@Spell,perlTodo keepend fold extend
- syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend fold extend
+ syn region perlPOD start="^=[\I]" end="^=cut" contains=@Pod,@Spell,perlTodo keepend fold extend contained
+ syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend fold extend contained
else
- syn region perlPOD start="^=[\I]" end="^=cut" contains=@Pod,@Spell,perlTodo keepend
- syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend
+ syn region perlPOD start="^=[\I]" end="^=cut" contains=@Pod,@Spell,perlTodo keepend contained
+ syn region perlPOD start="^=cut" end="^=cut" contains=perlTodo keepend contained
endif
else
" Use only the bare minimum of rules
if exists("perl_fold")
- syn region perlPOD start="^=[\I]" end="^=cut" fold
+ syn region perlPOD start="^=[\I]" end="^=cut" fold contained
else
- syn region perlPOD start="^=[\I]" end="^=cut"
+ syn region perlPOD start="^=[\I]" end="^=cut" contained
endif
endif



--
--
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, October 25, 2016

Re: capture output of a vim command into a quickfix windows without freezing vim

with vim 8, you can try:
http://github.com/skywind3000/asyncrun.vim

--
--
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, October 24, 2016

Re: Load one key- map

On the 24th of October 2016 23:19:52 UTC+2, Tony Mechelynck wrote:

> After the user leaves (closes) Vim, the keys aren't mapped anymore.
> Starting Vim without the appropriate -c or -S command-line switch will
> simply not load it.

Yes, sure... sorry! I was confused with the mapping I have written in my personal .vimrc file.
Thank you again and sorry for the inconvenience!

guido

--
--
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: Load one key- map

On Mon, Oct 24, 2016 at 6:25 PM, Guido Milanese
<guido.milanese@gmail.com> wrote:
> Perfect, thank you. I think that using "-c" for short commands and a file for long sequences is a very wise choice.
> An additional question: how could I unmap the keys leaving the vim session without asking my user to unmap the keys manually? Could I run again vim "silently" from my bash script unloading the mapping? For example:
>
> vim -c "MAP KEY"
> # the user works in vim; after he leaves,
> vim -c "UNMAP KEY"
>
> As usual, a great program and a generous group.
>
> guido (italy)

After the user leaves (closes) Vim, the keys aren't mapped anymore.
Starting Vim without the appropriate -c or -S command-line switch will
simply not load it.

If you want a mapping to be loaded every time a user starts Vim, it is
possible too, but then you should create a global plugin or (if the
mapping is defined with <buffer>, to be used only for one filetype) a
filetype-plugin.

See
:help 'runtimepath', and in particular
:help after-directory
:help write-plugin
:help add-global-plugin
:help add-filetype-plugin

This is of course for mappings you want to distribute. Your private
ones you can of course just write into your vimrc.

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.

Using undojoin with eclim's JavaImportOrganize

This is my existing script for java imports. It gets around eclim not supporting inferring static imports by inserting them into the file before calling JavaImportOrganize. The problem is this creates two entries in my undo history. One for the static imports and one for the call to JavaImportOrganize. I'm trying to use undojoin but it doesn't seem to be working. The call to undo doesn't seem to be working either.

Can anyone suggest improvements? Thanks!

function! HandleImports()
if (&ft == 'java' && eclim#EclimAvailable() && eclim#project#util#IsCurrentFileInProject())
mark `
call cursor(2, 0)
normal Aimport static org.junit.Assert.*;
normal Aimport static org.mockito.Matchers.*;
normal Aimport static org.mockito.Mockito.*;
normal O
normal ``
try
" TODO: why doesn't undojoin work?
undojoin | execute "JavaImportOrganize"
catch
" TODO: This doesn't work either.
undo
endtry
endif
endfunction

--
--
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: Load one key- map

Perfect, thank you. I think that using "-c" for short commands and a file for long sequences is a very wise choice.
An additional question: how could I unmap the keys leaving the vim session without asking my user to unmap the keys manually? Could I run again vim "silently" from my bash script unloading the mapping? For example:

vim -c "MAP KEY"
# the user works in vim; after he leaves,
vim -c "UNMAP KEY"

As usual, a great program and a generous group.

guido (italy)

--
--
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: Load one key- map

2016-10-24 5:56 GMT+03:00 Tony Mechelynck <antoine.mechelynck@gmail.com>:
> On Mon, Oct 24, 2016 at 1:50 AM, Nikolay Aleksandrovich Pavlov
> <zyx.vim@gmail.com> wrote:
>> 2016-10-24 2:03 GMT+03:00 Tony Mechelynck <antoine.mechelynck@gmail.com>:
>>> On Mon, Oct 24, 2016 at 12:15 AM, Guido Milanese
>>> <guido.milanese@gmail.com> wrote:
>>>> Dear all,
>>>> I'm probably making a mountain out of a molehill, but I'm lost in a (probably) very simple problem.
>>>>
>>>> I have written a simple bash script that performs some transformations in a file, calls (g)vim, waits for the user to edit the file, and exits. The problem is:
>>>>
>>>> * I have defined one simple key map of the kind
>>>>
>>>> map <F11> do-this-and-this
>>>>
>>>> * I would like to save this mapping to a file, in order to add this particular key-map to other mapping(s) defined by users; I would like to load the mapping from an external file, in order for this mapping to be unloaded after the current session. Such as:
>>>>
>>>> (g)vim FILE-WITH-MAPPING FILE-TO-WORK
>>>>
>>>> I tried to use *mkexrc* but I did not obtain what I want, i.e. to save in a file *only* the particular mapping I need for this particular script.
>>>>
>>>> Could you please help me?
>>>>
>>>> Thank you!
>>>> guido (Italy)
>>>
>>> Well, you could write your mapping to a file, and source that file
>>> when needed; but unless it is a rather complex "do this and that" it
>>> might be simpler to simply type the :map command at the command line,
>>> or as argument to the -c command-line switch.
>>>
>>> For a complex mappinf (written to ./mymapping.vim)
>>>
>>> (g)vim -c "source ./mymapping.vim"
>>>
>>> would, I suppose, do the trick. (Vim accepts forward slashes as path
>>> separators on all platforms including Windows, or backslashes on
>>> Windows only.)
>>
>> vim -S ./mymapping.vim
>>
>> is a shortcut to `-c 'so ./mymapping.vim'`. Note: implementation used
>> so far *literally* joins `so<space>` and a file name, saving this in a
>> location where `-c` commads are saved, so `vim -S './$FOO'` is not
>> going to open file `./$FOO` like you probably expected. You need to
>> know this in case you happen to know your file name contains special
>> characters (e.g. space), or in case you don't know which characters
>> your temporary file name can contain in advance, so the safest way
>> which does not require you messing with escaping should be something
>> like
>>
>> _MYMAPPING=./mymapping.vim vim -c 'source $_MYMAPPING'
>>
>
> ... which unless things have changed a lot since I left Windows, would
> work on Mac, Linux or Unix, or even in Cygwin bash, but not in
> "vanilla" Windows and not in CMD.EXE.

"… I have written a simple bash script …" - this is a quote from
original post. And this has reasons not to work on *nix: e.g. if OP
was writing a fish script he would need to use `env` (not sure, but
may be also possible in cmd.exe with some programs installed since
there are ports of quite a few *nix tools).

Also in cmd.exe the idea does not change, just you need a different
syntax for 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.

--
--
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.

Sunday, October 23, 2016

Re: Load one key- map

On Mon, Oct 24, 2016 at 1:50 AM, Nikolay Aleksandrovich Pavlov
<zyx.vim@gmail.com> wrote:
> 2016-10-24 2:03 GMT+03:00 Tony Mechelynck <antoine.mechelynck@gmail.com>:
>> On Mon, Oct 24, 2016 at 12:15 AM, Guido Milanese
>> <guido.milanese@gmail.com> wrote:
>>> Dear all,
>>> I'm probably making a mountain out of a molehill, but I'm lost in a (probably) very simple problem.
>>>
>>> I have written a simple bash script that performs some transformations in a file, calls (g)vim, waits for the user to edit the file, and exits. The problem is:
>>>
>>> * I have defined one simple key map of the kind
>>>
>>> map <F11> do-this-and-this
>>>
>>> * I would like to save this mapping to a file, in order to add this particular key-map to other mapping(s) defined by users; I would like to load the mapping from an external file, in order for this mapping to be unloaded after the current session. Such as:
>>>
>>> (g)vim FILE-WITH-MAPPING FILE-TO-WORK
>>>
>>> I tried to use *mkexrc* but I did not obtain what I want, i.e. to save in a file *only* the particular mapping I need for this particular script.
>>>
>>> Could you please help me?
>>>
>>> Thank you!
>>> guido (Italy)
>>
>> Well, you could write your mapping to a file, and source that file
>> when needed; but unless it is a rather complex "do this and that" it
>> might be simpler to simply type the :map command at the command line,
>> or as argument to the -c command-line switch.
>>
>> For a complex mappinf (written to ./mymapping.vim)
>>
>> (g)vim -c "source ./mymapping.vim"
>>
>> would, I suppose, do the trick. (Vim accepts forward slashes as path
>> separators on all platforms including Windows, or backslashes on
>> Windows only.)
>
> vim -S ./mymapping.vim
>
> is a shortcut to `-c 'so ./mymapping.vim'`. Note: implementation used
> so far *literally* joins `so<space>` and a file name, saving this in a
> location where `-c` commads are saved, so `vim -S './$FOO'` is not
> going to open file `./$FOO` like you probably expected. You need to
> know this in case you happen to know your file name contains special
> characters (e.g. space), or in case you don't know which characters
> your temporary file name can contain in advance, so the safest way
> which does not require you messing with escaping should be something
> like
>
> _MYMAPPING=./mymapping.vim vim -c 'source $_MYMAPPING'
>

... which unless things have changed a lot since I left Windows, would
work on Mac, Linux or Unix, or even in Cygwin bash, but not in
"vanilla" Windows and not in CMD.EXE.

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: Load one key- map

2016-10-24 2:03 GMT+03:00 Tony Mechelynck <antoine.mechelynck@gmail.com>:
> On Mon, Oct 24, 2016 at 12:15 AM, Guido Milanese
> <guido.milanese@gmail.com> wrote:
>> Dear all,
>> I'm probably making a mountain out of a molehill, but I'm lost in a (probably) very simple problem.
>>
>> I have written a simple bash script that performs some transformations in a file, calls (g)vim, waits for the user to edit the file, and exits. The problem is:
>>
>> * I have defined one simple key map of the kind
>>
>> map <F11> do-this-and-this
>>
>> * I would like to save this mapping to a file, in order to add this particular key-map to other mapping(s) defined by users; I would like to load the mapping from an external file, in order for this mapping to be unloaded after the current session. Such as:
>>
>> (g)vim FILE-WITH-MAPPING FILE-TO-WORK
>>
>> I tried to use *mkexrc* but I did not obtain what I want, i.e. to save in a file *only* the particular mapping I need for this particular script.
>>
>> Could you please help me?
>>
>> Thank you!
>> guido (Italy)
>
> Well, you could write your mapping to a file, and source that file
> when needed; but unless it is a rather complex "do this and that" it
> might be simpler to simply type the :map command at the command line,
> or as argument to the -c command-line switch.
>
> For a complex mappinf (written to ./mymapping.vim)
>
> (g)vim -c "source ./mymapping.vim"
>
> would, I suppose, do the trick. (Vim accepts forward slashes as path
> separators on all platforms including Windows, or backslashes on
> Windows only.)

vim -S ./mymapping.vim

is a shortcut to `-c 'so ./mymapping.vim'`. Note: implementation used
so far *literally* joins `so<space>` and a file name, saving this in a
location where `-c` commads are saved, so `vim -S './$FOO'` is not
going to open file `./$FOO` like you probably expected. You need to
know this in case you happen to know your file name contains special
characters (e.g. space), or in case you don't know which characters
your temporary file name can contain in advance, so the safest way
which does not require you messing with escaping should be something
like

_MYMAPPING=./mymapping.vim vim -c 'source $_MYMAPPING'

>
> see
> :help :source
> :help -c
>
> 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.

--
--
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: Load one key- map

On Mon, Oct 24, 2016 at 12:15 AM, Guido Milanese
<guido.milanese@gmail.com> wrote:
> Dear all,
> I'm probably making a mountain out of a molehill, but I'm lost in a (probably) very simple problem.
>
> I have written a simple bash script that performs some transformations in a file, calls (g)vim, waits for the user to edit the file, and exits. The problem is:
>
> * I have defined one simple key map of the kind
>
> map <F11> do-this-and-this
>
> * I would like to save this mapping to a file, in order to add this particular key-map to other mapping(s) defined by users; I would like to load the mapping from an external file, in order for this mapping to be unloaded after the current session. Such as:
>
> (g)vim FILE-WITH-MAPPING FILE-TO-WORK
>
> I tried to use *mkexrc* but I did not obtain what I want, i.e. to save in a file *only* the particular mapping I need for this particular script.
>
> Could you please help me?
>
> Thank you!
> guido (Italy)

Well, you could write your mapping to a file, and source that file
when needed; but unless it is a rather complex "do this and that" it
might be simpler to simply type the :map command at the command line,
or as argument to the -c command-line switch.

For a complex mappinf (written to ./mymapping.vim)

(g)vim -c "source ./mymapping.vim"

would, I suppose, do the trick. (Vim accepts forward slashes as path
separators on all platforms including Windows, or backslashes on
Windows only.)

see
:help :source
:help -c

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.

Load one key- map

Dear all,
I'm probably making a mountain out of a molehill, but I'm lost in a (probably) very simple problem.

I have written a simple bash script that performs some transformations in a file, calls (g)vim, waits for the user to edit the file, and exits. The problem is:

* I have defined one simple key map of the kind

map <F11> do-this-and-this

* I would like to save this mapping to a file, in order to add this particular key-map to other mapping(s) defined by users; I would like to load the mapping from an external file, in order for this mapping to be unloaded after the current session. Such as:

(g)vim FILE-WITH-MAPPING FILE-TO-WORK

I tried to use *mkexrc* but I did not obtain what I want, i.e. to save in a file *only* the particular mapping I need for this particular script.

Could you please help me?

Thank you!
guido (Italy)

--
--
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: cursor blinking in Bash on Ubuntu on Windows

read :h gcr
:
In an MSDOS or Win32 console, only the height of the cursor can be changed.
For a console the 't_SI' and 't_EI' escape sequences are used
But in Win32 console the curser blinks

In bash on Ubuntu on Windows the curser blinks also
and $TERM is xterm.

I asked about in
https://github.com/Microsoft/BashOnWindows/issues/1253

Erhy

--
--
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: A problem (bug?) with = and remapping

On 22/10/2016 13:57, Lifepillar wrote:
> On 22/10/2016 11:14, Lifepillar wrote:
>> Hello,
>> I have a problem with a plugin I am writing. To reproduce [snip]
>
> Ok, I think that my example may be reduced to the following:
>
> fun! G()
> return "\<c-c>k"
> endf
>
> fun! F()
> return "\<c-r>=G()\<cr>"
> endf
>
> imap <expr> <tab> F()
>
> Is there a way to have this working (i.e., have <c-c> remapped to what
> the SQL filetype defines)?

Took me a while to figure out, but solved my problem. For the record:

fun! G()
return "\<c-c>k"
endf

fun! F()
return "\<c-c>s\<plug>(Foo)"
endf

imap <expr> <tab> F()
imap <expr> <plug>(Foo) pumvisible() ? '' : G()

Now, pressing <tab> will trigger <c-c>s and, if no results are found,
<c-c>k, and both mappings will be remapped, as I wanted.

Life.

--
--
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.

Saturday, October 22, 2016

Re: E117: Unknown function, dict member called as timer's handler

Ni Va wrote:

> Applying timer_start help, I would like to differ from example by calling a function declared as dict member and passing FuncName at timer_start parameter.
>
> I got that message :
>
> E117: Unknown function:
>
> -------------------THE CODE---------
>
> fu! g:messagesManager.DisplayMessage(timer) "{{{
> echo printf("%s",self.messagesBuffer[self.currentMessageIndex])
> let self.currentMessageIndex+=1
> if self.currentMessageIndex==len(self.messagesBuffer)
> let self.currentMessageIndex=0
> endif
> endfu
> "}}}
> fu! g:messagesManager.StartDisplay() "{{{
> " if has('timers') && !exists('s:timer')
> let FuncRef = function('self.DisplayMessage')
> let FuncName = string(FuncRef)
> if has('timers')
> let s:timer = timer_start(1000,
> \ FuncName, {'repeat': 10})
> else
> echo "timers not supported by your version of vim"
> endif
> endfu

Yeah, that doesn't work. Why turn the function reference into a string?
Just don't do that.

--
A year spent in artificial intelligence is enough to make one
believe in God.

/// 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: cursor blinking in Bash on Ubuntu on Windows

read :h gcr
:
In an MSDOS or Win32 console, only the height of the cursor can be changed.
For a console the 't_SI' and 't_EI' escape sequences are used

But in Win32 console the curser blinks

In bash on Ubuntu on Windows the curser blinks also
and $TERM is xterm.

:set t_mb? reports [5m

in bash:
echo '[5m'
stops blinking also in bash

I modified vimrc.local with
set t_mb=

but VIM don't blink, so it must be set earlier to non blinking mode

Erhy

--
--
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: A problem (bug?) with = and remapping

On 22/10/2016 11:14, Lifepillar wrote:
> Hello,
> I have a problem with a plugin I am writing. To reproduce [snip]

Ok, I think that my example may be reduced to the following:

fun! G()
return "\<c-c>k"
endf

fun! F()
return "\<c-r>=G()\<cr>"
endf

imap <expr> <tab> F()

Is there a way to have this working (i.e., have <c-c> remapped to what
the SQL filetype defines)?

Thanks,
Life.


--
--
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.

A problem (bug?) with = and remapping

Hello,
I have a problem with a plugin I am writing. To reproduce, define
`keysequence.vim` with this content:

let s:keys = ["\<c-c>s", "\<c-c>k"]

fun! KeySequence(i)
return
s:keys[a:i]."\<c-r>=pumvisible()?'':KeySequence(".(a:i+1).")\<cr>"
endf

imap <expr> <tab> KeySequence(0)

Then:

vim -N -u NONE
:filetype on
:filetype plugin on
:syntax on
:set ft=sql
:source keysequence.vim
:set completeopt+=menuone

and type:

ocr<tab> ta<tab>

The first <tab> correctly completes the keyword using <c-c>s, but the
second does not. The second <tab> is remapped to

<c-c>s<c-r>=pumvisible()?'':KeySequence(1)<cr>

and since <c-c>s does not return any result, KeySequence(1) is called
and <c-c>k is typed. But this latter <c-c> is not remapped, causing Vim
to exit Insert mode and go up one line (because of `k`).

Why isn't the second `<c-c>` remapped?

Life.

--
--
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.

Friday, October 21, 2016

BUG: charclas "isident" missing identifier chars above 255? (was: how to turn off error-highlight of UTF-8 char(s) in perl-function names?)

Paul wrote:
>
> This might help:
>
> Put the cursor on the target character, and do 「:echo
> map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')」. That
> will show you what highlight group it is using. 「:verbose highlight
> <that group>」 will show you where it was defined.
>
Thanks! .. didn't know about that, but it led me to where I thought
the problem was.

On the char w/the error, it's in "perlSubError" which links to "Error".
The other chars are in "perlSubName". The problem looks like it is
the use of "isident", referenced by "\i" and "\I". For syntax, "isident"
refers to "isfname", where it says:

"Multi-byte characters 256 and above are always included, only the
characters up to 255 are specified with this option.
For UTF-8 the characters 0xa0 to 0xff are included as well."

While that is true for "isfname", It appears to leave out all characters
above 255, which makes it "incorrect" for most of the world's alphabetic
characters. Does this look like the problem to anyone else?

Maybe using "\f" & "\F", for "\i" and "\I" would provide a bit better
function
(though still not correct) until \i can support wide characters?

Does "isident" support UTF-8 or will it in the near future?



--
--
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.

E117: Unknown function, dict member called as timer's handler

Hi,

Applying timer_start help, I would like to differ from example by calling a function declared as dict member and passing FuncName at timer_start parameter.

I got that message :

E117: Unknown function:

-------------------THE CODE---------

fu! g:messagesManager.DisplayMessage(timer) "{{{
echo printf("%s",self.messagesBuffer[self.currentMessageIndex])
let self.currentMessageIndex+=1
if self.currentMessageIndex==len(self.messagesBuffer)
let self.currentMessageIndex=0
endif
endfu
"}}}
fu! g:messagesManager.StartDisplay() "{{{
" if has('timers') && !exists('s:timer')
let FuncRef = function('self.DisplayMessage')
let FuncName = string(FuncRef)
if has('timers')
let s:timer = timer_start(1000,
\ FuncName, {'repeat': 10})
else
echo "timers not supported by your version of vim"
endif
endfu

--
--
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: cursor blinking in Bash on Ubuntu on Windows

2016-10-21 20:24 GMT+03:00 Erhy <erhard.glueck.austria@gmail.com>:
> Hello,
> Using VIM in Bash on Ubuntu on Windows
> the cursor doesn't blink.
>
> I would like that the cursor blinks.
>
> This doesn't work:
> set gcr=a:blinkon600-blinkoff400

This is not supposed to work in the terminal, please read `:h 'gcr'` first.

>
> Is it a failure in terminfo?
>
> Thank you for tips
> Erhy
>
> --
> --
> 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.

--
--
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.

cursor blinking in Bash on Ubuntu on Windows

Hello,
Using VIM in Bash on Ubuntu on Windows
the cursor doesn't blink.

I would like that the cursor blinks.

This doesn't work:
set gcr=a:blinkon600-blinkoff400

Is it a failure in terminfo?

Thank you for tips
Erhy

--
--
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, October 20, 2016

Re: color name definitions in Bash on Ubuntu on Windows

Thank you Tony!

You mention t_Co
and it was 8 in my VIM

I set it to 16 and now I have 16 colors which assignable with numbers.

Erhy

--
--
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, October 19, 2016

Re: color name definitions in Bash on Ubuntu on Windows

On Wed, Oct 19, 2016 at 11:42 PM, Erhy <erhard.glueck.austria@gmail.com> wrote:
> Hello!
> I struggle with the colors in VIM.
> (in the Ubuntu Subsystem of Windows 10)
> Because comment lines with syntax on was not readable for me.
>
> I found the file rgb.txt in the folder /usr/share/vim/vim74
> but most color names are not accepted by vim
> e.g. :highlight Comment ctermfg=MidnightBlue
>
> With numbers instead of names there a differences between 0 and 7
> but the terminal emulation knows 16 colors.
>
> Have you any tips?
>
> Erhy

Many color terminals only know 8 background and 16 foreground colors.
rgb.txt doesn't apply to the console anyway, but only to the GUI,
which can display (in theory) 256^3 = 16777216 colors (as 256 levels
each of red, green and blue). The acceptable colors for ctermfg are
found at ":help cterm-colors".

Alternatively, with a GUI-capable Vim (but maybe not on Windows, you
will have to check it for yourself there) you can approximate GUI
colors in a console provided that it is known to Vim (via its 't_Co'
setting) as able to display 88 or 256 colors: see
http://vim.wikia.com/wiki/Using_GUI_color_settings_in_a_terminal#Solution_2:_the_CSApprox_plugin
— in that case you can use all rgb.txt color names since you're using
guibg= guifg= colors; the CSApprox plugin will translate them to
something that the cterm understands.

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.

color name definitions in Bash on Ubuntu on Windows

Hello!
I struggle with the colors in VIM.
(in the Ubuntu Subsystem of Windows 10)
Because comment lines with syntax on was not readable for me.

I found the file rgb.txt in the folder /usr/share/vim/vim74
but most color names are not accepted by vim
e.g. :highlight Comment ctermfg=MidnightBlue

With numbers instead of names there a differences between 0 and 7
but the terminal emulation knows 16 colors.

Have you any tips?

Erhy

--
--
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, October 18, 2016

Re: Compile and Run Java Projects

On Monday, October 17, 2016 at 6:08:35 PM UTC-4, Luis Henriquez-Perez wrote:
> I am using vim to code my java projects. I've been noticing I've been jumping back to the terminal a lot to compile and run my code. So I want to create a function that does all this for me (and gets rid of the class files afterwards). The code below is my attempt. Could someone let me know how I can fix my code?
>
> func! CompileFolderJava()
>
> " compile all java files in folder of the current buffer
> :!javac "%:p:h" . "/*.java" " javac path/name/to/current/buffer/directory/*.java
>
>
> " run Main java file in that folder
> :!java "%:p:h" . ".Main" " java path/name/to/current/buffer/directory.Main
>
> " delete all the .class files in that folder
> :!rm "%:p:h" . ".class"
>
> " :echo "Done"
> endfunc

Thank you! This also works perfectly. I'll check out help :make to learn about the user experience benefits you spoke of.

--
--
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 turn off error-highlight of UTF-8 char(s) in perl-function names?

On Saturday, 15 October, 2016 at 08:01:04 BST, L. A. Walsh wrote:
>1) How might this be fixed to remove this error checking any
>UTF-8 "alnum"-class char?

This might help:

Put the cursor on the target character, and do 「:echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")')」. That will show you what highlight group it is using. 「:verbose highlight <that group>」 will show you where it was defined.

--
--
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: Compile and Run Java Projects

Hi,

You should instead use the integrated :make/quickfix feature of vim. You'll have a much better user experience.

First be sure that you have set javac as the make program. It's best done by sourcing compiler/javac.vim
-> :runtime compiler/javac.vim

I would have done it in a java ftplugin, but as I'm not a Java developer, I'm not sure this is a good default setting. So, let's put it in your function.


```vim
command! MakeAndRun :call s:CompileAndRunFolderJava()

function! s:CompileAndRunFolderJava() abort
runtime compiler/javac.vim

" old trick to detect compilation errors - part 1
" --- The following code is borrowed from LaTeXSuite
" close the quickfix window before trying to open it again,
" otherwise whether or not we end up in the quickfix window
" after the :cwindow command is not fixed.
cclose " used to detect errors
let winnum = winnr()

" compile all java files in folder of the current buffer
make %:p:h/*.java

" old trick to detect compilation errors - part 2
if winnum == winnr() " => no error detected
" run Main java file in that folder
:!(cd .. && java %:p:h:t.Main)

" delete all the .class files in that folder
:!rm %:p:h/*.class
endif

" :echomsg "Done"
endfunction
```

--
--
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, October 17, 2016

Re: Compile and Run Java Projects

On Monday, October 17, 2016 at 6:08:35 PM UTC-4, Luis Henriquez-Perez wrote:
> I am using vim to code my java projects. I've been noticing I've been jumping back to the terminal a lot to compile and run my code. So I want to create a function that does all this for me (and gets rid of the class files afterwards). The code below is my attempt. Could someone let me know how I can fix my code?
>
> func! CompileFolderJava()
>
> " compile all java files in folder of the current buffer
> :!javac "%:p:h" . "/*.java" " javac path/name/to/current/buffer/directory/*.java
>
>
> " run Main java file in that folder
> :!java "%:p:h" . ".Main" " java path/name/to/current/buffer/directory.Main
>
> " delete all the .class files in that folder
> :!rm "%:p:h" . ".class"
>
> " :echo "Done"
> endfunc

Oh and in case anyone would like to learn from the solution I will post it too.
func! CompileFolderJava()

" compile all java files in folder
:!javac %:p:h/*.java

" save the variable containing current path
:let mypath = expand(":cd %:p:h")

" a java thing I have to be in this directory to call java main
:cd ..

" run all the java files in folder
:!java %:p:h:t.Main

" get back to current directory
:execute mypath

" delete all the .class files in folder
:!rm %:p:h/*.class
endfunc

--
--
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: Compile and Run Java Projects

On Monday, October 17, 2016 at 6:08:35 PM UTC-4, Luis Henriquez-Perez wrote:
> I am using vim to code my java projects. I've been noticing I've been jumping back to the terminal a lot to compile and run my code. So I want to create a function that does all this for me (and gets rid of the class files afterwards). The code below is my attempt. Could someone let me know how I can fix my code?
>
> func! CompileFolderJava()
>
> " compile all java files in folder of the current buffer
> :!javac "%:p:h" . "/*.java" " javac path/name/to/current/buffer/directory/*.java
>
>
> " run Main java file in that folder
> :!java "%:p:h" . ".Main" " java path/name/to/current/buffer/directory.Main
>
> " delete all the .class files in that folder
> :!rm "%:p:h" . ".class"
>
> " :echo "Done"
> endfunc

Thank you. It worked out.

--
--
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: Compile and Run Java Projects

On Mon, Oct 17, 2016, Luis Henriquez-Perez wrote:
> On Monday, October 17, 2016 at 6:08:35 PM UTC-4, Luis Henriquez-Perez wrote:
> > I am using vim to code my java projects. I've been noticing I've been jumping back to the terminal a lot to compile and run my code. So I want to create a function that does all this for me (and gets rid of the class files afterwards). The code below is my attempt. Could someone let me know how I can fix my code?
> >
> > func! CompileFolderJava()
> >
> > " compile all java files in folder of the current buffer
> > :!javac "%:p:h" . "/*.java" " javac path/name/to/current/buffer/directory/*.java
> >
> >
> > " run Main java file in that folder
> > :!java "%:p:h" . ".Main" " java path/name/to/current/buffer/directory.Main
> >
> > " delete all the .class files in that folder
> > :!rm "%:p:h" . ".class"
> >
> > " :echo "Done"
> > endfunc
>
> The solution of " :!java -cp %:p:h Main" did not work out.
>
> I think this might be because my java files all have the following line:
> Package myjavafiles;
>
> as of yet the only way I've found to compile and run it from the terminal (and not from vim)
> is by being in the parent directory of myjavafiles and doing:
>
> javac myjavafiles/*.java
> java myjavafiles.Main
>
> I've found that I can specify the directory of the java files I want to compile in the "javac" command. But when the "java" command will only work when I'm in the directory that has the folder of java files.
>
> I came to this conclusion after doing the following in vim from myjavafiles directory:
>
> // succesful
> : cd ..
> : !javac myjavafiles/*.java
> : !java myjavafiles.Main
>
> // not successful
> : !javac *.java <---worked
> : !java Main <----did not work
>
> // suprisingly not successful
> : cd ..
> : !javac myjavafiles/*.java
> : !java ~/path/to/myjavafiles.Main
>
> Because of these tests I think that perhaps I need to change directories to compile. But I'm not sure how to get only the folder name "myjavafiles" instead of the whole path.

Try %:p:h:t to get just 'myjavafiles'.

The help for %'s modifiers is can be accessed at :help
filename-modifiers.

--
Eric Christopherson

--
--
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.

Channels and REPL (racket)

Hi,

since a long time SLIME on Emacs is THE solution
for developers using Lisp like languages.
Similiar solutions are available for vim.

Now, with the new features of vim80 (channels
for example), is it possible to use those for
connecting to a REPL and feed input and outout
to and from it...or did I understand channels
wrong?
;)

Cheers,
Meino


--
--
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: Compile and Run Java Projects

On Monday, October 17, 2016 at 6:08:35 PM UTC-4, Luis Henriquez-Perez wrote:
> I am using vim to code my java projects. I've been noticing I've been jumping back to the terminal a lot to compile and run my code. So I want to create a function that does all this for me (and gets rid of the class files afterwards). The code below is my attempt. Could someone let me know how I can fix my code?
>
> func! CompileFolderJava()
>
> " compile all java files in folder of the current buffer
> :!javac "%:p:h" . "/*.java" " javac path/name/to/current/buffer/directory/*.java
>
>
> " run Main java file in that folder
> :!java "%:p:h" . ".Main" " java path/name/to/current/buffer/directory.Main
>
> " delete all the .class files in that folder
> :!rm "%:p:h" . ".class"
>
> " :echo "Done"
> endfunc

The solution of " :!java -cp %:p:h Main" did not work out.

I think this might be because my java files all have the following line:
Package myjavafiles;

as of yet the only way I've found to compile and run it from the terminal (and not from vim)
is by being in the parent directory of myjavafiles and doing:

javac myjavafiles/*.java
java myjavafiles.Main

I've found that I can specify the directory of the java files I want to compile in the "javac" command. But when the "java" command will only work when I'm in the directory that has the folder of java files.

I came to this conclusion after doing the following in vim from myjavafiles directory:

// succesful
: cd ..
: !javac myjavafiles/*.java
: !java myjavafiles.Main

// not successful
: !javac *.java <---worked
: !java Main <----did not work

// suprisingly not successful
: cd ..
: !javac myjavafiles/*.java
: !java ~/path/to/myjavafiles.Main

Because of these tests I think that perhaps I need to change directories to compile. But I'm not sure how to get only the folder name "myjavafiles" instead of the whole path.

--
--
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: Compile and Run Java Projects

On Mon, Oct 17, 2016, Luis Henriquez-Perez wrote:
> On Monday, October 17, 2016 at 6:08:35 PM UTC-4, Luis Henriquez-Perez wrote:
> > I am using vim to code my java projects. I've been noticing I've been jumping back to the terminal a lot to compile and run my code. So I want to create a function that does all this for me (and gets rid of the class files afterwards). The code below is my attempt. Could someone let me know how I can fix my code?
> >
> > func! CompileFolderJava()
> >
> > " compile all java files in folder of the current buffer
> > :!javac "%:p:h" . "/*.java" " javac path/name/to/current/buffer/directory/*.java
> >
> >
> > " run Main java file in that folder
> > :!java "%:p:h" . ".Main" " java path/name/to/current/buffer/directory.Main
> >
> > " delete all the .class files in that folder
> > :!rm "%:p:h" . ".class"
> >
> > " :echo "Done"
> > endfunc
>
> I managed to get the compiling and the removing to work. For running, I think I have to be in the parent directory of the file. The format needs to be: java ParentDir.Main

Well, what's going wrong with it? I would suggest, though, that instead
of changing directories you use the classpath (-cp) option to tell Java
where to find the Main class. E.g.

:!java -cp %:p:h Main

>
> func! CompileFolderJava()
> " compile all java files in folder
> :!javac %:p:h/*.java
>
> " a java thing I have to be in this directory to call java main
> :cd ..
> " run all the java files in folder
> :!java %:h.Main
>
> " delete all the .class files in folder
> :!rm %:p:h/*.class
>
> " :echo "hello"
> endfunc

--
Eric Christopherson

--
--
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: Compile and Run Java Projects

On Monday, October 17, 2016 at 6:08:35 PM UTC-4, Luis Henriquez-Perez wrote:
> I am using vim to code my java projects. I've been noticing I've been jumping back to the terminal a lot to compile and run my code. So I want to create a function that does all this for me (and gets rid of the class files afterwards). The code below is my attempt. Could someone let me know how I can fix my code?
>
> func! CompileFolderJava()
>
> " compile all java files in folder of the current buffer
> :!javac "%:p:h" . "/*.java" " javac path/name/to/current/buffer/directory/*.java
>
>
> " run Main java file in that folder
> :!java "%:p:h" . ".Main" " java path/name/to/current/buffer/directory.Main
>
> " delete all the .class files in that folder
> :!rm "%:p:h" . ".class"
>
> " :echo "Done"
> endfunc

I managed to get the compiling and the removing to work. For running, I think I have to be in the parent directory of the file. The format needs to be: java ParentDir.Main

func! CompileFolderJava()
" compile all java files in folder
:!javac %:p:h/*.java

" a java thing I have to be in this directory to call java main
:cd ..
" run all the java files in folder
:!java %:h.Main

" delete all the .class files in folder
:!rm %:p:h/*.class

" :echo "hello"
endfunc

--
--
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.