Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Cybernetic Vermin
Apr 18, 2005

didn't realize you were expecting some rad ui elements in your terminal text editor. though micro is better than nano there too in that its defaults wastes two lines less on banners and reminders for the comedy keybindings.

for some actual features it has vastly better syntax highlighting, sane defaults, buffer splits, multi-cursor, macros and plugins, and so on and so forth. nano does have an upside in often being installed by default, but i think that is literally the one thing unless one has fallen on ones head hard enough to enjoy the pine heritage keybinds.

Cybernetic Vermin fucked around with this message at 16:48 on Feb 21, 2024

Adbot
ADBOT LOVES YOU

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN

Cybernetic Vermin posted:

didn't realize you were expecting some rad ui elements in your terminal text editor. though it is better than nano there too in that its defaults wastes two lines less on banners and reminders for the comedy keybindings.

you can turn those banners off though. and the help command is the same ctrl-G??

seriously idgi. what's better about it? the only thing i'm seeing that is undoubtedly better than nano is that it doesn't have any dependencies, but if you're just installing it from a package then who gives a poo poo

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN

Cybernetic Vermin posted:

for some actual features it has vastly better syntax highlighting, sane defaults, buffer splits, multi-cursor, macros and plugins, and so on and so forth.

oic. better syntax highlighting i'll take your word for, i usually use it for bash or some C variant (or more rarely, but more frequently these days, python), so i could see it being better at newer/esoteric languages

but the defaults seem more or less the same as nano, which can also do buffer splits and macros (but no plugins afaik)

honestly idk why you'd want multiple cursors, hopefully you can enlighten me there because i'm not coming up with a compelling use for that on my own (not being facetious, i really don't know why that'd be desirable)

Cybernetic Vermin
Apr 18, 2005

i had no idea nano did buffer splits, but near as i can tell neither does nano-editor.org, so it might be more of an by-invitation deal i guess.

multiple cursors are cool and good.

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN

Cybernetic Vermin posted:

i had no idea nano did buffer splits, but near as i can tell neither does nano-editor.org, so it might be more of an by-invitation deal i guess.

echo "set multibuffer" >> .nanorc; invoke with nano -F

Cybernetic Vermin posted:

multiple cursors are cool and good.

well, why? i really don't get it

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN
oh apparently you don't need to invoke with "-F" after all

at least on nano 7.3 "nano file1.sh file2.txt file3.c" etc. worksforme with no nanorc, alt-./alt-, to switch (e: alt-arrow keys seems to work too)

you can also open a new file into a new buffer with ctrl-R and then meta-F to switch from inserting into the current buffer vs. a new one

Beeftweeter fucked around with this message at 17:17 on Feb 21, 2024

Cybernetic Vermin
Apr 18, 2005

right, but splitting so you can *see* two things is indeed not a thing then?

i am not making this out to be a be-all end-all feature, but, hey, one of the things micro does.

Clark Nova
Jul 18, 2004

micro will be feature-complete when it offers a vim mode

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN

Cybernetic Vermin posted:

right, but splitting so you can *see* two things is indeed not a thing then?

i am not making this out to be a be-all end-all feature, but, hey, one of the things micro does.

no, afaik it can't show them at the same time, but it does support multiple buffers (i didn't realize you meant "split" literally). i suppose you could always use a terminal that has split functionality/tmux (or similar). but tbh my terminal windows usually aren't big enough to be able to usefully split anyway, so it's not really a big deal to me

but i'm still curious what people are doing with multiple cursors?

Cybernetic Vermin
Apr 18, 2005

i think you'd need to try them for a bit to appreciate any description, if you make a similar edit in more than one place it is often easy to do with multiple cursors. sublime feature originally i believe, pretty much anything made since has it in some form. and as such you can no doubt find 2 hour youtube videos where someone at great length describes all the ways they use it.

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN
hmm i never hopped on the sublime bandwagon, but lol can't say i'm terribly interested in watching a video about a text editor

i'll just try it out on my own

Cybernetic Vermin
Apr 18, 2005

don't know that you need to try them out either, it is not some killer feature.

it does invite a certain circularity for this conversation to follow the formula 1) "i use nano" 2) "what does micro have that nano doesn't" 3) "well i don't use that", as i could kind of tell from 1) that you don't.

e: do suggest you try out micro in general though, if you like nano i am pretty sure micro is pretty much a superset, and you may strike on other things you like. the mouse support might also be even stronger, which i think is kind of fun as mouse on the terminal is one of those slightly transgressive features on unix.

