Wednesday, February 28, 2024

Scrolling horizontally in a popup

Hello,

I'm trying to scroll horizontally in a pop-up window that contains very long lines. I'm sure I've missed something simple, but trying things like (Vim9)

    win_execute(popup_id, ':normal! zH')

Doesn't work. I can execute other commands in the window using the above mechanism.

I'd appreciate any help. Thank you,

Salman

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CANuxnEfoTn%3DYkL%3Dt7YUmjFG0cP0_rdaqh9O_6S8cehfOequV%3DA%40mail.gmail.com.

Re: I had to replace gvim with neovim

Gary Johnson said on Wed, 28 Feb 2024 06:45:04 -0800

>On 2024-02-28, Steve Litt wrote:
>> Hi all,
>>
>> The gvim program became too much of a hassle because it printed all
>> sorts of GTk errors and warnings to the terminal, obliterating
>> valuable information that was there. So I had to uninstall Vim and
>> install neovim, which isn't as good, but all those GTk warnings were
>> messing up my workflow.
>>
>> If anyone knows how to use gvim without all those GTk warnings, I'd
>> like to hear it.
>
>Hi Steve,
>
>I can't test this because I don't get those warnings, but I'm
>assuming they are printed to standard error. Try starting gvim this
>way and see if the warnings go away.
>
> $ gvim 2> /dev/null

Thanks Gary, I should have thought of that. I followed your advice and
renamed /usr/bin/gvim to gvim.warnings, and then made a shellscript
called gvim to call it, piping stderr to /dev/null.

Thanks,

SteveT

Steve Litt

Autumn 2023 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20240228210335.543b9d32%40mydesk.domain.cxm.

Re: surrounding a word with tag with a dynamic attribute

So ...

I've added the function to my vimrc, and that works as "advertised".  Thank  you for that.

One annoying interraction is gvim always giving the " :'<,'> " prompt when I want to call the function in VISUAL mode.  

Is there something I could add to the function to suppress the '' '<,'> ", either a manual toggle off/on before I start using the command, or something to block that after the first instance of the function call, and auto-reinstate after about 1 minute after the last function call?

Eric

On Wednesday 28 February 2024 at 16:15:14 UTC-5 Eric Marceau wrote:
I forgot to say that I was hoping that using the "repeat last" function, namely the ".", would apply that modified command at the next text location where a new string is highlited.

Eric

On Wednesday 28 February 2024 at 16:12:30 UTC-5 Eric Marceau wrote:
Also,

Can someone offer the modified version of that which would permit specifying the desired single tag-string (i.e. 'em') as a parameter for the function call, instead of the open-ended user entry of a string?

I visualize doing something like   ':TagSelection em' for the action to be applied without further interaction.  Is that possible?

Thank you in advance for anyone's contributing that modified code.

Eric

On Wednesday 28 February 2024 at 15:45:11 UTC-5 Eric Marceau wrote:
Hi David,

Your posting of the tip dates quite a while ago.

Any idea if that would still work for vim/gvim 8.1 ?

Is that added to the ~/.vim/vimrc  ?

Finally, is that action triggered by typing the sequence   ':TagSelection'   ?

Thank you,

Eric

On Wednesday 5 May 2010 at 10:23:52 UTC-4 David Fishburn wrote:
On Tue, May 4, 2010 at 7:23 PM, discipulus <ger...@gmail.com> wrote:
...
> It should have been {span class="sX"}discipulus{/span}
>
> I wrote this function just now:
>
> function! mytest()
>  let l:current_column=col('.')
>  exe 'normal b'
>  let l:beginning_column=col('.')
>  let l:diff = l:current_column - l:beginning_column + 1
> " this relies on the surround plugin
>  exe 'normal vs'
> endfunction
>
> What do you think and thanks for your response!

I wrote my own function specifically to wrap XML tags around some
highlighted text. If the text is part of a line I wrap it inline. If
the text (visually selected) spans multiple lines, then I add the tags
on new lines before and after the text.

I also allow you to add attributes and remove those when adding the closing tag.

" Tip #346: Tag Select/Wrapper:/*{{{*/
" http://vim.sourceforge.net/tips/tip.php?tip_id=346
" Author: David Fishburn
" These mappings and TagSelection function will allow you to place
" an XML tag around either the current word, or the current selected
" text.
" If the visual select is on a single line, the tag is wrapped
" around the text <this>way</this>. If the visual select extends
" over multiple lines, the tag is wrapped around the text
" <this>
" way
" </this>
"
" When you are prompted for the tag name, you can enter:
" Tag name? p class="classname" attri="bute"
" The select is wrapped with:
" <p class="classname" attri="bute">
" Your selection
" </p>
" Notice the attributes have been stripped from the closing tag.
"
" Use nmap, not nnoremap, since we do want to use an existing mapping
nmap ,,, viw,,,
vnoremap ,,, <Esc>:call TagSelection()<CR>

function! TagSelection()
let tag = input("Tag name (include attributes)? ")

if strlen(tag) == 0
return
endif

" Save b register
let saveB = @b
" <C-R> seems to automatically reindent the line for some filetypes
" this will disable it until we have applied our changes
let saveIndent = &indentexpr
let curl = line(".")
let curc = col(".")
let &indentexpr = ''

" If the visual selection is over multiple lines, then place the
" data between the tags on newlines:
" <tag>
" data
" </tag>
let newline = ''
if getline("'>") != getline("'<")
let newline = "\n"
let curl = line("'>")
endif

