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
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
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
> 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
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,
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
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
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
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
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
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?
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
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
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
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
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?
>
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:
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
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:
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
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()
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
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
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
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.
: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
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
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
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
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.
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!
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
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"),
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
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
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
&
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
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)
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
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
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:
>>>
>&
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
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
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
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
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,
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
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
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.
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
> 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
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
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
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!
201 - 254 of 254 matches
Mail list logo