Re: vim9 Equivalence of __FILE__, __LINE__, and __FUNCTION__ usage in C++

2023-07-04 Thread Lifepillar
On 2023-07-04, Nicolas wrote: > Hi Life, > > My Main goal is to add prefix of vim9script current '__FUNCTION__' to my > debug message. Something along these lines, perhaps? vim9script def Debug(F: func) echo string(F) enddef def Foo() Debug(Foo) enddef def

Re: Improving vim startuptime

2023-07-16 Thread Lifepillar
On 2023-07-16, Manas wrote: > `startuptime` surprisingly shows me a mere 656ms, while hyperfine shows > me 2.7s. I am not sure how this discrepancy is arising. Here is the full > log. https://pastebin.mozilla.org/uTrJ7i8N > > I see 234ms (out of those 656ms, ~35%) due to VimEnter autocommands. 17

[vim9script] On extending interfaces

2023-07-19 Thread Lifepillar
Vim 9 script allows the following definitions, in which I2 extends I1 by "implementing" it: interface I1 def Foo() endinterface interface I2 implements I1 def Foo() def Bar() endinterface The above compiles: I don't know whether it is intentional, but it is pret

Re: [vim9script] On extending interfaces

2023-07-20 Thread Lifepillar
> Also, if a concrete class has to implement both i1 and i2 explicitly, > then i2 might as well not subclass i1. Right, that's the approach I am currently adopting, which is fine because my interfaces are small. I may add that the problem with an orthogonal approach such as this: interface I

[vim9script] How to compare two objects for identity vs equality?

2023-07-23 Thread Lifepillar
The following test passes: ```vim vim9script class C endclass def Test_ObjectEquality() var o1 = C.new() var o2 = C.new() assert_true(o1 == o2) enddef v:errors = [] Test_ObjectEquality() echo v:errors ``` Fine, == is value-based equality. Is there a way to compare for identity, that is,

Re: [vim9script] How to compare two objects for identity vs equality?

2023-07-23 Thread Lifepillar
On 2023-07-23, Lifepillar wrote: > Fine, == is value-based equality. Is there a way to compare for > identity, that is, so that o1 and o2 are considered two different > instances? Aaah, never mind, there are `is` and `isnot`. Time to find a cool place to avoid brain melting, I guess

Re: Vim9 script performance vs. legacy

2023-08-30 Thread Lifepillar
Gruvbox 8| 17.2s | 3.7s Solarized 8 | 17.4s | 2.2s Vim colorschemes²| 20.5s | 3.2s ¹ https://github.com/lifepillar/vim-colortemplate ² https://github.com/vim/colorschemes And this comparison is a bit apples vs oranges because it was not a porting, but a co

Re: Vim9 script performance vs. legacy

2023-08-31 Thread Lifepillar
On 2023-08-31, Salman Halim wrote: > On Wed, Aug 30, 2023 at 5:25 PM Lifepillar wrote: >> For a more apples-to-apples comparison, below is the execution time of >> `libcolor.Neighbours()` from my libcolor library,³ which is a literal >> translation of a legacy col

Re: E325 ATTENTION message wrapping/formatting problem

2023-09-30 Thread Lifepillar
On 2023-09-29, 'Trey Blancher' via vim_use wrote: > I have a problem with the E325 ATTENTION message, informing me of an > existing swap file. It appears that every line in the message is > inordinately long, > [...] > This has been going on for quite some time, I don't know exactly when it > sta

Is uploading new scripts to vim.org possible?

2023-10-14 Thread Lifepillar
I am not able to upload new scripts to www.vim.org. The "type" drop-down is empty and there is no "upload/submit" button or similar. Is that intentional? Thanks, Life. -- -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying t

Re: Is uploading new scripts to vim.org possible?

2023-10-14 Thread Lifepillar
On 2023-10-14, Christian Brabandt wrote: > > On Sa, 14 Okt 2023, Lifepillar wrote: > >> I am not able to upload new scripts to www.vim.org. The "type" drop-down >> is empty and there is no "upload/submit" button or similar. Is that >> intentional?

Re: Is uploading new scripts to vim.org possible?

2023-10-14 Thread Lifepillar
On 2023-10-14, Christian Brabandt wrote: > > On Sa, 14 Okt 2023, Lifepillar wrote: > >> On 2023-10-14, Christian Brabandt wrote: >> > >> > On Sa, 14 Okt 2023, Lifepillar wrote: >> > >> >> I am not able to upload new scripts to www.vim.or

Re: Is uploading new scripts to vim.org possible?

2023-10-15 Thread Lifepillar
On 2023-10-15, Christian Brabandt wrote: > > On Sa, 14 Okt 2023, Lifepillar wrote: > >> Now, after pressing "upload" I'm sent back to the form page, but the >> script is still not uploaded. > > I tried it yesterday and it worked. I now tried it again and