" Strip off all but the first word in the tag for the end tag
let @b = newline . substitute( tag, '^[ \t"]*\(\<\S*\>\).*', '<\/\1>\e', "" )
let curc = curc + strlen(@b)
exec "normal `>a\<C-R>b"

let @b = substitute( tag, '^[ \t"]*\(\<.*\)', '<\1>\e', "" ) . newline
let curc = curc + strlen(@b)
exec "normal `<i\<C-R>b"

" Now format the area
exec "normal `<V'>j="

" Restore b register
let @b = saveB
let &indentexpr = saveIndent

call cursor(curl, curc)
endfunction
" /*}}}*/


If it is of any use to you.

Enjoy.
Dave

--
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 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/510200d6-5bee-4f14-b2e4-61b0ba974bf2n%40googlegroups.com.

Re: surrounding a word with tag with a dynamic attribute

I forgot to say that I was hoping that using the "repeat last" function, namely the ".", would apply that modified command at the next text location where a new string is highlited.

Eric

On Wednesday 28 February 2024 at 16:12:30 UTC-5 Eric Marceau wrote:
Also,

Can someone offer the modified version of that which would permit specifying the desired single tag-string (i.e. 'em') as a parameter for the function call, instead of the open-ended user entry of a string?

I visualize doing something like   ':TagSelection em' for the action to be applied without further interaction.  Is that possible?

Thank you in advance for anyone's contributing that modified code.

Eric

On Wednesday 28 February 2024 at 15:45:11 UTC-5 Eric Marceau wrote:
Hi David,

Your posting of the tip dates quite a while ago.

Any idea if that would still work for vim/gvim 8.1 ?

Is that added to the ~/.vim/vimrc  ?

Finally, is that action triggered by typing the sequence   ':TagSelection'   ?

Thank you,

Eric

On Wednesday 5 May 2010 at 10:23:52 UTC-4 David Fishburn wrote:
On Tue, May 4, 2010 at 7:23 PM, discipulus <ger...@gmail.com> wrote:
...
> It should have been {span class="sX"}discipulus{/span}
>
> I wrote this function just now:
>
> function! mytest()
>  let l:current_column=col('.')
>  exe 'normal b'
>  let l:beginning_column=col('.')
>  let l:diff = l:current_column - l:beginning_column + 1
> " this relies on the surround plugin
>  exe 'normal vs'
> endfunction
>
> What do you think and thanks for your response!

I wrote my own function specifically to wrap XML tags around some
highlighted text. If the text is part of a line I wrap it inline. If
the text (visually selected) spans multiple lines, then I add the tags
on new lines before and after the text.

I also allow you to add attributes and remove those when adding the closing tag.

" Tip #346: Tag Select/Wrapper:/*{{{*/
" http://vim.sourceforge.net/tips/tip.php?tip_id=346
" Author: David Fishburn
" These mappings and TagSelection function will allow you to place
" an XML tag around either the current word, or the current selected
" text.
" If the visual select is on a single line, the tag is wrapped
" around the text <this>way</this>. If the visual select extends
" over multiple lines, the tag is wrapped around the text
" <this>
" way
" </this>
"
" When you are prompted for the tag name, you can enter:
" Tag name? p class="classname" attri="bute"
" The select is wrapped with:
" <p class="classname" attri="bute">
" Your selection
" </p>
" Notice the attributes have been stripped from the closing tag.
"
" Use nmap, not nnoremap, since we do want to use an existing mapping
nmap ,,, viw,,,
vnoremap ,,, <Esc>:call TagSelection()<CR>

function! TagSelection()
let tag = input("Tag name (include attributes)? ")

if strlen(tag) == 0
return
endif

" Save b register
let saveB = @b
" <C-R> seems to automatically reindent the line for some filetypes
" this will disable it until we have applied our changes
let saveIndent = &indentexpr
let curl = line(".")
let curc = col(".")
let &indentexpr = ''

" If the visual selection is over multiple lines, then place the
" data between the tags on newlines:
" <tag>
" data
" </tag>
let newline = ''
if getline("'>") != getline("'<")
let newline = "\n"
let curl = line("'>")
endif

" Strip off all but the first word in the tag for the end tag
let @b = newline . substitute( tag, '^[ \t"]*\(\<\S*\>\).*', '<\/\1>\e', "" )
let curc = curc + strlen(@b)
exec "normal `>a\<C-R>b"

let @b = substitute( tag, '^[ \t"]*\(\<.*\)', '<\1>\e', "" ) . newline
let curc = curc + strlen(@b)
exec "normal `<i\<C-R>b"

" Now format the area
exec "normal `<V'>j="

" Restore b register
let @b = saveB
let &indentexpr = saveIndent

call cursor(curl, curc)
endfunction
" /*}}}*/


If it is of any use to you.

Enjoy.
Dave

--
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 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/d09dba03-dde5-4a98-aa32-7a125f06d837n%40googlegroups.com.

Re: surrounding a word with tag with a dynamic attribute

Also,

Can someone offer the modified version of that which would permit specifying the desired single tag-string (i.e. 'em') as a parameter for the function call, instead of the open-ended user entry of a string?

I visualize doing something like   ':TagSelection em' for the action to be applied without further interaction.  Is that possible?

Thank you in advance for anyone's contributing that modified code.

Eric

On Wednesday 28 February 2024 at 15:45:11 UTC-5 Eric Marceau wrote:
Hi David,

Your posting of the tip dates quite a while ago.

Any idea if that would still work for vim/gvim 8.1 ?

Is that added to the ~/.vim/vimrc  ?

