Monday, May 27, 2024

man.vim plugin : « troff: [...]cannot select font 'CW' »

hi,

this is the warning I get when I use Man command, to call wget's man page for example.
one appears for each line where CW is used (I guess).

I get the same warnings from command line : man wget | vim -

--
$vim --version
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled May 26 2024 00:11:37)
Included patches: 1-445
Compiled by Arch Linux
Huge version without GUI.[...]

--
--
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/96574e80-0607-4058-8dad-bc81e67546d9n%40googlegroups.com.

Error building Vim

Hello,

I'm trying to set up a new Windows 11 laptop and have followed the steps in INSTALLpc.txt after getting the latest Vim repository from git. When I try to compile with Python support, I get the following error and compilation stops. I'm hoping someone can tell me what to do about this.

if_python.c:66:10: fatal error: Python.h: No such file or directory
   66 | #include <Python.h>
      |          ^~~~~~~~~~
compilation terminated.

My command-line (executed from inside vim/src):

mingw32-make -f Make_ming.mak -j$NUMBER_OF_PROCESSORS GUI=yes FEATURES=HUGE PYTHON3=c:/Python312 PYTHON3_VER=312 PYTHON=c:/Python27 PYTHON_VER=27 DYNAMIC_PYTHON=yes STATIC_STDCPLUS=yes DIRECTX=yes

I've tried changing 'mingw32-make' to just 'make' and still get the same error. Running it with 'clean' instead of all the other parameters works as expected.

I would appreciate any help here, please.

Thank you and best regards,

--
 
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/CANuxnEdHmE60wbQa95f8puM%2BmmZrFWvDdOmuV-i_u8bssNjQ0A%40mail.gmail.com.

Re: Adapting swich-case indentation

Hi radl...,

On Monday, 2024-05-27 15:06:51 -0700, radl...@gmail.com wrote:

> Is there a way to bend Vim to my will in indenting C switch-case statements
> with local scopes delimited by braces. Here's what I mean: (Vim 9.1 on
> MacOS (M2 chip and Intel x86-64)
> int main() {
> int n = 42;
> switch (n) {
> case 42: {
> int twice = 2*n;
> }
> }
> }

Play with the cinoptions values, see :h 'cinoptions-values'

Adding l1 should suit your case. So
:set cinoptions=l1
if you don't have other values already.

Eike

--
OpenPGP/GnuPG encrypted mail preferred in all private communication.
GPG key 0x6A6CD5B765632D3A - 2265 D7F3 A7B0 95CC 3918 630B 6A6C D5B7 6563 2D3A
Use LibreOffice! https://www.libreoffice.org/

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

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

Adapting swich-case indentation

Is there a way to bend Vim to my will in indenting C switch-case statements with local scopes delimited by braces.  Here's what I mean: (Vim 9.1 on MacOS (M2 chip and Intel x86-64) 
int main() {
    int n = 42;
    switch (n) {
        case 42: {
            int twice = 2*n;
        }        
    }
}

