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: 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-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 to set `Co

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 =

Re: Nested Classes — thoughts and workarounds

2024-03-23 Thread Lifepillar
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-devel Protobuf's grammar seems

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

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

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

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 received th

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 >

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: 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

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:

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"

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

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: 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

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

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 it s

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 scrip

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?

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

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 >

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: Vim9 script performance vs. legacy

2023-08-30 Thread Lifepillar
| 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 complete rew

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

[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

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

[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

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.

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: vim9 Equivalence of __FILE__, __LINE__, and __FUNCTION__ usage in C++

2023-07-04 Thread Lifepillar
On 2023-07-04, Nicolas wrote: > Hi, > > Is there an equivalence in vim9 of __FILE__, __LINE__, and __FUNCTION__ > usage in C++ > The closest to __FILE__ is likely (`:help `). I use this snippet to get the path of the

Re: [vim 9 script] String indexing behavior different from legacy Vim

2023-06-03 Thread Lifepillar
On 2023-06-03, Lifepillar wrote: >> Yes, in Vim9 script the index is in characters. In legacy script it is >> in bytes. >> >> The help for this doesn't have it's own tag, I'll add one. >> You can find it above ":help vim9-gotchas". > > I was expe

Re: [vim 9 script] String indexing behavior different from legacy Vim

2023-06-03 Thread Lifepillar
On 2023-06-03, Bram Moolenaar wrote: > >> Legacy Vim script: >> >> let text = 'àbc' >> echo text[2] >> >> Result: 'b' >> >> Vim 9 script: >> >> const text = 'àbc' >> echo text[2] >> >> Result: 'c' >> >> Is the different behavior (counting chars vs bytes?) intentional? > > Yes, in

Re: [vim 9 script] String indexing behavior different from legacy Vim

2023-06-03 Thread Lifepillar
On 2023-06-03, Lifepillar wrote: > On 2023-06-03, Lifepillar wrote: > Mmh, even strpart(), which is supposed to count bytes, gives the same > result: Forget this: strpart() is fine. I have trouble just with indexing. Life. -- -- You received this message from the "vim_use

Re: [vim 9 script] String indexing behavior different from legacy Vim

2023-06-03 Thread Lifepillar
On 2023-06-03, Lifepillar wrote: > Legacy Vim script: > > let text = 'àbc' > echo text[2] > > Result: 'b' > > Vim 9 script: > > const text = 'àbc' > echo text[2] > > Result: 'c' > > Is the different behavior (counting chars vs byt

[vim 9 script] String indexing behavior different from legacy Vim

2023-06-03 Thread Lifepillar
Legacy Vim script: let text = 'àbc' echo text[2] Result: 'b' Vim 9 script: const text = 'àbc' echo text[2] Result: 'c' Is the different behavior (counting chars vs bytes?) intentional? Thanks, Life. -- -- You received this message from the "vim_use" maillist. Do not

Re: The package you uploaded (vim-noweb.tgz) is empty

2023-06-03 Thread Lifepillar
On 2023-06-02, Bram Moolenaar wrote: > You could try using another browser. I have tried with Safari, Brave, and LibreWolf (~Firefox) on macOS to no avail. I have taken care to disable ad blockers and, afaics, only cross-site cookies are blocked. Life. -- -- You received this message from

Re: The package you uploaded (vim-noweb.tgz) is empty

2023-06-02 Thread Lifepillar
On 2023-05-26, Edward McGuire wrote: > I offered a tarball containing an ftdetect, a syntax, and a README and > LICENSE. > The site replied: "The package you uploaded (vim-noweb.tgz) is empty". I am getting the same error, e.g.: vim-solarized8-1.5.0.tar.gz is empty, are you sure you

Re: [vim9script] Forward declarations for classes?

2023-03-26 Thread Lifepillar
On 2023-03-26, Bram Moolenaar wrote: > The second one should just work. Currently the class is only defined > when "endclass" is found. Doing it earlier is more implementation work, > but it should not require anything on the user side. > > For the first example I'm not sure what the best

[vim9script] Forward declarations for classes?

2023-03-26 Thread Lifepillar
Consider the following example: class Rgb this.r: float this.g: float this.b: float def ToHsv(): Hsv # ... enddef endclass class Hsv this.h: float this.s: float this.v: float def ToRgb(): Rgb # ... enddef

[vim9script] Default value for object argument?

2023-03-12 Thread Lifepillar
How do you define a default value for a function argument whose type is a class? I have tried this: vim9script class X endclass def F(x: X = null_object) enddef F() But this results in: E1013: Argument 1: type mismatch, expected object but got object Maybe this

Re: SQL quote sign syntax fail

2023-03-12 Thread Lifepillar
(name) FROM stdin; > Thomas O'Malley > \. > > The quote is a legal character in that block and the color should not be > changed. > > After \. on a single line the color should go back to normal. AFAIK, the syntax is not standard SQL. PostgreSQL's dialect is supported by my plugi

Search undo history

2023-03-08 Thread Lifepillar
Is there a built-in way or a plugin to extend / to the undo history? Use case: working on some code, I deleted a function a few hours ago, and I wanted to reinstate it. Using :earlier/:later did the job, but required a bit of trial and error. Thanks, Life. -- -- You received this message

Re: [Vim 9 script] Is there a way to get the actual type of an object?

2023-01-15 Thread Lifepillar
On 2023-01-15, Bram Moolenaar wrote: >> Is there a way to distinguish the class of the value returned by >> [a function]? > > Currently not. I have been wondering what would be the best way to > cover this. We already have type(), but this only returns the basic > type. For example for list

[Vim 9 script] Is there a way to get the actual type of an object?

2023-01-15 Thread Lifepillar
Silly example: vim9script class Num this.n = 0 endclass class Even extends Num def new(this.n) if this.n % 2 == 1 throw 'Not even' endif enddef def IsPrime(): bool return this.n == 2 enddef endclass class

Re: vim9 autoload script modified : How to reload it On-The-Fly

2023-01-12 Thread Lifepillar
On 2023-01-11, N i c o l a s wrote: > Hum, thanks a lot Life, after one more check: > > *./vimfiles/plugged/foo-helper.vim/autoload/vim9fooscript.vim* > > vim9script > > *# some many defs func* > > export def *High_Caller*(): void >Sub_Called(4) > enddef > > def Sub_Called(code: number ):

Re: vim9 autoload script modified : How to reload it On-The-Fly

2023-01-11 Thread Lifepillar
On 2023-01-11, N i c o l a s wrote: > > effectively, sourcing does not work sorry lifepillar: it echoes to me a > message E1091 Function HighCaller (below) is not compiled. > > And the calling tree is as this : > nnoremap *foo * Helper. *HighCaller* () -> > au

Re: vim9 autoload script modified : How to reload it On-The-Fly

2023-01-11 Thread Lifepillar
On 2023-01-11, N i c o l a s wrote: > Hi, > > Currently modifying an *autoload*/*vim9fooscript*.vim which can be started > by typing a nnoremap as this : > > >- *_vimrc* : > > import autoload './vimfiles/some/thing/*autoload*/*vim9fooscript* .vim' > as thatHelp > *nnoremap* inout

Re: Is there a way to open the ":terminal" in the bottom pane instead of the top pane ?

2022-10-10 Thread Lifepillar
On 2022-10-10, Eric Marceau wrote: > I would like to open the terminal in the bottom pane, rather than the > top pane. > > Is there an option that could be specified to allow me to control that? If you are ok with the bottom window always getting the focus on every split (not only for terminal

Re: Play sound on search wrap

2022-10-07 Thread Lifepillar
On 2022-10-06, Arun wrote: > You could try a hack by calling a function that checks for v:warningmsg and > reset it, in a "statusline" invoked function. Something like: > > --- > fu! CheckWrap() > if v:warningmsg =~# "^search hit [BT]" > "Ring bell > exe "norm! \" > endif

Play sound on search wrap

2022-10-06 Thread Lifepillar
When performing a search, it's easy for me to miss the "search hit BOTTOM, continuing at TOP" message because my attention is focused on the matches. For this reason, I'd like a sound of my choice to be played when the search wraps (using +sound). Is this possible? Thanks, Life. -- -- You

Re: Bugs in visual mode marks?

2022-09-27 Thread Lifepillar
On 2022-09-27, M wrote: > You're using cmd token that doesn't switch the modes. The effect is that as > long as you're in visual mode the < and > marks are not updated. This is > the way how it works and always worked. Aha, that's it! In fact, I have switched to use when I have migrated to Vim

Re: Bugs in visual mode marks?

2022-09-27 Thread Lifepillar
Source this script: vim9script def g:Select(): list const lnum1 = getpos("'<")[1] const lnum2 = getpos("'>")[1] return getline(lnum1, lnum2) enddef vnoremap x echo Select() Then select some line(s) and type \x. What I would expect (and what I think Vim used to

Re: Bugs in visual mode marks?

2022-09-27 Thread Lifepillar
On 2022-09-27, Lifepillar wrote: > Today, I checked the value of getpos("'>") after selecting some text, > and got: > > [0, 15, 2147483647, 0] Now I have seen that the large number is expected. I will try to make a reproducible example of my issue. Life. -- --

Bugs in visual mode marks?

2022-09-27 Thread Lifepillar
Has something changed recently in the way Visual mode marks are handled? I have a couple of functions using '<, '> and the like and they have started misbehaving recently. Today, I checked the value of getpos("'>") after selecting some text, and got: [0, 15, 2147483647, 0] This using Vim

[vim9script] Behavior of has_key()

2022-08-17 Thread Lifepillar
The help entry for has_key() says that the key must be a string. In legacy Vim script, however, this works fine: let dd = {42: '42', v:true: 'T', 3.14: '3.14'} echo dd->has_key(42) echo dd->has_key(v:true) echo dd->has_key(3.14) In Vim 9 script, the behavior is different:

Re: Build Vim without +vim9script

2022-08-11 Thread Lifepillar
On 2022-08-11, Bram Moolenaar wrote: > >> Is it possible to build Vim without support for Vim 9 script? >> >> I would like to build Vim without +vim9script for testing purposes. >> I have tried to pass --disable-vim9script to ./configure, but it does >> not recognize the option. And I can't find

Build Vim without +vim9script

2022-08-11 Thread Lifepillar
Is it possible to build Vim without support for Vim 9 script? I would like to build Vim without +vim9script for testing purposes. I have tried to pass --disable-vim9script to ./configure, but it does not recognize the option. And I can't find anything related to Vim 9 script in feature.h.

Re: vim9 exported functions not recognized by ctags

2022-08-11 Thread Lifepillar
On 2022-08-11, N V wrote: > So I put it in *somewhereOvertherainbow\*Vim\vim90\.ctags.d If you put Ctags configuration there, does `ctags --list-kinds=vim` still use it? > But it seems to not runnning well : does not displays vim9 exported > functions I'm afraid I can't help you with

Re: Use Vim 9 script function for indentexpr?

2022-08-11 Thread Lifepillar
On 2022-08-10, Lifepillar wrote: > However, a Vim 9 script function does not seem to be called: > > vim9script > > def BarIndent() > echomsg "BarIndent called" > return indent(v:lnum - 1) + 4 > enddef > > setlocal indentexpr=B

Re: vim9 exported functions not recognized by ctags

2022-08-11 Thread Lifepillar
Aah, the line for global vars got cut off the Ctags config: --kinddef-vim=e,export,Vim 9 exported defs --kinddef-vim=g,global,Vim 9 global variables --kinddef-vim=K,const,Vim 9 constants --regex-vim=/^\s*export\s+def\s+([^(]+)/\1/e,export/

Re: vim9 exported functions not recognized by ctags

2022-08-11 Thread Lifepillar
On 2022-08-10, Lifepillar wrote: > On 2022-08-10, N V wrote: >> Hi, >> >> Exported functions in New vim9 are not found by exubérant ctags, universal >> ctags and not displayed by tagbar plugin >> https://github.com/preservim/tagbar >> >> Is there a w

Use Vim 9 script function for indentexpr?

2022-08-10 Thread Lifepillar
The following silly indent works as expected (of course): function! FooIndent() return indent(v:lnum - 1) + 2 endfunction setlocal indentexpr=FooIndent() However, a Vim 9 script function does not seem to be called: vim9script def BarIndent() echomsg "BarIndent

Re: vim9 exported functions not recognized by ctags

2022-08-10 Thread Lifepillar
On 2022-08-10, N V wrote: > Hi, > > Exported functions in New vim9 are not found by exubérant ctags, universal > ctags and not displayed by tagbar plugin > https://github.com/preservim/tagbar > > Is there a work around. I have the same problem. I think that this will be eventually solved

Re: Setting termcap entries: avoid literal Esc?

2022-08-08 Thread Lifepillar
Thank you both! I hadn't thought about using execute. 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

Setting termcap entries: avoid literal Esc?

2022-08-08 Thread Lifepillar
In my vimrc I have entries such as these: set =^[f set =^[h where ^[ is a literal Esc. Is it possible to perform such assignments without using a literal Esc? For other entries I am able to use the & form (say, _BE = "\033[?2004h"). I am asking specifically about entries like the above,

Re: Inserting on alternate lines?

2022-06-02 Thread Lifepillar
On 2022-06-02, Tim Chase wrote: > On 2022-06-02 11:58, Lifepillar wrote: >> This morning I made a vertical selection with CTRL-V and typed (too) >> quickly to prepend a quote to the selected lines. I got so

Inserting on alternate lines?

2022-06-02 Thread Lifepillar
This morning I made a vertical selection with CTRL-V and typed (too) quickly to prepend a quote to the selected lines. I got something like this: "... ... "... ... "... ... For the life of me (pun intended), I cannot do it again. How is it possible to insert text on

Re: %f item in getqflist()

2022-04-25 Thread Lifepillar
On 2022-04-25, Lifepillar wrote: > I am looking into parsing a list of strings with an errorformat to > create a quicklist or location list out of it. Currently, I am doing it > as follows: > > let efm = "%f:%l:%m" > let what = getqflist({"lines":

%f item in getqflist()

2022-04-25 Thread Lifepillar
I am looking into parsing a list of strings with an errorformat to create a quicklist or location list out of it. Currently, I am doing it as follows: let efm = "%f:%l:%m" let what = getqflist({"lines": ["foo:3:bar"], "efm": efm}) call setloclist(0, what.items) echo what.items[0]

Re: Should Darkyellow, Lightmagenta, Lightred be defined in colors/lists/default.vim?

2022-03-20 Thread Lifepillar
On 2022-03-20, Lifepillar wrote: > highlight.c (and, formerly, syntax.c) mention the three colors in the > subject. Curiously, they are not defined in colors/lists/default.vim. Is > that an oversight or is it intentional? Aargh, I was looking at syntax.c in an older Vim sour

Should Darkyellow, Lightmagenta, Lightred be defined in colors/lists/default.vim?

2022-03-20 Thread Lifepillar
highlight.c (and, formerly, syntax.c) mention the three colors in the subject. Curiously, they are not defined in colors/lists/default.vim. Is that an oversight or is it intentional? I ask because, AFAICS, all the other colors are defined in default.vim. Thanks, Life. -- -- You received this

Re: Large file - Opening n head lines

2022-03-17 Thread Lifepillar
On 2022-03-17, Ni Va wrote: > Is it possible to open a Large File Vim but just only few beginning lines > of it, edit one of these 50 first lines and then save and quit ? I don't think that is possible with Vim without the help of some pre/post-processing tool, but... Vim can edit pretty large

Re: Avoid jumping cursor after undo

2022-03-16 Thread Lifepillar
On 2022-03-14, Lifepillar wrote: > I have defined this function: > > fun! Lint() > let l:view = winsaveview() > keepjumps normal gggqG > call winrestview(l:view) > endf > > When the function is executed, the cursor does not move, as expected. > Unfortunatel

Avoid jumping cursor after undo

2022-03-14 Thread Lifepillar
I have defined this function: fun! Lint() let l:view = winsaveview() keepjumps normal gggqG call winrestview(l:view) endf When the function is executed, the cursor does not move, as expected. Unfortunately, pressing u after that makes the cursor jump to the top of the buffer. I had hoped

Re: New User -- regex question(s) ...

2022-03-13 Thread Lifepillar
On 2022-03-09, LOSS PREVENTION <980beadvi...@gmail.com> wrote: > I have read, both http://www.vimregex.com/ -and- various sections of > http://vimdoc.sourceforge.net/htmldoc/help.html. That said, I just can't > figure out what I'm doing incorrectly. Please follow the live examples > below: > > 1)

Re: Dictionary Completion of Capitalized Words

2022-03-05 Thread Lifepillar
On 2022-03-04, Gary Johnson wrote: > On 2022-03-04, Bram Moolenaar wrote: >> Gary Johnson wrote: >> >> > Typing part of a word, then using Ctrl-X Ctrl-K to complete the word >> > from entries in a dictionary works fine as long as the word (not >> > a proper noun) is all lower case. But when a

Re: vim/colorschemes: Request For Comments

2022-02-13 Thread Lifepillar
On 2022-02-12, Romain Lafourcade wrote: > thanks to the hard work of a small but motivated team, a > first milestone is finally within reach As a mostly passive observer of the development of this project, I feel compelled to thank you for undertaking this time-consuming task with invincible

Re: Vim9 import [was Vim9 script feature-complete]

2022-01-05 Thread Lifepillar
On 2022-01-04, Marvin Renich wrote: > * Bram Moolenaar [220104 12:26]: >> While using: >> >> import "thatscript.vim" >> >> Or: >> >> import "thatscript.vim" as that >> >> Is nice and short, no need for "from". The help for ":import" becomes >> much shorter. The implementation will

Re: [VIM] Re: [VIM] Re: Persistent undo and swapfile

2022-01-03 Thread Lifepillar
On 2022-01-03, Walter Cazzola wrote: > On Mon, 3 Jan 2022, Lifepillar wrote: > >> On 2022-01-03, Walter Cazzola wrote: >>> Out of curiosity: which plugin are you using for the persistent undo. >> >> Do you mean, to navigate the (not necessarily persistent) undo

Re: [VIM] Re: [VIM] Re: Persistent undo and swapfile

2022-01-03 Thread Lifepillar
On 2022-01-03, Manfred Lotz wrote: > Another point might be interesting. In the undo directory there are > undo files where the real files don't exist any longer. Not sure if > there is some cleanup procedure avalaible. I use this command to remove undo files that haven't changed in a long time:

Re: [VIM] Re: Persistent undo and swapfile

2022-01-03 Thread Lifepillar
On 2022-01-03, Walter Cazzola wrote: > Out of curiosity: which plugin are you using for the persistent undo. Do you mean, to navigate the (not necessarily persistent) undo history? I use undotree (https://github.com/mbbill/undotree). I prefer it over other choices mainly because it is pure Vim

Re: Vim9 import [was Vim9 script feature-complete]

2022-01-03 Thread Lifepillar
On 2022-01-03, Marvin Renich wrote: > Don't bother with the > import MyClass from "myclass.vim" > import {someValue, MyClass} from "thatscript.vim" > > syntax, and only provide > > import "myclass.vim" > import "myclass.vim" as Other > > and require use of the namespace prefix: > >

Re: Vim9 script feature-complete

2022-01-03 Thread Lifepillar
["Followup-To:" header set to gmane.editors.vim.] On 2021-12-30, Bram Moolenaar wrote: > The work on Vim9 script is coming to a point where the syntax and > semantics are practially done. There might be some more tests > uncovering problems that need to be fixed and perhaps some tiny tweaks, >

Re: goyo plugin and artifacts in TTY

2021-10-30 Thread Lifepillar
On 2021-10-30, meine wrote: > When starting Goyo, artifacts of the previous screen-wide display of the > text stay. Scrolling though the text doesn't remove them (as opposed to > Goyo in a GUI, where resizing the window removes the artifacts). I do not have a solution, but I use Goyo and I

Re: New User Several Questions and Concerns

2021-09-17 Thread Lifepillar
On 2021-09-17, Bernard wrote: > I assumed each tab would be identified w/ a number Yes, that is the case. If you want the number to show up in the tab label, you may customize the tab line. See `:help setting-tabline`. > so one can merely type something like ":gototab3" :3tabnext (See `:help