Finally, is that action triggered by typing the sequence   ':TagSelection'   ?

Thank you,

Eric

On Wednesday 5 May 2010 at 10:23:52 UTC-4 David Fishburn wrote:
On Tue, May 4, 2010 at 7:23 PM, discipulus <ger...@gmail.com> wrote:
...
> It should have been {span class="sX"}discipulus{/span}
>
> I wrote this function just now:
>
> function! mytest()
>  let l:current_column=col('.')
>  exe 'normal b'
>  let l:beginning_column=col('.')
>  let l:diff = l:current_column - l:beginning_column + 1
> " this relies on the surround plugin
>  exe 'normal vs'
> endfunction
>
> What do you think and thanks for your response!

I wrote my own function specifically to wrap XML tags around some
highlighted text. If the text is part of a line I wrap it inline. If
the text (visually selected) spans multiple lines, then I add the tags
on new lines before and after the text.

I also allow you to add attributes and remove those when adding the closing tag.

" Tip #346: Tag Select/Wrapper:/*{{{*/
" http://vim.sourceforge.net/tips/tip.php?tip_id=346
" Author: David Fishburn
" These mappings and TagSelection function will allow you to place
" an XML tag around either the current word, or the current selected
" text.
" If the visual select is on a single line, the tag is wrapped
" around the text <this>way</this>. If the visual select extends
" over multiple lines, the tag is wrapped around the text
" <this>
" way
" </this>
"
" When you are prompted for the tag name, you can enter:
" Tag name? p class="classname" attri="bute"
" The select is wrapped with:
" <p class="classname" attri="bute">
" Your selection
" </p>
" Notice the attributes have been stripped from the closing tag.
"
" Use nmap, not nnoremap, since we do want to use an existing mapping
nmap ,,, viw,,,
vnoremap ,,, <Esc>:call TagSelection()<CR>

function! TagSelection()
let tag = input("Tag name (include attributes)? ")

if strlen(tag) == 0
return
endif

" Save b register
let saveB = @b
" <C-R> seems to automatically reindent the line for some filetypes
" this will disable it until we have applied our changes
let saveIndent = &indentexpr
let curl = line(".")
let curc = col(".")
let &indentexpr = ''

" If the visual selection is over multiple lines, then place the
" data between the tags on newlines:
" <tag>
" data
" </tag>
let newline = ''
if getline("'>") != getline("'<")
let newline = "\n"
let curl = line("'>")
endif

" Strip off all but the first word in the tag for the end tag
let @b = newline . substitute( tag, '^[ \t"]*\(\<\S*\>\).*', '<\/\1>\e', "" )
let curc = curc + strlen(@b)
exec "normal `>a\<C-R>b"

let @b = substitute( tag, '^[ \t"]*\(\<.*\)', '<\1>\e', "" ) . newline
let curc = curc + strlen(@b)
exec "normal `<i\<C-R>b"

" Now format the area
exec "normal `<V'>j="

" Restore b register
let @b = saveB
let &indentexpr = saveIndent

call cursor(curl, curc)
endfunction
" /*}}}*/


If it is of any use to you.

Enjoy.
Dave

--
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 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/be76c093-185e-49d9-a081-72eae7d89084n%40googlegroups.com.

Re: surrounding a word with tag with a dynamic attribute

Hi David,

Your posting of the tip dates quite a while ago.

Any idea if that would still work for vim/gvim 8.1 ?

Is that added to the ~/.vim/vimrc  ?

Finally, is that action triggered by typing the sequence   ':TagSelection'   ?

Thank you,

Eric

On Wednesday 5 May 2010 at 10:23:52 UTC-4 David Fishburn wrote:
On Tue, May 4, 2010 at 7:23 PM, discipulus <ger...@gmail.com> wrote:
...
> It should have been {span class="sX"}discipulus{/span}
>
> I wrote this function just now:
>
> function! mytest()
>  let l:current_column=col('.')
>  exe 'normal b'
>  let l:beginning_column=col('.')
>  let l:diff = l:current_column - l:beginning_column + 1
> " this relies on the surround plugin
>  exe 'normal vs'
> endfunction
>
> What do you think and thanks for your response!

I wrote my own function specifically to wrap XML tags around some
highlighted text. If the text is part of a line I wrap it inline. If
the text (visually selected) spans multiple lines, then I add the tags
on new lines before and after the text.

I also allow you to add attributes and remove those when adding the closing tag.

" Tip #346: Tag Select/Wrapper:/*{{{*/
" http://vim.sourceforge.net/tips/tip.php?tip_id=346
" Author: David Fishburn
" These mappings and TagSelection function will allow you to place
" an XML tag around either the current word, or the current selected
" text.
" If the visual select is on a single line, the tag is wrapped
" around the text <this>way</this>. If the visual select extends
" over multiple lines, the tag is wrapped around the text
" <this>
" way
" </this>
"
" When you are prompted for the tag name, you can enter:
" Tag name? p class="classname" attri="bute"
" The select is wrapped with:
" <p class="classname" attri="bute">
" Your selection
" </p>
" Notice the attributes have been stripped from the closing tag.
"
" Use nmap, not nnoremap, since we do want to use an existing mapping
nmap ,,, viw,,,
vnoremap ,,, <Esc>:call TagSelection()<CR>

function! TagSelection()
let tag = input("Tag name (include attributes)? ")

if strlen(tag) == 0
return
endif

