this post was submitted on 06 Feb 2025
31 points (97.0% liked)

Linux

8699 readers
157 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 2 years ago
MODERATORS
 

I use gedit for most of my text editing, but markdown support is very limited.

Things I've tried:

  • vscode, too heavy and intrusive
  • Google docs, only renders, doesn't show the plain text, need to manually export to see markdown
  • Eclipse, haven't actually tried markdown, but I have no doubt that it's supported, but heavier than anything else
  • atom, no longer developed last time I checked
  • online editor, don't want to share my text and functionality is poor
  • type markdown, save it and render with pandoc, lots of effort, but the results are good

Over to you.

Edit: Had some issues with my Lemmy client, moved to Voyager and hopefully I can fix things.

I was asked what functionality I require, which to be fair, I hadn't considered because I use my editor for pretty much everything.

Ideally I'd be able to use it to either see the raw markdown or the rendered version of whatever I'm writing, code in a dozen languages, articles, websites, legal documents, books, all of which I do pretty regularly.

The side-by-side view doesn't do it for me, I'd more likely than not have multiple windows open with different documents instead.

It should do autocomplete, syntax highlighting, bracket closing, live spell checking in a variety of languages, launch quickly, be rock solid when faced with a massive log file and allow me to add menu-items to run bash scripts that do things like calculate the time it would take me to read out the text at my normal podcast reading voice or covert weird characters into html-entities.

There have been many wonderful suggestions, most of them do the preview side-by-side which pretty much eliminates them as a candidate.

There are many suggestions to use a vscode floss version, but the biggest issue with vscode is its weight and I'm not sure if it changes by moving to the floss version. I note that my search for that tool brought me many AI features, which is why I did a hard pass and why I can't remember its name ATM. (Edit: Codium)

I've been using Debian since 1999 and still struggle with remembering the vi control codes, so emacs is unlikely to get in the door.

So, with that in mind, whadayagot?

top 35 comments
sorted by: hot top controversial new old
[–] highball@lemmy.world 4 points 15 hours ago (1 children)

Too bad you are not a fan of vim. Helix is a good alternative. But, Helix and frogmouth in tmux is a good combo. Maybe nano instead of helix or vim?. https://github.com/Textualize/frogmouth

[–] vk6flab@lemmy.radio 2 points 15 hours ago (1 children)

I want to be friends with vi, but I cannot get my head around it, between the regex for sed, grep, awk, vi and even languages like bash, python, PHP, and Perl something has gotta give.

[–] highball@lemmy.world 3 points 12 hours ago

I hear you. the vi family, even helix (which is an IDE where the vi-like editors are not) takes quite of bit of use for things to just be natural. If I knew a terminal editor like nano but as powerful as VSCode that would be a great option for you. I'm sure it's out there, I just don't know what it is. But frogmouth is what you want to review the rendered markdown. tmux with helix and frogmouth is such a simple combo. I'm sure there is a hx/vi-like/vscode alternative out there. I mean, it's the internet, guaranteed somebody else wanted that too.

Another tip though, since I think most people have never heard of it. Xonsh instead of bash shell. It's a shell done in python. Then you can drop bash, php, and perl. Just stick with python. xonsh also has a wrapper for running bash scripts too, so you don't have to redo old work. It's worth a look to see if xonsh can simplify some things for you.

[–] CrayonRosary@lemmy.world 4 points 19 hours ago* (last edited 19 hours ago) (1 children)

Since you mentioned VSCode. I wanted to bring up VSCodium. It's a fork of VSCode with no telemetry. Yes, it's a full fledged IDE, and probably too much if you just want to markdown editor, but I use it for much more than that, and I think it's great.

[–] babybus@sh.itjust.works 1 points 6 hours ago* (last edited 6 hours ago) (1 children)

Yes, it’s a full fledged IDE, and probably too much if you just want to markdown editor, but I use it for much more than that, and I think it’s great.

It is a full fledged IDE if you install a lot of extensions. Without them, it is rather lightweight. I'm unsure what OP finds heavy about it.

[–] CrayonRosary@lemmy.world 1 points 5 hours ago

Me too, honestly.

[–] dbkblk@lemmy.world 13 points 1 day ago

Obsidian, it's not open-source, but it's not locking you down, and it's exceptionnally well written.

[–] bitjunkie@lemmy.world 2 points 19 hours ago

