Re: Upgrade to recent version broke vimrc -- doesnt recognize unix style environmental variables

2021-02-17 Thread 'c.willis...@btinternet.com' via vim_use


-- Original Message --
From: joha...@nacs.net
To: vim_use@googlegroups.com
Cc: v...@vim.org
Sent: Wednesday, 17 Feb, 2021 At 18:00
Subject: Re: Upgrade to recent version broke vimrc -- doesnt recognize 
unix style environmental variables

On Mon, Feb 15, 2021 at 09:47:09AM -0600, tom wrote:
I was working in vim and tried to sort something. The sort didn't work 
as I

expected.
I thought I would upgrade to version 8.0 in the hopes that would fix it.
The upgrade gave me a new problem.
in my vimrc there was the line
set backupdir=$HOME/vim/backup
This no longer works and yields the dreaded "E303: Unable to open swap 
file"

I fixed it this way
set backupdir=c:\\Users\\myuser\\Documents\\home\\vim\\backup,c:\\TMP
I would try running the following as an ex command:
:echo $HOME
It might be that Vim does not see a HOME environment variable on 
Windows.

Hi
it seems the equivalent Windows environment variable is HOMEPATH
Chris Willis
--
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20210217180002.GD14859%40linux.site 
 
.


--
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/2d8e1488.353.177b22bc8b1.Webtop.52%40btinternet.com.


Re: vim9script: dump file content to list of list question !

2021-01-15 Thread 'c.willis...@btinternet.com' via vim_use


-- Original Message --
From: "Ni Va" 
To: "vim_use" 
Sent: Friday, 15 Jan, 2021 At 13:38
Subject: vim9script: dump file content to list of list question !

Hi,


I got this kind of classical logfile :


2021/01/14 07:42:22.588 Information  Foo dbg
2021/01/14 07:42:22.588 Information  Bar dbg
2021/01/14 07:42:22.588  InformationFoobar dbg
2021/01/14 07:42:22.588  InformationBarbar dbg
..
.


and would like to add all lines' informations split by space into dict 
or array in vim9script.

['2021/01/14', '07:42:22.588', 'Information  Foo dbg   ']


trying map(getline(1, '$'), ' v:val->split() ') it returns 
list> but impossible to declare var foo: list>



How can I fix it ?


Best Wishes 2021
NiVa

 Hi
not quite clear on what you want to achieve. If it's lines like the 
square bracketed example (rather than internal Vim arrays), then you cd 
use 4 :%s constructs:

 :%s/^/['/
 :%s/$/']/
 :%s/ /','/
 :%s/ /','/
which cd of course be canned in a single command. Note not to use a 
global instead of the two single replacements.

regards - Chris

  --
 --
 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 
unsubscr...@googlegroups.com">vim_use+unsubscr...@googlegroups.com 
 
.


--
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/5b674455.40f.1770679b823.Webtop.229%40btinternet.com.


Re: fault in * in perl files (.pl)

2021-01-13 Thread 'c.willis...@btinternet.com' via vim_use


-- Original Message --
From: "'Paul' via vim_use" 
To: vim_use@googlegroups.com
Sent: Wednesday, 13 Jan, 2021 At 21:40
Subject: Re: fault in * in perl files (.pl)
On Tue, Jan 12, 2021 at 03:24:52PM +, 'c.willis...@btinternet.com' 
via vim_use wrote:
 in .pl files vim includes colon (:) in the identifier character set. 
This is sort of reasonable, as perl identifiers include those of the 
form /\w+::\w+/ .


 Unfortunately this prevents search finding the next relevant entry in 
(where the search is started with a * on intl1.):


 $intl1 = $intobl + 1 ; # new 12 Jan 2021
 s/(\d+)/$1==4?$intl1:$row/eg ; # revised 12 Jan 2021
 Can this be changed to only accept double colons as part of an 
identifier in a * search?


 No. The subject you're looking for is :help 'iskeyword', and see 
'isfname' for its format. It's a list of single characters that consist 
a keyword, there's no "but not a double character" option, 
unfortunately.


Hi Paul
thanks for that. I've added an au FileType perl set iskeyword-=: to my 
.vimrc. I can live with adjusting the / if I need fully qualified 
identifiers. (Probably very rarely). The possibility of missing a real 
match is a real problem.

regards - Chris
 --
 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 
<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+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20210113214044.GA24530%40rainslide.net 
<https://groups.google.com/d/msgid/vim_use/20210113214044.GA24530%40rainslide.net> 
.



--
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/472724fb.a9e.176fddfa448.Webtop.226%40btinternet.com.


fault in * in perl files (.pl)

2021-01-12 Thread &#x27;c.willis...@btinternet.com&#x27; via vim_use


Hi

in .pl files vim includes colon (:) in the identifier character set. 
This is sort of reasonable, as perl identifiers include those of the 
form /\w+::\w+/ .


Unfortunately this prevents search finding the next relevant entry in 
(where the search is started with a * on intl1.):


 $intl1 = $intobl + 1 ; # new 12 Jan 2021
 s/(\d+)/$1==4?$intl1:$row/eg ; # revised 12 Jan 2021
Can this be changed to only accept double colons as part of an 
identifier in a * search?


regards - Chris

--
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/766a29b4.f9e.176f73324e5.Webtop.231%40btinternet.com.


Re: Tab separated fields

2020-12-06 Thread &#x27;c.willis...@btinternet.com&#x27; via vim_use




-- Original Message --
From: "'Paul' via vim_use" 
To: "Vim Users" 
Sent: Sunday, 6 Dec, 2020 At 18:07
Subject: Re: Tab separated fields
On Sun, Dec 06, 2020 at 11:46:52AM -0500, Salman Halim wrote:
There is a really useful plugin you can download off http://vim8.org 
  called
csv.vim. I believe you can change the separator from comma to tab, 
though I

haven't tried it with anything but commas.
I'm not sure what was meant by "work within the nth tab separated 
field", but the plugin I believe you're referring to is 
https://github.com/chrisbra/csv.vim 


Hi Salman and Paul
thanks. That looks as if it is what I want.
regards - Chris--
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/20201206180729.GB5992%40rainslide.net 
 
.


--
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/8903727.17fa.176398c00fc.Webtop.223%40btinternet.com.


Tab separated fields

2020-12-06 Thread &#x27;c.willis...@btinternet.com&#x27; via vim_use


Hi

are there commands to work in the nth tab separated field (like awk)? As 
I understand it block visual doesn't do this.


regards - Chris

--
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/7087ee99.15fd.17638ea5a61.Webtop.223%40btinternet.com.


Re: How to replace string in specific paragraph only?

2020-09-19 Thread &#x27;c.willis...@btinternet.com&#x27; via vim_use




-- Original Message --
From: "Salman Halim" 
To: "Vim Users" 
Sent: Saturday, 19 Sep, 2020 At 15:48
Subject: Re: How to replace string in specific paragraph only?



On Sat, Sep 19, 2020, 10:41 'c.willis...@btinternet.com 
 ' via vim_use 
mailto:vim_use@googlegroups.com> > wrote:





-- Original Message --
From: "Salman Halim"  >
To: "vim_use"  >

Sent: Saturday, 19 Sep, 2020 At 14:15
Subject: Re: How to replace string in specific paragraph only?



On Sat, Sep 19, 2020, 08:08 Sven Guckes  > wrote:

* Igor mailto:igo...@gmail.com> > [2020-09-19 12:55]:
 > I have the following sample text file: ...
 > *REPLACE RULE:*
 > I need to replace string "aaa" with "bbb"
 > only in paragraphs that starts with "XXX".

   :g/^XXX/?^$?,/^$/s:aaa:bbb:g

 i wish i could write that with less characters. ;)

 Sven