" Save b register
let saveB = @b
" <C-R> seems to automatically reindent the line for some filetypes
" this will disable it until we have applied our changes
let saveIndent = &indentexpr
let curl = line(".")
let curc = col(".")
let &indentexpr = ''

" If the visual selection is over multiple lines, then place the
" data between the tags on newlines:
" <tag>
" data
" </tag>
let newline = ''
if getline("'>") != getline("'<")
let newline = "\n"
let curl = line("'>")
endif

" Strip off all but the first word in the tag for the end tag
let @b = newline . substitute( tag, '^[ \t"]*\(\<\S*\>\).*', '<\/\1>\e', "" )
let curc = curc + strlen(@b)
exec "normal `>a\<C-R>b"

let @b = substitute( tag, '^[ \t"]*\(\<.*\)', '<\1>\e', "" ) . newline
let curc = curc + strlen(@b)
exec "normal `<i\<C-R>b"

" Now format the area
exec "normal `<V'>j="

" Restore b register
let @b = saveB
let &indentexpr = saveIndent

call cursor(curl, curc)
endfunction
" /*}}}*/


If it is of any use to you.

Enjoy.
Dave

--
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 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/08d6aee9-4e4c-4165-917b-38675c9f994en%40googlegroups.com.

Re: I had to replace gvim with neovim

On 2024-02-28, Steve Litt wrote:
> Hi all,
>
> The gvim program became too much of a hassle because it printed all
> sorts of GTk errors and warnings to the terminal, obliterating valuable
> information that was there. So I had to uninstall Vim and install
> neovim, which isn't as good, but all those GTk warnings were messing up
> my workflow.
>
> If anyone knows how to use gvim without all those GTk warnings, I'd
> like to hear it.

Hi Steve,

I can't test this because I don't get those warnings, but I'm
assuming they are printed to standard error. Try starting gvim this
way and see if the warnings go away.

$ gvim 2> /dev/null

If that works, then you can either create an alias like this in your
~/.bashrc, assuming your shell is bash:

alias gvim='2>/dev/null gvim'

or you can put the command in this shell script and put the shell
script in some directory in your PATH ahead of wherever gvim is,
e.g. in ~/bin.

#!/bin/sh
exec /usr/bin/gvim "$@" 2>/dev/null

That assumes that your gvim is in /usr/bin. If necessary, change
/usr/bin to the directory where your gvim resides. To find out, use

$ type gvim

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20240228144504.GJ26982%40phoenix.

I had to replace gvim with neovim

Hi all,

The gvim program became too much of a hassle because it printed all
sorts of GTk errors and warnings to the terminal, obliterating valuable
information that was there. So I had to uninstall Vim and install
neovim, which isn't as good, but all those GTk warnings were messing up
my workflow.

If anyone knows how to use gvim without all those GTk warnings, I'd
like to hear it.

SteveT

Steve Litt

Autumn 2023 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20240228082518.7f400374%40mydesk.domain.cxm.

Tuesday, February 20, 2024

Some comments on :help E1377 (subclassing and constructors)

:help E1377 has this paragraph:

Unlike other languages, the constructor of the base class does not
need to be invoked. In fact, it cannot be invoked. If some
initialization from the base class also needs to be done in a child
class, put it in an object method and call that method from every
constructor().

That seems accurate, as in the following script `Bar` has its own
(implicitly defined) constructor, and the parent's constructor is not
invoked (no message is printed):

vim9script

class Foo
var _y = 0

def new(this._y, z: string)
this.Init(z)
enddef

def Init(z: string)
echomsg $'y={this._y}, z={z}'
enddef
endclass

class Bar extends Foo
endclass

var bar = Bar.new(1) # Sets _y to 1, doesn't print anything

Now, I have a couple of remarks:

It seems a bit counterintuitive that `Bar` cannot be initialized like
`Foo`, but with either `Bar.new()` or `Bar.new(n)`.

It may be the case that `Init()` does something necessary for the
initialization of the object. But `Bar` does not call `Init()`, so `bar`
may be potentially broken.

Ok, all that is as documented and can be remedied, of course:

class Bar extends Foo
def new(this._y, z: string)
this.Init(z)
enddef
endclass

var bar = Bar.new(1, 'a') # OK

But:

- I have basically redefined the same constructor of the superclass;
- I must know the private members of `Foo` to do that;
- I must be aware that any constructor must call `Init()` for the
correct initialization of the object. Again, I must know an
implementation detail of the superclass.

Note that `Foo` may be a library object imported by arbitrary users in
arbitrary scripts.

Wouldn't it make more sense for `Bar` to have the parent's constructor
as a default?

Thanks,
Life.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ur2trf%24hf%241%40ciao.gmane.io.

Re: "iabbrev" erratic behaviour

Am 20/02/2024 um 09:42 schrieb Christian Brabandt:
>
> On Mo, 19 Feb 2024, 'Ottavio Caruso' via vim_use wrote:
>
>> Hi,
>>
>> I have this is in my .vimrc:
>>
>> iabbrev mdate <C-R>=strftime("%a %d/%m/%Y")
>>
>>
>> It used to work fine, but as of recently (3 or 4 weeks or so), this
>> abbreviation only works if it is the first thing that I input on any
>> file. If I edit a file, type some characters and then I type "mdate",
>> it doesn't get expanded. I have to save and exit the file, then
>> re-open it and then type "mdate".
>>
>> Is there a way to troubleshoot that?
>
> Make sure you do not have paste mode left enabled.

Thanks. I have double checked but it's not enabled. This is erratic. It
seems to work now. There must be some key combination that triggers this
behaviour.