The above example illustrates what I want:.  But when I visual-select those lines and press =. I get this:
int main() {
    int n = 42;
    switch (n) {
        case 42: {
                     int twice = 2*n;
                 }
    }

The compiler insists on the braces because of that local int twice variable;   putting the opening brace of the case: on its own line helps, but then I have a deviation from my preferred style. 

Please note that this example is contrived to illustrate the problem, not an excerpt from  an actual program..

Am I just finally asking too much of Vim?

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/e1c52cd7-710b-4d27-a4cb-c601b3f3fa80n%40googlegroups.com.

Sunday, May 26, 2024

Re: unexpected value from mode(1) command



вс, 26 мая 2024 г., 19:25 Mike <mssr953@gmail.com>:
Hello.

If, in normal mode, I type a colon followed by the command "echo
mode(1)", the value "n" is displayed in the command-line area indicating
normal mode.  I would have expected something beginning with "c" which
would be consistent with what ":help cmdline-mode" states.

Could someone explain why the observed behavior should have been expected?

Thanks in advance for the education!

--
--
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/v2vnpp%24i0q%241%40ciao.gmane.io.

Vim stays in Command-line mode as long as user _is editing_ the command line. After enter key has been pressed Vim gets back into the Normal mode, as explained at `:help mode-switching` topic.

Kind regards,

--
--
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/CAFsTB%2BLM4b8pGtSsNu292J-o-zZCD4%2BKCzN5_CN%2B%2BYncPqXKUA%40mail.gmail.com.

Re: problem to create a shortcut

For the record, the following worked for me:

```
function GotoMark(str) abort
  execute printf('/MARK_%s', a:str)
endfunction

command -nargs=* Gm call GotoMark(<f-args>)

" test
new | put =['abc', 'MARK_X', 'def']
Gm X
```

Note that `:/{pattern}` is a shorter way of saying `:global/{pattern}/` if all you care about is the side-effect of moving the cursor; technically, the latter moves to the last occurrence of the pattern while `:/` moves to the next occurrence (with wrap-around controlled by the 'wrapscan' option).

--
--
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/2025f52d-65f1-40f6-8a1e-c5d01be15c63n%40googlegroups.com.

unexpected value from mode(1) command

Hello.

If, in normal mode, I type a colon followed by the command "echo
mode(1)", the value "n" is displayed in the command-line area indicating
normal mode. I would have expected something beginning with "c" which
would be consistent with what ":help cmdline-mode" states.

Could someone explain why the observed behavior should have been expected?

Thanks in advance for the education!

--
--
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/v2vnpp%24i0q%241%40ciao.gmane.io.

Saturday, May 25, 2024

Re: problem to create a shortcut

Note: The very first message to this list is always moderated, so
sometimes it takes a bit of time until a moderator notices a new message
in the queue waiting for approval.

On Sa, 25 Mai 2024, Andreas Otto wrote:

> the following  code does NOT work.
> The goal is to use a shortcut like "Gmx" to jump to a mark "MARK_X" in the test.
> to make it more useable U want to create a function with the last string (in the case above "X" as argument.
>
> question: HOW I write a "goto-mark" function in vim?

In its simplest form the following should work:

function GotoMark(str)
exe 'g/MARK_' .. a:str
endfunction


Thanks,
Christian
--
Line Printer paper is strongest at the perforations.

--
--
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/ZlGiAQGXJ6%2B98wsy%40256bit.org.

problem to create a shortcut

the following  code does NOT work.
The goal is to use a shortcut like "Gmx" to jump to a mark "MARK_X" in the test.
to make it more useable U want to create a function with the last string (in the case above "X" as argument.

question: HOW I write a "goto-mark" function in vim?

" old → works
command! -nargs=0 Gmu    silent g/MARK_U\>/
command! -nargs=0 Gmv    silent g/MARK_V\>/
command! -nargs=0 Gmw    silent g/MARK_W\>/
command! -nargs=0 Gmx    silent g/MARK_X\>/
command! -nargs=0 Gmy    silent g/MARK_Y\>/
command! -nargs=0 Gmz    silent g/MARK_Z\>/

" new → doesn't work
function GotoMark(str)
  "execute("g/MARK_" . a:str . "/")
  "execute("g/MARK_" . "PN" . "/")
  g/MARK_PN/
endfunction

command! -nargs=1 Gm     silent call GotoMark(<f-args>)
"command! -nargs=1 GM     silent execute("g/MARK_" . string(<f-args>) . "/")
"command! -nargs=1 GM     silent g/MARK_PN/

--
--
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/a9f7041d-2265-42c5-9802-3b5463237381n%40googlegroups.com.

Friday, May 24, 2024

Vim in Windows Command Prompt only has 16 colors to work with

If I launch vim from the Windows 10 cmd line and then run the command "echo &t_Co" it only returns 16. Is there any way to get at least 256 colors to display in a regular cmd window, if not full color?

--
--
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/b9bdca24-389c-457d-995f-a06ec6fa5859n%40googlegroups.com.

Wednesday, May 22, 2024

Can netrw be used to connect to ifs on an AS400?

Would it allow member editing as well?

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/96bea487-df3d-4cc1-b9de-1ccde1063cd3n%40googlegroups.com.

Re: Mark special characters

* Christian Brabandt <cblists@256bit.org> [240522 09:01]:
> On Mi, 22 Mai 2024, Igor wrote:
> > I would like to distinguish normal spaces with characters that are in
> > vim displayed as spaces, but are some non-space characters. Is there a
> > way to display those characters so that I will spot them as special
> > characters?
>
> Someone shared the following on the list a few years ago
> https://groups.google.com/g/vim_use/c/FuEGojGwKCM/m/V1K8VAWWKrEJ
>
> and since then I have it in my .vimrc even so I should probably change
> it to a WinEnter autocommand.

Why WinEnter? Won't that set this much more often than necessary?

> " Highlight special white space
> hi def link WhiteSpaceError Error
> match WhiteSpaceError /[\x0b\x0c\u00a0\u1680\u180e\u2000-\u200a\u2028\u202f\u205f\u3000]/
>
> Thanks,
> Christian
> --
> Almost anything derogatory you could say about today's software design
> would be accurate.
> -- K. E. Iverson
^^^^^^^^^^^^^
Are you an APL fan?

...Marvin

--
--
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/Zk4L5ZS7Sc4r51Jt%40basil.wdw.

Re: Mark special characters

On Mi, 22 Mai 2024, Igor wrote:

> Hi, I use latest vim v9.1.0429 on Windows 11.
>
> In the file I have received I was convinced there are spaces between
> words, but there were some special characters and so when I tried to
> execute the commands in my cmd I have got very strange syntax errors.
> Probably some special character has been copied from Microsoft Word.
>
> I would like to distinguish normal spaces with characters that are in
> vim displayed as spaces, but are some non-space characters. Is there a
> way to display those characters so that I will spot them as special
> characters?

Someone shared the following on the list a few years ago
https://groups.google.com/g/vim_use/c/FuEGojGwKCM/m/V1K8VAWWKrEJ

and since then I have it in my .vimrc even so I should probably change
it to a WinEnter autocommand.

" Highlight special white space
hi def link WhiteSpaceError Error
match WhiteSpaceError /[\x0b\x0c\u00a0\u1680\u180e\u2000-\u200a\u2028\u202f\u205f\u3000]/

Thanks,
Christian
--
Almost anything derogatory you could say about today's software design
would be accurate.
-- K. E. Iverson

--
--
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/Zk3sfp1p1qA1crbG%40256bit.org.

Mark special characters

Hi,
I use latest vim v9.1.0429 on Windows 11.

In the file I have received I was convinced there are spaces between words, but there were some special characters and so when I tried to execute the commands in my cmd I have got very strange syntax errors. Probably some special character has been copied from Microsoft Word.

I would like to distinguish normal spaces with characters that are in vim displayed as spaces, but are some non-space characters. Is there a way to display those characters so that I will spot them as special characters?

Regards

--
--
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/dedaf00b-8d58-46d9-ad4c-175e102dea65n%40googlegroups.com.

Saturday, May 18, 2024

Termdebug in docker?

Hi all,

is there anyone who tried to use/is using Termdebug to debug in docker?
If so, how did you setup the whole machinery?

Thanks,
/Ubaldo


--
--
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/CA%2BnhgoO9-VLEgU0DL4dZNDN0%2B_YR%2BUZvsG3DzcqTbXMa9%3DHqxw%40mail.gmail.com.

Friday, May 17, 2024

Re: Using vim9 script in cmd-line without vim9cmd

As also wrote on github, I second this. However:

1. vim9 variables are script-scoped. If you declare from the command line, e.g. `:var a = 0` what shall be the scope of `a`?
2. Having an option set vim9cmdline (false as default) to switch the command line interpreter between legacy and vim9 script looks a viable idea to me

My 2 cents,
/Ubaldo
 

On Wednesday 15 May 2024 at 10:57:01 UTC+2 Girish wrote:
Can this feature be added without major upheaval? Basically, I want to execute vim9 script without typing 'vim9cmd' in command line. Turn off legacy script in command line, and only use vim9 script. Today, we cannot even declare a vim9 variable in command 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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/fd62e037-5dd9-4cb4-a074-21dc05b048afn%40googlegroups.com.

Thursday, May 16, 2024

Python or Powershell library for Vim-Server functionality?

All,

Are there any libs for Python3 or Powershell to utilize the vim-server functionality in Windows?

I'm asking because I'm trying to find one that's safe to install.

Thank you,
  helpdeskaleer

--
--
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/CAEJF0%2B3Yn94GLSq4fUS7fiKV--sh5XS8rQwhhg4s_-DXNMtVkA%40mail.gmail.com.

Wednesday, May 15, 2024

Using vim9 script in cmd-line without vim9cmd

Can this feature be added without major upheaval? Basically, I want to execute vim9 script without typing 'vim9cmd' in command line. Turn off legacy script in command line, and only use vim9 script. Today, we cannot even declare a vim9 variable in command 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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ab9b59bb-aff5-4912-b44f-fba5f492bd76n%40googlegroups.com.

Tuesday, May 14, 2024

Termdebug in vim9?

Hi all,

I was in need of a debugger for embedded systems and I built all a machinery around Termdebug. I eventually made it work in satisfactory manner, or., let's say, it met my needs. However, I wanted to make some other changes and I figured that I had to change the Termdebug source code. However, given that I cannot script with the legacy language, and given that I had a surgery ten days ago that keep me locked at home (all good and all fine if you were asking) I took the freedom of converting Termdebug in Vim9 language. I tested it a bit and it seems to work fine.

If you want to give it a shot and give some feedback, here is where it is stored:


There is also the original plugin in legacy scripting language. If you open both the versions in a vertical split, then you can compare them back-to-back fairly easily. There is also a changes.txt so you can see my intentions on what I wish to do with it. :) 

If you believe that the work is well-done I can issue a PR towards Vim repo. Or I can make some changes reported in changes.txt file and make a PR. You let me know :)   
Otherwise if you think it's a bad porting (and I would be perfectly fine with that given that I am an applied mathematician, not a programmer :D) I will hack the current version by throwing away all the things that I don't need and use the "leftovers" it as basis for a plugin that I actually kinda need. :) 

