There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

lemmy.fosshost.com

jaybone , to linux in How dare you use a text editor because it's easy to use

You noobs. I just use combinations of cat piped to sed to edit my files, which are mainly lisp code.

WrenHavoc ,

Amateur! I write my code down on a piece of paper, scan it in, send it to my computer through email, then make a custom-built AI read the paper and print it in the terminal!

thevoidzero ,

M-x M-c butterfly

sundray ,

Link.

lemmesay ,
@lemmesay@discuss.tchncs.de avatar
JackbyDev ,

`<file foobar|

Trail ,

Huh does that actually work? Don’t have a system handy to try it out.

lemmesay ,
@lemmesay@discuss.tchncs.de avatar

showing the output in termux


<span style="color:#323232;">storage/documents/programs ro
</span><span style="font-weight:bold;color:#a71d5d;">></span><span style="color:#323232;"> echo puts </span><span style="color:#183691;">"hello world" </span><span style="font-weight:bold;color:#a71d5d;">></span><span style="color:#323232;"> main.rb
</span><span style="color:#323232;">
</span><span style="color:#323232;">storage/documents/programs ro via rb
</span><span style="font-weight:bold;color:#a71d5d;">></span><span style="color:#323232;"> ls
</span><span style="color:#323232;">c  js  main.rb  python
</span><span style="color:#323232;">
</span><span style="color:#323232;">storage/documents/programs ro via rb
</span><span style="font-weight:bold;color:#a71d5d;">> <</span><span style="color:#323232;"> main.rb grep hello
</span><span style="color:#323232;">puts hello world
</span><span style="color:#323232;">
</span><span style="color:#323232;">storage/documents/programs ro via rb
</span><span style="font-weight:bold;color:#a71d5d;">>
</span>
JackbyDev ,

I think so! I think it’s something like < file works anywhere in the line, not just the end. There may be some specifics about no space when it is the front but I don’t remember lol.

datelmd5sum ,

cat pipeing is safer though.

foobar > file and your file is gone.

wise_pancake ,

You can always alias > to < in your shell.

fossphi ,

Get out!

riodoro1 , to linux in How dare you use a text editor because it's easy to use

Average vim user: vim is easy.

Also average vim user: literally hours of reading tutorial pages on how to use vim.

barsquid ,

It is easy, though? I cannot even use it correctly. I just know some of the commands and that if you hold down shift it goes backwards.

Voytrekk ,
@Voytrekk@lemmy.world avatar

I’m a vim user and I would say it’s not. It’s very powerful, but only once you become familiar with the commands.

Nano is a better default for the average user because it works in a way most users would expect for a text editor to work.

ysjet , (edited )

Honestly, these days it’s pretty simple. The thing you need to remember is that you do not need to know EVERYTHING all at once. Learn a little bit, use it, keep what you use, discard what you don’t, get it in muscle memory, and learn a bit more. Very quickly you’ll be zooming through vim.

You can learn the basics, and go from there- the basics of vim (which imo everyone should know- vi is often the fallback editor), and then you can just casually learn stuff as you go.

Here’s the basics for modern default/standard vim: Arrow keys move you around like you expect in all ‘modes’ (there’s some arguments about if you should be using arrow keys in the vim community- for now, consider them a crutch that lets you learn other things). There’s two ‘modes’- command mode, and edit mode.

Edit mode acts like a standard, traditional text editor, though a lot of your keybinds (e.g. ctrl-c/ctrl-v) don’t work.

Press escape to go back into command mode (in command mode, esc does nothing- esc is always safe to use. If you get lost/trapped/are confused, just keep hitting escape and you’ll drop into command mode). You start vim in command mode. Press i to go into edit mode at your current cursor position.

To exit vim entirely, go to command mode (esc), and type :wq<enter>.

‘:’ is ‘issue command string’,

‘w’ is ‘write’, aka save,

‘q’ is quit.

In other words, ‘:wq’ is ‘save and quit’

‘:q’ is quit without saving, ‘:w’ is save and don’t quit. Logical.

Depending on your terminal, you can probably select text with your mouse and have it be copied and then pasted with shift-ins in edit mode, which is a terminal thing and not a vim thing, because vim ties into it natively.

That gets you started with basically all the same features as nano, except they work in a minimal environment and you can build them up to start taking advantage of command mode, which is where the power and speed of vim start coming into play.

For example ‘i’ puts you in edit mode on the spot- capital i puts you in command mode at the beginning of the line. a is edit mode after your spot- capital A is edit mode at the end of the current line.

Do you need these to use vim? Nope. Once you learn them, start using them, and have them as muscle memory, is it vastly faster to use? Yes. And there’s hundreds of keybinds like that, all of which are fairly logical once you know the logic behind them- ‘insert’ and ‘after’ for i/a, for example.

Fair warning, vim is old enough that the logic may seem arcane sometimes- e.g. instead of ‘copy and paste’ vim has ‘yank and put,’ because copy/paste didn’t exist yet, so the keybinds for copy/paste are y and p.

wise_pancake ,

The second most important thing about vim to learn is:

If nothing is behaving then you probably have caps lock on.

s_s ,

Vim makes it easy to edit text in complicated ways, once you’ve learned it.

Vim is not easy to learn nor intuitive.

It is simple and compounding.

You might not ever edit enough text to ever need to learn a new skillset to edit text. If that’s the case, use nano.

But if you do find yourself editing a lot of text, consider trying vimtutor.

It takes 20 minutes and you’ll be proficient enough to match nano’s efficiency ceiling.

Telorand ,

Allow me to present to you my Ultimate Guide to Emacs.

Opisek ,

You can learn Emacs in one day. Every day.

737 ,

It’s extremely easy to get started

geneva_convenience , (edited )
@geneva_convenience@lemmy.ml avatar

VIM is like drugs. Easy to start, hard to quit.

thingsiplay , to linux in How dare you use a text editor because it's easy to use

The Terminator is not here to kill you, its here to protect you from Emacs (which can change its form to anything).

https://beehaw.org/pictrs/image/780de71b-d929-4c95-9b86-0bde3a949be3.webp

tetris11 ,
@tetris11@lemmy.ml avatar

Cmon dude, what’s most likely to be Skynet?

  • Vim: Clearly evil, lightning fast. Relies on vimscript for any interactivity and can barely be used outside of the editor.
  • Emacs: the hippie brain child of some of the brightest minds at the MIT AI lab, funded by military contracts. Slow, but uses a near-universal language that can easily escape the bounds of the editor, (and often does (, and holy shit where did those parentheses come from. (Oh no, it’s becoming self-aware… fly you fools!
thingsiplay ,

Vim: Clearly evil, lightning fast. Relies on vimscript for any interactivity and can barely be used outside of the editor.

I don’t know why you want use Vimscript for anything outside of the editor. But if that your issue, then there is Neovim. It uses Lua instead Vimscript, but what is the benefit of using Lua outside of Vim? That changes nothing.

tetris11 ,
@tetris11@lemmy.ml avatar

Lua outside of Vim has huge applications in embedded products. Dude I would kill for Lua. Do you know what we have? Common Lisp. Yeah, it’s great and fancy and all, but try adding that to your CV and applying for an embedded system job.

thingsiplay ,

My point is, then use Lua outside of Vim. What does this have anything to do with the language used in Vim? You can use Vimscript in Vim, and still use Lua outside of Vim. So what’s the problem? It’s not like Lua gets available to you outside of Vim, just because you switch to Neovim. What do I miss here?

tetris11 ,
@tetris11@lemmy.ml avatar

(it was mostly a joke, but) the skills you acquire tinkering your Vim to your needs using vimscript can’t be used elsewhere, whereas Emacs has the (small) advantage that at least most of one’s elisp skills can be translated to common lisp quite easily (with the joke being that common lisp really isn’t that useful, hence my Lua jealousy rant).

cygnus ,
@cygnus@lemmy.ca avatar

It uses Lua instead Vimscript, but what is the benefit of using Lua outside of Vim?

The only other (in fact, the first) place I’ve run into Lua is WoW plugins.

thingsiplay ,

But WoW plugins have nothing to do with Vim. That’s my point. You can use Lua in WoW, while using Vimscript in Vim.

PlexSheep ,

Factoring mods also use lua. Lua is a neat little extension language.

NiPfi , to memes in Firefox + Ublock = 👑

And in the meantime Mozilla keeps making worse decisions, too

gdog05 ,

Enshitification of all the things.

HotsauceHurricane ,

Someone who gives a damn needs to be in charge of mozilla but i dont see that happening.

thesporkeffect ,

As long as they are entirely supported by Google, they aren’t going to try too hard to outcompete them.

Ephera ,

In order to get away from that, they need to find alternative ways of making money, like showing ads, which loops us back around to the guy above saying they’re making bad decisions.

thesporkeffect ,

Your point is fair, but their real problem is they bloated up to absorb their insane budget and they are going to have to strip down to a reasonable size for a browser company before trying to establish a non-google revenue stream.

Ephera ,

How the hell would you know this? There’s a reason no grassroots project is able to compete with Chrome, Firefox or Safari, and it’s not for a lack of trying.

And if you’re going to tell me they should stop doing Pocket etc., then please refer to my comment above.

RadioFreeArabia , to memes in Firefox + Ublock = 👑

I really hope there’s a significant rise in Firefox -and derivatives- usage share. It will be good for everyone, even those stuck on Chromium browsers.

daniskarma , to linux in How dare you use a text editor because it's easy to use

I’ll say that I find easier to exit vim that to exit nano.

I don’t know what ^ means. I just start pressing special keys until it doesn’t the thing

LodeMike ,

CTRL

unknowing8343 , to linux in How dare you use a text editor because it's easy to use

In every post of this kind I am amazed at so many people using nano instead of micro which is SO MUCH BETTER while being the same thing at the same time.

ObsidianZed ,

When you help manage thousands of servers with vim and nano already installed, it’s just faster to use one of those than installing something else nearly ever single time.

I prefer nano for quick edits of small files, but vim for hunting down things in larger files.

unknowing8343 ,

Or you can preinstall micro like you preinstall everything else 😅

ObsidianZed ,

I’m not that high on the totem pole unfortunately

RandomlyRight ,

I’ve discovered it just a few days ago and now use it on all my machines

Dasnap , to linux in How dare you use a text editor because it's easy to use
@Dasnap@lemmy.world avatar

I started on Unix systems using Vim, so I find Nano to be the confusing editor. A Vim install is one of the first things I do on a new server.

btp , to linux in How dare you use a text editor because it's easy to use
@btp@lemmy.world avatar

The best text editor is ‘$EDITOR’.

0x0 ,

I think you mean “$EDITOR”. Gotta have that variable expansion.

namingthingsiseasy ,

Not necessarily! I always run ln -s ‘/usr/bin/$EDITOR’ $(which $EDITOR) after a fresh install, so I have a valid executable on the path called $EDITOR.

Of course, then I have to make sure to add export EDITOR=$EDITOR to my .bashrc. (Obviously.)

sabin ,

Well,.that’s one way to solve the problem of not expanding your editor var correctly…

theshatterstone54 , to linux in How dare you use a text editor because it's easy to use

That’s like the picture of a normal dude with Nano, a large Vim dude, a larger buff Emacs dude and an ever larger massive Ed dude.

PotatoesFall ,

eh the emacs folks are just chilling in a corner somewhere. Maybe in the old folks home together with the ed users

escapedgoat ,

Don’t forget the joe user in the corner wearing a trench coat with a bomb strapped to his chest wired to a dead man’s switch.

thingsiplay ,

Ed is like Skynet itself.

pastermil ,

Do people still use ed unironically outside of scripting context?

peto ,

Unironically? Maybe not. But using something ironically is still using it.

SuperIce , to memes in Firefox + Ublock = 👑

Mozilla is about to collapse due to the Google antitrust ruling though.

refalo ,

Um, what makes you think that?

Ghostalmedia ,
@Ghostalmedia@lemmy.world avatar

Mozilla makes about $590m a year.

$510m of that is from Google paying for the search engine default spot.

UNY0N ,

Well I for one hope they figure out an alternative income, like a premium subscription? Or perhaps look to get acquired by proton and get some integration going with those services? I’m no expert here, I just think that they have a lot of happy users, and there must be some way to figure this out financially.

anachronist ,

They need to reform as a non-profit with user membership, an elected board, and fundraising like Wikipedia.

hanke ,

This is the real answer

Ephera ,

I’m not aware of any non-profit with staffing the size of Mozilla. The problem is that you need to be able to make money and to set it aside for bad times, so you don’t have to fire employees the moment the donations falter.

The 501©(3) non-profit form of tax-exempt non-profit, which is what the Mozilla Foundation continues to be, is not allowed to do so. That’s why they opened up the for-profit Mozilla Corporation subsidiary that does most of the Firefox development.

On the plus side, the only shareholder of the Mozilla Corporation is the Mozilla Foundation, which therefore essentially cannot accept any of the profit the MoCo might make.

raspberriesareyummy ,

That’s a ridiulously low amount of money given the amount of users. I’d happily pay 10-20 bucks a year to keep mozilla alive. Not that I like it much, but more so than the big alternatives

Ghostalmedia ,
@Ghostalmedia@lemmy.world avatar

Yeah, Apple seems to be able to fetch a little more than a billion per percent of the browser market (18% at 20B), but Mozilla is only able to score 0.5B for 2-3% of the market. Mozilla is getting a quarter of Apple’s rate.

That said, Apple has a lot more leverage than Google, and they can strong arm a better deal. I also wouldn’t be surprised if Safari users are just a more valuable marketing cohort. Firefox’s user base is going to have a lot more people who opt out of and or block targeted marketing.

SuperIce ,

The Google antitrust decision will result in Mozilla losing 90% of their revenue since Google won’t be allowed to pay them to use their search engine anymore.

Scrollone ,

The antitrust case is about Google and Apple, not Mozilla. It doesn’t mean the antitrust case will have any impact on Mozilla, because it’s not a major player, unlike Apple.

lolcatnip ,

I don’t think you realize where and why Mozilla gets its funding.

anachronist ,

Mozilla and its murder/suicide pact with Google falling apart may be the best thing that could possibly happen to Firefox.

kuneho , to linux in How dare you use a text editor because it's easy to use
@kuneho@lemmy.world avatar

I like nano tho it has some strange shortcuts

kautau ,

micro has some improvements and default shortcuts that are much closer to common GUI text editors

micro-editor.github.io

Varyag ,

oohh that is nice, I think I’ll swap my nano to that.

SapphironZA , to memes in Firefox + Ublock = 👑

“And then Mozilla management comes in from the top rope with the chair”

Seriously, for profit companies should not own open source projects.

Chakravanti ,

You can’t stop that. But you can use Librewolf if video download helper stops ignoring Librewolf.

SapphironZA ,

I mostly use waterfox, which is very similar to librefox. I just like the more compacted UI and performance optimization they have done.

Chakravanti ,

That’s awesome. Does Video DownloaderHelper work there?

SapphironZA ,

I believe so. Have not checked recently. All my Firefox extentions work as expected

Ephera ,

That for-profit company is owned by a non-profit. They don’t have shareholders to which they could pay out the profits.

queue , to linux in How dare you use a text editor because it's easy to use
@queue@lemmy.blahaj.zone avatar

Nano isn’t even that simple. Ctrl+X to quit? I guess if you use phonetic sounds to figure out how to exit a program. At least Vim uses the idea of “use what the words start with.”

I personally use micro in the terminal, and Kate if I want a GUI to write. Vim and Emacs are fine for those who want it, I have no stakes in the editor wars beyond “I just want my program to do what I want, and I want it to be simple to learn.”

Doxin ,

Nano has a cheat sheet at the bottom of the screen at all times

queue ,
@queue@lemmy.blahaj.zone avatar

Meanwhile I can just use the same shortcuts every other program made in the last 40 years uses. Ctrl+Q to quit, Ctrl+S to save, Ctrl+Z for undo. If I wanted to consult a cheatsheet to relearn keyboard shortcuts, I’ll use vim and emacs.

cravl ,

To be fair, you can easily rebind all the keys to be more normal by adding a .nanorc. Though, Ctrl-Z conflicts with suspend in many terminals, so I keep that one as Ctrl-U. A .nanorc also allows turning on mouse support, changing the color scheme, etc.

Kaput , to linux in How dare you use a text editor because it's easy to use

Isn’t this supposed to be VIM vs Emac? What’s is there point to be programming in the terminal anyway? Nano is good to fix some config files while your are in there, but if I needed to do real programming I’ll be finding something that works in the GUI.

Zozano ,
@Zozano@lemy.lol avatar

Did you just say GUI?

More like ewwwie.

deuleb_biezelbob ,
@deuleb_biezelbob@programming.dev avatar

Its GNUI

Zozano ,
@Zozano@lemy.lol avatar

What you’re referring to as GNUI, is in fact GNUI/Linux or as I’ve recently taken to calling it, GNUI plus Linux.

roguetrick ,

GNUssy

cakeistheanswer ,
@cakeistheanswer@lemmy.dbzer0.com avatar

Efficiency.

There’s 0 chance if you have to pick up your mouse that you can keep up with a Unix gray beard.

That’s just editing, if they’re from the emacs era there might be nothing you can do with text faster across their whole system.

I like vscode as a entry point, but if you care to get faster learning just vim motions and sys utils alone is going to cut time from the process.

Kaput ,

Oh it’s about speed. What’s the one that get your brain to be faster at programming? I use 4 fingers typing and am still typing much faster than I can think.

cakeistheanswer , (edited )
@cakeistheanswer@lemmy.dbzer0.com avatar

Definitely worth running through vim tutor at least once.

It’s beyond typing speed, things like piping out strings to utilities is using one program to write another, you aren’t just getting faster because of access, it’s a paradigm shift.

Edit just for fun: im a non Dev dummy who happened to grow up in a Unix household. Even having dropped vim for helix and bounced around the MS admin/Apple IT space for 30+ years. When I switched to Linux I could still remember binds I’d set up and last used at 9.

Kinda like riding a bike.

expr ,

It’s speed, but it’s also flow and a continuous stream of thought. If all your editing is being done with muscle memory and minimal thought, you can continue thinking about the problem at hand rather than interrupting your thoughts process to fumble through some context menu to make a change.

corsicanguppy ,

supposed to be VIM vs Emac?

30 years ago it was vi vs everything. I don’t see it changed today.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • lifeLocal
  • goranko
  • All magazines