Licensing question: compatibility between Vim license and GPL

2023-10-15 Thread Lifepillar
Can code released under Vim license include third-party code released under GPLv2 or GPLv3? I have read that Vim license is "GPL-compatible", but it is not clear to me which way such compatibility works. Thanks for providing legal advice for free ;) Life -- -- You received this message from th

Re: typewriter sounds

2023-10-17 Thread Lifepillar
On 2023-10-17, rwmit...@gmail.com wrote: > Lifepillar, > > Could you include a sample g:keysound configuration that makes use of the > auxiliary typewriter-sounds ? It would be nice to start from a known > interesting setup. > > ( the help file mentions using keyN.mp3 where

Re: Licensing question: compatibility between Vim license and GPL

2023-10-17 Thread Lifepillar
On 2023-10-16, Christian Brabandt wrote: > > On So, 15 Okt 2023, Tony Mechelynck wrote: > >> On Sun, Oct 15, 2023 at 7:29 PM Lifepillar wrote: >> > >> > Can code released under Vim license include third-party code released >> > under GPLv2 or GPLv3? >

Re: Edit edit tar.gz file

2023-10-21 Thread Lifepillar
On 2023-10-21, Nutcha Schonn wrote: > About 3-4 years ago I remember that I could edit a edit tar.gz file with vi > command. > When trying that today it does not work, is there something I can do to get > it to work with the latest VIM 9 version? It works with Vim 9.0.1946. Besides: :echo g:

Location list entries for unsaved buffer open a new buffer

2023-10-21 Thread Lifepillar
I have a function that pipes a buffer into an external program, then parses its output in a callback and adds the parsed results to a location list. Simplified code for the callback: def Callback(channel: job, msg: string, winid: number, efm: string, cwd: string) silent execute "lcd" cw

Re: Location list entries for unsaved buffer open a new buffer

2023-10-21 Thread Lifepillar
On 2023-10-21, Yegappan Lakshmanan wrote: > On Sat, Oct 21, 2023 at 7:09 AM Lifepillar wrote: >> How do I generate location list entries that refer to the proper unsaved >> buffer? >> >> > There is a item in the todo list for more than 20 years now for this:

Re: Rely on ‘runtimeparh’ in import autoload

2023-11-25 Thread Lifepillar
On 2023-11-24, Matan Nassau wrote: > When is it good practice to use the import autoload form that relies > on ‘runtimepath’? > > import autoload ‘foo.vim’ > > I think plugins generally know where their autoload stuff is, and can > gain a few milliseconds by pointing the import directly at it with

Re: Out_cb callback handler in vim9

2023-12-10 Thread Lifepillar
On 2023-12-09, Nicolas wrote: > Hi all, > > According to Bram example in the job's help now, > Is it possible to pass additional parameters to job's handlers callback in > vim9script ? Yes. See, for instance, $VIMRUNTIME/autoload/typeset.vim, in particular the Callbacks section and the Typeset()

Re: vim9 exported functions not recognized by ctags

2023-12-18 Thread Lifepillar
On 2023-12-16, Nicolas wrote: > this is mine .ctags.d > > --kinddef-vim=e,export,function,"Vim 9 exported functions" > --kinddef-vim=f,function,"Vim 9 non-exported functions" > --kinddef-vim=g,global,"Vim 9 global variables" > --kinddef-vim=K,const,Vim 9 constants > --regex-vim=/^\s*export\s+def\s

Building a Reactive Library from Scratch in Vim 9 Script

2023-12-29 Thread Lifepillar
https://gist.github.com/lifepillar/d44e6ca33f0b1f66a0b403e133413699 The task was pretty straightforward, I must say. The code still leaves much to be desired (among the rest because I've tried to deviate from the original as little as possible), but it works well. Enjoy! Life. -- -- You receiv

Re: Building a Reactive Library from Scratch in Vim 9 Script

2023-12-31 Thread Lifepillar
On 2023-12-30, Steve Litt wrote: > I had a chuckle when you called Vimscript a "sane language". I'm more > of a Lua or Python or C guy myself. But looking at your code, it looks > like the Vim9 script language is a big improvement over that old viml > stuff. That was basically the sense of my pos

Get list of lambdas and closures

2024-01-31 Thread Lifepillar
Is it possible to get the list of all lambdas? I'm looking for something similar to :function. 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.

Some comments on :help E1377 (subclassing and constructors)

2024-02-20 Thread Lifepillar
: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

Re: Nested Classes — thoughts and workarounds

2024-03-23 Thread Lifepillar
seems the most straightforward approach to me. If you don't care about typing (but wouldn't that defeat the purpose of protobuf?), you may simply use dictionaries, which can be arbitrarily nested. If your problem is parsing, libparser might help: https://github.com/lifepillar/vim-d