I can't think of a more efficient way. The only suggestion is to perhaps 
replace the last 'g' with a 'ge' on the off chance that a paragraph 
doesn't contain the text so that the whole thing won't give an error 
message.



Salman



--
Hi
didn't work for me - said bad range or words to that effect. This does:
:g/^XXX/.,/^$/s:aaa:bbb:g
I don't imagine aaa can occur in some other word, but in case, perhaps 
\.

Chris W



You're going from the line that contains the text to the end of the 
paragraph. Sven's solution didn't assume that the line was at the 
beginning of the paragraph and started by first going back up to a blank 
line, just in case.



What happened when you tried it?


I didn't type it in, because I'm using my mobile phone right now, but it 
looked okay. Again, other than the addition of the e at the end.



Salman




Hi Salman

:g/^XXX/?^$?,/^$/s:aaa:bbb:g
E16: Invalid range
Press ENTER or type command to continue

It seems to me that the start line of the range we need is the current 
line with the XXX.


regards - Chris


  --
 --
 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 
unsubscr...@googlegroups.com">vim_use+unsubscr...@googlegroups.com 
 
.


--
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/5cc29a7f.d16.174a6db3f8a.Webtop.70%40btinternet.com.


Re: How to replace string in specific paragraph only?

2020-09-19 Thread &#x27;c.willis...@btinternet.com&#x27; via vim_use





-- Original Message --
From: "Salman Halim" 
To: "vim_use" 
Sent: Saturday, 19 Sep, 2020 At 14:15
Subject: Re: How to replace string in specific paragraph only?



On Sat, Sep 19, 2020, 08:08 Sven Guckes  > wrote:

* Igor mailto:igo...@gmail.com> > [2020-09-19 12:55]:
 > I have the following sample text file: ...
 > *REPLACE RULE:*
 > I need to replace string "aaa" with "bbb"
 > only in paragraphs that starts with "XXX".

   :g/^XXX/?^$?,/^$/s:aaa:bbb:g

 i wish i could write that with less characters. ;)

 Sven



I can't think of a more efficient way. The only suggestion is to perhaps 
replace the last 'g' with a 'ge' on the off chance that a paragraph 
doesn't contain the text so that the whole thing won't give an error 
message.



Salman




  --
Hi
didn't work for me - said bad range or words to that effect. This does:
:g/^XXX/.,/^$/s:aaa:bbb:g
I don't imagine aaa can occur in some other word, but in case, perhaps 
\.

Chris W
 --
 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 
unsubscr...@googlegroups.com">vim_use+unsubscr...@googlegroups.com.
 To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/CANuxnEdwssZCjK_hpJKJ_25oGnMnq1HRsToug1%3DoO8P1ODs-eg%40mail.gmail.com 
 
.



--
--
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_use/3e922b9a.cff.174a6cfb2ea.Webtop.70%40btinternet.com.