Re: strange difference in UI for identical .vimrc

2022-08-03 Thread 'Grant Taylor' via vim_use

On 8/3/22 5:37 PM, Aryeh Friedman wrote:
I have two machines with 8.2.2263 and 8.2.5052 respectively with 
the following .vimrc (same NIS account/NFS home dir) and in the 2263 
machine shows a transparent background (which is what I want) and the 
5052 shows and opaque one which is not what I want (See screen shots). 
How do I make 5052 behave like 2263.


This seems like a Window Manager / Desktop Environment issue more than 
it seems like a Vim issue to me.


Though I would naively assume that a common NFS mounted home directory 
would have the same WM / DE preferences too.


What happens if you run gVim on each machine displaying on the other 
machine remote X11 display (possibly via SSH forwarding)?




--
Grant. . . .
unix || die

--
--
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/236c3bf4-6700-be2b-c4ab-f3e60ebabec0%40spamtrap.tnetconsulting.net.


Re: TERM (was Cursors)

2022-06-15 Thread 'Grant Taylor' via vim_use

On 6/15/22 3:17 PM, 'Grant Taylor' via vim_use wrote:
I suspect that my problem is related to the super tight security 
settings that $CORP_IT has put in place since the last time I tried to 
use it.


While talking about this with a coworker, it came to my attention that 
my problem is related to the program not working Apple's M1 processor.




--
Grant. . . .
unix || die

--
--
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/39826b12-304c-50c7-2a16-f2f048d804c0%40spamtrap.tnetconsulting.net.


Re: TERM (was Cursors)

2022-06-15 Thread 'Grant Taylor' via vim_use

On 6/15/22 2:44 PM, Bram Moolenaar wrote:
Yes, that is indeed a problem.  Lots of terminal emulators keep popping 
up, many with the same or similar base, and adding one more feature. 
 They don't bother distributing a correct termcap/terminfo entry and 
just use something like "xterm" for $TERM.


I wonder how much of that is by conscious choice vs ignorance.

I have been thinking of a way to just ignore termcap/terminfo and 
let the terminal tell us what it's features are.  Xterm does this 
partially, but there can be artifacts (e.g. when Vim exits very 
quickly).  I haven't found the right solution yet.


I'm curious.  Though that is probably even further off topic.

It works well compared to other solutions (e.g. Putty).  If you can't 
get it to connect double check the settings.  It works for me (when 
I get the domain or IP address and port right).


I suspect that my problem is related to the super tight security 
settings that $CORP_IT has put in place since the last time I tried to 
use it.




--
Grant. . . .
unix || die

--
--
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/1e90f2d9-2a17-c048-8781-758c3a21ea26%40spamtrap.tnetconsulting.net.


Re: TERM (was Cursors)

2022-06-15 Thread 'Grant Taylor' via vim_use

On 6/15/22 2:43 PM, Gary Johnson wrote:

Yeah, but...


IMHO there's no but about it.


A problem is that if somebody comes out with a new Whizbang terminal
that does everything an Xterm does but so much more, and they set
TERM=whizbang, then everyone with scripts and configurations looking
for TERM=xterm* complains that their tools don't work anymore.


I believe that these terminals should default to whizbang or whatever 
their name is.


They can optionally support xterm personality / emulation.

As far as they're concerned, it looks like an Xterm so they want it 
to identify itself as an Xterm.  The same goes for terminals that work 
mostly but not quite like an Xterm but have some "better" features.


I think that the more people that pile onto the Xterm terminal type the 
muddier the water will get.


This seems reminiscent of the User-Agent header for web browsers.

IMHO we should /own/ the terminal type that we are using.  Either create 
a new whizbang terminal and give it an xterm personality / emulation 
capability -or- stick with venerable xterm / vt100 and not expect more 
than the specifications define.



HP had this problem about 40 years ago when they introduced
a successor to the 2645 terminal.  Its ID string was something like
"HP2647" and customers raised Cain that their systems did work right
with the new terminal, so HP changed it to report itself as an
"HP2645".


IMHO HP made the wrong choice.  It sounds like they bowed to marketing 
pressure and made their new HP2647 terminal lie and say that it was an 
HP2645.  Maybe the marketing / support types have more clout than the 
technical types.


I recently copied an xterm definition so that it could be used for 
xterm-color because that's what my terminal reported as and the 20 year 
old system I was connecting to didn't know what xterm-color was.



You can't win either way.


Either you can own the terminal type and do your best / the work to keep 
it pure.  Or you can have a completely unrelated web web browser lie and 
say that it's a 20 year old piece of software that's long since dead, a 
la. User-Agent headers.


If we're going to ignore what the value actually means, then we might as 
well make it a random opaque token.


I don't know what the right answer is.  Some HP products tried to 
use capability strings instead of product IDs with limited success.


My vote is to actually use the value for what it's meant to be and 
actively /own/ the maintenance.



That would help a lot.  Is that what Vim refers to as the
termresponse?


I don't know.


I use that when it matters what the terminal really is.


I often find that the answer back is unset / null or that the terminal 
(emulator) completely fails / ignores it.




--
Grant. . . .
unix || die

--
--
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/13a08f6b-21cb-618d-a73f-b2f3f9ca1464%40spamtrap.tnetconsulting.net.


Re: Cursors

2022-06-15 Thread 'Grant Taylor' via vim_use

On 6/15/22 11:55 AM, Bram Moolenaar wrote:

The terminal that I use to run ssh does not support it.


Hum.

This sounds like a potential problem in the terminal.  Specifically that 
the terminal should set TERM to the terminal that it's actually emulating.


I consider it a bug if a terminal emulator claims that it's emulating a 
terminal that's more capable than it actually is.  E.g. claiming XTerm 
when it's really VT100 level capabilities.


I also use answer back for some things like this.  I define the answer 
back on specific systems via the ~/.Xdefaults file.  I usually set the 
answer back to be the host name that the terminal emulator is running on.


So, between the contents of the TERM environment variable and the value 
of the answer back, I can have my servers choose how they configure the 
interactive environment.



I am using the Secure Shell extension for Chrome.


The Secure Shell 0.47 (in a tab) that I have installed for work seems to 
have an option to specify the TERM environment variable via Secure Shell 
(icon) -> Options -> Terminal Settings -> Miscellaneous.  If it doesn't 
actually support xterm-256color (what mine's defaulted to) I'd file a 
bug with them.  If that didn't work, I'd change it to something less 
capable; xterm base, or even vt100.  That way the value of the TERM 
environment variable would be more believable.


I feel like the purpose of the TERM environment variable is slipping 
into obscurity and people are setting it to something they've always 
seen, e.g. xterm, and not realizing that it actually has a specific 
meaning.  Instead they are defaulting and having to re-invent the wheel.



I actually haven't tried recently, they keep improving it.


ACK

I just tried the Secure Shell for the first time in a long time and I 
can't get it to connect to anything.  :-/  I'm not upset b/c I found it 
so inferior and frustrating.  That being said, I'm an Xterm power user 
and expect more than the average person from my terminal emulator.




--
Grant. . . .
unix || die

--
--
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/e2580871-10c9-e67f-65ec-39f53951da7f%40spamtrap.tnetconsulting.net.


Re: Cursors

2022-06-15 Thread 'Grant Taylor' via vim_use

On 6/15/22 9:58 AM, Bram Moolenaar wrote:

if  =~ "xterm" && $SSH_CLIENT == ''


Why do you check to see that SSH_CLIENT is unset / empty?

Wouldn't that preclude SSHing from a shell running in Xterm?

I'm just curious.



--
Grant. . . .
unix || die

--
--
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/abb31f5a-3fe1-5b4c-6e1d-efa0c7e099cc%40spamtrap.tnetconsulting.net.


Re: % and matchpairs

2022-06-06 Thread 'Grant Taylor' via vim_use

On 6/5/22 6:47 PM, Eli the Bearded wrote:

One neat thing about vim is configurability. I think it's widely known
(and done) to add < and > to matchpairs for %, but you can add Unicode
pairs in the list to, for smart quotes and quote styles not used in
English (at ast not often).


#TIL

Thank you for sharing this Eli.  I'll be trying ~> using a subset of this.

Aside:  How wrong is it that I'm thinking about adding m4's "`" and "'" 
based on file / buffer type?  a la. set matchpairs=`:'




--
Grant. . . .
unix || die

--
--
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/531c13a3-5000-5390-8270-2f3e44707ad8%40spamtrap.tnetconsulting.net.


Re: Where are vim macros stored

2021-05-28 Thread 'Grant Taylor' via vim_use

On 5/28/21 7:43 AM, Ruben Safir wrote:

Where are the vim macros stored.  I want to edit them by hand


My understanding is that, by default, macros only exist in memory, are 
volatile, and not stored persistently.  The only live in vim's memory 
while vim is running.


There are some non-default options that you can use to change some of that.



--
Grant. . . .
unix || die

--
--
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/7f4523c3-53ef-abdf-4c36-24a4c1b8ec6a%40spamtrap.tnetconsulting.net.


Re: How to setup an external command to indent bash script?

2021-04-02 Thread 'Grant Taylor' via vim_use

On 4/2/21 4:16 PM, Peng Yu wrote:

It can take the file from STDIN in this way. The output is to STDOUT.


Even better.


Could you show me the commands...


I don't know as I've not used formatprg in recent memory.

I'd try interactively setting it and testing it with a file.

Quickly poking at things looks like:

:set formatprg=/path/to/shfmt

Give it a try.  Please let us know what you find out.



--
Grant. . . .
unix || die

--
--
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/8bb7d206-f4c1-0174-56e4-513996070bbd%40spamtrap.tnetconsulting.net.


Re: How to setup an external command to indent bash script?

2021-04-02 Thread 'Grant Taylor' via vim_use

On 4/2/21 3:52 PM, Peng Yu wrote:
I want to use shfmt to indent bash script in vim instead of using the 
default vim indenter. Could anybody show me how to set this up in vim?


I would play with the formatprg setting.

:help formatprg


shfmt -l -w script.sh


Based on my read of the help section, it looks like formatprg expects to 
read STDIN and write to STDOUT.  So you might need some sort of wrapper 
to read Vim's STDOUT to a file, shfmt said file, then write said file 
back to Vim's STDIN.


But I suspect that this is eminently doable.



--
Grant. . . .
unix || die

--
--
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/ed861df1-0a61-cae5-dfd9-8c576d664e92%40spamtrap.tnetconsulting.net.


Re: [vim colours + iTerm2 colours]

2020-09-23 Thread 'Grant Taylor' via vim_use

On 9/22/20 7:33 AM, Maxim Abalenkov wrote:
I tend to use both vim colours and iTerm2 colour scheme. If I understand 
correctly, the resulting colours that I see are a mixture of both Vim 
and iTerm2 colour profiles superimposed. Therefore, my question is how 
do I tell Vim to use only Vim colour settings and ignore the iTerm2 
colours? Thank you very much and have a productive day ahead!


Doesn't vim just specify the color number / index (0-7 / 0-15 / 0-255) 
that it wants used for specific characters and then rely on the terminal 
(emulator) to set the actual colors used for any given color number / index?


I don't think there is any (good*) way for vim to know that you're using 
iTerm2 and adjust it's behavior accordingly.  I think this is all in 
iTerm2's control.


*Shell ~> vim may be able to deduce from the TERM environment variable 
(and possibly answer back) what the terminal is.  But there usually is 
not a one-to-one correlation.  Further many terminal emulators tend to 
lie and say they are a different terminal; ANSI and VT100 are common.  I 
don't remember what iTerm2 does by default.




--
Grant. . . .
unix || die

--
--
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/2ce2173e-e077-8905-5aa3-e0a70f83d3e4%40spamtrap.tnetconsulting.net.


Re: How to replace string in specific paragraph only?

2020-09-19 Thread 'Grant Taylor' via vim_use

On 9/19/20 3:13 PM, Tim Chase wrote:
My assumption was that "aaa" was a meta-regex that matched whatever 
was needed, including any word-boundaries or other matching/context 
the OP needed.


That seems like a reasonable assumption.  Thank you for clarifying.


Depends on what you mean.  There are multiple regex in play:

- the thing looked for in the g/first/


This first one is what I had in mind when I asked the question.


- the boundary looked for when looking backwards (empty line or BOF)

- the boundary looked for when looking forwards (empty line or EOF)

- the thing looked for in the s// command


This is actually where I was wanting to use the contents of g/first/.  ;-)

Using the :norm method, you don't have the two boundary regexen to 
change the most-recently-used-search, so the regex in the :g can be 
preserved into the :s// command so you don't have to duplicate it.


If I'm understanding you correctly, the following regex could be used:

   :g/aaa/?^$\|\%^?,/^$\|\%$/s::bbb:g

Either way, whatever regex the :s// searches for can capture all (for 
replacement with "&") or subsets (with "\(…\)" for replacements 
with "\1" through "\9"), and then use those captured bits in the 
replacement.


I keep forgetting that & matches the full capture.

Including if you use the :norm method and capture them in the :g 
portion.  Here I look for "G" followed by any number of "C"s followed 
by another "G" and then replace them with a "T" followed by the 
"C"s we captured, followed by another "T":


   :g/G\(C*\)G/norm vip:s//T\1T/g^V^M


This seems like the typical subset mentioned above used in conjunction 
with the "last search pattern" (nomenclature?).


Thank you Tim.  As always you make it easy to learn new things.  :-)



--
Grant. . . .
unix || die

--
--
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/54b71e93-4c02-fb4d-7be4-53854af1aca8%40spamtrap.tnetconsulting.net.


Re: How to replace string in specific paragraph only?

2020-09-19 Thread 'Grant Taylor' via vim_use

On 9/19/20 9:27 AM, Tim Chase wrote:
The only gotcha with this is that a paragraph must have a blank 
line before & after it.  I've gotten stung doing this exact format 
of command because the match was in the first/last paragraph of the 
document.  So you need to also ("\|") accept a match of the beginning 
of the file ("\%^") and end of the file ("\%$")


   :g/aaa/?^$\|\%^?,/^$\|\%$/s:aaa:bbb:g

As Sven says, it's ugly.  But it's doable and fairly concise in what 
you're describing:


   Find all the "aaa"
   Starting there, search backwards to the previous blank line or BOF
   From there, search forwards to the next blank line or EOF
   Substitute "aaa" → "bbb" on all the lines of that range


Very interesting.

Thank you for that explanation Tim.


Alternatively, you could hack it with normal mode, something like

   :g/aaa/norm vip:s//bbb^V^M

where ^V^M is a control-V followed by a control-M (which makes this 
nasty to put in a mapping or vimrc).  This works because vim knows 
that a "paragraph" is bounded by empty lines *or* BOF/EOF and does 
the ugly work for us.


ACK

Would it be worth while to include word boundaries \< and \> so that you 
don't accidentally get a sub-string?


:g/aaa/?^$\|\%^?,/^$\|\%$/s:\:bbb:g

Also, is there any way to group the first "aaa" so that it could be 
(back) referenced in the substitution?  }:-)


I can't imagine doing this in pretty much any other text editor 
without typing a LOT more.


~chuckle~



--
Grant. . . .
unix || die

--
--
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/dd4e9977-15d9-12d7-ee94-6d1faf50b553%40spamtrap.tnetconsulting.net.


Re: enabling xterm_clipboard support by default

2020-03-28 Thread 'Grant Taylor' via vim_use

On 3/28/20 3:15 PM, Manas Gupta wrote:
I was wondering what could be the reasoning behind not enabling the 
xterm_clipboard and clipboard support in native vim installations in 
different distributions?


I can't remember of a distribution that I wasn't able to use X11's 
clipboard or primary selection buffer.


I went through a few forums and threads where I found people find it 
difficult to copy/paste text into system's clipboard.


I'll agree that it's not obvious how to use the clipboard / primary 
selection buffer in vim.  But then again, this is vim, what is obvious 
or intuitive to the new vim user?


Although I found there is a way, by using skel. But it doesn't seem to 
be working as expected.


What's wrong with using the + (plus) / * (star) registers?

"+p   puts the contents of the system clipboard.
"*p   puts the contents of the primary selection buffer.

You can easily use other commands using the standard register notation.



--
Grant. . . .
unix || die

--
--
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/b4bd01c1-6d50-e77d-7feb-49c38fc79bc2%40spamtrap.tnetconsulting.net.


Re: -x option encryption

2020-01-13 Thread 'Grant Taylor' via vim_use

On 1/13/20 10:22 AM, 'Andy Wokula' via vim_use wrote:

You can set a key with :set key=mycoolkey


Interesting.


This works here (doubles quotes = on Windows):

vim --cmd "set key=mycoolkey" mynicefile.txt


I wonder if it would be possible to play with other methods to populate 
the "mycoolkey" text.  Admittedly, they aren't as Windows friendly.


Environment variables are the first thing that comes to mind.

After that is file redirection, possibly from a sub-command.

Finally, a full sub-command that extracts the password out of something, 
possibly GPG protected file.  }:-)



(needless to say this is not recommended ...)


I know that the typical gotchas are the output of ps (et al.) and 
methods to access other processes environment variables.  What other 
concerns are there that my uncaffeinated brain is missing?




--
Grant. . . .
unix || die

--
--
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/61f70749-65e2-5066-de17-a1f6db20abf6%40spamtrap.tnetconsulting.net.


Re: -x option encryption

2020-01-12 Thread 'Grant Taylor' via vim_use

On 1/12/20 8:24 AM, Stevew wrote:

is the  a way to automatically put the password in the startup command.


If your goal is to open vim and work with encrypted files without the 
hassle of decrypting them, there is an option.


I've installed a plugin that will automatically decrypt GPG encrypted 
files on open and encrypt on write / close.  It interfaces with the GPG 
agent to access the keys as necessary.


Depending on how the GPG agent is configured, if the key is in memory, 
you will not be prompted for any pass phrase.



But is the a way to do something like this?


I don't know if what I described above will do what you want or not.


thanks.


:-)



--
Grant. . . .
unix || die

--
--
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/8e236cb9-a49c-52bc-23d0-1a98dafae6ba%40spamtrap.tnetconsulting.net.


Re: [VIM] Re: netrw and tunneling

2019-08-09 Thread 'Grant Taylor' via vim_use

On 8/9/19 9:07 PM, Richard Mitchell wrote:
Yes, I just meant if he was concerned about unintentional use of the 
tunnel, he could give it a specific Host name that he only used with 
vi commands.  Certainly that name and its associated configuration 
would be available to ssh/scp/rsync/etc if he used that name with 
those commands, but he could use names (say with _vi appended) that 
he only used with vi.


Ah.  Agreed.

--
--
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/c3f9ed1f-af35-5283-349b-d5972fee2e9e%40spamtrap.tnetconsulting.net.


Re: [VIM] Re: netrw and tunneling

2019-08-09 Thread 'Grant Taylor' via vim_use

On 8/9/19 12:08 PM, Richard Mitchell wrote:
The tunnel would only be used for that host, which you already have 
to get to by going through the intermediate host.  It isn't going to 
force other hosts to go through the same intermediate host.


Correct.

Regardless, "Host" is only an alias.  Call it whatever you want and 
use it just for vi.


Not quite.  "Host" is how you define a set of entries that are for a 
specific host.  The "targetHost" and "tunnel-host" are the names / aliases.


The example ProxyCommand line is associated with the host entry named 
"targetHost".  Meaning that ssh / scp / sftp to targetHost will use the 
entries under the "Host targetHost" line.


--
--
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/97cf03be-3e79-7e53-3fcf-d91420bb91a6%40spamtrap.tnetconsulting.net.


Re: netrw and tunneling

2019-08-09 Thread 'Grant Taylor' via vim_use

On 8/9/19 4:17 AM, Walter Cazzola wrote:
I'm already used to "gvim scp://host+path" but in this case the remote 
server can be accessed only through one other machine and I've to do a 
tunnel to edit them.


I've already tried to add to my .vimrc

   let g:netrw_scp_cmd="scp -q -oProxyCommand=\"ssh -W %h:%p tunnel-host\""

but it didn't work. I googled around but seems that this problem never 
raised.


I'm still on vim 7.4 and I'm using a version of openssh older 
than 7.3 (this is why I'm still using ProxyCommand instead of 
ProxyJump). Unfortunately to update my linux-box is not an option in 
the near future.


Any idea?


Yes.

Teach OpenSSH how to get to the host by putting entries in the OpenSSH 
/client/ configuration file; ~/.ssh/config or system wide 
/etc/ssh/ssh_config. E.g.


Host targetHost
ProxyCommand ssh -W %h:%p tunnel-host

Host tunnel-host
# any options you might want here

This teaches any and all OpenSSH clients how to get to targetHost 
without needing to specify additional command line options.  I.e. you 
can run the following command:


   gvim scp://targetHost+path

(G)vim doesn't need to worry about /how/ scp connects.  OpenSSH's scp 
command deals with that transparently.


IMHO the OpenSSH /client/ configuration file opens up a world of 
possibilities.


Link - Empowering OpenSSH
 - 
https://dotfiles.tnetconsulting.net/articles/2015/0506/empowering-openssh.html




--
Grant. . . .
unix || die

--
--
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/303379b3-8f69-7dbd-cb9a-ab3f20fd1073%40spamtrap.tnetconsulting.net.


Re: OT: aliases vs functions vs executables

2019-07-11 Thread 'Grant Taylor' via vim_use

On 7/11/19 7:57 AM, aroc...@vex.net wrote:
Something to bear in mind with all this aliasing, linking, and 
environmental trickery is the effect on subsequent maintainability.


Even if you ensure that it's properly documented and generally understood, 
how many hours are going to be spent figuring out what's going on before 
any real problem gets addressed? How much time and effort do you have 
to save to justify it?


All very good points.

IMHO that's another reason for actual scripts that are in the $PATH.



--
Grant. . . .
unix || die

--
--
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/0ccc69a8-3aa1-d955-1f15-a52a871d83d0%40spamtrap.tnetconsulting.net.
For more options, visit https://groups.google.com/d/optout.


OT: aliases vs functions vs executables

2019-07-10 Thread 'Grant Taylor' via vim_use

On 7/10/19 3:25 AM, Mathieu Roux wrote:

I love aliases since i am a child! i am absolutely fascinated by them!
i dream of them every night:-)


Aliases can be quite useful.  But they generally only work /in/ /the/ 
/shell/.  If you want to use (something like) an alias /outside/ /of/ 
/the/ /shell/ you quite likely need to use something other than an alias.


Scripts or other executables—that are in the $PATH—are quite good for this.

The 3rd alternative, function, will likely have the same limitations as 
aliases.


As a general rule, if I want to use something outside of the interactive 
shell, I use an executable.  This applies equally as well to things like 
running :!theCommand from within vim to running theCommand remotely via 
ssh to creating desktop shortcuts that search the $PATH.




--
Grant. . . .
unix || die

--
--
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/bb591a4f-b655-0aba-7b80-96143fda1377%40spamtrap.tnetconsulting.net.
For more options, visit https://groups.google.com/d/optout.


Re: Display of characters is inconsistent

2019-06-12 Thread 'Grant Taylor' via vim_use

On 6/12/19 2:03 PM, Eric Weir wrote:
I’m coming back to vim after an extended absence. Display of text is 
splotchy, not sharp as I remember. The problem seems to be certain 
characters, primarily “i” and “j” as near as I can tell are not as 
bright as others. A screen shot is attached.


Clues as to why this is happening would be appreciated.


Is this Gvim?  Or is this by chance a terminal emulator issue?



--
Grant. . . .
unix || die

--
--
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/7ff0b5ac-7ce3-134f-bf0e-ed84f93437a8%40spamtrap.tnetconsulting.net.
For more options, visit https://groups.google.com/d/optout.


Re: delete until

2019-05-18 Thread 'Grant Taylor' via vim_use

On 5/18/19 9:34 AM, Stefan Klein wrote:

i guess you're looking for t(o) instead of f(orward)


Agreed.

I've frequently seen it referred as (un)t(il).  (I think that's what I 
see in vim :help.)


--
--
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/53b8dba0-8dfe-90ab-fe02-562b0ae9b085%40spamtrap.tnetconsulting.net.
For more options, visit https://groups.google.com/d/optout.


Re: Vim selection underlined rather than reversed

2019-04-15 Thread 'Grant Taylor' via vim_use

On 4/15/19 9:24 AM, Jeenu wrote:
Sometimes, after I attach to a tmux session, visual selection in 
an already-running vim instance is shown as underlined instead of 
reversed. See the attached files for the difference; both are from the 
same host - one from new, and the other from existing session. The only 
way out I've found is to quit and launch vim again. Does any one know 
why this happens and/or how to fix it?


This sounds to me like screen is loosing state and not (re)displaying 
things properly after some condition.


I would bet another order of magnitude that this is the case if you 
visually select something so it's highlighted, change screen (disconnect 
/ switch screens), change screen back (reconnect / switch back), and 
what was highlighted is now underlined.


This is the same problem as someone had posted a while ago: 
https://superuser.com/questions/1186500/vim-visually-selected-text-sometimes-appears-as-underlined-not-reversed


This seems to have the same symptoms to me.

You can probably test vim, if not eliminate it from the scenario, by 
playing with ANSI control codes at a command line and see if the 
symptoms are the same as vim when changing screen (see above).




--
Grant. . . .
unix || die

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


Re: How to vim recognize ssh config file?

2018-12-20 Thread 'Grant Taylor' via vim_use

On 12/20/18 7:56 PM, Tony Mechelynck wrote:
P.S. And regardless of whether you set 'filetype' or 'syntax', use 
:setlocal, not plain :set, in order to avoid setting the default for 
new files you write from scratch (the global default should be empty).


Duly noted.

Thank you for the explanation in the last email and the clarification in 
this email 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to vim recognize ssh config file?

2018-12-20 Thread 'Grant Taylor' via vim_use

On 12/20/18 7:53 PM, Tony Mechelynck wrote:

On Fri, Dec 21, 2018 at 3:39 AM 'Grant Taylor' via vim_use
 wrote:

Normally you set 'filetype', not 'syntax'.


Facepalm.  You are correct.  That's what I meant.  I quickly edited 
~/.ssh/config, ran :set, and looked for "ssh".  I wondered about 
"syntax", but didn't wonder enough to look a few lines below for:


filetype=sshconfig

Sorry.

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


Re: How to vim recognize ssh config file?

2018-12-20 Thread 'Grant Taylor' via vim_use

On 12/20/18 5:27 PM, Peng Yu wrote:

Hi


Hi,

vim recognize ~/.ssh/config. But I'd like to recognize it in a none 
standard location via some file extension. Is there a standard file 
extension that will make vim recognize it in a none standard location? 
Thanks.


I don't know the nuances of file type detection.  But I do know that you 
can easily set it for any arbitrary file by running the following command:


:set syntax=sshconfig

If you support mode lines (?) you can add that.

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


Re: What is the quickes way to delete spaces in front of each line?

2018-09-19 Thread 'Grant Taylor' via vim_use

On 09/19/2018 08:53 AM, Igor Forca wrote:
I know there is ed command: 1,5s/^\s\+// but this is difficult to type 
quickly and requires a lot of thinking.


I don't know about difficult to type.  I type things like that quite 
frequently.


As for (a lot of) thinking, well, I find that most of vim's power 
requires some thinking.


Unless I had a reason not to, I'd likely use %s/^\s\+// and apply it to 
the entire buffer.


Using some normal command and repeating j. would be much simpler to 
think and edit.


I find that repeating commands gets tedious quite quickly.  Especially 
if you're munging data.  Hence why I like regular expressions like the 
one above, or macros (possibly of the recursive variety).  Why should I 
have to mentally execute the test to see if I need to apply the action 
to the line when I can have the computer do it for me.  I just need to 
tell the computer what to do.


IMHO regular expressions and and macros lend themselves to more 
automation.  It might even be possible to move the regular expression to 
a (s)ed script.




--
Grant. . . .
unix || die

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


Re: How do I delete from the end of the line through space (up to) the first word?

2018-09-10 Thread 'Grant Taylor' via vim_use

On 09/05/2018 12:38 PM, Arun wrote:
Could not you just move right one character and do the "Td" (kind of like 
"Tdx", but moving right can be done easily with the space bar). Anyway, 
to move beyond the last character in line, though, you will have to set:

     :set virtualedit=onemore


Thank you for sharing virtualedit=onemore Arun.  I've used it multiple 
times and have found it very helpful.  :-)




--
Grant. . . .
unix || die

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


Re: How do I delete from the end of the line through space (up to) the first word?

2018-09-05 Thread 'Grant Taylor' via vim_use

On 09/05/2018 12:38 PM, Arun wrote:
Could not you just move right one character and do the "Td" (kind of like 
"Tdx", but moving right can be done easily with the space bar).


Um …

Anyway, to move beyond the last character in line, though, you will have 
to set:


     :set virtualedit=onemore


I'll have to check that out.  I do think that would work.

Of course, when it comes to Vim Golf, it would be comparable.

 TdD

-or-

$TdD

Is effectively the same number of characters (strokes).

Tdx


Alternatively, have you considered recording/macros?


I use macros quite frequently.  I wouldn't have considered them for this 
particular use case as it was two lines of data I was cleaning up.


If I need to do something multiple times and I have a wrote process to 
use, I tend to reach for the macro hammer quite readily.


You could just record a set of key strokes using the "q" command and 
recall the sequence whenever you want.


Agreed.  It's just not proper for this use case.  And it doesn't answer 
the question of if there is a different method that is like a backwards dw.




--
Grant. . . .
unix || die

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


Re: How do I delete from the end of the line through space (up to) the first word?

2018-09-05 Thread 'Grant Taylor' via vim_use

On 09/05/2018 11:11 AM, Tim Chase wrote:
Also, note that once you've done a f/F/t/T command, you can save a 
character (and some thinking) by using "," and ";" to navigate to the 
next/previous one, prefixing that with a count.


   :help ,
   :help ;


Ya.  I think it moves the thinking from "how many times do I want to do 
the following action?" (count / multiplier) to "do I want to do the last 
action again?".  Depending on what the context is, sometimes the count / 
multiplier ends up being less mental load.


Some people remap  to one of these keys, but I use them frequently 
enough that I recoil at the thought of losing them :-)


Fair enough.


So the first one could be

   F D

and then subsequent ones could be

   ,D

or

   ;D

depending on where your cursor is.


ACK



--
Grant. . . .
unix || die

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


Re: How do I delete from the end of the line through space (up to) the first word?

2018-09-05 Thread 'Grant Taylor' via vim_use

On 09/04/2018 06:45 PM, Tim Chase wrote:
But "dTb" does keep the character under the cursor.  If you're at the 
end of the line and *do* want to delete the character under the cursor, 
you can use


   vTbd


Interesting.


to use character-wise visual mode or

   TbD


I like that.  It takes a moment to wrap my head round.

It doesn't work as such with my original example of the annotated 
domains.  (Because the "b" is not in them.)


That being said, I can modify it a little bit:

   F D

Or more specifically, a count version of it:

   4F D

I feel like that is within the spirit of what I was originally asking 
about.  Namely something to arbitrarily delete backwards to words.


to position first and then delete to the end of the line (slightly 
different behaviors if the cursor isn't at the end of the line).


Yep.

There are lots of options depending on how much you want to do manually 
vs. automatically, as well as how easy it is to identify the matches 
in question.


I know.

I'm mainly asking about how I can clean up / mung arbitrary data that 
I'm working with.




--
Grant. . . .
unix || die

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


Re: How do I delete from the end of the line through space (up to) the first word?

2018-09-04 Thread 'Grant Taylor' via vim_use

On 09/04/2018 05:27 PM, Gary Johnson wrote:
The best way to move to the first space on a line is to move to the start 
of the line, then find the next space to the right.  The best solution 
to your problem that I know of would be this:


^f D


Interesting idea.  It makes perfect sense.

It also solves the problem as I described it.

I would still like to know how to delete backwards {t,T}o a word, not 
{f,F} on a character I'd like to keep.


I've got all sorts of things like the following:

aaa  c ddd eee 

Where the cursor is on the last f and I want to delete from the last f 
up to but not including the last d.  I.e. "Td".


But, "Td" leaves the last f there.

I suppose I could use "Tdx".

I figured that there was a Vim movement that I'm not aware of.

Any other solution that tries to find the first space by working 
backwards from the end of the line is going to require more typing, 
unless you create a macro for it.


Ya.  I'm not as worried about the "first space" as I am going backward 
and deleting as I go with something like gE.




--
Grant. . . .
unix || die

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


Re: How do I delete from the end of the line through space (up to) the first word?

2018-09-04 Thread 'Grant Taylor' via vim_use

On 09/04/2018 05:16 PM, Tim Chase wrote:
I'm having a little trouble parsing (1) where the cursor is (it 
sounds like you're describing it at the last "t" of the first line)


Yes, the cursor is on the last t at the last character of the line.


(2) what you want the final results to be.  Do you want

   example.net <-- actually importan.example.com <-- not actually important

or

   example.net <-- actually importan<-- not actually important


No, I want to end up with the following:

example.net
different.example.com


Or are the "<-- ..." meta-commentary and not actually content in the file?


No, the actual content includes the ""arrow and what you're calling 
meta-commentary.  That (and the proceeding space) are what I wanted to 
remove.


It would help to have unannotated "before" and "after" and "where is 
the cursor".


Before:

"""
example.net <-- actually important
different.example.com <-- not actually important
"""

After:
"""
example.net
different.example.com
"""

Background is I was copying and pasting content from an email (including 
annotations) from a friend about domains I'm configuring for him.  I 
wanted to get just the domain names first \W of the line and enter them 
into my /etc/mail/local-host-names file.


I was editing /etc/mail/local-host-names in vim, copied and pasted the 
content from email into the terminal, and wanted to remove the annotations.


Also, is this a one-off thing where you're trying to optimize something 
manually, or should this be automated across all lines (or lines matching 
some condition) in the file?  (noting that a :s command can be repeated 
with either "@:" or "&" or "g&" depending on intent)


This was a one-off.  But I would like to learn the vim methodology to 
play Vim Golf next time I need to do it.


I have frequently (monthly if not more often) needed to do a delete with 
something similar to a "gE", but stop before the word.




--
Grant. . . .
unix || die

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


How do I delete from the end of the line through space (up to) the first word?

2018-09-04 Thread 'Grant Taylor' via vim_use
How do I delete from the end of the line (where the cursor is at) 
through the space after the first word?


example.net <-- actually important
different.example.com <-- not actually important

What is the optimal way to delete from (and including) the t at the end 
of the line up through the space after the first Word?


I'm looking for something functionally comparable to D when the cursor 
is on the space after the first word, just coming from the opposite 
direction.


diW works and multiple dot repetitions get the job done.  But i feel 
like there is a better method.




--
Grant. . . .
unix || die

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


Re: How can i add the same string to many lines ?

2018-08-30 Thread 'Grant Taylor' via vim_use

On 08/30/2018 10:01 AM, Antharia Jack wrote:

Hello everyone ?


Hi,


I would like to add target="_blank" to all my href in a html file.


Okay.  That seems odd, but you do your own thing.

I would like to say to vim : add this string after the second " symbol 
of each line where is the word href.


Can you provide an example?

I'd be inclined to try a regular expression like the following.

:%s///g

Use a non-greedy wildcard match to find an anchor tag (assuming it 
starts with href) and append the target="_blank" to the end.



For now i just use the dot command to each line.


That's annoying, especially if you have a LOT of anchor tags to change.


Thanks for reading.


:-)



--
Grant. . . .
unix || die

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


Re: Change only second match on a line...

2018-02-15 Thread 'Grant Taylor' via vim_use

On 02/15/2018 06:54 PM, Tim Chase wrote:
The easiest way on most platforms is to just pipe it through sed which 
does the dirty work for you:


  :%! sed 's/old/new/2'


Yep, that would do it.

Sometimes the solution is to look outside of vim.


If you don't have sed available...


I shudder to think of such systems.

I have grown EXTREMELY fond of the standard unix text processing 
environment.


I was creating histograms with awk earlier today.  (Something like 20 of 
them.)



...this would be the route you'd go.

  :%s/old.\{-}\zsold/new

for just two, or more generically for an arbitrary Nth place (e.g.  N=4)

  %s/\%(old\%(\%(old\)\@!.\)*\)\{3}\zsold/new

where the "3" is N-1.  Indeed ugly.


Ew.  I think I'll step over that pile of annoying for now and stick with 
your good sed recommendation.


Thus my recommendation for the simplicity of sed over the pure-vim 
solution.


Indeed.

Thank you again Tim.



--
Grant. . . .
unix || die

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


Change only second match on a line...

2018-02-15 Thread 'Grant Taylor' via vim_use
Is there a way to change only the second (or any specific) instance of a 
pattern on a line?


Sort of like how 's/old/new/' changes the first instance of "old" to 
"new", but for the second (or any specific) instance.


Or does this involve changing the first instance of "old" twice and then 
changing the first instance of the "new" pattern back to the "old" pattern?


Extrapolating the above sequence out to subsequent instances would be 
more and more annoying.


I know that I can build a full RE that will match the first, second, and 
subsequent instances and surrounding text but that seems cumbersome 
compared to a tweak of "s/old/new/".




--
Grant. . . .
unix || die

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


Re: Modern Vim

2017-11-04 Thread 'Grant Taylor' via vim_use

On 11/04/2017 07:50 AM, Phil Dobbin wrote:

I recently bought a copy of Drew Neil's 'Modern Vim':


I've been eyeing "Modern Vim".

From reading through it (a cursory glance it has to be said) it seems 
well written & covers Vim 8 & NeoVim also.


I've been quite happy with all of Drew's material that I've looked at, 
including "Mastering Vim" and "Vim Casts".


At this point I have to say of course that I have no affiliation with 
the author or the publishers at all, yada, yada, yada.


Likewise.  ;-)



--
Grant. . . .
unix || die

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


Re: libvterm color palette

2017-09-24 Thread 'Grant Taylor' via vim_use

On 09/24/2017 11:46 AM, Bram Moolenaar wrote:
I suppose the xterm source code must contain the "source of truth". 
 I was assuming Leonerd took it from there, but perhaps he didn't. 
Should be easy to fix, but I wonder if Paul will want to take it over.


The last time I went digging for color information in XTerm, I was ... 
disappointed.  It seems as if XTerm's colors are somewhat fluid and were 
never truly set in stone.  (At least that's my understanding.)


Perhaps my (limited) research was based on distro's (modified?) versions 
of XTerm.  -  Though I don't recall hard answers from the authors page 
either.


I ended up installing Linux in a VM, and matching the colors from 
console (not X) output.  -  I then set them in my .Xdefaults file.


Note:  These colors differ from the colors that Microsoft used for cmd.exe.



--
Grant. . . .
unix || die




--
Grant. . . .
unix || die

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


Re: User-defined tabulations

2017-09-19 Thread Grant Taylor

On 09/19/2017 01:37 PM, Mikhail V wrote:
I have noticed that there is similar functionality in VIM 
like markers, that are stored separately in side files.


Are you referring to per file a-z marks / per instance A-Z marks?  Which 
can be stored in viminfo files?




--
Grant. . . .
unix || die

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


Re: Splits and resizing

2017-08-31 Thread Grant Taylor

On 08/31/2017 07:33 AM, Robert wrote:

I almost always do a vertical split to the left of my main window. I would like 
the main window I started with not to resize when the split is added (widening 
the window to accommodate the split) and when closing the split I am back to 
the original window size.


Are you talking about terminal and / or GUI?

It sounds like you're talking about GUI and wanting the vim window to 
widen to accommodate the new split.




--
Grant. . . .
unix || die

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


Re: "sudo vim example" and "vim example"

2017-08-25 Thread Grant Taylor
On 08/25/2017 09:00 AM, Tobias Klausmann wrote:
> Well, if vim is run with sudo, it runs as root and uses root's 
> settings (vimrc etc). What you probably want is sudoedit. It 
> copies the file you want to edit and launches the default editor 
> on it. Once you quit, it copies the file back with propepr 
> permissions etc.

Further, sudoedit (which uses your $EDITOR) is safer than running vim under 
sudo.

At least from a security perspective, sudoedit is safer as many editors, vim 
include, provide a way to escape the editor and launch a shell.

"sudo vim /path/to/file" followed by ":shell" gives you root shell.

"sudoedit /path/to/file" followed by ":shell" gives you a shell as your normal 
user.



-- 
Grant. . . .
unix || die

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


Re: A very naive question: any doc (book, web page, ...) to learn step by step how to custom configure vim?

2017-08-11 Thread Grant Taylor
On 08/11/2017 09:53 AM, John Passaro wrote:
> To my mind, the short answer is learn regular, unconfigured vim first. 

I'd suggest not modifying how Vim behaves / does thing while getting started 
with Vim.

However that does not extend to unconfigured Vim.  I say this because things 
like line numbers (:set number), search highlighting (:set hlsearch), and 
(syntax highlighting (:syntax on) do not modify Vim's behavior, but (I think) 
they do make Vim a bit more friendly.

IMHO there's a subtle but distinct difference.

> To go deeper and really set yourself up for powerful configuration, it 
> helps to go a little deeper than vimtutor. I learned a lot by reading 
> Practical Vim (by Drew Neil of vimcasts.org )

I also strongly recommend Practical Vim & Vimcasts.

> Before that, I was more or less just copying stuff without 
> really understanding what it did. The book was an amazing combination of 
> depth and accessibility; I gained a huge amount of knowledge without 
> having to work all that hard. (The real understanding comes in the 
> practice of course, but the book does a lot to set you up for that.)

I have also found some people on Twitter that seem to have some impressive 
VimFu.  Here are some people I recommend, in alphabetical order:

@ed1conf - Vim can do much of what ed does, and ex mode is quite similar.
@gumnos - WONDERFUL resource. Tim is happy to explain the odd things that he 
does in Vim.
@MasteringVim - Lots of good information and is working on a book.
@nixcraft - LOTS of good unix things, including Vim info.
@VimLinks - Frequently has interesting Vim specific things.

I also frequently tweet, as @DrScriptt, things about Vim, or comment on other 
peoples tweets, frequently asking questions.  @gumnos tends to have wonderful 
answers to explain things.

I played, enjoyed, and learned from VIM Adventures 
(https://vim-adventures.com/).  (I never beat the boss at the end.)  - I'm 
tempted to re-up my subscription and play again.  -  There are some free levels.

I would also recommend that you learn some about regular expressions.  -   Vim 
is a little bit different than other RE engines, mainly in escaping some 
special control characters.  -  I find that RE's are EXTREMELY powerful and 
probably what brought me into Vim.

Sorry for devolving from Vim customization into general Vim.  -  But then 
again, you need to learn enough base Vim to decide what you want to customize.

Finally, strive to understand what things do, and how they do it.

@gumnos and I had a discussion about the following yesterday:

:let a=''|g/pattern/y A

See https://twitter.com/gumnos/status/846310953494986752 for more details.

> A quick perusal of Mr. Neil's site yields at least one essay about the 
> pros and cons of customizing. Cutting to the end you'll find Mr. Neil 
> seems to agree you should learn vim itself:

Agreed.  Learn the basics of Vim, get annoyed by it, find a way to change what 
annoys you, put those changes in your .vimrc as you grow and learn more Vim.



-- 
Grant. . . .
unix || die

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


Re: xsel copies to clipboard twice

2017-08-08 Thread Grant Taylor
On Tuesday, 8 August 2017 12:27:13 UTC-6, Tim Johnson  wrote:
> When I select some text in visual mode and then press ;cc
> the selected text is copied _twice_ to the clipboard 

What happens if you use the following sequence?

"+y

That should copy the selected (hilighted) text into the X11 clipboard.

"*y

That should copy the selected (hilighted) text into the X11 primary selection 
buffer.

(Where "copy" is subject to the typical X11 issues with the source program 
still being available.)



-- 
Grant. . . .
unix || die

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