Cheers,
/Ubaldo 

--
--
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/CA%2BnhgoNCY668Q%2BGfrGFwjF7_0XFyF3visnGgtkzOaCmRu3eEew%40mail.gmail.com.

Monday, May 13, 2024

Re: vim cannot write a file being saved by OneDrive but Notepad++ can

I found a reference to whitelisting a program with Windows, here:

https://answers.microsoft.com/en-us/windows/forum/all/ransomeware-protection-adding-applications-to-the/842850e6-4312-49b6-9c10-09bf3ba1804a

Sadly I followed the instructions and it didn't fix the problem.

My IT guy came by and suggested I go to "Windows Security > Virus & threat protection > Protection history", and click on a recent item.

Sure enough, it showed

App or process blocked: gvim.exe
...
Blocked by: Controlled folder access

There was a link, "Controlled folder access settings" > "Allow an app through Controlled folder access" which shows "Allow an app through Controlled folder access".

There's a list there of allowed apps, and a button, "+ Add an allowed app".  I used that to allow gvim and away I went. No more problems.


On Monday, May 13, 2024 at 4:07:46 PM UTC-4 Richard Pennenga wrote:
Has anyone else seen this?

I have an existing text file (foo.py) in a folder backed up by OneDrive.  I created the file using Notepad++.  I opened the file using vim, modified the text and tried to write it (":w<cr>").  I get the following:

"foo.py" E514: Write error (file system full?)
WARNING: Original file may be lost or damaged
don't quit the editor until the file is successfully written!

Notepad++ can read and write the file just fine.

Any ideas?

--
--
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/b2b5431c-6d7d-4a3f-96ab-8284bfa86042n%40googlegroups.com.

vim cannot write a file being saved by OneDrive but Notepad++ can

Has anyone else seen this?

I have an existing text file (foo.py) in a folder backed up by OneDrive.  I created the file using Notepad++.  I opened the file using vim, modified the text and tried to write it (":w<cr>").  I get the following:

"foo.py" E514: Write error (file system full?)
WARNING: Original file may be lost or damaged
don't quit the editor until the file is successfully written!

Notepad++ can read and write the file just fine.

Any ideas?

--
--
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/721af91f-cb89-4085-af35-0dc4802e8671n%40googlegroups.com.

Friday, May 10, 2024

Re: Access class member from command line

On 2024-05-10, Yegappan Lakshmanan <yegappanl@gmail.com> wrote:
>> Right now, the only issue I have is with autoload scripts in my vimrc,
>> but I see that it's being tracked as #13313 in GitHub. Other than that,
>> I must say that Vim 9 script has been rock solid for me (no more
>> crashes), and very pleasant to use!
>>
>
> I have opened the PR https://github.com/vim/vim/pull/14740 to address
> this issue.

I've just tried that, and it works like a charm! For older versions of
Vim, I've found that I can create a symlink in ~/.vim/autoload, e.g.:

cd ~/.vim/autoload
ln -s ../pack/plugins/foo/autoload/foo.vim

Then foo.vim is found by `import autoload` in my vimrc.

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/v1lu3p%24ead%243%40ciao.gmane.io.

Thursday, May 9, 2024

Re: Access class member from command line

Hi,