--
Ottavio Caruso

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/db94bc29-5c81-42d5-b388-f5a187669e25%40yahoo.com.

Re: "iabbrev" erratic behaviour

On Mo, 19 Feb 2024, 'Ottavio Caruso' via vim_use wrote:

> Hi,
>
> I have this is in my .vimrc:
>
> iabbrev mdate <C-R>=strftime("%a %d/%m/%Y")
>
>
> It used to work fine, but as of recently (3 or 4 weeks or so), this
> abbreviation only works if it is the first thing that I input on any
> file. If I edit a file, type some characters and then I type "mdate",
> it doesn't get expanded. I have to save and exit the file, then
> re-open it and then type "mdate".
>
> Is there a way to troubleshoot that?

Make sure you do not have paste mode left enabled.

Thanks,
Christian
--
Official Project Stages:
(1) Uncritical Acceptance
(2) Wild Enthusiasm
(3) Dejected Disillusionment
(4) Total Confusion
(5) Search for the Guilty
(6) Punishment of the Innocent
(7) Promotion of the Non-participants

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ZdR0HvhTBukfYb5D%40256bit.org.

Monday, February 19, 2024

Re: "iabbrev" erratic behaviour

On 2024-02-19, Maxim Kim wrote:

> On Monday, February 19, 2024 at 11:29:19 PM UTC+11 Ottavio Caruso wrote:
> >
> > Hi,
> >
> > I have this is in my .vimrc:
> >
> > iabbrev mdate <C-R>=strftime("%a %d/%m/%Y")
> >
> >
> > It used to work fine, but as of recently (3 or 4 weeks or so), this
> > abbreviation only works if it is the first thing that I input on any
> > file. If I edit a file, type some characters and then I type "mdate",
> > it doesn't get expanded. I have to save and exit the file, then
> > re-open it and then type "mdate".
> >
> > Is there a way to troubleshoot that?
>
> You can check if it works without your configuration: 
>
> $ vim -Nu NONE
> : iabbrev mdate <C-R>=strftime("%a %d/%m/%Y")<CR>
>
> If it isthere must be something in vim config you will need to figure out. One
> common approach is to bisect your vimrc.

Also, you can start vim like this:

$ vim --noplugin

which will use your vimrc but not your plugins. If your
abbreviation works then, it's _probably_ a plugin and not your
vimrc.

To see which plugins are loaded, use this:

:scriptnames

If it appears to be a plugin that's causing the problem, you can
bisect your list of plugins by moving some of them elsewhere
temporarily.

Since the problem started 3 or 4 weeks ago, it's likely due to
something you changed 3 or 4 weeks ago. This command might help in
spotting a change you made at that time.

$ find ~/.vim -type f -mtime +21 -mtime -35 | xargs ls -lt

That will find all regular files (-type f) with modification times
(-mtime) greater than 3 weeks ago (+21) and less than 5 weeks ago
(-35) and list them, sorted by modification time.

>> A: Because it messes up the order in which people normally read text.
>> Q: Why is top-posting such a bad thing?
>> A: Top-posting.
>> Q: What is the most annoying thing in e-mail?

B-)

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20240220054824.GH26982%40phoenix.

Re: matchbufline and ignorecase/smartcase


On Mon, Feb 19, 2024 at 12:11 PM Salman Halim <salmanhalim@gmail.com> wrote:
>
> Hello,
>
> I'm using 64-bit GVim 9.1 patches 1-95 on Windows 10.
>
> Is it possible to have matchbufline() observe 'ignorecase' and 'smartcase'? Currently, if I have 'ignorecase' and 'smartcase' set, it behaves as if only 'ignorecase' were on and gives me results that regular search, for example, don't:
>

The matchbufline() function currently only supports the 'ignorecase'
option setting and
ignores the 'smartcase' setting.

Regards,
Yegappan

Okay. I wasn't sure if it was in the plan. Thank you for explaining.

I wrote this function that does the job, but with a few defaults that I like:

1. Defaults to the current buffer
2. Uses the current search pattern if none is provided
3. Starts on line 1
4. Ends on the last line in the file (basically, defaults to the whole file)

If both ignorecase and smartcase are on and the pattern contains any uppercase letter, it temporarily turns off ignorecase to force the function to match case.

The function:

