this post was submitted on 16 Jun 2023
1 points (100.0% liked)

Linux

48153 readers
774 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

like the title says, i've been trying to replicate the snippet functionality of vim ultisnips, so i can expand "fn" into find ./ '*$1* , and then at $1 i can type "or" to expand to find ./ \( -name '*$1*' -o -name '*$2*' $3 \) $4. if i need to add a third pattern to that i can add onm at $4 to expand into -o -name '*$1*' $2 where i can add yet another onm at $2, or "! or" to add a bunch of patterns i can exclude. i have a bunch of these set up in neovim, for a bunch of commands, and they save me so much time, but when it comes to writing them in the terminal it feels like i'm typing in porridge.

i know i can open the current line in $EDITOR, and this is super useful, but it still breaks my flow more than i'd like, and unless the command is particularly long and awkward it's easier just to bash it out like a caveman.

there's also a tool called "pet", but despite going over the github page a few times, i can't work out whether it will offer the ability to nest snippets like this. it seems like it's just a glorified version of the functions i can set in my zshrc, where i'd need to write all the various combinations of the find command (for eg), rather than the flexibility of ultisnips. if you use pet and can confirm that it does this, then consider the thread closed ha.

sorry for the long post. i'm not really a codey scripty person, i'm just somebody who installed linux mint a few years back and realised that the command line is sort of really cognitively ergonomic (most of the time).

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here