I really like Typora on macOS but haven't tried the Linux version.

[–] lambalicious@lemmy.sdf.org 9 points 1 day ago

There are a few good ones I can recommend, depending on what experience are you looking for (programmer, writer, simple note-taking).

Apostrophe would be the first, better for freestyle writing IMO; and then in no particular order I'd recommend Formiko which seems to work wonders for technical / programming-related writing, Remarkable and Ghostwriter for that no items, text only, final desktop kind of experience. Most or all of these should be findable in software stores like Flatpak, too.

[–] dangling_cat@lemmy.blahaj.zone 3 points 22 hours ago

There is also Zed Rust based code editor that ofc supports markdown

[–] tal@lemmy.today 5 points 1 day ago* (last edited 1 day ago)

Emacs's Markdown mode has two options for preview:

  • C-c C-c p (Control-C Control-C p) runs markdown-preview, which will open a preview in a new window

  • C-c C-c l runs markdown-live-preview mode, which will show an updated-as you edit preview next to the text.

In addition to built-in functionality, in my emacs setup, I also personally bind C-c a k to run Make. In my init.el:

(global-set-key (kbd "C-c a k") 'compile)

That way, if you have any sort of project -- which could hypothetically be a Markdown file -- and a Makefile for it in the same directory, it'll build it. An example Makefile:

all: foo.pdf

%.pdf: %.md
	pandoc -f markdown -t pdf $< -o $@

Editing foo.md in emacs and hitting C-c a k will regenerate the pdf using pandoc with that setup. It sounds like you're familiar with pandoc.

If you have evince running on foo.pdf, it'll monitor changes to the displayed pdf file, and then just update its display if the file changes.

[–] thevoidzero@lemmy.world 2 points 21 hours ago

You said you can type in markdown, convert it to PDF with pandoc and you like the results.

Now all you need is an editor that can open two file side by side (anything works here, I use emacs), and needs to auto reload PDF on file change. And a tool that can run your configured command each time markdown file changes (I have my own program for this, but it's a simple bash script as well if you want to write).

Now with those two all you do is write in markdown and every time you save it the command will run, get the pdf and it'll reload the pdf. Even if you don't have the same program to open text and PDF you can just use two with split screen.

[–] Bravebellows@lemmy.sdf.org 5 points 1 day ago

Take a look at Obsidian over at obsidian.md

[–] jamesbunagna 2 points 22 hours ago

My all-time personal favorite is probably MarkText. I'm actually surprised no one else has mentioned it; knowing it has garnered almost 50k stars on GitHub.

I really like it for its realtime preview and support for mathematical expressions. Though, it's wonderfully feature-rich; so please check out its README for the full list.

Unfortunately, it (currently) doesn't enjoy as much development as it previouslu did. Which has ultimately led me to pivot to ghostwriter more recently.

[–] sicco@feddit.nl 1 points 20 hours ago

Nextcloud Notes can show your notes as raw text and as formatted markdown. You do need a Nextcloud server to connect to though.

(There is an issue for an accountless mode)

[–] mortalic@lemmy.world 2 points 1 day ago

Codium with a markdown plugin gives both edit and preview with syntax highlighting. Add in Genie extension with a chatgpt api key and you can really do some cool stuff

[–] 7uWqKj@lemmy.world 1 points 22 hours ago

QOwnNotes does both at the same time in a nice way.

[–] 97xBang@feddit.online 2 points 1 day ago
[–] mhzawadi@lemmy.horwood.cloud 2 points 1 day ago (1 children)

I use pulsar edit, the successor to atom. Also on the terminal, have a look at glow.

[–] vk6flab@lemmy.radio 1 points 1 day ago (1 children)

Had a quick look for glow but couldn't find it. I didn't know about pulsar. Is it more stable than atom, which managed to fall over when ever I looked at it sideways, a bit like the ZX80 keyboard which would cause a reboot if you dared to think about touching it, that said, reboot was much faster than atom starting up. Does pulsar take the same absurd amount of time?

[–] mhzawadi@lemmy.horwood.cloud 1 points 22 hours ago* (last edited 22 hours ago)

Oh, not sure where I got glow from. Will have a look.

Pulsar is a fork of atom and is in active development, it can still be a little slow sometimes. But is now getting updates to make it run better

Edit: this https://github.com/charmbracelet/glow

[–] muntedcrocodile@lemm.ee 1 points 1 day ago (1 children)

If u wanna avoid the intrusiveness of vscode u can use codium for a fully foss experience

[–] vk6flab@lemmy.radio 1 points 1 day ago (1 children)
[–] muntedcrocodile@lemm.ee 2 points 1 day ago

It doesn't have any ai unless u add an ai extension. I use continue pointed at openwebui that uses a self hosted model full foss ai tool chain. And again its optional.

[–] nesc@lemmy.cafe -1 points 1 day ago (1 children)
[–] vk6flab@lemmy.radio 1 points 1 day ago (2 children)

I have no idea what that's a screenshot of.

What do other headings, tables and footnotes look like?

If it's just more colours, that doesn't help me.

[–] nesc@lemmy.cafe 3 points 1 day ago (1 children)

Name of the app is kate. It only does light formating and syntax highlight. Are you looking specifically for markdown editor that just doesn't hide markup? From the list you gave my understanding was that you are looking for higlight and that's +- it. There are multiple markdown specific editors that do it like ghostwriter, retext, or even emacs with markdown-mode (iirc it does rendering without hiding markup, auto-formats tables, makes links clickable, etc.)

[–] vk6flab@lemmy.radio 1 points 1 day ago* (last edited 18 hours ago) (2 children)

I tried editing my post to add this, but ~~Pachli~~ Connect doesn't want to play at the moment.

Ideally I'd be able to use it to either see the raw markdown or the rendered version of whatever I'm writing, code in a dozen languages, articles, websites, legal documents, books, all of which I do pretty regularly.

The side-by-side view doesn't do it for me, I'd more likely than not have multiple windows open with different documents instead.

It should do autocomplete, syntax highlighting, bracket closing, live spell checking in a variety of languages, launch quickly, be rock solid when faced with a massive log file and allow me to add menu-items to run bash scripts that do things like calculate the time it would take me to read out the text at my normal podcast reading voice or covert weird characters into html-entities.

Edit: Changed Lemmy client to Voyager and can now fix things again. I'll leave this comment here and also include it in my post body.

[–] tal@lemmy.today 1 points 22 hours ago* (last edited 15 hours ago) (1 children)

The side-by-side view doesn't do it for me, I'd more likely than not have multiple windows open with different documents instead.

That'll probably rule out text editors like emacs if you don't want side-by-side. Emacs has some functionality that can do some styling, but you probably won't have a purely WYSIWYG mode for, say, tables. It looks like emacs has some way to translate org-mode tables to Markdown, but that's probably not quite what you want.

It should do autocomplete, syntax highlighting, bracket closing, live spell checking in a variety of languages, launch quickly, be rock solid when faced with a massive log file and allow me to add menu-items to run bash scripts that do things like calculate the time it would take me to read out the text at my normal podcast reading voice or covert weird characters into hrml-entities.

That'll rule out most "small" programs targeting specifically Markdown.

Depends on what you mean by "massive" log files. If you mean you require out-of-memory editing -- the ability to load only a small portion of the document into memory, which is probably going to be necessary once you exceed your machine's main memory -- then you're looking at a small set of software. Some hex editors, emacs can use vlf (which will constrain other features available), a few programs targeting specifically this feature.

I haven't looked at heavyweight word processors, but some may have reasonable support for at least many of those, stuff like LibreOffice. They probably won't open quickly, but there are a few programs capable of speeding up startup by leaving a daemon running, just opening something in that daemon, like emacs, urxvt, etc. You can possibly do that or just leave a blank document open on another workspace.

[–] vk6flab@lemmy.radio 1 points 17 hours ago (1 children)

Not sure if this will reply properly (new Lemmy client), but you made some excellent points.

I'm loathe to leave an app window open because I don't want the editor to "help" when I'm wanting to replace text in all open windows and discover that it did so on another workspace. I tend to launch separate instances for each set of files.

The massive file comment really stems from opening a file without checking every time how big it is and getting locked out of your editor whilst it chokes on a json or xml file with no line breaks. At the time of writing, all I could think of was log files.

I am beginning to suspect that I'm going to need to use multiple editors and I can't say that this fills me with joy.

[–] tal@lemmy.today 1 points 13 hours ago* (last edited 9 hours ago) (1 children)

considers tradeoffs

So, if it were me, I'd probably use a text editor, as the big text editors are going to be able to do the rest of those. I've authored text in a number of lightly-annotated-text formats like Markdown and similar (AsciiDoc, Docbook, Markdown), and I always did it in emacs, and generally vim has analogous functionality.

If you don't mind me asking, what is the use case for this? Markdown originally had the design goal to be easily-editable as plain text -- that is, one could view it as plain text almost as well as in a rendered form. That was kind of its selling point relative to many other rich text markup languages; it was intended to let a user edit and read it in a plain-text editing environment, without even colorization and such.

Markdown, unlike, say, PDF or Microsoft Word or something, is intended to be display-device-agnostic. That is, if you distribute a Markdown file to others, what the end user will see may differ from what you see, because Markdown intentionally abstracts the specifics of how the material is displayed. Normally, WYSIWYG is mostly-useful for formats that don't do this. If you're using Markdown to author PDFs or printed pages or something and then using that format for distribution, I get that. But if you're handing out Markdown, what you see might not be what the end user sees; screen size differences, typeface differences, other things may pretty-dramatically change what they see. Even above-and-beyond device differences, the Lemmy Web UI, Mbin, the Lemmy clients that I've used, Reddit, and GitHub all use intentional variations on the basic Markdown format. IIRC from last time I used pandoc, it supports multiple of the different dialects, but even it can't provide a representation for every one. Lemmy recently ripped out the auto-renumbering of numbered lists. IIRC either Reddit or Lemmy disabled huge top-level headers after people abused them to flood threads (though maybe that's a per-community/subreddit CSS thing). Reddit doesn't support Markdown's syntax for inline images (well, old.reddit doesn't, at any rate, and I haven't tested new.reddit). Many websites and client software packages that present Markdown permit a user to view it in light-on-dark or dark-on-light or have other theming options.

Is it to make sure that there are no errors in the Markdown leading to some kind of wonky display, say (like a table row missing a trailing pipe or something)? There may be a non-editable-WYSIWYG way to accomplish that that might work with text editors. pandoc may have the ability to emit errors, and it looks like there are Markdown linting packages. It may be possible to rig those up to a text editor to highlight any errors. If I were doing it in emacs, I'd guess that flycheck can run a command in the background during idle time to check for errors and flag them. I don't know how vim does it, but I'm sure that it has an analogous feature.

kagis

It looks like flycheck already does support running markdownlint in the background to highlight errors in Markdown, actually:

https://www.flycheck.org/en/latest/languages.html

Supported Languages

Markdown

markdown-markdownlint-cli

Check Markdown with markdownlint-cli.

goes to try it out

On my system, I just needed to install markdownlint, and then enable the flycheck minor mode (M-x flycheck-mode) when in markdown-mode. Then emacs starts highlighting errors in the Markdown text, and one can get a list of errors in the document and jump to each.

It looks like markdownlint is pretty nitpicky out of the box (warns about line length, trailing whitespace, multiple consecutive blank lines), but I expect that that's configurable. It also did pick up on table column count mismatches, which is the main thing that I can think of to ask it for.

I also see a couple of vim extensions for markdownlint. Can't speak as to their functionality, but there's some level of integration there as well.

[–] vk6flab@lemmy.radio 2 points 10 hours ago

I hadn't considered thinking of markdown as something that could be syntax checked, but that idea opens up a whole host of options, after all is said and done, I'm still a code monkey :)

I generally use markdown to create various different types of documents:

  • eBooks, consisting of one document per chapter, collated and generated into EPUB by pandoc.
  • Legal documents and system and proposal documentation, made into PDF, also by pandoc.
  • HTML text for use on static sites, also pandoc.
  • Documentation for git repos, native.
  • Note taking during meetings and phone calls, native.
  • Invoice generation, though tables are not really suitable, but I'm working on it.

Most of that is likely able to be handled by a live syntax checker and I could easily add a few pandoc commands to my current editor.

I'm beginning to suspect that I'm looking at this from the wrong end.

Thank you!

[–] nesc@lemmy.cafe 1 points 23 hours ago (1 children)

Unless you are planning to go with emacs route, you have a chance to make it yourself from scratch.

[–] vk6flab@lemmy.radio 1 points 23 hours ago

Yeah, I hear you. There are a few other projects in the pipeline.

[–] 97xBang@feddit.online 1 points 1 day ago

First, lol

Second, that looks like Kate. It's the stock text editor on KDE.