Edit in plaintext mode

I think it would be useful to be able to edit in plaintext mode without the Markdown rendering within the editor, maybe just a simple toggle switch in settings to turn it off.

I apologize if there is already a way to do this, or if this has been mentioned (please let me know!).

7 Likes

Like a true source editor? Do you at least want syntax highlighting?

Yes, personally, I just find the enlarged headers and other major stylistic changes undesirable when typing, especially since I want my notes to look good as well in plaintext form, but syntax highlighting would be welcome.

The specific situation I found bothersome was in using ‘—’ or “===” to underline h1s or h2s, since the editor made the font larger, so I couldn’t tell how many hyphens or equals signs would align with the text. There is also a rendering bug when using footnotes within a quote block (e.g., “> some quote[^1]”) where it renders the superscript footnote link on top of the text to its left in the editor, so that kind of rendering makes it difficult to edit the document, but that’s obviously a bug, and I can make a separate post about that

This would be very helpful for many users. Switch to plain text mode: monospaced font with the same size. But syntax highlighting is a must! If you open several windows, then large titles and different sizes of characters only get in the way and take up space.
If I need to make a preview, I’ll press the preview button.
But editing and writing text in plain text mode, I think many will need (like me).

P.S. If there is any easy way to enable such a mode or there might be a css file, please tell me.

1 Like

Surely you just want a CSS to do this. You should be able to do it yourself if you like none of the community themes.

3 Likes

Not everyone will be able to create and debug a CSS file. If there were additional display mode options in the settings, it would be very nice.

Appearance:

Dark mode
Light mode
Dark simple mode
Light simple mode

1 Like

I would use this in an instance, rather I have to rely on 3rd-party css authors since I don’t code css and I don’t want to learn. I would set it to Dark simple mode and never come back. If I could set everything to monospace I would.

As someone who edited / is editing the Clean theme to more or less be this, I support this idea.

At times I open my files in an external plain text editor, but I miss the ability to auto fill links and click between them. It’s nice to have a markdown preview immediately available as well.

This could simply be a barebones theme, but the problem is that a theme also includes all of the formatting for the panes and navigation of Obsidian – and when you choose a theme you’re leaning into whatever that particular theme editor wanted. ⟹ Would be nice to have a plaintext subtheme that let’s you keep the framing of the vault the same.

(In case you want it, I’m uploading my CSS as it currently is – but know that I’ve minimally tested it and its very much WIP. It’s a slow and lazy process of noticing things aren’t how I want them and changing them. obsidian.css (10.3 KB) )

1 Like

This is awesome! thank you! Not an issue for me, but on windows, there is no titlebar to grab and move. Nothing that alt+space cant fix. I looked at the css code, and it’s beyond me to edit. Would like to see the edit mode look more like “source code”. Like “sublimetext”, “vscode” would display it.

Would love to see all the fonts using some type of monospace. i.e. folder view, status bar at the bottom, etc…

Again this is great.

I agree about the status bar! I modified this from the Clean theme and haven’t yet figured out how to put the title bar back in. Tonight or tomorrow I’ll upload another version with everything monospace. Do you want the preview in monospace as well? Personally I like the strong distinction of edit mode in mono and preview in sans

Preview can be left as is; normal. Edit mode is were I really like the monospace typeface. Is there a way in css to not increase the size of the font too. i.e. all styles are the same size in edit mode.

I was using a theme called “dark graphite pie” that has the status as monospace. Maybe a clue in there.

Ugh, I did some CSS learning. This code changes the heading font size in the edit mode. Double Ugh, I don’t know what I’m doing. Ha

I just tried the following code. This looks to make the editing mode emulate plaintext coding. This could be “Light/Dark simple mode” maybe, again, I don’t code css. It is nice that there is a “ctrl+shift+I” to look at debug for the css.

body {
  font-size: 13px;
  font-family: Source Code Pro, Fira Code, monospace;
  --font-monospace: Source Code Pro, Fira Code, monospace;
}
.CodeMirror pre.CodeMirror-line {
  font-size: 13px;
  font-family: Source Code Pro, Fira Code, monospace;
}

.cm-header-1 {
  font-size: 13px;
}
.cm-header-2 {
  font-size: 13px;
}
.cm-header-3 {
  font-size: 13px;
}

.cm-s-obsidian pre.HyperMD-header {
   padding-bottom: 0px; 
}

This can be already done in few ways, depending on what advanced functionality do you want to strip/preserve/add. So IMHO, this request can be archived.

(a) In OS, Set preferred default app for opening/editing “.md” files. Then in Obsidian use command/hotkey “Open in default app”.

(b) Use theme, e.g. Theme: Simple Plaintext

(c) Use CSS snippet which modifies/preserves only features that you want.
For example the following shows headers in standard font-size and removes strike-through line but preserves bold text, elevated block-IDs and footnote references, …

:root {
  --font-size: 100%;
  --font-family: Source Code Pro, Fira Code, monospace;
  }
.markdown-source-view {
  font-size: var(--font-size); 
  font-family: var(--font-family)
  } 
.cm-header {
  font-size: var(--font-size); 
  font-family: (--font-family); 
  } 
.cm-strikethrough {
  text-decoration: none
  }

Related:
Whitespace characters can be shown by Show whitespace plugin .

1 Like

I ended up using the Minimal Theme and it’s plugin. I set the plugin fonts to use a monospaced typeface.

1 Like