Re: How to replace pattern with shell command's output using matched pattern

2021-09-04 Thread Lifepillar
On 2021-09-04, rwmit...@gmail.com wrote: > I'm just curious, is the file being otherwise edited in vim? I usually > just use less to view logs, in which case, a command line filter would be > more efficient (for me). Thanks that's a good suggestion in general. In this case, yes, I am going to

How to replace pattern with shell command's output using matched pattern

2021-09-04 Thread Lifepillar
Use case at hand: replace Unix timestamps with date/time in a log file: [1630720618] unbound[63495:0] info: 127.0.0.1 foo.bar.com IN [1630720618] unbound[63495:1] info: 127.0.0.1 foo.bar.com A IN ... The shell command I'd apply is `date -r `. How would you perform the substitution? The

Re: [vim9script] Why is a forward declaration needed?

2021-08-19 Thread Lifepillar
On 2021-08-19, Bram Moolenaar wrote: > You are using "Call" in Expr(), and Expr is used in an expression > to set "TrailingArg". To be able to check the type there, Expr() is > compiled, which requires "Call" to exist. Got it. > NumberLiteral is defined just before setting "TrailingArg". Too

[vim9script] Why is a forward declaration needed?

2021-08-19 Thread Lifepillar
Hi, I have tried to port this TypeScript script: https://github.com/sigma-engineering/blog-combinators/blob/master/index.ts to Vim9 script (please find the full code at the end of this message). It appears to work, but to make it work I had to add a "forward declaration" of the Call()