Cybernetic Vermin fucked around with this message at 19:22 on Feb 21, 2024

outhole surfer
Mar 18, 2003

40 oz to freedom was good

matti
Mar 31, 2019

code:
" Have the <escape> delay be 50 milliseconds. The default is a full second.
set timeoutlen=50    
    
" Have the text width be 79 characters. The default is 0.
set textwidth=79
here's my .vimrc

then i just change things manually if i got to

matti
Mar 31, 2019

shitface posted:

:set number

to turn on line numbers then say you want to comment lines 45 to 50

:45,50s/^/#/

and if you want to undo Esc (to make sure) and then u

ed and ex are cool and fun to learn

FlapYoJacks
Feb 12, 2009

matti posted:

ed and ex are cool and fun to learn

:wrong:

fresh_cheese
Jul 2, 2014

MY KPI IS HOW MANY VP NUTS I SUCK IN A FISCAL YEAR AND MY LAST THREE OFFICE CHAIRS COMMITTED SUICIDE
ed saved my rear end multiple times when i broke the network config and only had a line mode terminal to fix it.

matti
Mar 31, 2019

vim is the improved version of vi, which is the visual mode for ex, which is the extended version of ed, which is the standard text editor

matti
Mar 31, 2019

in practice that means you can just hit : and type any ed or ex command and it just works

except the line the cursor is on is .

so e.g. :69 moves the cursor to line 69, or :$ moves the cursor to the last line, :p prints the line

and so on

very cool

shitface
Nov 23, 2006

matti posted:

vim is the improved version of vi, which is the visual mode for ex, which is the extended version of ed, which is the standard text editor

ed and ex are a bit too far for me but the reason I suggest what I did over some cursor block marking bullshit is its general applicability

replace the start of a line

:s/^/yospos /

replace the end of variable length lines (can this even be done with the block method?)

:s/#/ bitch/

replace a typo

:s/bitch/bicth/

or you know, any regex for stuff you want to do in the middle of lines. put a few of these together and you can quickly turn a mess into something structured and nice. one thing I’d use these fairly often is where you put a bunch of files/objects/whatever into a text file that you need to wrap in to a command with the command before it, other arguments after it. edit the list file and then ^ and # are your friends

matti
Mar 31, 2019

i think my point is that the : nonsense makes a lot more sense when you realize it's literally just ex

e.g. w writes the file to disk just like in ed, or q quits the program

shitface
Nov 23, 2006

matti posted:

i think my point is that the : nonsense makes a lot more sense when you realize it's literally just ex

e.g. w writes the file to disk just like in ed, or q quits the program

oh yeah for sure you described the evolutionary path of editing

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

i'm also using micro on all my machines because it has ctrl-s to save, ctrl-q to quit, and ctrl-(shift)-c/v to copy/paste, just like every other editor i've ever used and currently use

and no, you don´t need to tell me how i can simply write a custom script in a custom language in a .nano_rc file to replace nano's default bindings or whatever. i don´t use terminal editors often enough to give a poo poo about learning to customize them, that's what vscode and intellij are for. but i do use them just often enough to bother downloading micro into ~/.local/bin

Silver Alicorn
Mar 30, 2008

𝓪 𝓻𝓮𝓭 𝓹𝓪𝓷𝓭𝓪 𝓲𝓼 𝓪 𝓬𝓾𝓻𝓲𝓸𝓾𝓼 𝓼𝓸𝓻𝓽 𝓸𝓯 𝓬𝓻𝓮𝓪𝓽𝓾𝓻𝓮
vim is fine

sb hermit
Dec 13, 2016





Amethyst
Mar 28, 2004

I CANNOT HELP BUT MAKE THE DCSS THREAD A FETID SWAMP OF UNFUN POSTING
plz notice me trunk-senpai
my 2018 dell xps 13 is dying. is anyone running ubuntu on a 2024 xps 13? Preferably jammy

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

ban this sick filth

Nitrousoxide
May 30, 2011

do not buy a oneplus phone




https://www.youtube.com/watch?v=9n1dtmzqnCU

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:
I use vim and Kate unless I am writing Python, where I have gone Full Pycharm.

AlbertFlasher
Feb 14, 2006

Hulk Hogan and the Wrestling Boot Band

Gun Metal Cray
Apr 27, 2005

Pillbug

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN

oh jeez you got this all screwed up


i mean, technically it's spelled with a k, but since you use vim i'll give you a pass on the spell check

BlankSystemDaemon
Mar 13, 2009



If I'm working on mdoc(7) or AsciiDoc for FreeBSD, I use nano for syntax highlighting and columnation.
It's project policy that all files in src (which includes manual pages) has to fit in 80 characters, and commit message headers have to fit in 70 - to allow for reading source code and commits on the console (so you can rootcause an issue without a GUI).

If I just need to edit a file quickly, I use nvi2 (new vi v2, a reimpmentation by Keith Bostic of vi(1) that Bill Joy wrote, which has had many additions including unicode and wide character support) as found in FreeBSDs base system.

I managed to gently caress up a system to the point that that the only way to fix it was to learn ed(1) - and there was no way to schedule a maintenance window, because of production workloads, so I also know how to do that, in a pinch.
Shamefully, I think it involved a rm /* that was caught early, which is why I now have 'set rmstar' in .tcshrc.

EDIT: Oh, I forgot the more important part of my development process.
When I'm working on mdoc(7) files, I use mantra (which is a tiny wrapper script around entr) that regenerates manual pages when you write out the file to disk, similar to how hugo renders AsciiDoc when you use the 'run' make target in /usr/doc - so I always keep a live-preview in a separate pane next to my editor - either via tmux or swaywm tiling.

BlankSystemDaemon fucked around with this message at 16:17 on Feb 22, 2024

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:
I always put an echo in front of any rm while I am writing it when I am forced to do anything on a production system.

Same reason why I write a SELECT (and WHERE) first before changing to a UPDATE or DELETE. :v:

Cybernetic Vermin
Apr 18, 2005

it is interesting to learn that i am better at computers than people who know ed, seeing how i've never hosed one up bad enough to need it.

BlankSystemDaemon
Mar 13, 2009



Antigravitas posted:

I always put an echo in front of any rm while I am writing it when I am forced to do anything on a production system.

Same reason why I write a SELECT (and WHERE) first before changing to a UPDATE or DELETE. :v:
Yeah, there's good reason for it - I love that ZFS has the -n flag for any administrative command, which acts as a noop, and also tells you what it would've done.
I wish every command-line utility had that.

Cybernetic Vermin posted:

it is interesting to learn that i am better at computers than people who know ed, seeing how i've never hosed one up bad enough to need it.
Can you even say you've lived as a system operator, if you've never felt the cold rush down your spine from doing something awfully stupid, and then the sheer loving relief when you manage to fix it before anyone noticed?

BlankSystemDaemon fucked around with this message at 16:22 on Feb 22, 2024

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN
i had to use ed to fix some config when i was first trying out linux circa 2000 or so. i can't honestly say i remember how though

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:
I was once diagnosing an issue with a large ZFS box. I wanted to get a quick overview of all the drives.

The plan: Dump smartctl -a data into one file per drive, named after the drive
The execution (it was late): Dump smartctl -a data into the file of the drive.

Recovered online without data loss or service interruption, but the next maintenance reboot had me sweating bullets.

BlankSystemDaemon
Mar 13, 2009



Antigravitas posted:

I was once diagnosing an issue with a large ZFS box. I wanted to get a quick overview of all the drives.

The plan: Dump smartctl -a data into one file per drive, named after the drive
The execution (it was late): Dump smartctl -a data into the file of the drive.

Recovered online without data loss or service interruption, but the next maintenance reboot had me sweating bullets.
There's just something about sharing war stories from datacenters, that makes me wanna do it over drinks - it's probably operant conditioning from all the times it's happened in the past.

And we all know that anyone who claims to be so good at computers as to never make mistakes, is someone who would barely qualify as a PYF, let alone BOFH.

Adbot
ADBOT LOVES YOU

Beeftweeter
Jun 28, 2005

OFFICIAL #1 GNOME FAN

Antigravitas posted:

I was once diagnosing an issue with a large ZFS box. I wanted to get a quick overview of all the drives.

The plan: Dump smartctl -a data into one file per drive, named after the drive
The execution (it was late): Dump smartctl -a data into the file of the drive.

Recovered online without data loss or service interruption, but the next maintenance reboot had me sweating bullets.

so you did like smartctl -a &> /dev/hda instead of idk, smartctl -a &> /mnt/hda?

lol

luckily that probably wouldn't overwrite much

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply