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!

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

Emacs users laughing at VIM users.

Emacs - A pretty good OS you can use as a text editor.

theshatterstone54 ,

And to counter the old saying of it lacking a decent editor, there’s always evil-mode.

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

I’ve come to the conclusion, people who use vim just continue to do so out of a stubborn sense of pride for finally learning the key combinations.

psycho_driver ,

That’s funny, I feel the same way about Excel users.

techwizrd ,

I am faster, more comfortable, and more productive in Vim. I use the same keybindings in all my editors and IDEs. It’s okay for people to have different preferences.

JustAnotherKay ,

In my case it’s not a sense of pride. I can’t use anything other than Vim because I keep accidentally putting random incantations into my word documents.

“There once was a dduuuZQ:q!”

lemmesay ,
@lemmesay@discuss.tchncs.de avatar

haha, same. do you use vimium as well?

JustAnotherKay ,

Ya know, I might throw that on to my browser but I doubt I’d actually use it much. I only really use my browser for research; notes, music, and most of my work is done in the terminal. Being able to swap tabs faster by not having to cycle could be useful, but other than that I find the mouse to be a pretty rapid way of navigating unfamiliar pages

lemmesay ,
@lemmesay@discuss.tchncs.de avatar

in my case, my hand hurts if I use mouse(or a mobile phone) for some time. using j/k for scrolling and clicking links via f help me a lot.

PlexSheep ,

That extension is actually pretty cool. There is also tridactyl and a browser that was made with vim in mind, but a browser and a text editor are too different for many things to translate.

lemmesay ,
@lemmesay@discuss.tchncs.de avatar

thanks for sharing, I’ll try it on my work machine

hakunawazo ,

It’s just convenient that it’s pre-installed on many servers.
So I can use it now everywhere with my stubborn sense of pride for finally learning the key combinations.

Theharpyeagle ,

I honestly learned it just because I hated having to change hand position to use a mouse.

Treachery4524 ,

Can you use a mouse in nano? I always just use the arrow keys, or page up/down and home/end

I mostly use vim but I barely use the jkl; to navigate the document.

Theharpyeagle ,

Ah sorry, I meant using Vim in a GUI program. I wanted something with the flexibility of a mouse (quick navigation, context menu actions, etc.) without using a mouse. Using just the arrow keys, shift highlighting, etc. is just too slow when writing lots of text, and it doesn’t follow the natural position of typing.

cerement ,
@cerement@slrpnk.net avatar

nano -m <file> or set mouse in your nanorc

Opisek ,

Even if you use arrows, you still have to reposition your hand.

catshit_dogfart ,

I just use vi

Is that stupid? It’s all I ever bothered to learn, hasn’t failed me yet. Now I’m not some big time linux guru but I’m a sysadmin and regularly find myself elbow deep in a CLI for stuff.

pixelscript ,

I mean, yeah, kind of. In the same way pilots fly planes out of a stubborn sense of pride for knowing what all the flight deck controls do.

Semi_Hemi_Demigod ,
@Semi_Hemi_Demigod@lemmy.world avatar

It’s not pride, it’s just that I know how to use it really well and that makes it easy for me to use.

But it’s really only for viewing files on another system over SSH. For local work I use Sublime Text

alexaralvarado ,
@alexaralvarado@infosec.pub avatar

Somehow it seems this would apply to any linux user

PlexSheep ,

What do you mean? The vim users know their key combinations pretty well, that’s kind of the point of vim.

TheV2 ,

There is no sense of pride. Every text/code editor has key combinations that many users will learn eventually. Vim has easier key bindings.

737 ,

no, modal text editors are just nicer to use

root ,

When you only need to hammer a nail every once in a while, any hammer will do. When you’re a roofer, you better have a roofing hammer.

If you don’t spend your life in a terminal and just need to edit a file, vim isn’t for you. If you want to learn complex strings of arcane wizardry to not only make your life easier but amaze your underlings, use vim.

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

Worst is when installing a new distro(usually in a vm ) and it defaults to nano and for some weird reason no vi of any sort is installed. I hated nano. Last time I intentionally used something like nano was the 90s with pine I think.

prole ,

What is there to hate? I don’t really understand. It does what it says on the package, and seems to do it pretty well. At least with respect to making small and quick edits to config files in the command line.

RedWeasel ,

My fingers don’t speak it is the problem.

prole ,

Pardon?

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.

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

Nano is my “daily drive”, but I’d use vim as well – takes a couple seconds to search for “how to type in linux vim” and “how to save a file in linux vim” anyways. :^)

Rekhyt ,

I know i and :wq and that’s all I ever plan on learning

