Better HN
topnewbestaskshowjobs
Log inSign up

hou32hou

70 karma · joined Sep 1, 2020 (6y ago) · 30 submissions

Submissions

comment 8mo ago · link · parent

Please feel free to ask for help in https://ki-editor.zulipchat.com/join/zzhagqzl6wyzpqfeqxcsrki... :)

comment 8mo ago · link · parent

Have you actually tried it?

comment 8mo ago · link · parent

Have you used `*` to pick the keyboard layout?

comment 8mo ago · link · parent

In Ki you don't have to know the name of the syntax node, you can just press `d m`, and the editor will show the labels of all the syntax node visible that you can jump to.

comment 8mo ago · link · parent

"Emacs is an editor" is as true as "Toyota Hilux is a gattling gun carrier"

comment 8mo ago · link · parent

TBH, it's actually not as hard as you think, most of the time, what I do is just select the whole syntax node and delete it, copy it, or replace it, and only 20% of the time would actually require deliberate understanding of how the AST is structured in the current language I'm coding in.

comment 8mo ago · link · parent

Sorry for derailing a bit, the search and replace using a query make sense for purly textual (non-syntactic) editing, but if you want to apply consistent syntactic modifications across multiple locations in the same file, you will need both multi-cursor and syntax node selection/navigation/modification.

It's hard to explain unless you actually try Ki, because it is a paradigm shift

comment 8mo ago · link · parent

We have one underway in https://codeberg.org/alicealysia/ki-bindings.nvim

comment 8mo ago · link · parent

> It shows the creator comes from VSCode

Hey, one of the creators here, I actually daily drove Neovim for two years, before switching to Helix for a while, then finally Ki.

> multi-cursor is a useless feature

I was a Neovim macro user until I figured out how insane that was compared to multi-cursor after using Helix.

comment 8mo ago · link · parent

It's good at least in my case because I switch between Dvorak (Corne) and Qwerty (laptop's keyboard) all the time, without positional keymap, I would have to develop two sets of muscle memory

comment 8mo ago · link · parent

It's not generated by LLM, it was actually my idea, but grammar-corrected by LLM, but you are not wrong either, the docs are really subpar in a lot of ways, and not clearly explaining why is one of them, and of course, the potentially cringey sentences too, someone complained the docs read like a Vogue magazine before lol

comment 8mo ago · link · parent

> How does the machine I ssh to know my keyboard layout

Why does it need to? If you are using say, Dvorak, you can just pick the keyboard layout by pressing `*` (a keybinding which is not affected by the chosen keyboard layout)

comment 8mo ago · link · parent

> For large edits, most selections will be out of the scroll window and not really helping.

That's why the Ki editor has a feature called Reveal Cursors (https://ki-editor.org/docs/normal-mode/space-menu#-cursor-re...), which is specifically made to solve this issue

comment 2y ago · link · parent

Honestly they're just a bunch of data transformers plugged together to create the illusion of behaving like a human.

comment 2y ago · link · parent

Do you mind sharing the Emacs package that does "tree based selection expanding" so I can better highlight their differences?

comment 2y ago · link · parent

Multi-cursor, yes; structural selection, not so much, they are more like an afterthought for most editors, there’s a big difference between being treated as first-class and second-class.

comment 2y ago · link · parent

Thank you for trying!

For character-based movement, simply press 'z' to enter the column mode.

Regarding the built-in tutor, yes I really have to put in the effort, because it's so much harder than authoring documentation.

And yes, a lot more has to be improved, Ki needs a lot of polishing around the edges.

comment 2y ago · link · parent

I think it's significantly better, because you don't need to know the specific type of node you want to select.

In Ki, you only need to use `s` for any syntax node, while in nvim-treesitter-textobject, you need to use `vaf` for functions, `vac` for classes, and so on. Additionally, this also depends on how well the Tree-sitter queries are written, or if they're written at all.

comment 2y ago · link · parent

Selection modes are sticky, so it would be “w l l l l l”

comment 2y ago · link · parent

Künstliche Intelligenz. Sounds super cool, not gonna lie.

comment 2y ago · link · parent

That's true for some users certainly, but I guess most users will not know which 4 easy-to-access keybindings to downgrade in exchange for the 4 syntax navigation keys, if it were you which 4 default keybindings are you willing to sacrifice?

The 4 movements are parent, first child, previous sibling, and next sibling.

comment 2y ago · link · parent

To be frank it takes time to get used to, especially if you are already a Vim amateur.

However, once you get the hang of it you will find that most common operations can be achieved within 3 keypresses.

For example, to delete the current line, press `e` (Line selection mode) and then `d` (Delete).

To delete the current word, press `w` (Word selection mode) and then `d`.

To insert new text at the end of the current line, press `e`, then `a` (enter insert mode at the end of the selection).

To insert new text at the beginning of the current line, press `e`, then `i` (enter insert mode at the beginning of selection).

To go to the first line, press `e`, then `,` (Move to the first selection).

To go to the last line, press `e`, then `.` (Move to the last selection).

There are too many of such examples that I cannot fit in one comment, but I think you get the idea. It's all about creative combinations between selection modes and movements.

comment 2y ago · link · parent

Ki is much inspired by Helix and Kakoune, however, it introduces an extra layer called the Selection Mode, with this, every movement is standardized to the same set of keybindings.

Also, most importantly, syntactical selection/navigation/modification is first class, although it is somehow supported in Helix, the default keybindings are not very accessible.

Another big difference from Helix is its internal architecture, most Helix components were rebuilt from scratch, while in Ki every components uses the core editor as the base, which means all components shares the same set of keybindings, you don't need to learn different set of keybindings for different components.

comment 2y ago · link · parent

I will need help unfortunately because I don't have an accessible Windows machine.

For the configuration I'm planning something crazier, I might use my programming language that I built earlier (https://github.com/wongjiahau/kk).

comment 2y ago · link · parent

Just `s` if your cursor is already placed on the first token of the function call node.

26.

Show HN: Ki Editor – Multicursor syntactical editor(ki-editor.github.io ↗)

138 points · by hou32hou · 2y ago · 71 comments

comment 6y ago · link · parent

Nope because I’m not convinced by this language anymore

comment 6y ago · link · parent

It won’t be delivered because it’s actually my final year project for my software engineering degree, and plus I’m also not convinced by this language anymore, I still think that there’s a better syntax which I can’t think of right now

comment 6y ago · link · parent

No no we haven’t broke up yet

comment 6y ago · link · parent

Yea it is indeed halted, because I’m still in search of a better syntax.