Statusline's minwidth not respected?

2021-08-02 Thread Lifepillar
Vim gurus, if I set the statusline as follows: set statusline=X%1MX the % item does not occupy any space if the buffer is unmodified, despite the minimum width of one character. Is that expected behaviour? What I would expect is what I get with: set statusline=X%1(%M%)X Thanks, Life.

Re: Help converting function to Vim9 script

2021-07-08 Thread Lifepillar
On 2021-07-07, lgc wrote: >> Any idea what would be the best way to convert the snippet above? > > Move the `i` variable in the script-local namespace. Thanks for the thorough explanation. For now, I am keeping a function instead of a def. But, as you say: > FWIW, I would still refactor the

Help converting function to Vim9 script

2021-07-04 Thread Lifepillar
The MetaPost plugin in Vim contains the following definition to replace the n-th occurrence of `beginfig(...)` with `beginfig(n)`: function! s:fix_beginfigs() let i = 1 g/^beginfig(\d*);$/s//\='beginfig('.i.');'/ | let i = i + 1 endfunction command -nargs=0 FixBeginfigs

Re: syntaxcomplete#Complete() and nested filetypes

2021-06-22 Thread Lifepillar
On 2021-06-22, David Fishburn wrote: > Life, > > I am not sure I quite understand your use case for the plugin. Thanks for the feedback. My goal is to have some sort of context-sensitive completion. My use case is ConTeXt, which can include MetaPost blocks: \starttext TeX code here:

Re: syntaxcomplete#Complete() and nested filetypes

2021-06-21 Thread Lifepillar
On 2021-06-21, Lifepillar wrote: > I would like to use syntaxcomplete#Complete() in a filetype that > includes a nested filetype. This is what I have so far, which appears to be working in filetype `foobar` with nested filetype `xyz`: def foobarcomplete#Complete(findstart: number

syntaxcomplete#Complete() and nested filetypes

2021-06-21 Thread Lifepillar
I would like to use syntaxcomplete#Complete() in a filetype that includes a nested filetype. The only way I have found so far is to define my own completion function that checks whether the current position is within the nested filetype, then calls OmniSyntaxList() with the appropriate regular

Re: Search for pattern in the first few lines of a buffer

2021-06-21 Thread Lifepillar
On 2021-06-21, Yegappan Lakshmanan wrote: > Hi, > > On Sun, Jun 20, 2021 at 3:59 AM Lifepillar wrote: >> >> I need to programmatically search for a pattern in the first ten lines >> of a given buffer, and save the match in a variable when found. Say, the >> pa

Search for pattern in the first few lines of a buffer

2021-06-20 Thread Lifepillar
I need to programmatically search for a pattern in the first ten lines of a given buffer, and save the match in a variable when found. Say, the pattern is: % KEY = value I need to extract the value if the above appears in the first lines of the buffer. Of course, the state of the buffer's

Translating complete functions to Vim9

2021-06-19 Thread Lifepillar
Is there a way to turn a completion function (:h complete-functions) into Vim9 script? The issue is that such functions are called twice, and they are expected to return values of different types in each call. Thanks, Life. -- -- You received this message from the "vim_use" maillist. Do not

  1   2   3   >