On Thu, May 9, 2024 at 1:16 AM Lifepillar <lifepillar@lifepillar.me> wrote:
>
> On 2024-05-09, Yegappan Lakshmanan <yegappanl@gmail.com> wrote:
> > Hi,
> >
> > On Wed, May 8, 2024 at 2:11 PM Lifepillar <lifepillar@lifepillar.me> wrote:
> >> > Looks like a bug. Should be able to do `foo.Config.option = true`
> >>
> >> Indeed. And fixed. That works with the latest Vim (9.1.399).
> >>
> >
> > Yes. This should be addressed by patch 9.1.0398. If you see any
> > additional problems
> > in using different types of imported variables in a Vim9 script (after
> > this patch), please
> > open an issue. In particular, look for any issues in using nested types.
>
> Right now, the only issue I have is with autoload scripts in my vimrc,
> but I see that it's being tracked as #13313 in GitHub. Other than that,
> I must say that Vim 9 script has been rock solid for me (no more
> crashes), and very pleasant to use!
>

I have opened the PR https://github.com/vim/vim/pull/14740 to address
this issue.

Regards,
Yegappan

>
> >> >> But how do I access the class member from the command line? Is that even
> >> >> possible?
> >>
> >> I still haven't found a way to do that, and I'm starting to think that
> >> it is not currently possible. If I put this in ~/.vim/autoload/foo.vim:
> >>
> >

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAAW7x7nJHG36B%3Dspo2Xr0Y27FB7wDETn%2BV0p_PancBwtQN0Fmg%40mail.gmail.com.

Re: Access class member from command line

On 2024-05-09, Yegappan Lakshmanan <yegappanl@gmail.com> wrote:
> Hi,
>
> On Wed, May 8, 2024 at 2:11 PM Lifepillar <lifepillar@lifepillar.me> wrote:
>> > Looks like a bug. Should be able to do `foo.Config.option = true`
>>
>> Indeed. And fixed. That works with the latest Vim (9.1.399).
>>
>
> Yes. This should be addressed by patch 9.1.0398. If you see any
> additional problems
> in using different types of imported variables in a Vim9 script (after
> this patch), please
> open an issue. In particular, look for any issues in using nested types.

Right now, the only issue I have is with autoload scripts in my vimrc,
but I see that it's being tracked as #13313 in GitHub. Other than that,
I must say that Vim 9 script has been rock solid for me (no more
crashes), and very pleasant to use!

>> >> But how do I access the class member from the command line? Is that even
>> >> possible?
>>
>> I still haven't found a way to do that, and I'm starting to think that
>> it is not currently possible. If I put this in ~/.vim/autoload/foo.vim:
>>
>
> A class in a Vim9 script is a script-local variable. So it cannot be
> directly accessed
> from outside the script (without using the script name).

I'm not sure I understand. Classes can be exported, and I'm prepending
the script name, so why doesn't this work in the command line?

:echo foo#C.member

where the script is ~/.vim/autoload/foo.vim, `C` is an exported class
defined in foo.vim, and `member` is a static variable of C. Maybe
because `C` is a type? For comparison, this works in a script:

import autoload 'foo.vim'
echo foo.C.member

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/v1i0o0%24n8%241%40ciao.gmane.io.

Re: Termdebug for Windows: why a "prompt" buffer instead of a terminal buffer?

Yeah. In-fact there are apparently no reasons to use term_sendkeys…

Best,
/Ubaldo

> Il giorno 9 mag 2024, alle ore 09:27, Christian Brabandt <cblists@256bit.org> ha scritto:
>
> 
>> On Do, 09 Mai 2024, Ubaldo Tiberi wrote:
>>
>> Ok! Makes sense! Thanks!
>>
>> But that lead me to the following question: why use gdb mi instead of
>> term_sendkeys, jobs and channel?
>
> jobs and channels will always be used. Using term_sendkeys sounds
> brittle however.
>
>
> Thanks,
> Chris
> --
> Moon, n.:
> 1. A celestial object whose phase is very important to hackers. See
> PHASE OF THE MOON. 2. Dave Moon (MOON@MC).
>
> --
> --
> 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 a topic in the Google Groups "vim_use" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/5EK-lEmgPto/unsubscribe.
> To unsubscribe from this group and all its topics, 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/Zjx648DK4ZLE4nch%40256bit.org.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/EA456E57-5BB0-4017-970C-D4B73A752E17%40gmail.com.

Re: Termdebug for Windows: why a "prompt" buffer instead of a terminal buffer?

On Do, 09 Mai 2024, Ubaldo Tiberi wrote:

> Ok! Makes sense! Thanks!
>
> But that lead me to the following question: why use gdb mi instead of
> term_sendkeys, jobs and channel?

jobs and channels will always be used. Using term_sendkeys sounds
brittle however.


Thanks,
Chris
--
Moon, n.:
1. A celestial object whose phase is very important to hackers. See
PHASE OF THE MOON. 2. Dave Moon (MOON@MC).

--
--
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/Zjx648DK4ZLE4nch%40256bit.org.

Re: Termdebug for Windows: why a "prompt" buffer instead of a terminal buffer?

Ok! Makes sense! Thanks!

But that lead me to the following question: why use gdb mi instead of term_sendkeys, jobs and channel?

That way we would be OS independent and we would also not depend on external tools features (in this case gdb mi) for which we have zero control.

… genuinely asking. :-)

Best,
/Ubaldo

> Il giorno 9 mag 2024, alle ore 09:08, Christian Brabandt <cblists@256bit.org> ha scritto:
>
> 
>> On Mi, 08 Mai 2024, Ubaldo Tiberi wrote:
>>
>> Hi!
>>
>> I thanks for your reply.
>> have already read it but It didn't answer any of my questions.
>
> I think the reason is, that on Windows using a pty may not always work.
> This is briefly mentioned at :h 'termwintype'. If you sure it works for
> you (because your Windows is new enough or you have winpty), you could
> give it a shot in termdebug with the following patch applied and then
> setting the termwintype option:
>
> ```patch
> diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
> index 50833f0df..8236fc2b0 100644
> --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
> +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
> @@ -196,7 +196,7 @@ func s:StartDebug_internal(dict)
> elseif exists('g:termdebug_use_prompt')
> let use_prompt = g:termdebug_use_prompt
> endif
> - if has('terminal') && !has('win32') && !use_prompt
> + if has('terminal') && (!has('win32') || !empty(&termwintype)) && !use_prompt
> let s:way = 'terminal'
> else
> let s:way = 'prompt'
> ```
>
> Thanks,
> Chris
> --
> Confess your sins to the Lord and you will be forgiven;
> confess them to man and you will be laughed at.
> -- Josh Billings
>
> --
> --
> 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 a topic in the Google Groups "vim_use" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/5EK-lEmgPto/unsubscribe.
> To unsubscribe from this group and all its topics, 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/Zjx2WJlua8j1jQAa%40256bit.org.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/FD4DA0C5-20C6-4A44-8646-FDEE38F8A13A%40gmail.com.

Re: Termdebug for Windows: why a "prompt" buffer instead of a terminal buffer?

I meant, I read 'termdebug-prompt' :-) 

Best,
/Ubaldo

Il giorno 9 mag 2024, alle ore 08:18, Ubaldo Tiberi <ubaldo.tiberi@gmail.com> ha scritto:

termdebug-prompt'

Re: Termdebug for Windows: why a "prompt" buffer instead of a terminal buffer?

On Mi, 08 Mai 2024, Ubaldo Tiberi wrote:

> Hi! 
>
> I thanks  for your reply.
> have already read it but It didn't answer any of my questions. 

I think the reason is, that on Windows using a pty may not always work.
This is briefly mentioned at :h 'termwintype'. If you sure it works for
you (because your Windows is new enough or you have winpty), you could
give it a shot in termdebug with the following patch applied and then
setting the termwintype option:

```patch
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index 50833f0df..8236fc2b0 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -196,7 +196,7 @@ func s:StartDebug_internal(dict)
elseif exists('g:termdebug_use_prompt')
let use_prompt = g:termdebug_use_prompt
endif
- if has('terminal') && !has('win32') && !use_prompt
+ if has('terminal') && (!has('win32') || !empty(&termwintype)) && !use_prompt
let s:way = 'terminal'
else
let s:way = 'prompt'
```

Thanks,
Chris
--
Confess your sins to the Lord and you will be forgiven;
confess them to man and you will be laughed at.
-- Josh Billings

--
--
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/Zjx2WJlua8j1jQAa%40256bit.org.

Wednesday, May 8, 2024

Re: Termdebug for Windows: why a "prompt" buffer instead of a terminal buffer?

Hi! 

I thanks  for your reply.
have already read it but It didn't answer any of my questions. 

Best,
/Ubaldo
On Thursday 9 May 2024 at 01:48:06 UTC+2 Alessandro Antonello wrote:
Hi, Tiberi.

You should take a look in the help of 'termdebug-prompt'. There you can find why your Vim version is using prompt instead of terminal.
I hope this message reaches you.

Regards,

Em ter., 7 de mai. de 2024 às 10:34, Ubaldo Tiberi <ubaldo...@gmail.com> escreveu:
Hi all,

I have noticed that Termdebug for Windows uses a "prompt" buffer instead of a terminal for the gdb interpreter. 

  - Is there any reason why is that? 
  - Is there any plan to "upgrade" the Termdebug Windows version to use a terminal buffer instead?  

Thanks!

/Ubaldo

--
--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CA%2BnhgoMvaBm_EMyQut%3DGtC_ax0LowK4dv_xWMmQR3%2BbYcMniHw%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/b50a0d86-b5b6-4db3-8c86-9086a3eb4cecn%40googlegroups.com.

Re: Access class member from command line

Hi,

On Wed, May 8, 2024 at 2:11 PM Lifepillar <lifepillar@lifepillar.me> wrote:
>
> On 2024-05-07, Girish <girishji@gmail.com> wrote:
> > On Sunday 5 May 2024 at 15:39:53 UTC+2 Lifepillar wrote:
>
> >> Let's say I have this class in some `foo.vim` file:
> >>
> >> export class Config
> >> public static var option = false
> >> endclass
> >>
> >> Now, I'd like to set `Config.option` to `true` from a script and from
> >> the command line. From a script, I can do this:
> >>
> >> import "foo.vim"
> >>
> >> type FooConfig = foo.Config
> >> FooConfig.option = true
> >> echo FooConfig.option # OK
> >> echo foo.Config.option # Also works
> >>
> >> Unfortunately, this gives an error (Undefined variable Config):
> >>
> >> foo.Config.option = true
> >>
> > Looks like a bug. Should be able to do `foo.Config.option = true`
>
> Indeed. And fixed. That works with the latest Vim (9.1.399).
>

Yes. This should be addressed by patch 9.1.0398. If you see any
additional problems
in using different types of imported variables in a Vim9 script (after
this patch), please
open an issue. In particular, look for any issues in using nested types.

>
> >> But how do I access the class member from the command line? Is that even
> >> possible?
>
> I still haven't found a way to do that, and I'm starting to think that
> it is not currently possible. If I put this in ~/.vim/autoload/foo.vim:
>

A class in a Vim9 script is a script-local variable. So it cannot be
directly accessed
from outside the script (without using the script name).

Regards,
Yegappan

> vim9script
>
> export var x = 42
>
> export def F()
> enddef
>
> export class C
> public var setting = "ok"
> public static var option = false
> endclass
>
> export var config = C.new()
>
> Then these work from the command line:
>
> echo foo#x
> call foo#F()
> echo foo#config
> echo foo#config.setting
>
> But I can't find a way to access the static variable 'option'.
>
> 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/CAAW7x7ksKt7Dq3mceEz2JjYab3vWeGbBgOWNoP9BeLXqqsPtRw%40mail.gmail.com.

Re: Termdebug for Windows: why a "prompt" buffer instead of a terminal buffer?

Hi, Tiberi.

You should take a look in the help of 'termdebug-prompt'. There you can find why your Vim version is using prompt instead of terminal.
I hope this message reaches you.

Regards,

Em ter., 7 de mai. de 2024 às 10:34, Ubaldo Tiberi <ubaldo.tiberi@gmail.com> escreveu:
Hi all,

I have noticed that Termdebug for Windows uses a "prompt" buffer instead of a terminal for the gdb interpreter. 

  - Is there any reason why is that? 
  - Is there any plan to "upgrade" the Termdebug Windows version to use a terminal buffer instead?  

Thanks!

/Ubaldo

--
--
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/CA%2BnhgoMvaBm_EMyQut%3DGtC_ax0LowK4dv_xWMmQR3%2BbYcMniHw%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/CA%2BJN8R%2BX%2BfqVNpeYOr7-xhVF8jqjce%2BV2xUrkk_OPTLGL8Qvkw%40mail.gmail.com.

Re: Access class member from command line

On 2024-05-07, Girish <girishji@gmail.com> wrote:
> On Sunday 5 May 2024 at 15:39:53 UTC+2 Lifepillar wrote:

>> Let's say I have this class in some `foo.vim` file:
>>
>> export class Config
>> public static var option = false
>> endclass
>>
>> Now, I'd like to set `Config.option` to `true` from a script and from
>> the command line. From a script, I can do this:
>>
>> import "foo.vim"
>>
>> type FooConfig = foo.Config
>> FooConfig.option = true
>> echo FooConfig.option # OK
>> echo foo.Config.option # Also works
>>
>> Unfortunately, this gives an error (Undefined variable Config):
>>
>> foo.Config.option = true
>>
> Looks like a bug. Should be able to do `foo.Config.option = true`

Indeed. And fixed. That works with the latest Vim (9.1.399).

>> But how do I access the class member from the command line? Is that even
>> possible?

I still haven't found a way to do that, and I'm starting to think that
it is not currently possible. If I put this in ~/.vim/autoload/foo.vim:

vim9script

export var x = 42

export def F()
enddef

export class C
public var setting = "ok"
public static var option = false
endclass

export var config = C.new()

Then these work from the command line:

echo foo#x
call foo#F()
echo foo#config
echo foo#config.setting

But I can't find a way to access the static variable 'option'.

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/v1gppm%24jvc%241%40ciao.gmane.io.

Tuesday, May 7, 2024

Re: Access class member from command line

Looks like a bug. Should be able to do `foo.Config.option = true`

```
Items in a class ~
*E1318* *E1325* *E1388*
Inside a class, in between `:class` and `:endclass`, these items can appear:
- An object variable declaration: >
var _protectedVariableName: memberType
var readonlyVariableName: memberType
public var readwriteVariableName: memberType
- A class variable declaration: >
static var _protectedClassVariableName: memberType
static var readonlyClassVariableName: memberType
public static var readwriteClassVariableName: memberType

```
On Sunday 5 May 2024 at 15:39:53 UTC+2 Lifepillar wrote:
Let's say I have this class in some `foo.vim` file:

export class Config
public static var option = false
endclass

Now, I'd like to set `Config.option` to `true` from a script and from
the command line. From a script, I can do this:

import `foo.vim`

type FooConfig = foo.Config
FooConfig.option = true
echo FooConfig.option # OK
echo foo.Config.option # Also works

Unfortunately, this gives an error (Undefined variable Config):

foo.Config.option = true

But how do I access the class member from the command line? Is that even
possible?

Context: I'm exploring alternatives to `g:myplugin_option` to configure
a script without using global variables.

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/0ad05182-8aa2-467a-8bbf-2b1b32f19811n%40googlegroups.com.

Termdebug for Windows: why a "prompt" buffer instead of a terminal buffer?

Hi all,

I have noticed that Termdebug for Windows uses a "prompt" buffer instead of a terminal for the gdb interpreter. 

  - Is there any reason why is that? 
  - Is there any plan to "upgrade" the Termdebug Windows version to use a terminal buffer instead?  

Thanks!

/Ubaldo

--
--
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/CA%2BnhgoMvaBm_EMyQut%3DGtC_ax0LowK4dv_xWMmQR3%2BbYcMniHw%40mail.gmail.com.

Monday, May 6, 2024

Re: Access class member from command line

Yeah, all variables within vim9script seem script-local. If you want to access them in the command line, you'd have to prefix them with the scopes in :h eval.txt — global, window, and buffer all work.

Best,
Igbanam

On Sun, May 5, 2024 at 2:39 PM Lifepillar <lifepillar@lifepillar.me> wrote:
Let's say I have this class in some `foo.vim` file:

    export class Config
      public static var option = false
    endclass

Now, I'd like to set `Config.option` to `true` from a script and from
the command line. From a script, I can do this:

    import `foo.vim`

    type FooConfig = foo.Config
    FooConfig.option = true
    echo FooConfig.option  # OK
    echo foo.Config.option # Also works

Unfortunately, this gives an error (Undefined variable Config):

    foo.Config.option = true

But how do I access the class member from the command line? Is that even
possible?

Context: I'm exploring alternatives to `g:myplugin_option` to configure
a script without using global variables.

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/v1826l%24m0o%241%40ciao.gmane.io.

--
--
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/CAOmRJrcLVHMM9bVJKvbAHjHvKOH1wi9fULf74jzexQS7u4V9tg%40mail.gmail.com.

Sunday, May 5, 2024

Access class member from command line

Let's say I have this class in some `foo.vim` file:

export class Config
public static var option = false
endclass

Now, I'd like to set `Config.option` to `true` from a script and from
the command line. From a script, I can do this:

import `foo.vim`

type FooConfig = foo.Config
FooConfig.option = true
echo FooConfig.option # OK
echo foo.Config.option # Also works