Access class member from command line

2024-05-05 Thread Lifepillar
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

Re: Access class member from command line

2024-05-08 Thread Lifepillar
On 2024-05-07, Girish 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

Re: Access class member from command line

2024-05-09 Thread Lifepillar
On 2024-05-09, Yegappan Lakshmanan wrote: > Hi, > > On Wed, May 8, 2024 at 2:11 PM Lifepillar 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.

Re: Access class member from command line

2024-05-10 Thread Lifepillar
On 2024-05-10, Yegappan Lakshmanan 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!

Re: partial syntax in vim

2024-06-23 Thread Lifepillar
On 2024-06-17, Andreas Otto wrote: > Hi is it possible to change the syntax for a limit part of a file? Yes. See :help syn-include and :help mysyntaxfile-add. > example: tcl file with bash syntax used with "pseudo code" vim: push … vim: I do not recommend using comments with `vim:` because they

Re: ":b {bufname}" tab-completion uses whole filepath

2024-06-23 Thread Lifepillar
purpose of the plugin. This is an example: vim9script import autoload 'zeef.vim' def SwitchToBuffer(items: list) execute 'buffer' matchstr(items[0], '^\s*\zs\d\+') enddef zeef.Open( execute('ls')->split("\n"),

Re: Configuration file does not support #

2024-06-27 Thread Lifepillar
On 2024-06-27, 李坏之 wrote: > Why does an error occur when changing the comment of the vim9.1 > configuration file to #? 9.1 does not support # Not sure I understand your question, but before `vim9script` you should use the legacy comment symbol " (double quote). For example: " vim: set sw=2 t

Grouping digraphs

2019-04-29 Thread 'Lifepillar' via vim_use
I recall reading about a proposal (by C. Brabandt, I think) for grouping the presentation of digraphs. I don’t seem to be able to find that discussion, however. Does anyone know the status of the proposal and whether there is a patch available to try? Digraphs are a wonderful feature, except that

Re: Grouping digraphs

2019-04-29 Thread 'Lifepillar' via vim_use
On 30 Apr 2019, at 07:44, Christian Brabandt wrote: > > > On Mo, 29 Apr 2019, 'Lifepillar' via vim_use wrote: > >> I recall reading about a proposal (by C. Brabandt, I think) for grouping >> the presentation of digraphs. I don’t seem to be able to find that &

Tweaking t_Co to configure colorscheme

2019-04-30 Thread 'Lifepillar' via vim_use
I have made some colorschemes that use colors 0-15 or 16-256 according to the value of t_Co or based on a user option: if &t_Co < 256 || g:mytheme_force16colors = 1 # Define hi groups with colors 0-15 else # Define hi groups with colors 16-256 endif Setting t_Co at runtime

Re: Grouping digraphs

2019-04-30 Thread &#x27;Lifepillar' via vim_use
On 30 Apr 2019, at 13:13, Tony Mechelynck wrote: > But (@Lifepillar) Christian is too modest — another great tool for > (among others) searching for and identifying Unicode characters is his > own unicode.vim plugin (which includes online help according to the > great Vim tradition)

Create buffer without opening a window

2019-05-06 Thread &#x27;Lifepillar' via vim_use
I would like to create a new buffer "in the background", without opening any new window, put some text into the buffer then write it to disk, without ever showing the buffer (the reason why I am not populating a List and use writefile() directly is that I need to perform some text manipulation such

Re: Create buffer without opening a window

2019-05-06 Thread &#x27;Lifepillar' via vim_use
On 6 May 2019, at 20:57, 'Andy Wokula' via vim_use wrote: > > Am 06.05.2019 um 17:02 schrieb 'Lifepillar' via vim_use: >> I would like to create a new buffer "in the background", without opening >> any new window, put some text into the buffer th

Re: Create buffer without opening a window

2019-05-06 Thread &#x27;Lifepillar' via vim_use
On 7 May 2019, at 00:39, Tony Mechelynck wrote: > > On Mon, May 6, 2019 at 9:40 PM 'Lifepillar' via vim_use > mailto:vim_use@googlegroups.com>> wrote: >> >> On 6 May 2019, at 20:57, 'Andy Wokula' via vim_use >> wrote: >>> >&

A question about highlight-cterm

2019-05-11 Thread &#x27;Lifepillar' via vim_use
I am a bit puzzled by the note in `:help highlight-cterm`: Note: Many terminals (e.g., DOS console) can't mix these attributes with coloring. Use only one of "cterm=" OR "ctermfg=" OR "ctermbg=“. Virtually all colorschemes I have seen use ctermfg AND ctermbg AND cterm. The note above is

Re: A question about highlight-cterm

2019-05-11 Thread &#x27;Lifepillar' via vim_use
On 11 May 2019, at 13:10, Bram Moolenaar wrote: > >> >> I am a bit puzzled by the note in `:help highlight-cterm`: >> >>Note: Many terminals (e.g., DOS console) can't mix these attributes with >>coloring. Use only one of "cterm=" OR "ctermfg=" OR "ctermbg=“. >> >> Virtually all colorsc

Re: download statistics from the daily win builds

2019-05-17 Thread &#x27;Lifepillar' via vim_use
On 17 May 2019, at 21:42, Christian Brabandt wrote: > > Hi, > I thought, that I share some download statistics from the daily Vim > builds from the vim-win32-installer repository that I created today. > > So here are some statistics for the releases 8.1.1201 (Apr 25th, 2019) - > 8.1.1336 (May

Re: Vim "by far the best editor on the iPad"

2019-05-21 Thread &#x27;Lifepillar' via vim_use
On 18 May 2019, at 20:17, Eric Weir wrote: > > > Lotsa questions about running Vim on an iPad within the constraints of > iOS/iVim. For starters, just two: Is it possible to create folders in the > iVim sandbox, e.g., in the .vim folder? Yes. You can do it with netrw: :edit . d Type director

Questions about colors/tools/check_colors.vim

2019-05-24 Thread &#x27;Lifepillar' via vim_use
Currently, colors/tools/check_colors.vim prints warnings when 1. one of the checked highlight groups is defined with `hi link` instead of `hi`; 2. a hi command defines guifg but not ctermfg or vice versa. For instance, I get warnings for hi! link ColorColumn SomethingElse Is this intended,

Has window-toolbar feature?

2019-05-26 Thread &#x27;Lifepillar' via vim_use
How do you check whether Vim has the window-toolbar (WinBar) feature? 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 th

Re: Has window-toolbar feature?

2019-05-26 Thread &#x27;Lifepillar' via vim_use
On 26 May 2019, at 13:14, Bram Moolenaar wrote: > > >> How do you check whether Vim has the window-toolbar (WinBar) feature? > > if has('menu') I have compiled v8.0.0197 (with +menu), has('menu') returns 1, yet it doesn't seem to have support for window toolbars. Ah ok, helpgrep-ing wind

Re: Looking for help getting iVim set up

2019-05-29 Thread &#x27;Lifepillar' via vim_use
On 29 May 2019, at 00:53, Eric Weir wrote: > > I'm struggling trying to get iVim setup on my iPad. I wish there was a way to > put problems and questions to a community of experienced users. > > Most immediately are the walls I’m running into in trying to import my .vim > folder and my .vimrc.

Re: Looking for help getting iVim set up

2019-05-29 Thread &#x27;Lifepillar' via vim_use
On 29 May 2019, at 10:27, 'Lifepillar' via vim_use wrote: > > On 29 May 2019, at 00:53, Eric Weir <mailto:eew...@bellsouth.net>> wrote: >> >> I'm struggling trying to get iVim setup on my iPad. I wish there was a way >> to put problems a

Re: Looking for help getting iVim set up

2019-05-30 Thread &#x27;Lifepillar' via vim_use
> On 29 May 2019, at 19:46, Eric Weir wrote: > > >> On May 29, 2019, at 4:27 AM, 'Lifepillar' via vim_use >> wrote: >> >> I feel your pain, that’s much harder than it should be. > > Thanks much for your response. Glad to hear I’m not

Highlight definitions displaying both settings and link

2019-06-02 Thread &#x27;Lifepillar' via vim_use
Some highlight groups may have both settings and links. What does it depend from? For instance, in the color scheme I am using (but I have noticed this in many others): :hi StatusLineTerm StatusLineTerm xxx term=bold,reverse cterm=bold ctermfg=0 ctermbg=121 gui=bold guifg=bg guibg=LightGreen

g:actual_curwin undefined

2019-06-19 Thread &#x27;Lifepillar' via vim_use
I want to use g:statusline_winid and g:actual_curwin to detect whether the currently drawn status line is the active one. With Vim 8.1.1517, I have tried the following code: fun! BuildStatusLine() return g:statusline_winid ==# g:actual_curwin \ ? 'Active' : 'Inactive' endf

Re: g:actual_curwin undefined

2019-06-19 Thread &#x27;Lifepillar' via vim_use
On 19 Jun 2019, at 20:13, 'Lifepillar' via vim_use wrote: > > I want to use g:statusline_winid and g:actual_curwin to detect > whether the currently drawn status line is the active one. > > With Vim 8.1.1517, I have tried the following code: > >fun!

<    1   2   3