export def g:MatchBufLine( buf: any = bufnr(), pat: string = @/, lnum: any = 1, end: any = '$', dict: dict<any> = {} ): list<dict<any>>
  var matchCase: bool = false

  if ( &ignorecase && &smartcase && pat =~# '[A-Z]' )
    matchCase = true

    set noignorecase
  endif

  var result: list<dict<any>> = matchbufline( buf, pat, lnum, end, dict )

  if ( matchCase )
    set ignorecase
  endif

  return result
enddef

Hope someone else finds it useful.

Salman

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CANuxnEeVwKfhMKHhChk2zFNZrkLcPLMfbawwd0fbXFPkqQKVfQ%40mail.gmail.com.

Re: "iabbrev" erratic behaviour

> Is there a way to troubleshoot that?

You can check if it works without your configuration: 

$ vim -Nu NONE
: iabbrev mdate <C-R>=strftime("%a %d/%m/%Y")<CR>

If it isthere must be something in vim config you will need to figure out. One common approach is to bisect your vimrc.

On Monday, February 19, 2024 at 11:29:19 PM UTC+11 Ottavio Caruso wrote:
Hi,

I have this is in my .vimrc:

iabbrev mdate <C-R>=strftime("%a %d/%m/%Y")


It used to work fine, but as of recently (3 or 4 weeks or so), this
abbreviation only works if it is the first thing that I input on any
file. If I edit a file, type some characters and then I type "mdate",
it doesn't get expanded. I have to save and exit the file, then
re-open it and then type "mdate".

Is there a way to troubleshoot that?

--
Ottavio Caruso

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/b34ee5a3-7464-4697-8611-9716f1bffb23n%40googlegroups.com.

Re: matchbufline and ignorecase/smartcase

Hi,

On Mon, Feb 19, 2024 at 12:11 PM Salman Halim <salmanhalim@gmail.com> wrote:
>
> Hello,
>
> I'm using 64-bit GVim 9.1 patches 1-95 on Windows 10.
>
> Is it possible to have matchbufline() observe 'ignorecase' and 'smartcase'? Currently, if I have 'ignorecase' and 'smartcase' set, it behaves as if only 'ignorecase' were on and gives me results that regular search, for example, don't:
>

The matchbufline() function currently only supports the 'ignorecase'
option setting and
ignores the 'smartcase' setting.

Regards,
Yegappan

>
> Search for 'Unknown' where the file contains:
>
> unknown
> Unknown
> UNKNOWN
>
> Searching via n/N only finds the middle one (smartcase forces case matching) while matchbufline() matches all three.
>
> I COULD, of course, stick a \c or \C in front of my pattern based on whether the pattern contains an upper-case character, but I'd rather find out whether there is a plan to make matchbufline() observer smartcase before I put in the workaround.
>
> Thank you,
>
> --
>
> Salman

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAAW7x7mRsZ%2BMsFyhYxfRe6O1SGsrFfBgR84F9Xc%3D%2BpsKLV8FsA%40mail.gmail.com.

matchbufline and ignorecase/smartcase

Hello,

I'm using 64-bit GVim 9.1 patches 1-95 on Windows 10.

Is it possible to have matchbufline() observe 'ignorecase' and 'smartcase'? Currently, if I have 'ignorecase' and 'smartcase' set, it behaves as if only 'ignorecase' were on and gives me results that regular search, for example, don't:

Search for 'Unknown' where the file contains:

unknown
Unknown
UNKNOWN

Searching via n/N only finds the middle one (smartcase forces case matching) while matchbufline() matches all three.

I COULD, of course, stick a \c or \C in front of my pattern based on whether the pattern contains an upper-case character, but I'd rather find out whether there is a plan to make matchbufline() observer smartcase before I put in the workaround.

Thank you,

--
 
Salman

I, too, shall something make and glory in the making.

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CANuxnEcZ0SWUpbQ5GxmLm%2B8EApabdG%3DHWbLE9Xt-xrOH8hTgEg%40mail.gmail.com.

"iabbrev" erratic behaviour

Hi,

I have this is in my .vimrc:

iabbrev mdate <C-R>=strftime("%a %d/%m/%Y")


It used to work fine, but as of recently (3 or 4 weeks or so), this
abbreviation only works if it is the first thing that I input on any
file. If I edit a file, type some characters and then I type "mdate",
it doesn't get expanded. I have to save and exit the file, then
re-open it and then type "mdate".

Is there a way to troubleshoot that?

--
Ottavio Caruso

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAEJNuHxMZRcW93dG5SyKaWpq6cwUDMjfwyc68tZNK7%2BjkscOqg%40mail.gmail.com.

Friday, February 16, 2024

Re: Vim 9 problem under Cygwin64

 Thanks for your comment, Gary. I was certainly very surprised that such a workaround would be necessary, and wondered what might be going wrong 'under the hood'. In fact, in the course of my lengthy searching on the web for advice on the problem, I saw an intriguing post from you (probably from a good many years ago) about something quite similar where I think you were saying that you had a different way of handling the combination of cygwin and windows so didn't need to fuss with an issue which somebody was experiencing. Sorry, that's just my vague recollection, and I've now closed all the tabs I had open in my searches.
 For now I'm relieved to have some sort of a fix, even though it may be a bit 'dirty'. A deeper understanding of what is causing the problem would be good to learn about—someday.

John Cordes


On Fri, Feb 16, 2024 at 7:55 PM Gary Johnson <garyjohn@spocom.com> wrote:
On 2024-02-16, John Cordes wrote:
> My apologies for too many posts! I have added the export VIM command to
> cygwin's .bash_profile; I believe that should do the trick.
> Many thanks to Salman Halim for the suggestion.

I'm glad you and Salman got this working, and that is the most
important thing.  However, I did want to mention, in case anyone
else reads this, that setting VIM in your ~/.bashrc should not be
necessary.

I've been running Cygwin and Cygwin64 for many years on Windows 10
and 11, using Windows' gvim, Cygwin's vim, and vims I've built
myself under Cygwin, and I've never had to do that.  There's a root
cause that hasn't been uncovered yet; I just don't have the time at
the moment to help with an investigation.

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20240216235414.GG26982%40phoenix.

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAGZBEdRAp%2B2foWpD4vohK16O1ZUTxxytk45XZG1NQTcsXjKdaA%40mail.gmail.com.

Re: Vim 9 problem under Cygwin64

On 2024-02-16, John Cordes wrote:
> My apologies for too many posts! I have added the export VIM command to
> cygwin's .bash_profile; I believe that should do the trick.
> Many thanks to Salman Halim for the suggestion.

I'm glad you and Salman got this working, and that is the most
important thing. However, I did want to mention, in case anyone
else reads this, that setting VIM in your ~/.bashrc should not be
necessary.

I've been running Cygwin and Cygwin64 for many years on Windows 10
and 11, using Windows' gvim, Cygwin's vim, and vims I've built
myself under Cygwin, and I've never had to do that. There's a root
cause that hasn't been uncovered yet; I just don't have the time at
the moment to help with an investigation.

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20240216235414.GG26982%40phoenix.

Re: Vim 9 problem under Cygwin64

My apologies for too many posts! I have added the export VIM command to cygwin's .bash_profile; I believe that should do the trick.
Many thanks to Salman Halim for the suggestion.
John Cordes

On Fri, Feb 16, 2024 at 6:46 PM John Cordes <john.cordes@dal.ca> wrote:
I tried something based on your original suggestion:

$ export VIM=/usr/share/vim

which seems to 'work' (no longer any interruption when opening a file with vim, and syntax highlighting is working). How would I set this to always be implemented whenever cygwin is run?

Thanks,
John


On Fri, Feb 16, 2024 at 6:43 PM Salman Halim <salmanhalim@gmail.com> wrote:
In my Windows environment, VIM and VIMRUNTIME are regular environment variables that I can edit like any others. If that doesn't work, maybe they're defined in your shell's RC file?

Salman

On Fri, Feb 16, 2024, 17:18 John Cordes <john.cordes@dal.ca> wrote:
Thanks for the thought. In Cygwin echo $PATH shows all forward slashes. Did you mean to somehow edit things like $VIMRUNTIME? I'm not sure how that would be done.

John


On Fri, Feb 16, 2024 at 6:11 PM Salman Halim <salmanhalim@gmail.com> wrote:
This may be too simple, but have you tried changing the environment variables variables to have forward slashes instead of back slashes?

Salman

On Fri, Feb 16, 2024, 16:46 John Cordes <John.Cordes@dal.ca> wrote:
I'm hoping someone can help with a problem. I've had cygwin64 installed for at least a couple of years, with Vim v8 running just fine. I also have Windows Vim running; this is all under Win 10.
 I've just updated the cygwin64 installation and vim is now v9.0. When I start the cygwin vim I get these lines:

===========================
Error detected while processing /etc/vimrc:
line   90:
E484: Can't open file C:UsersOwner_vim/vim90/syntax/syntax.vim
Error detected while processing /home/Owner/.vimrc:
line    6:
E484: Can't open file C:UsersOwner_vim/vim90/syntax/syntax.vim
Press ENTER or type command to continue
===========================

Pressing ENTER allows me to continue, editing files, etc. but not surprisingly with no syntax highlighting.

:echo $VIMRUNTIME = C:\Users\Owner\_vim/vim90
Note the mixed up forward and backward slashes in that path. Note also the lack of slashes in the paths reported above as E484. 

 It seems clear that there is some sort of clash between Unix and Windows path conventions going on but I haven't been able to figure out how to fix it.

The file syntax.vim does exist and is in the right location (I think):
$ ls -l /usr/share/vim/vim90/syntax/syntax.vim
-rw-r--r-- 1 Owner Administrators 1.4K Dec 20 01:57 /usr/share/vim/vim90/syntax/syntax.vim

vim --version includes these lines:
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Dec 20 2023 06:57:02)
Included patches: 1-2155
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
 