Unfortunately, this gives an error (Undefined variable Config):

foo.Config.option = true

But how do I access the class member from the command line? Is that even
possible?

Context: I'm exploring alternatives to `g:myplugin_option` to configure
a script without using global variables.

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/v1826l%24m0o%241%40ciao.gmane.io.

Saturday, May 4, 2024

Re: How do I build vim with clipboard support.

It worked.
I had not installed all the dependencies to compile with X11.

Thank you very much.

On Saturday 4 May 2024 at 18:32:45 UTC+2 Tony Mechelynck wrote:
On Sat, May 4, 2024 at 4:38 PM Gary Johnson <gary...@spocom.com> wrote:
>
> On 2024-05-04, Jose Ignacio Seco wrote:
> > I'm building with the huge set of features.
> >
> > I cannot see any option related when running configure --help.
> > Then I don't see any error regarding clipboard when configuring or building.
>
> I don't think the absence of support for the clipboard shows up as
> an error; it just shows up as a "no" after some configure check.
>
> > I'm also using --with-x, and installed the related libraries, as it seemed to
> > solve the problem for some people, but not for me.
> >
> > I'm building in Ubuntu 23.10.
> >
> > This is my configuration:
> > ./configure --prefix=/home/nacho/.local \
> > � � � � � � --with-features=huge \
> > � � � � � � --enable-pythoninterp \
> > � � � � � � --enable-python3interp \
> > � � � � � � --enable-libsodium=yes \
> > ��� � � � � --enable-luainterp=yes \
> > � � � � � � --enable-largefile \
> > � � � � � � --with-x
>
> Before building vim for the first time on a machine running Ubuntu,
> I run this:
>
> $ sudo apt-get build-dep vim-gtk3
>
> Regards,
> Gary

Try adding
--enable-gui=gtk3
to your configure arguments. This ought to build a GUI-enabled Vim
that can also be used in Console mode when started as vim rather than
gvim.

I also recommend not to run configure separately, as in some
circumstances a plain "make" will start by invoking configure with
whatever parameters it finds in the environment (or the defaults if
none), but to set configure arguments in the environment, so they will
be set correctly even if make reconfigures your Vim build. Here is an
example (for the bash shell):

export CONF_OPT_GUI='--enable-gui=gtk3'
export CONF_OPT_PERL='--enable-perlinterp'
export CONF_OPT_PYTHON='--enable-pythoninterp'
export CONF_OPT_PYTHON3='--disable-python3interp'
export CONF_OPT_TCL='--enable-tclinterp'
export CONF_OPT_RUBY='--enable-rubyinterp'
export CONF_OPT_LUA='--enable-luainterp'
export CONF_OPT_MZSCHEME='--disable-mzschemeinterp'
export CONF_OPT_CSCOPE='--enable-cscope'
export CONF_OPT_TERMINAL='--enable-terminal'
export CONF_OPT_AUTOSERVE='--enable-autoservername'
export CONF_OPT_FEAT='--with-features=huge'
export CONF_OPT_COMPBY='"--with-compiledby=antoine.m...@gmail.com"'

If written as a script, this must be sourced, not executed, by bash so
that the values remain in the environment after bash has read them.

If you decide to use this, you will need to change at least the last
line and possibly add, change or remove others depending on your
preferred configuration. The names of the environment variables used
by Vim make and their possible values can be found in the src/Makefile
at lines 207 to 640.

Best regards,
Tony.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/bc3a8c0d-e889-4a73-aefa-b2f862fb0a4an%40googlegroups.com.

Re: How do I build vim with clipboard support.

On Sat, May 4, 2024 at 4:38 PM Gary Johnson <garyjohn@spocom.com> wrote:
>
> On 2024-05-04, Jose Ignacio Seco wrote:
> > I'm building with the huge set of features.
> >
> > I cannot see any option related when running configure --help.
> > Then I don't see any error regarding clipboard when configuring or building.
>
> I don't think the absence of support for the clipboard shows up as
> an error; it just shows up as a "no" after some configure check.
>
> > I'm also using --with-x, and installed the related libraries, as it seemed to
> > solve the problem for some people, but not for me.
> >
> > I'm building in Ubuntu 23.10.
> >
> > This is my configuration:
> > ./configure --prefix=/home/nacho/.local \
> > � � � � � � --with-features=huge \
> > � � � � � � --enable-pythoninterp \
> > � � � � � � --enable-python3interp \
> > � � � � � � --enable-libsodium=yes \
> > ��� � � � � --enable-luainterp=yes \
> > � � � � � � --enable-largefile \
> > � � � � � � --with-x
>
> Before building vim for the first time on a machine running Ubuntu,
> I run this:
>
> $ sudo apt-get build-dep vim-gtk3
>
> Regards,
> Gary

Try adding
--enable-gui=gtk3
to your configure arguments. This ought to build a GUI-enabled Vim
that can also be used in Console mode when started as vim rather than
gvim.

I also recommend not to run configure separately, as in some
circumstances a plain "make" will start by invoking configure with
whatever parameters it finds in the environment (or the defaults if
none), but to set configure arguments in the environment, so they will
be set correctly even if make reconfigures your Vim build. Here is an
example (for the bash shell):

export CONF_OPT_GUI='--enable-gui=gtk3'
export CONF_OPT_PERL='--enable-perlinterp'
export CONF_OPT_PYTHON='--enable-pythoninterp'
export CONF_OPT_PYTHON3='--disable-python3interp'
export CONF_OPT_TCL='--enable-tclinterp'
export CONF_OPT_RUBY='--enable-rubyinterp'
export CONF_OPT_LUA='--enable-luainterp'
export CONF_OPT_MZSCHEME='--disable-mzschemeinterp'
export CONF_OPT_CSCOPE='--enable-cscope'
export CONF_OPT_TERMINAL='--enable-terminal'
export CONF_OPT_AUTOSERVE='--enable-autoservername'
export CONF_OPT_FEAT='--with-features=huge'
export CONF_OPT_COMPBY='"--with-compiledby=antoine.mechelynck@gmail.com"'

