Friday, June 30, 2017

Re: dbext version 20 does not prompt for connection profile

On Wednesday, October 30, 2013 at 8:23:15 AM UTC-7, David Fishburn wrote:
> On Tue, Oct 29, 2013 at 7:51 AM, NJia <jiana...@gmail.com> wrote:
>
> Hi Everyone
>
>
>
> I just upgraded my dbext plugin from version 19 to 20 but noticed that version 20 does not prompt for connection profiles any more.
>
>
>
> I have two MYSQL connection defined in my .vimrc when I type "\slt"  v19 asks me which connection profile I want to use.
>
>
>
> But version 20 just display an error message "dbext:A valid database type must be chosen", I have to issue command "\sbp" to select the connection first.
>
>
>
> anyway to change this in version 20 ?
>
>
>
>
> Assuming you have 2 profiles defined in your .vimrc:
>
>
>
> let g:dbext_default_profile_A = 'type=ASA:dsnname=cons'
>
> let g:dbext_default_profile_B = 'type=ASA:dsnname=cons_prime'
>
>
> Hmmm, I believe if you define:
>
> let g:dbext_default_profile = 'A'
>
>
>
> Then run your \slt this might pick up the A profile first.
>
>
> Please let me know.
>
>
> Thanks for the report, I will look into the issue.
>
>
> David


Hi All,

I have just discovered this old post but have run into the same problem with version 23.00 (just installed for the first time). The functionality works fine if I set a default profile but it will connect only to that default and I am not prompted to choose among the several profiles that I have included in my vimrc. Was this resolved?

Otherwise, this is quite possibly the greatest vim package in existence.


Thanks,
Steve

--
--
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: Failing to do an install in $HOME from git

On 2017-06-30 15:30, Tim Chase wrote:
> On 2017-06-30 22:04, Christian Brabandt wrote:
> > The last line, if run successfully, should show this:
> > ...
> > checking whether we need -D_FORTIFY_SOURCE=1... yes
> > checking linker --as-needed support... yes
> > configure: updating cache auto/config.cache
> > configure: creating auto/config.status
> > config.status: creating auto/config.mk
> > config.status: creating auto/config.h
> >
> > You might want to check the log file, something is wrong here.
> > Perhaps you are missing some packages? Did you try running
> > apt-get build-dep vim-nox
>
> Yes, I've got the build-dep for vim-nox installed, and I see the
> line (as quoted previously) about "creating auto/config.h" but no
> file appears there.

Though I do get one extra line after the "creating auto/config.h"
line:

config.status: auto/config.h is unchanged

I'm not sure how it's determining that, as there's no auto/config.h
file present to compare it to.

-tim


--
--
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: Failing to do an install in $HOME from git

On 2017-06-30 22:04, Christian Brabandt wrote:
> The last line, if run successfully, should show this:
> ...
> checking whether we need -D_FORTIFY_SOURCE=1... yes
> checking linker --as-needed support... yes
> configure: updating cache auto/config.cache
> configure: creating auto/config.status
> config.status: creating auto/config.mk
> config.status: creating auto/config.h
>
> You might want to check the log file, something is wrong here.
> Perhaps you are missing some packages? Did you try running
> apt-get build-dep vim-nox

Yes, I've got the build-dep for vim-nox installed, and I see the line
(as quoted previously) about "creating auto/config.h" but no file
appears there.

[scratches head]

Thanks for helping me through this,

-tim


--
--
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: Failing to do an install in $HOME from git

P.S. After a failed configure, or after installing additional software
packages, you may want to run "make reconfig" (with configure settings
in the environment) in order to discard whatever was left over from
the previous configure run. This particular make target runs configure
first from a clean slate, and then proceeds to compile and link if the
configure step doesn't end in an error.

Best regards,
Tony.

On Fri, Jun 30, 2017 at 10:18 PM, Tony Mechelynck
<antoine.mechelynck@gmail.com> wrote:
> See also http://users.skynet.be/antoine.mechelynck/vim/compunix.htm
> it is written for Mercurial but you should have no difficulty adapting
> it for git. Beware of false friends however: "hg fetch" corresponds to
> "git pull" and vice-versa, and their options may be different. Apart
> from getting the sources, the rest, and in particular the necessity of
> installing all relevant "development" packages from your distro, and
> how to always set consistent configure settings by means of
> environment variables, is common to all Unix-like systems. (Depending
> on what was updated since last time, a plain [supposedly incremental]
> "make" run may sometimes decide that a configure run is needed before
> compiling, and you will want to be ready for that eventuality.)
>
> 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: Failing to do an install in $HOME from git

See also http://users.skynet.be/antoine.mechelynck/vim/compunix.htm
it is written for Mercurial but you should have no difficulty adapting
it for git. Beware of false friends however: "hg fetch" corresponds to
"git pull" and vice-versa, and their options may be different. Apart
from getting the sources, the rest, and in particular the necessity of
installing all relevant "development" packages from your distro, and
how to always set consistent configure settings by means of
environment variables, is common to all Unix-like systems. (Depending
on what was updated since last time, a plain [supposedly incremental]
"make" run may sometimes decide that a configure run is needed before
compiling, and you will want to be ready for that eventuality.)

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: Failing to do an install in $HOME from git

On Fr, 30 Jun 2017, Tim Chase wrote:

> On 2017-06-30 21:43, Christian Brabandt wrote:
> > On Fr, 30 Jun 2017, Tim Chase wrote:
> >
> > > I just pulled down a clone of the git repo, modified src/Makefile
> > > to point `prefix` at $HOME/local but when I go to build, it
> > > complains that it can't find auto/config.h but as far as I can
> > > tell, I'm doing everything according to the install-from-source
> > > instructions in usr_90:
> > >
> > > $ git clone https://github.com/vim/vim.git
> > > $ cd vim/src
> > > $ sed -i '/^#prefix/{s/^#//;s@$@/local@}' Makefile
> > > $ mkdir -p $HOME/local/
> > > $ make
> > > :
> > > :
> > > configure: creating auto/config.status
> > > config.status: creating auto/config.mk
> > > config.status: creating auto/config.h
> > > config.status: auto/config.h is unchanged
> > > make: *** No rule to make target 'auto/config.h', needed by
> > > 'objects/arabic.o'. Stop.
> >
> > You need to run configure. I usually do something like this:
> > ,----
> > | ./configure --with-features=huge --enable-luainterp
> > | --enable-python3interp --enable-pythoninterp
> > |
> > --with-python3-config-dir=/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu
> > | --enable-gui=no --prefix=/home/chrisbra/local `----
>
> I tried your suggestion (I don't need other language interpreters for
> my testing)
>
> $ git clean -xf # reset back to fresh repo status
>
> $ ./configure --with-features=huge --enable-gui=no --prefix=$HOME/local

The last line, if run successfully, should show this:
...
checking whether we need -D_FORTIFY_SOURCE=1... yes
checking linker --as-needed support... yes
configure: updating cache auto/config.cache
configure: creating auto/config.status
config.status: creating auto/config.mk
config.status: creating auto/config.h

You might want to check the log file, something is wrong here.
Perhaps you are missing some packages? Did you try running
apt-get build-dep vim-nox

Best,
Christian
--
Oliver's Gesetz:
Erfahrung ist etwas, was man erst unmittelbar nachdem man es brauchte
bekommen kann.

--
--
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: Failing to do an install in $HOME from git

On 2017-06-30 21:43, Christian Brabandt wrote:
> On Fr, 30 Jun 2017, Tim Chase wrote:
>
> > I just pulled down a clone of the git repo, modified src/Makefile
> > to point `prefix` at $HOME/local but when I go to build, it
> > complains that it can't find auto/config.h but as far as I can
> > tell, I'm doing everything according to the install-from-source
> > instructions in usr_90:
> >
> > $ git clone https://github.com/vim/vim.git
> > $ cd vim/src
> > $ sed -i '/^#prefix/{s/^#//;s@$@/local@}' Makefile
> > $ mkdir -p $HOME/local/
> > $ make
> > :
> > :
> > configure: creating auto/config.status
> > config.status: creating auto/config.mk
> > config.status: creating auto/config.h
> > config.status: auto/config.h is unchanged
> > make: *** No rule to make target 'auto/config.h', needed by
> > 'objects/arabic.o'. Stop.
>
> You need to run configure. I usually do something like this:
> ,----
> | ./configure --with-features=huge --enable-luainterp
> | --enable-python3interp --enable-pythoninterp
> |
> --with-python3-config-dir=/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu
> | --enable-gui=no --prefix=/home/chrisbra/local `----

I tried your suggestion (I don't need other language interpreters for
my testing)

$ git clean -xf # reset back to fresh repo status

$ ./configure --with-features=huge --enable-gui=no --prefix=$HOME/local

$ ls -1 $VIMSRC/src/auto/
config.cache
config.log
config.mk
config.status
configure

$ make
Starting make in the src directory.
If there are problems, cd to the src directory and run make there
cd src && make first
make[1]: Entering directory '/home/demo/vim/src'
make[1]: *** No rule to make target 'auto/config.h', needed by 'objects/arabic.o'. Stop.
make[1]: Leaving directory '/home/demo/vim/src'
Makefile:26: recipe for target 'first' failed
make: *** [first] Error 2



Still no config.h in the src/auto/ directory, and `make` still fails
with the same error (regardless of whether I issue `make` from
$VIMSRC or $VIMSRC/src).

-tim



--
--
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: Failing to do an install in $HOME from git

On Fr, 30 Jun 2017, Tim Chase wrote:

> I just pulled down a clone of the git repo, modified src/Makefile to
> point `prefix` at $HOME/local but when I go to build, it complains
> that it can't find auto/config.h but as far as I can tell, I'm doing
> everything according to the install-from-source instructions in
> usr_90:
>
> $ git clone https://github.com/vim/vim.git
> $ cd vim/src
> $ sed -i '/^#prefix/{s/^#//;s@$@/local@}' Makefile
> $ mkdir -p $HOME/local/
> $ make
> :
> :
> configure: creating auto/config.status
> config.status: creating auto/config.mk
> config.status: creating auto/config.h
> config.status: auto/config.h is unchanged
> make: *** No rule to make target 'auto/config.h', needed by
> 'objects/arabic.o'. Stop.

You need to run configure. I usually do something like this:
,----
| ./configure --with-features=huge --enable-luainterp
| --enable-python3interp --enable-pythoninterp
| --with-python3-config-dir=/usr/lib/python3.4/config-3.4m-x86_64-linux-gnu
| --enable-gui=no --prefix=/home/chrisbra/local
`----

I think one can also export those variables into the shell. (Look into
how the travis CI script builds Vim). But I usually don't bother,
because I let my shell give me the last configure call.

Best,
Christian
--
Es läßt den Bauern gar nicht ruh'n, wenn die Hähne morgens muh'n.

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

Failing to do an install in $HOME from git

I just pulled down a clone of the git repo, modified src/Makefile to
point `prefix` at $HOME/local but when I go to build, it complains
that it can't find auto/config.h but as far as I can tell, I'm doing
everything according to the install-from-source instructions in
usr_90:

$ git clone https://github.com/vim/vim.git
$ cd vim/src
$ sed -i '/^#prefix/{s/^#//;s@$@/local@}' Makefile
$ mkdir -p $HOME/local/
$ make
:
:
configure: creating auto/config.status
config.status: creating auto/config.mk
config.status: creating auto/config.h
config.status: auto/config.h is unchanged
make: *** No rule to make target 'auto/config.h', needed by
'objects/arabic.o'. Stop.

When I check, there's no auto/config.h file generated by the
configure process, so of course objects/arabic.o can't be built if
it requires auto/config.h to continue. Attempting `touch
auto/config.h` doesn't seem to net me any progress. I find a
config.h.in file but figured `configure` (or `make`) should be using
this file to generate auto/config.h

What am I missing?

This is on Debian Stretch (9.0) if that makes a difference.

Thanks,

-tim




--
--
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: [netrw] Netrw bugs on gvim for windows

skywind3000 wrote:
> Does anyone knows how to contact DrChip ?
> His email is invalid now.
>
My email is and has been "valid". Did you happen to neglect to remove
the NOSPAM embedded therein?

Regards,
Chip Campbell

--
--
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: problems (and bugs) with netrw

Hi, DrChip

I have encountered a serious netrw bug on windows:
https://groups.google.com/forum/#!topic/vim_use/45FO_l_QakM

I don't know how to contact you, your email is invalid now.

Will you please have a look at it ? thanks

--
--
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: [netrw] Netrw bugs on gvim for windows

Does anyone knows how to contact DrChip ?
His email is invalid now.

--
--
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, June 29, 2017

[netrw] Netrw bugs on gvim for windows

reporting a netrw bug in the latest version v164:

system: windows 7 64 bits
vim version: gvim 8.0.636
netrw version with wrong behavior: maybe from v160 - v164

step to reproduce:
1. open a new gvim
2. ":help index" to show a help window
3. ":vs C:/Windows" to split a vertical netrw window
4. selet a directory and press ENTER.

expected behavior:
netrw on the right window should enter the directory.

actually behavior:
netrw entered the directory, but the help window on the left had been closed by netrw.

some screen captures (see the attachments):

netrw-error-1.png: before enter the directory
netrw-error-2.png: entered the new directory, but the help windows has been closed by netrw (v164)
netrw-error-3.png: netrw v156 works fine, the help window hasn't been closed.


1. the vim builtin netrw (v156) works fine, but the latest version does not.
2. but thay are both ok on the linux.

I want to upgrade my netrw from v156 to v164, but this bug prevents me from upgrading.

thanks

--
--
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: Trouble downloading VIm via FTP (MS Edge)

On Thu, Jun 29, 2017 at 11:07 PM, Andrew Pennebaker
<andrew.pennebaker@gmail.com> wrote:
> The ftp://ftp.vim.org/pub/vim/pc/gvim80-586.exe URL for downloading Vim
> doesn't play well with modern Web browsers like Edge, which now limit FTP
> support.
>
> Could we move Vim installation media to HTTP hosts, to make it easier for
> newbies to access these files?
>
> --
> Cheers,
> Andrew

It already is on an HTTP host: in fact, ftp.vim.org responds to both
HTTP queries on the HTTP port and to FTP queries on the FTP port.
Simply replace ftp:// by http:// at the start of the URL you gave (and
of any other ones for the same host), leaving ftp.vim.org etc.
unchanged after the double slash, and you'll get Vim over HTTP.

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: vi.bat helper

2017-06-30 0:16 GMT+03:00 Andrew Pennebaker <andrew.pennebaker@gmail.com>:
> The Vim installer for Windows helps to add "vim" to the command PATH by
> adding a vim.bat file in C:\Windows. Could the installer also add a vi.bat
> file, so that developers can invoke Vim by the even shorter command "vi"?
>
> vi.bat:
>
> vim %*
>
> Cheers,
> Andrew

Those who need it can do same thing themselves. One letter is not
actually hard to type and `vi` has its own meaning, mostly "tiny
version of Vim" (in Debian-based) or "featureless Vi-like editor"
(i.e. busybox `vi` applet) now.

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

vi.bat helper

The Vim installer for Windows helps to add "vim" to the command PATH by adding a vim.bat file in C:\Windows. Could the installer also add a vi.bat file, so that developers can invoke Vim by the even shorter command "vi"?

vi.bat:

vim %*

Cheers,
Andrew

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

Trouble downloading VIm via FTP (MS Edge)

The ftp://ftp.vim.org/pub/vim/pc/gvim80-586.exe URL for downloading Vim doesn't play well with modern Web browsers like Edge, which now limit FTP support.

Could we move Vim installation media to HTTP hosts, to make it easier for newbies to access these files?

--
Cheers,
Andrew

--
--
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, June 25, 2017

Weird perl message started . .

People,

I am not sure what I did to my setup - and renaming my .vimrc file made
no difference but when I did:

$ vim t

I got:

Can't locate bignum.pm in @INC (you may need to install the bignum
module) (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5
/usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl
/usr/lib64/perl5 /usr/share/perl5 .) at (eval 8) line 161.
BEGIN failed--compilation aborted at (eval 8) line 161.
Press ENTER or type command to continue

As root I installed the perl.bignum module and the problem went away -
but why did it start happening? Why is vim calling perl somehow?

Thanks,

Phil.
--
Philip Rhoades

PO Box 896
Cowra NSW 2794
Australia
E-mail: phil@pricom.com.au

--
--
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, June 23, 2017

Re: Vim-script: How to produce an error if there is semicolon in buffer?

Christian,
thanks a lot for you help. It works excellent. I just replaced the "echo" part to get an error in red color.

if search(';', 'nw') > 0
echohl Error
echomsg "Warning. Semicolon in file."
echohl None
finish
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.

Re: Vim-script: How to produce an error if there is semicolon in buffer?

On Fr, 23 Jun 2017, Igor Forca wrote:

> Hi,
> using Vim 8 on Windows 7. I have written simple script that does some janitor in my config files. Tiding works fine.
>
> I execute this script by executing keyboard shortcut: leader + r
> So the following is in my vimrc file:
> :nnoremap <leader>r :source $HOME\vimfiles\myscript.vim<CR>
>
> In myscript.vim is all of the janitor work.
>
> So far no problem. Now what I see if there is a semicolon (one or many) in my current buffer, then janitor work (executing myscript.vim) should not be performed.
>
> How to do something like:
> if semicolon-in-my-file == true
> then in-status-bar-report-an-error and exit myscript.vim
> else execute the rest of the myscript.vim to do the janitor work.

At the beginning of your myscript.vim put something like

if search(';', 'nw') > 0
echomsg "Warning HERE"
finish
endif


You could also use :echoerr


Best,
Christian
--
Nehmen Sie die Menschen, wie sie sind, andere gibt's nicht.
-- Konrad Adenauer

--
--
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-script: How to produce an error if there is semicolon in buffer?

Hi,
using Vim 8 on Windows 7. I have written simple script that does some janitor in my config files. Tiding works fine.

I execute this script by executing keyboard shortcut: leader + r
So the following is in my vimrc file:
:nnoremap <leader>r :source $HOME\vimfiles\myscript.vim<CR>

In myscript.vim is all of the janitor work.

So far no problem. Now what I see if there is a semicolon (one or many) in my current buffer, then janitor work (executing myscript.vim) should not be performed.

How to do something like:
if semicolon-in-my-file == true
then in-status-bar-report-an-error and exit myscript.vim
else execute the rest of the myscript.vim to do the janitor work.

Thanks

--
--
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, June 22, 2017

Re: Is there any way to update a buffer in the background?

On Di, 14 Mär 2017, Yegappan Lakshmanan wrote:

> On Tue, Mar 14, 2017 at 2:41 PM, Christian Brabandt <cblists@256bit.org> wrote:
> > We already have getbufline() but are missing setbufline()
>
> I submitted a patch back in 2003 to add the setbufline() function.
> Refer to the following e-mail threads:
>
> https://marc.info/?l=vim-dev&m=104308972718854&w=3
> http://vim.1045645.n5.nabble.com/Re-missing-setbufline-td1200781.html
>
> But there were problems in changing the lines in a buffer. So this was
> not incorporated at that time.
>
> Looking at the latest todo.txt, I see the following patches:
>
> Patch to add setbufline(). (email from Yasuhiro Matsumoto, patch by Ozaki
> Kiichi, 2016 Feb 28)
> Update Mar 8: https://gist.github.com/mattn/23c1f50999084992ca98
> Update Mar 13: https://gist.github.com/mattn/23c1f50999084992ca98

It would be great, if this could be merged. Note, I haven't checked the
patch, however I notice that when using job_start(cmd, 'out_buf': bufnr)
it does already update a buffer even if the cursor is on a different
buffer. So it looks like it shouldn't be too hard to have the same
functionality in a new setbufline() vimscript function available.

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.

Re: vim readonly, scrolloff=5

On 2017-06-21, lothar atheling wrote:
> when i run "view", i always have,
> scrolloff=5
> i have put
> :set scrolloff=0
>
> in my $HOME/.vimrc
>
> my questions are:
>
> 1) why is my .vimrc file being overridden?
> 2) where is scrolloff being set?

:verbose set scrolloff?

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.

Wednesday, June 21, 2017

vim readonly, scrolloff=5

when i run "view", i always have,
scrolloff=5
i have put
:set scrolloff=0

in my $HOME/.vimrc

my questions are:

1) why is my .vimrc file being overridden?
2) where is scrolloff being set?

$ vi --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Feb 15 2017 20:44:18)
Included patches: 1-329
Modified by <cygwin@cygwin.com>
Compiled by <cygwin@cygwin.com>

--
http://www.fastmail.com - Access your email from home and the web

--
--
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: measure time betwween two normal commands

Great, thanks!  For help and method.


Le 21 juin 2017 23:10, "Bram Moolenaar" <Bram@moolenaar.net> a écrit :

Ni Va wrote:

> > > Since some days, I notice that time to reach next occurence of a
> > > search  take time.
> > >
> > > search foo
> > >
> > > n(ext) >>> here I see 1 or 2 seconds to jump to the occurence.
> > >
> > > How can I find the plugin, measure by profile before and after n command?
> >
> > I added more places to check for a timeout.  Esp. check if resetting
> > 'hlsearch' helps.
> >
> > To measure time:
> >
> >     let start = reltime()
> >     normal n
> >     echomsg 'elapsed: ' . string(reltimefloat(reltime(start)))
> >
> > If you have a specfic pattern and text on which it is slow, please let
> > me know so that I can run the profiler with it.
> >
> > --
> > hundred-and-one symptoms of being an internet addict:
> > 52. You ask a plumber how much it would cost to replace the chair in front of
> >     your computer with a toilet.
> >
> >  /// 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    ///
>
> Hi Bram,
>
> No specific pattern, it can be "set", "let", "foo", "bar".
>
> Effectively, reltime can help me to measure time but how to proceed to find which plugin, ftdetect, ftplugin slows this command ?

First thing I would do is find out if it is the search (unlikely) or
something related to redrawing the window (most likely).  You can find
out by searching for something that's already visible (no redraw) and
something that's further away (requires a redraw).

For the redraw, it can be syntax highlighting, folding, etc.

But keep in mind I changed the way timeouts are done in the regexp code,
if this checks the current time too often it will add overhead.  I would
need an example to figure out the balance between not timing out soon
and checking too often.

--
"I simultaneously try to keep my head in the clouds and my feet on the
ground.  Sometimes it's a stretch, though."              -- Larry Wall

 /// 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: measure time betwween two normal commands

Ni Va wrote:

> > > Since some days, I notice that time to reach next occurence of a
> > > search take time.
> > >
> > > search foo
> > >
> > > n(ext) >>> here I see 1 or 2 seconds to jump to the occurence.
> > >
> > > How can I find the plugin, measure by profile before and after n command?
> >
> > I added more places to check for a timeout. Esp. check if resetting
> > 'hlsearch' helps.
> >
> > To measure time:
> >
> > let start = reltime()
> > normal n
> > echomsg 'elapsed: ' . string(reltimefloat(reltime(start)))
> >
> > If you have a specfic pattern and text on which it is slow, please let
> > me know so that I can run the profiler with it.
> >
> > --
> > hundred-and-one symptoms of being an internet addict:
> > 52. You ask a plumber how much it would cost to replace the chair in front of
> > your computer with a toilet.
> >
> > /// 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 ///
>
> Hi Bram,
>
> No specific pattern, it can be "set", "let", "foo", "bar".
>
> Effectively, reltime can help me to measure time but how to proceed to find which plugin, ftdetect, ftplugin slows this command ?

First thing I would do is find out if it is the search (unlikely) or
something related to redrawing the window (most likely). You can find
out by searching for something that's already visible (no redraw) and
something that's further away (requires a redraw).

For the redraw, it can be syntax highlighting, folding, etc.

But keep in mind I changed the way timeouts are done in the regexp code,
if this checks the current time too often it will add overhead. I would
need an example to figure out the balance between not timing out soon
and checking too often.

--
"I simultaneously try to keep my head in the clouds and my feet on the
ground. Sometimes it's a stretch, though." -- Larry Wall

/// 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: measure time betwween two normal commands

Le mardi 20 juin 2017 22:49:42 UTC+2, Ni Va a écrit :
> Le mardi 20 juin 2017 22:40:24 UTC+2, Bram Moolenaar a écrit :
> > Ni Va wrote:
> >
> > > Since some days, I notice that time to reach next occurence of a
> > > search take time.
> > >
> > > search foo
> > >
> > > n(ext) >>> here I see 1 or 2 seconds to jump to the occurence.
> > >
> > > How can I find the plugin, measure by profile before and after n command?
> >
> > I added more places to check for a timeout. Esp. check if resetting
> > 'hlsearch' helps.
> >
> > To measure time:
> >
> > let start = reltime()
> > normal n
> > echomsg 'elapsed: ' . string(reltimefloat(reltime(start)))
> >
> > If you have a specfic pattern and text on which it is slow, please let
> > me know so that I can run the profiler with it.
> >
> > --
> > hundred-and-one symptoms of being an internet addict:
> > 52. You ask a plumber how much it would cost to replace the chair in front of
> > your computer with a toilet.
> >
> > /// 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 ///
>
> Hi Bram,
>
> No specific pattern, it can be "set", "let", "foo", "bar".
>
> Effectively, reltime can help me to measure time but how to proceed to find which plugin, ftdetect, ftplugin slows this command ?
>
> Thank you

Ok found. the winner is this mapping:
" nnoremap noh :noh<cr> bad mapping

--
--
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, June 20, 2017

Re: measure time betwween two normal commands

Le mardi 20 juin 2017 22:40:24 UTC+2, Bram Moolenaar a écrit :
> Ni Va wrote:
>
> > Since some days, I notice that time to reach next occurence of a
> > search take time.
> >
> > search foo
> >
> > n(ext) >>> here I see 1 or 2 seconds to jump to the occurence.
> >
> > How can I find the plugin, measure by profile before and after n command?
>
> I added more places to check for a timeout. Esp. check if resetting
> 'hlsearch' helps.
>
> To measure time:
>
> let start = reltime()
> normal n
> echomsg 'elapsed: ' . string(reltimefloat(reltime(start)))
>
> If you have a specfic pattern and text on which it is slow, please let
> me know so that I can run the profiler with it.
>
> --
> hundred-and-one symptoms of being an internet addict:
> 52. You ask a plumber how much it would cost to replace the chair in front of
> your computer with a toilet.
>
> /// 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 ///

Hi Bram,

No specific pattern, it can be "set", "let", "foo", "bar".

Effectively, reltime can help me to measure time but how to proceed to find which plugin, ftdetect, ftplugin slows this command ?

Thank you

--
--
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: measure time betwween two normal commands

Ni Va wrote:

> Since some days, I notice that time to reach next occurence of a
> search take time.
>
> search foo
>
> n(ext) >>> here I see 1 or 2 seconds to jump to the occurence.
>
> How can I find the plugin, measure by profile before and after n command?

I added more places to check for a timeout. Esp. check if resetting
'hlsearch' helps.

To measure time:

let start = reltime()
normal n
echomsg 'elapsed: ' . string(reltimefloat(reltime(start)))

If you have a specfic pattern and text on which it is slow, please let
me know so that I can run the profiler with it.

--
hundred-and-one symptoms of being an internet addict:
52. You ask a plumber how much it would cost to replace the chair in front of
your computer with a toilet.

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

measure time betwween two normal commands

Hi,

Since some days, I notice that time to reach next occurence of a search take time.

search foo

n(ext) >>> here I see 1 or 2 seconds to jump to the occurence.

How can I find the plugin, measure by profile before and after n command?

Thank you

--
--
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, June 19, 2017

Re: decrease number?

Thanks Tim,

Johns did work exactly the way I wanted it to.

I like yours too.

On Mon, Jun 19, 2017 at 8:37 PM, Tim Chase <vim@tim.thechases.com> wrote:
On 2017-06-19 22:29, John Passaro wrote:
> use the expression register:
>
> s/\v\w+\="\zs\d\d+\ze"/\=submatch(0)-10/g

Beware that this catches any variable name (not just [xy][12] which
may or may not be what you want), and also doesn't catch
negative-number values.

But for the general case of the example you (OP) gave, John's works
well too.

-tim


--
--
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: decrease number?

On 2017-06-19 22:29, John Passaro wrote:
> use the expression register:
>
> s/\v\w+\="\zs\d\d+\ze"/\=submatch(0)-10/g

Beware that this catches any variable name (not just [xy][12] which
may or may not be what you want), and also doesn't catch
negative-number values.

But for the general case of the example you (OP) gave, John's works
well too.

-tim


--
--
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: decrease number?

On 2017-06-19 19:14, stosss wrote:
> <line x1="20" y1="45" x2="820" y2="45" stroke-width="1"
> stroke="#c0c0c0" />
>
> I want to change them like this:
>
> <line x1="10" y1="35" x2="810" y2="35" stroke-width="1"
> stroke="#c0c0c0" />
>
> The "ten" place holder needs to decrease by one.
> x1="20" y1="45" x2="820" y2="45"
>
> Can someone point me to something that would show me a fast way to
> do this?
>
> I am thinking some how I should be able to use CTRL-X in a search
> and replace but I don't know how to do it. I am guessing '\=' would
> be used. I really don't know how to put this together.

I'd go with your "\=" suggestion. Something like

:%s/\<[xy][12]="\zs[^"]*\ze"/\=submatch(0)-10/g

This only finds x1, x2, y1, and y2. You can relax the pattern a bit
if there are other variable-names in question.

-tim


--
--
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: decrease number?

Thank You John! Awesome!

On Mon, Jun 19, 2017 at 8:29 PM, John Passaro <john.a.passaro@gmail.com> wrote:
use the expression register:

s/\v\w+\="\zs\d\d+\ze"/\=submatch(0)-10/g



On Mon, Jun 19, 2017 at 9:59 PM, stosss <stosss@gmail.com> wrote:
Placing cursor on the number and typing 10CTRL-X reduces it by the desired amount but how do I do it in a search and replace pattern?

On Mon, Jun 19, 2017 at 7:14 PM, stosss <stosss@gmail.com> wrote:
I have several hundred lines like the one below:

<line x1="20"  y1="45"  x2="820" y2="45"  stroke-width="1" stroke="#c0c0c0" />

I want to change them like this:

<line x1="10"  y1="35"  x2="810" y2="35"  stroke-width="1" stroke="#c0c0c0" />

The "ten" place holder needs to decrease by one.
x1="20" y1="45" x2="820" y2="45"

Can someone point me to something that would show me a fast way to do this?

I am thinking some how I should be able to use CTRL-X in a search and replace but I don't know how to do it. I am guessing '\=' would be used. I really don't know how to put this together.

Thanks

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

--
--
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: decrease number?

use the expression register:

s/\v\w+\="\zs\d\d+\ze"/\=submatch(0)-10/g



On Mon, Jun 19, 2017 at 9:59 PM, stosss <stosss@gmail.com> wrote:
Placing cursor on the number and typing 10CTRL-X reduces it by the desired amount but how do I do it in a search and replace pattern?

On Mon, Jun 19, 2017 at 7:14 PM, stosss <stosss@gmail.com> wrote:
I have several hundred lines like the one below:

<line x1="20"  y1="45"  x2="820" y2="45"  stroke-width="1" stroke="#c0c0c0" />

I want to change them like this:

<line x1="10"  y1="35"  x2="810" y2="35"  stroke-width="1" stroke="#c0c0c0" />

The "ten" place holder needs to decrease by one.
x1="20" y1="45" x2="820" y2="45"

Can someone point me to something that would show me a fast way to do this?

I am thinking some how I should be able to use CTRL-X in a search and replace but I don't know how to do it. I am guessing '\=' would be used. I really don't know how to put this together.

Thanks

--
--
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: decrease number?

Placing cursor on the number and typing 10CTRL-X reduces it by the desired amount but how do I do it in a search and replace pattern?

On Mon, Jun 19, 2017 at 7:14 PM, stosss <stosss@gmail.com> wrote:
I have several hundred lines like the one below:

<line x1="20"  y1="45"  x2="820" y2="45"  stroke-width="1" stroke="#c0c0c0" />

I want to change them like this:

<line x1="10"  y1="35"  x2="810" y2="35"  stroke-width="1" stroke="#c0c0c0" />

The "ten" place holder needs to decrease by one.
x1="20" y1="45" x2="820" y2="45"

Can someone point me to something that would show me a fast way to do this?

I am thinking some how I should be able to use CTRL-X in a search and replace but I don't know how to do it. I am guessing '\=' would be used. I really don't know how to put this together.

Thanks

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

decrease number?

I have several hundred lines like the one below:

<line x1="20"  y1="45"  x2="820" y2="45"  stroke-width="1" stroke="#c0c0c0" />

I want to change them like this:

<line x1="10"  y1="35"  x2="810" y2="35"  stroke-width="1" stroke="#c0c0c0" />

The "ten" place holder needs to decrease by one.
x1="20" y1="45" x2="820" y2="45"

Can someone point me to something that would show me a fast way to do this?

I am thinking some how I should be able to use CTRL-X in a search and replace but I don't know how to do it. I am guessing '\=' would be used. I really don't know how to put this together.

Thanks

--
--
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, June 16, 2017

Re: begin end folding problem

On Thursday, June 15, 2017 at 3:29:32 PM UTC-5, Ni Va wrote:
> Hi,
>
>
> I'have got file content which is alike that:
>
>
> BEGIN
>
>
> SECTION
>
>
> SECTION
>
>
> SECTION
>
>
> END
>
>
> Would like to fold starting at SECTION line, ending at :
> - line before second to last SECTION
> - for the last SECTION, ending at line before END tag.
>
> How can I do that ?
> Thank you

Using 'foldexpr' you can start a new fold at a given level by returning ">1", ">2", etc. See :help 'foldexpr' and :help fold-expr.

So your foldexpr function would return ">1" or similar for any line containing "SECTION" (probably using getline() to get the line text). Once you reach END, return 0. On other lines you can probably return "=".

--
--
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: "gq" command always linebreak even if setting textwidth=0?

On Friday, June 16, 2017 at 8:45:14 AM UTC-5, Joey Ling wrote:
> I have set the textwidth as 0, wy "gq" command still add linebreak with some certain textwidth in the paragraph?

:help gq says:

"If the 'textwidth' option is 0, the formatted line length is the screen width (with a maximum width of 79)."

So that's what's happening. Why are you using the "gq" command if you don't want to format lines to a width?

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

"gq" command always linebreak even if setting textwidth=0?

I have set the textwidth as 0, wy "gq" command still add linebreak with some certain textwidth in the paragraph?

--
--
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, June 15, 2017

Re: begin end folding problem

If the text is literally as you describe:

:set foldmethod=manual or :set foldmethod=marker

gg  " go to beginning of file
3/SECTION  " takes you to the third SECTION
:1,-2fold       " creates a fold from first line to end of previous section
:.,$fold         " creates a fold from here to the end of the file

If you use foldmethod=manual, you'll have to use :session when exiting vim, otherwise the folds will be lost next time you open the file.

If you use foldmethod=marker, the markers will be stored directly in the text, which may or may not be acceptable for you depending on the nature of your document. This can be useful if you have a way to hide them from your audience (e.g. comment them out), or if your audience is willing to ignore them.


On Thu, Jun 15, 2017 at 4:29 PM, Ni Va <nivaemail@gmail.com> wrote:
Hi,


I'have got file content which is alike that:


BEGIN


SECTION


SECTION


SECTION


END


Would like to fold starting at SECTION line, ending at :
- line before second to last SECTION
- for the last SECTION, ending at line before END tag.

How can I do that ?
Thank you

--
--
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: How does vim choose a color that is not in the terminals color palette?

On Thu, Jun 15, 2017 at 1:17 PM, S. Jacobi <sjacobi@mailueberfall.de> wrote:
> On Wed, 14 Jun 2017 17:54:50 -0700 (PDT)
> Tony Mechelynck <antoine.mechelynck@gmail.com> wrote:
>
>> On Thursday, June 15, 2017 at 2:35:39 AM UTC+2, S. Jacobi wrote:
>> > I am using termite as my terminal emulator, which advertises 256
>> > colors support via terminfo. I only defined 20 colors: fg, fg_bold,
>> > bg, cursor and the 16 colors in their normal and bright variants.
>> > I do not use a vim colorscheme, just the terminal colors. In some
>> > shell scripts I see colors that I have not defined and which are
>> > not affected if I change my color palette. So my question is: How
>> > are those colors determined and how can I change them?
>> >
>> > How to reproduce:
>> > 1) set t_Co=256 in vimrc (if it is set to 16 those "new" colors do
>> > not appear)
>> > 2) I set all 16 colors in my termite config file to #ff0000 (to
>> > oberserve the changes)
>> > 3) Minimal shell script:
>> > #/bin/bash
>> > $testvar=1
>> > cd dir
>> > ./command --help
>> > 4) $testvar is in cyan, --help is in some pinkish color
>> >
>> > I haven't tested setting all 256 colors in my config file to red, if
>> > this affects those two cases I found.
>> >
>> > Kind regards
>>
>> First, check that Vim knows that yout terminal allows 256 colors:
>>
>> :set t_Co?
>>
>> The answer should be
>>
>> t_Co=256
>>
>> If it isn't, and you know that your current console _does_ support
>> 256 colors, you can set it. Even in your vimrc if you know how to
>> identify that terminal (as opposed to a dumb 16-color text console)
>> at startup, e.g. from its 'term' value.
>>
>> Then, if you don't want to bother to identify where (at which
>> ordinal) in the terminal palette a certain pink or green or whichever
>> color is found, I recommend to use gui-like settings in the cterm.
>> There are two ways to do that:
>>
>> a) (easiest)
>> if has('termguicolors')
>> set termguicolors
>> endif
>>
>> b) to use guifg= guibg= in the cterm even with a gui-enabled Vim not
>> compiled with +termguicolors, you could also take advantage of the
>> CSApprox plugin, see
>> http://vim.wikia.com/wiki/Using_GUI_color_settings_in_a_terminal#Solution_2:_the_CSApprox_plugin
>>
>>
>> Best regards,
>> Tony.
>>
>
> Thanks for your answer. Me setting t_Co=256 in my vimrc was just
> keeping this line for testing purposes. If t_Co is not set at all, it
> is set automatically to 256 because this is what termite adertises via
> terminfo. I can manually force it to 16 so the "extra" colors are not
> used.
> My vim was not compiled with the termguicolors feature, so I don't know
> if b) applies here, too.

The CSApprox plugin was written before the +termguicolors feature was
even invented. It applies regardless of its presence, in any Vim
version which can remember GUI highlight settings while running in the
console. I tried to find out which Vim version this means but failed.
If when running Vim in a console and setting both (gui= guibg= guifg=
guisp= ) and (cterm= ctermfg= ctermbg= ) parts of the :highlight
command they are both remembered, then you should be all right.

> But I am actually interested in the internals. Is there a way to find
> the color index without manually checking color16 to color 255? Or
> even a comprehensive list of all uses of colorX with X > 15? No vim
> color scheme is used.

From the CSApprox plugin help:
[...]
Also, there are at least three different 256-color palettes in use. Nearly
all terminals use an xterm-compatible palette, so most users need not concern
themselves with this, with only two exceptions: Eterm uses a slightly
different palette, and older Konsole (pre KDE 2.2.0) used a third palette.
CSApprox has no reliable way to tell which palette your terminal uses, so it
makes some educated guesses:
[...]

There is also a "colortest" plugin, see ":help colortest.vim" — but by
default it will display the basic bg & fg colors by setting special
highlight groups to them. Vim cannot define anywhere near 16777216²,
or even 256², highlight groups at the same time so it is not possible
to get a list of all possible combinations displayed. IIUC the 256
colors are subdivided in 3 categories:
- Colors 0 to 0x0F are the colors used by 16-color terminals
- 216 (i.e. 6³) positions are used for the so-called "safe" colors,
i.e. those of the 16777216 for which the red, green and blue settings
are each (separately) a multiple of 0x33, namely one of {0x00, 0x33,
0x66, 0x99, 0xCC, 0xFF} for red, one of the same list for green and
one of the same list for blue.
- The rest (24 positions) are additional greyscale values.

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.

begin end folding problem

Hi,


I'have got file content which is alike that:


BEGIN


SECTION


SECTION


SECTION


END


Would like to fold starting at SECTION line, ending at :
- line before second to last SECTION
- for the last SECTION, ending at line before END tag.

How can I do that ?
Thank you

--
--
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 does vim choose a color that is not in the terminals color palette?

On Mi, 14 Jun 2017, S. Jacobi wrote:

> I am using termite as my terminal emulator, which advertises 256 colors
> support via terminfo. I only defined 20 colors: fg, fg_bold, bg, cursor
> and the 16 colors in their normal and bright variants.
> I do not use a vim colorscheme, just the terminal colors. In some shell
> scripts I see colors that I have not defined and which are not affected
> if I change my color palette. So my question is: How are those colors
> determined and how can I change them?
>
> How to reproduce:
> 1) set t_Co=256 in vimrc (if it is set to 16 those "new" colors do not
> appear)
> 2) I set all 16 colors in my termite config file to #ff0000 (to
> oberserve the changes)
> 3) Minimal shell script:
> #/bin/bash
> $testvar=1
> cd dir
> ./command --help
> 4) $testvar is in cyan, --help is in some pinkish color
>
> I haven't tested setting all 256 colors in my config file to red, if
> this affects those two cases I found.

I think those are hard coded default values see syntax/syncolor.vim

Best,
Christian
--
F: Was ist orange und bohrt sich in die Wand?
A: Eine BOrange!

--
--
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 does vim choose a color that is not in the terminals color palette?

On Wed, 14 Jun 2017 17:54:50 -0700 (PDT)
Tony Mechelynck <antoine.mechelynck@gmail.com> wrote:

> On Thursday, June 15, 2017 at 2:35:39 AM UTC+2, S. Jacobi wrote:
> > I am using termite as my terminal emulator, which advertises 256
> > colors support via terminfo. I only defined 20 colors: fg, fg_bold,
> > bg, cursor and the 16 colors in their normal and bright variants.
> > I do not use a vim colorscheme, just the terminal colors. In some
> > shell scripts I see colors that I have not defined and which are
> > not affected if I change my color palette. So my question is: How
> > are those colors determined and how can I change them?
> >
> > How to reproduce:
> > 1) set t_Co=256 in vimrc (if it is set to 16 those "new" colors do
> > not appear)
> > 2) I set all 16 colors in my termite config file to #ff0000 (to
> > oberserve the changes)
> > 3) Minimal shell script:
> > #/bin/bash
> > $testvar=1
> > cd dir
> > ./command --help
> > 4) $testvar is in cyan, --help is in some pinkish color
> >
> > I haven't tested setting all 256 colors in my config file to red, if
> > this affects those two cases I found.
> >
> > Kind regards
>
> First, check that Vim knows that yout terminal allows 256 colors:
>
> :set t_Co?
>
> The answer should be
>
> t_Co=256
>
> If it isn't, and you know that your current console _does_ support
> 256 colors, you can set it. Even in your vimrc if you know how to
> identify that terminal (as opposed to a dumb 16-color text console)
> at startup, e.g. from its 'term' value.
>
> Then, if you don't want to bother to identify where (at which
> ordinal) in the terminal palette a certain pink or green or whichever
> color is found, I recommend to use gui-like settings in the cterm.
> There are two ways to do that:
>
> a) (easiest)
> if has('termguicolors')
> set termguicolors
> endif
>
> b) to use guifg= guibg= in the cterm even with a gui-enabled Vim not
> compiled with +termguicolors, you could also take advantage of the
> CSApprox plugin, see
> http://vim.wikia.com/wiki/Using_GUI_color_settings_in_a_terminal#Solution_2:_the_CSApprox_plugin
>
>
> Best regards,
> Tony.
>

Thanks for your answer. Me setting t_Co=256 in my vimrc was just
keeping this line for testing purposes. If t_Co is not set at all, it
is set automatically to 256 because this is what termite adertises via
terminfo. I can manually force it to 16 so the "extra" colors are not
used.
My vim was not compiled with the termguicolors feature, so I don't know
if b) applies here, too.
But I am actually interested in the internals. Is there a way to find
the color index without manually checking color16 to color 255? Or
even a comprehensive list of all uses of colorX with X > 15? No vim
color scheme is used.

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