One more item:
:scriptnames
  1: /etc/vimrc
  2: ~/.vimrc
  3: ~/.vim/keymap/insert_only_capslock.vim
  4: ~/.vim/bufferlist.vim
  5: ~/.vim/plugin/matchit.vim

Thanks for any help!

John Cordes


--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/QB1PR01MB29933933E4C6D2C0145DDA0B9E4C2%40QB1PR01MB2993.CANPRD01.PROD.OUTLOOK.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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CANuxnEeF0f_A2%2BfXGS6oZRn_%3Ds17W7yDfyCORm3D68AD2GjAZw%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAGZBEdTa-CCta_7kJNcDxzwcSn%3DsTu_45OSx%2B3zwZjs%2BDPRZbA%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CANuxnEcRM15OLaxHs03cW6drhxa7zyK4eMYV2vT6jufHZ6R9hA%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAGZBEdT2ws0wiSEPqyrjLuaDGjeYgb2ivyJ9zWPzpPs_dO7onA%40mail.gmail.com.

Re: Vim 9 problem under Cygwin64

I tried something based on your original suggestion:

$ export VIM=/usr/share/vim

which seems to 'work' (no longer any interruption when opening a file with vim, and syntax highlighting is working). How would I set this to always be implemented whenever cygwin is run?

Thanks,
John


On Fri, Feb 16, 2024 at 6:43 PM Salman Halim <salmanhalim@gmail.com> wrote:
In my Windows environment, VIM and VIMRUNTIME are regular environment variables that I can edit like any others. If that doesn't work, maybe they're defined in your shell's RC file?

Salman

On Fri, Feb 16, 2024, 17:18 John Cordes <john.cordes@dal.ca> wrote:
Thanks for the thought. In Cygwin echo $PATH shows all forward slashes. Did you mean to somehow edit things like $VIMRUNTIME? I'm not sure how that would be done.

John


On Fri, Feb 16, 2024 at 6:11 PM Salman Halim <salmanhalim@gmail.com> wrote:
This may be too simple, but have you tried changing the environment variables variables to have forward slashes instead of back slashes?

Salman