If written as a script, this must be sourced, not executed, by bash so
that the values remain in the environment after bash has read them.

If you decide to use this, you will need to change at least the last
line and possibly add, change or remove others depending on your
preferred configuration. The names of the environment variables used
by Vim make and their possible values can be found in the src/Makefile
at lines 207 to 640.

Best regards,
Tony.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXsG1iu%3DyhLKfJcY1-iJt-%2ByGKxgjj-8KX-yrQdx%3Dve81A%40mail.gmail.com.

Re: How do I build vim with clipboard support.

On 2024-05-04, Jose Ignacio Seco wrote:
> I'm building with the huge set of features.
>
> I cannot see any option related when running configure --help.
> Then I don't see any error regarding clipboard when configuring or building.

I don't think the absence of support for the clipboard shows up as
an error; it just shows up as a "no" after some configure check.

> I'm also using --with-x, and installed the related libraries, as it seemed to
> solve the problem for some people, but not for me.
>
> I'm building in Ubuntu 23.10.
>
> This is my configuration:
> ./configure --prefix=/home/nacho/.local \
> � � � � � � --with-features=huge \
> � � � � � � --enable-pythoninterp \
> � � � � � � --enable-python3interp \
> � � � � � � --enable-libsodium=yes \
> ��� � � � � --enable-luainterp=yes \
> � � � � � � --enable-largefile \
> � � � � � � --with-x

Before building vim for the first time on a machine running Ubuntu,
I run this:

$ sudo apt-get build-dep vim-gtk3

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/20240504143947.GE24132%40phoenix.

How do I build vim with clipboard support.

I'm building with the huge set of features.

I cannot see any option related when running configure --help.
Then I don't see any error regarding clipboard when configuring or building.

I'm also using --with-x, and installed the related libraries, as it seemed to solve the problem for some people, but not for me.

I'm building in Ubuntu 23.10.

This is my configuration:
./configure --prefix=/home/nacho/.local \
            --with-features=huge \
            --enable-pythoninterp \
            --enable-python3interp \
            --enable-libsodium=yes \
            --enable-luainterp=yes \
            --enable-largefile \
            --with-x

Thank you.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/c670bce4-6968-48b9-82d2-1ba0bf91c8c5n%40googlegroups.com.

Thursday, May 2, 2024

Re: Why vimscript instead of another language? A philosophical or a technical question?

On Thu, May 02, 2024 at 01:42:50AM -0700, Girish wrote:
> There are some specific advantages. Regex handling, for example, as done in
> Python of Lua is not so suitable to the needs of an editor.

Not to mention that "editor state" specific are just not available

|/\%V| \%V \%V inside Visual area |/zero-width|
|/\%#| \%# \%# cursor position |/zero-width|
|/\%'m| \%'m \%'m mark m position |/zero-width|
|/\%v| \%23v \%23v in virtual column 23 |/zero-width|

regards

--
Marc Chantreux
Pôle CESAR (Calcul et services avancés à la recherche)
Université de Strasbourg
14 rue René Descartes,
BP 80010, 67084 STRASBOURG CEDEX
03.68.85.60.79

--
--
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/ZjNfHRey96D-7_Nc%40prometheus.

Re: Why vimscript instead of another language? A philosophical or a technical question?

There are some specific advantages. Regex handling, for example, as done in Python of Lua is not so suitable to the needs of an editor. You'll end up with many backslashes. Vim script gives you additional tools and implements regex optimally for editor users.

On a different note, learn vim9 script instead of legacy script. It looks familiar if you are from python or javascript, easy to read, compiled and very responsive. Does not make sense to use Python anymore inside Vim. Python has great standard library but most things can be implemented inside vim9 script without much fuss. 

On Wednesday 1 May 2024 at 17:24:17 UTC+2 Jose Caballero wrote:
Thanks a lot everybody for the comments. Very helpful.

Cheers
Jose

El dom, 28 abr 2024 a las 19:51, Jose Caballero (<jcaball...@gmail.com>) escribió:
Hello,

I am just curious about it. I have just been experimenting with it, and it is possible to send the selected range of lines, or even the entire buffer, to an external script. Right? In my case, in python. 
I find python, or even bash, to be more readable and friendly than vimscript. 

What would be the advantage of keeping using vimscript instead of writing plugins in your favourite language? What am I missing?

Cheers,
Jose

--
--
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/d6f56d4c-d186-48bc-b950-8af8630da271n%40googlegroups.com.

Wednesday, May 1, 2024

Re: Vim-Dev Google Groups List is blocked

Remember the good old days when the vim list was sent out using mutt, which uses vim as the text generator? I think it was hosted at vim.org.

Nick

On Thu, 2 May 2024 at 03:53, Christian Brabandt <cblists@256bit.org> wrote:
Hi,
I have just been informed by an automatic email coming from Google, that
all content on the vim-dev Google Groups List
https://groups.google.com/g/vim_dev has been removed/blocked for
Spam/Malware reasons.

As usual, there is no personal contact given and they just mention I can
pursue my legal claims in court :(

Currently it is still possible to view the list, when you are logged in,
but at least publicly the archive seems no longer available. Let's hope
this list here still remains active for a while.

So if anybody has any contacts to the Google Groups team, please contact
me off-list and that would be very much appreciated. Otherwise we may
have to think about moving the lists to a different hoster. I have no
idea if there still exists alternatives to Google nowadays.

Not enough that they keep blocking my mails for spam reasons :/

Thanks,
Christian
--
If you can survive death, you can probably survive anything.

--
--
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/ZjKBl6rA00ROTAMm%40256bit.org.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CALzQb_ny%2BTBz0CLh%2BRfg4FXAuxf%2B9U7rRF6qmzv5-nC4E39BOQ%40mail.gmail.com.