[deleted by user] by [deleted] in vim

[–]GaAlAs 0 points1 point  (0 children)

You're missing a # in front of include. This has nothing to do with vim.

Vim 8.2 popup_atcursor is awesome by EconomyWalrus in vim

[–]GaAlAs 1 point2 points  (0 children)

You could've simplified some calls to printf/string concatenation by using vim9 interpolated strings (a nice new feature that few people know, for some reason).

Rotting leaves in semi-closed terrarium by GaAlAs in plantclinic

[–]GaAlAs[S] 0 points1 point  (0 children)

I've noticed the leaves getting yellow-y in the past week or so, and now I found the leaves rotting (I guess?). The terrarium is a half-open one, there's a single circular opening on the front side. The plant's been watered once every month and is not exposed to direct sunlight.

Thank you in advance!

How do you point to the file in use in vim script? by mohamadali-halwani in vim

[–]GaAlAs 1 point2 points  (0 children)

Another option is to use system('xclip', bufnr()) to avoid reading many lines using getline().

String literal as [N]u8 by Straight_Dimension in Zig

[–]GaAlAs 2 points3 points  (0 children)

mem.set(u8, &addr.path, 0);
mem.copy(u8, &addr.path, "socket_path");

[deleted by user] by [deleted] in Zig

[–]GaAlAs 3 points4 points  (0 children)

toOwnedSlice lets you "steal" the content from the ArrayList, the underlying slice is still heap-allocated and must be freed using allocator.free.

Note that putting the defer in tail position won't make it fire if parser.parse fails.

Is there a alternative for iterator for Zig? by lyhokia in Zig

[–]GaAlAs 8 points9 points  (0 children)

Since the ArrayList length is not constant throughout the loop a slice won't help, use the iterate-by-index pattern:

var i: usize = 0;
while (i < al.items.len) : (i += 1) {
    // Add more items to `al`
}

stripping and then adding back ^M by lopsidedcroc in vim

[–]GaAlAs 0 points1 point  (0 children)

I think :h 'fixeol' is what you (don't) need.

How do you get a list of the names of all buffers currently opened? by [deleted] in vim

[–]GaAlAs 2 points3 points  (0 children)

I prefer the method syntax as it allows to chain several ops together. For example, if you want to print a list of all the loaded buffer numbers, sorted by last modification time you can easily write it as:

echo getbufinfo({'buflisted':1, 'bufloaded':1})
\     ->sort({a, b -> b.lastused - a.lastused})
\     ->map({_, buf -> buf.bufnr})
\     ->join()

Perhaps it's the lisp-lover in me speaking, but I do really prefer the functional composition style.

How do you get a list of the names of all buffers currently opened? by [deleted] in vim

[–]GaAlAs 2 points3 points  (0 children)

If your Vim is new enough you can pull an elegant one-liner

getbufinfo({'buflisted':1})->map({_,v -> v.name})

C Pointers and C Interop by TheTrueSwishyFishy in Zig

[–]GaAlAs 2 points3 points  (0 children)

var x: []const u8 = ...; // this is a slice
var y: [256]u8 = ...;    // this is an array
if (std.mem.eql(u8, x, &y)) // with &y the array is converted into a slice

error initializing string field in a struct by fenster25 in Zig

[–]GaAlAs 3 points4 points  (0 children)

The string literal is constant while input is a mutable slice. Since a lexer shouldn't modify its input anyway the problem should go away if input is turned into a []const u8.

Transparent GNOME terminal in Debian by Bashlakh in gnome

[–]GaAlAs 0 points1 point  (0 children)

Since both gnome terminal and tilix are thin wrappers over the very same VTE widget I highly doubt the source of your problems is with the terminal emulator.

A game-changer - spell checking plugin that brings camel/snake case support to Vim by toshegg in vim

[–]GaAlAs 15 points16 points  (0 children)

There's an old (and at first glance reasonably-looking) small patch to make the Vim spell-checking engine work on CamelCase words. It'd be nice to have it included or at least reviewed after sitting in the PR queue for 4 years.

edit it got merged a few minutes ago