theshatterstone54 ,

Not even Basic Command-Count-motion like c3w aka change 3 words after cursor, or d3b delete 3 words before the cursor?

To that, you add the D aka delete command C for change Y for yank (copy)

So yy to yank line, or dd to delete line.

Also p for paste

Also, i sends you before the cursor, a sends you after. Capital I is insert at beginning of line, Capital A is insert at end of line (append).

I terms of motions and moving around, you need: hjkl, C-d and C-u (half page jumps down and up), and within the line: 0 or ^ for beginning of line, $ for end (taken from regex), w for moving by word forwards, b for moving by word backwards. That’s pretty much all you need imo. There is also t and f. Where t goes forwards (think 'till aka until). Like dtc delete until the c character. F is the same but goes backwards in the line rather than forwards. Remember you can use these with xommands, so d$ deletes until the end of the line. Or “dt.” deletes till the “.” so… yeahI know there’s more, but that’s all you need for Normal and Insert mode imo.

For Visual mode, you only need to know how the Visual modes work. Visual (v), Visual Line (Shift-v) and Visual Block (Ctrl-V).

Also, for visual mode, it might be helpful to learn how to use V-Block to comment out multiple lines at once. Can’t be bothered to go into it.

But I’d argue that’s all there is to learn about vim keys in terms of getting work done.

Rekhyt , (edited )

Not gonna lie, once you’re getting past single button combos, I’m mentally checking out. Ctrl+K and Ctrl+U in nano are good enough for me, and if I need to do something more complex like actual coding, I’ll use an editor with a full GUI as well.

theshatterstone54 ,

Fair enough. I basically gave you a large chunk of vim so it will feel super overwhelming. The trick is to do one command or combo at a time. For example, I started with dd. Then I added yanking. Then I added visual mode. Then I added “o” (which I think I forgot to mention: o creates a newline under the current one and puts you in insert mode. Capital O does the same but above the current line). The real trick is going little by little. And to be honest, there are some commands I still rarely use or forget to mention. I’ve never used f instead of t. And in terms of forgetting to mention, there’s the x command which deletes the single character under the cursor rn.

Also, I’m sure someone will find this list helpful, so on top of this, I’ll also add this video (and hope that Piped bot will appear): www.youtube.com/watch?v=RSlrxE21l_k

It contains some things I haven’t mentioned.

As for learning all this, I’m repeating myself for the third time. Do it little by little. And when a command is already a thing you do almost without thinking about it, you’re ready to add more.

I’m mentally checking out

Why? dw is delete word, c5b change 5 words backwards, and those are the most complicated commands you’ll ever get to use, unless you start adding cuatom keybinds.

But I digress. If you don’t want to learn it, it’s fine.

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

Vim is way easier tho

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

I once fixed my bashrc file with libreoffice

deuleb_biezelbob ,
@deuleb_biezelbob@programming.dev avatar

calm down satan

voracitude ,

I regularly fix my bashrc file with Notepad. I run it in Wine because I cbf to RealVNC from my Windows CE media server.

(n.b: None of this is real, I wrote it to upset people, I’m sorry)

riodoro1 ,

Well let me upset you.

Ive been helping my coworker on a call and he was sharing his screen. I told him to edit a file (add a line) on a linux box we develop and he copied the file to his windows host with winscp, edited it in notepad and copied it back. I fantasize about killing him ever since.

voracitude ,

That’s crazy! At my job, I just help our users. I don’t have to build (and then maintain) infrastructure with them.

dgriffith ,

They need to learn how to use their tools better. Winscp does all that transparently for you if you press F4 on a file on a remote system. Or maybe they did and you just didn’t see it…

It’s quite a handy function when you’re diving through endless layers of directories on a remote box looking for one config file amongst many.

SexualPolytope ,
@SexualPolytope@lemmy.sdf.org avatar

I prefer Office 365 online.

nieceandtows ,

Come back after your uploaded it to the cloud and edited it using Google docs.

RxBrad , to linux in How dare you use a text editor because it's easy to use
@RxBrad@infosec.pub avatar

The Holy Trinity: VIM, Arch, and Rust

A7thStone ,

That’s a weird way to spell Vim, Arch, and C

amw3i7dwgoblinlabs ,
@amw3i7dwgoblinlabs@lemmy.world avatar

Seems you have a little typo, Emacs, Arch, and C

krakenfury ,

Fixed it for you: VSCode, Red Star OS, and sh

Telorand ,

Fixed it for you: Emacs.

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.

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.

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

Ugh, I swear vi and it’s derivatives are the absolute worse text editors going. There may have been reasons thirty or forty years ago, but now it’s just complexity and a weird ui for the sake of it

matthewmercury ,

I use VS Code on the desktop nowadays, but vi will always be my editor of choice in a terminal. Many of the reasons it was powerful and ubiquitous 30 years ago are still valid, so it’s still powerful and ubiquitous. And I’ve been using it for thirty years, so why would I switch to a training-wheels editor?

ReCursing ,

Because you want to get out of your Stockholm syndrome?

matthewmercury ,

Stockholm Syndrome was never real, it was made up to explain a situation where hostages recognized an injustice and refused to perpetuate it, so cops called them crazy. So sure, if you call me crazy for my affection for a tool that has served me well for decades, I’ll consider you a cop.

ReCursing ,

Okay… because you refuse to actually look at whether there are better options than the absolute trash you are using because you are used to it

BaroqueInMind ,

I’ve used other options and carefully elaborated them all, vim remained a superior tool.

ReCursing ,

Because you’re used to it. No other reason

BaroqueInMind ,

No other reason

Yep 🙄

matthewmercury ,

What’s the superior choice to vim, then?

ReCursing ,

Literally anything up to and including poking yourself in the eyes and trying to develop laser vision to manually modify bits on the disk platter

matthewmercury ,

See, you’ve realized your blunder, now. Tell us what editor you use in the terminal, ReCursing, the one that is better than vim. We’d love to know.

ReCursing ,

If I am forced to use an editor in the terminal, nano generally. But I very rarely need to because I have a functioning modern computer from within the last 25 years and therefore have a gui I can rely on. If I somehow manage to break the gui in a way that requires me to edit a text file (itself very very rare) I can fix it with nano.

Now, why would you voluntarily use an editor with a ui that’s needlessly confusing and convoluted, an arse to learn, and notoriously difficult to even save a file and close without checking help files if you haven’t already memorised completely random key combinations? I would say we’d love to know, but we already do. It’s because you’re an arrogant dickwad - at least that’s what your last comment makes you look like

matthewmercury ,

It’s because my job involves managing and operating systems that are only accessible through ssh or tty sessions. I spend hours every day in a terminal, on a remote session, frequently editing files for stuff: crontabs, configs, etc.

I learned vi because when I was coming up, university systems only had ed, vi and emacs, with pico on the servers that had pine for email. I learned vi because it was more powerful than pico (and because I couldn’t get the hang of emacs key combos). I read the help files and learned how to use it, because it was foundational.

Every Unix-like system has a variant of vi. Many of my container images don’t, but it’s trivial to install and use anywhere if needed.

It’s just a more powerful tool than nano, and consequently more difficult to use. Which is fine, man. It’s okay for you to use a basic text editor on the rare occasion you have to edit something in a terminal. You don’t have cause to learn how to be productive in an advanced editor, and that’s fine.

For what it’s worth, when I’m writing and testing python, I use VS Code.

ReCursing ,

It’s more powerful than nano, sure, but it’s also needlessly more complex a ui. Your use case is legit and that you know vi is a reason to continue using it, but it absolutely should not ever be the default for anything any more!

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

There’s always ed for masochists.

imouto ,

Ed, man! !man ed

The_Zen_Cow_Says_Mu ,

Ed is the standard editor

MonkderVierte ,

What’s with this childish rant?!

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

The first time I found myself in nano was when testing a distro fifteenor twenty years ago. I had to edit some files and it was the only available editor. The damn thing was a horror to use. I still have no idea who it caters to. I haven’t had to use it since though.

Jean_le_Flambeur ,

Dunno what you used, but nano is literally a text editor that may be simple simple but it just works. Shortcuts are shown to the user, buttons work like you expect them to (arrow keys, ESC, shift, etc)

With vim you open it and if you haven’t read 5pages of doc you won’t even be able to close it again. I see that its useful for power users, but for casuals who just want to edit a config once in a while nano is absolutely the way to go imho

AnUnusualRelic ,
@AnUnusualRelic@lemmy.world avatar

It’s not that simplle or user friendly when none of the usual shortcuts work. C-a did something completely unexpected.

Jean_le_Flambeur , (edited )

Well its shown to you at the bottom of the screen what it does…

And if you want Ctrl v,c,s etc. To work like in word etc you can always use nano --modernbindings

AnUnusualRelic ,
@AnUnusualRelic@lemmy.world avatar

They’re in Linux now, it should show the shortcuts they’ll encounter everywhere. Not leftovers from another system.

Jean_le_Flambeur ,

I am with you in this one!

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

I started on Emacs and then didn’t use it for a few years and forgot everything so now I’m stuck on Nano. But that’s fine because nano does everything I want it to do.

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