On Fri, Feb 16, 2024, 16:46 John Cordes <John.Cordes@dal.ca> wrote:
I'm hoping someone can help with a problem. I've had cygwin64 installed for at least a couple of years, with Vim v8 running just fine. I also have Windows Vim running; this is all under Win 10.
 I've just updated the cygwin64 installation and vim is now v9.0. When I start the cygwin vim I get these lines:

===========================
Error detected while processing /etc/vimrc:
line   90:
E484: Can't open file C:UsersOwner_vim/vim90/syntax/syntax.vim
Error detected while processing /home/Owner/.vimrc:
line    6:
E484: Can't open file C:UsersOwner_vim/vim90/syntax/syntax.vim
Press ENTER or type command to continue
===========================

Pressing ENTER allows me to continue, editing files, etc. but not surprisingly with no syntax highlighting.

:echo $VIMRUNTIME = C:\Users\Owner\_vim/vim90
Note the mixed up forward and backward slashes in that path. Note also the lack of slashes in the paths reported above as E484. 

 It seems clear that there is some sort of clash between Unix and Windows path conventions going on but I haven't been able to figure out how to fix it.

The file syntax.vim does exist and is in the right location (I think):
$ ls -l /usr/share/vim/vim90/syntax/syntax.vim
-rw-r--r-- 1 Owner Administrators 1.4K Dec 20 01:57 /usr/share/vim/vim90/syntax/syntax.vim

vim --version includes these lines:
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Dec 20 2023 06:57:02)
Included patches: 1-2155
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
 
One more item:
:scriptnames
  1: /etc/vimrc
  2: ~/.vimrc
  3: ~/.vim/keymap/insert_only_capslock.vim
  4: ~/.vim/bufferlist.vim
  5: ~/.vim/plugin/matchit.vim

Thanks for any help!

John Cordes


--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/QB1PR01MB29933933E4C6D2C0145DDA0B9E4C2%40QB1PR01MB2993.CANPRD01.PROD.OUTLOOK.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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CANuxnEeF0f_A2%2BfXGS6oZRn_%3Ds17W7yDfyCORm3D68AD2GjAZw%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAGZBEdTa-CCta_7kJNcDxzwcSn%3DsTu_45OSx%2B3zwZjs%2BDPRZbA%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CANuxnEcRM15OLaxHs03cW6drhxa7zyK4eMYV2vT6jufHZ6R9hA%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAGZBEdTrH%3DzEK7XgnZ-EELN15YrAXKY14-vndOTdcCFnOmxQaw%40mail.gmail.com.

Re: Vim 9 problem under Cygwin64

In my Windows environment, VIM and VIMRUNTIME are regular environment variables that I can edit like any others. If that doesn't work, maybe they're defined in your shell's RC file?

Salman

On Fri, Feb 16, 2024, 17:18 John Cordes <john.cordes@dal.ca> wrote:
Thanks for the thought. In Cygwin echo $PATH shows all forward slashes. Did you mean to somehow edit things like $VIMRUNTIME? I'm not sure how that would be done.

John


On Fri, Feb 16, 2024 at 6:11 PM Salman Halim <salmanhalim@gmail.com> wrote:
This may be too simple, but have you tried changing the environment variables variables to have forward slashes instead of back slashes?

Salman

On Fri, Feb 16, 2024, 16:46 John Cordes <John.Cordes@dal.ca> wrote:
I'm hoping someone can help with a problem. I've had cygwin64 installed for at least a couple of years, with Vim v8 running just fine. I also have Windows Vim running; this is all under Win 10.
 I've just updated the cygwin64 installation and vim is now v9.0. When I start the cygwin vim I get these lines:

===========================
Error detected while processing /etc/vimrc:
line   90:
E484: Can't open file C:UsersOwner_vim/vim90/syntax/syntax.vim
Error detected while processing /home/Owner/.vimrc:
line    6:
E484: Can't open file C:UsersOwner_vim/vim90/syntax/syntax.vim
Press ENTER or type command to continue
===========================

Pressing ENTER allows me to continue, editing files, etc. but not surprisingly with no syntax highlighting.

:echo $VIMRUNTIME = C:\Users\Owner\_vim/vim90
Note the mixed up forward and backward slashes in that path. Note also the lack of slashes in the paths reported above as E484. 

 It seems clear that there is some sort of clash between Unix and Windows path conventions going on but I haven't been able to figure out how to fix it.

The file syntax.vim does exist and is in the right location (I think):
$ ls -l /usr/share/vim/vim90/syntax/syntax.vim
-rw-r--r-- 1 Owner Administrators 1.4K Dec 20 01:57 /usr/share/vim/vim90/syntax/syntax.vim

vim --version includes these lines:
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Dec 20 2023 06:57:02)
Included patches: 1-2155
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
 
One more item:
:scriptnames
  1: /etc/vimrc
  2: ~/.vimrc
  3: ~/.vim/keymap/insert_only_capslock.vim
  4: ~/.vim/bufferlist.vim
  5: ~/.vim/plugin/matchit.vim

Thanks for any help!

John Cordes


--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/QB1PR01MB29933933E4C6D2C0145DDA0B9E4C2%40QB1PR01MB2993.CANPRD01.PROD.OUTLOOK.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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CANuxnEeF0f_A2%2BfXGS6oZRn_%3Ds17W7yDfyCORm3D68AD2GjAZw%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAGZBEdTa-CCta_7kJNcDxzwcSn%3DsTu_45OSx%2B3zwZjs%2BDPRZbA%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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CANuxnEcRM15OLaxHs03cW6drhxa7zyK4eMYV2vT6jufHZ6R9hA%40mail.gmail.com.