Specify Indentation Type & Changing The Default Font

Hi,
I noticed that logseq indents unordered lists using hard tabs with the size of 4 spaces.

  • Is there a way to force the use of spaces instead of tabs?
  • Where can I change the default font used by logseq?
1 Like

I’d like spaces instead of tabs, too.

The font depends on the theme you use. It’s also possible to add them overrides to your config directory,in a file called custom.css

Thanks for the info. Do you know the syntax used to specify a font or do you know of an example config?

To overwrite the font you can use the following in custom.css

@font-face {
  font-family: "JetBrains Mono Nerd";
  font-weight: 200 900;
  font-style: normal;
  font-stretch: normal;
  src: url("https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/JetBrainsMono/Ligatures/Regular/complete/JetBrains%20Mono%20Regular%20Nerd%20Font%20Complete.ttf");
}
:root {
  --ct-text-size: 14px;
  --ct-line-height: 1.6;
  --ls-font-family: "Only Emoji", "JetBrains Mono Nerd";
  --ct-page-title-font-family: var(--ls-font-family);
  --ct-code-font-family: "JetBrains Mono Nerd";
}

This example is based on the logseq dev theme and the font used in this example is JetBrains Mono Nerd Font.

1 Like

Overwriting Font Settings

To overwrite the font you can use the following in custom.css

@font-face {
  font-family: "JetBrains Mono Nerd";
  font-weight: 200 900;
  font-style: normal;
  font-stretch: normal;
  src: url("https://github.com/ryanoasis/nerd-fonts/raw/master/patched-fonts/JetBrainsMono/Ligatures/Regular/complete/JetBrains%20Mono%20Regular%20Nerd%20Font%20Complete.ttf");
}
:root {
  --ct-text-size: 14px;
  --ct-line-height: 1.6;
  --ls-font-family: "Only Emoji", "JetBrains Mono Nerd";
  --ct-page-title-font-family: var(--ls-font-family);
  --ct-code-font-family: "JetBrains Mono Nerd";
}

This example is based on the logseq dev theme by @Peng_Xiao and the font used in this example is JetBrains Mono with Nerd Font glyphs

Replacing Tabs with Spaces

You can specify the indentation type and count in config.edn using the following syntax

 :export/bullet-indentation :two-spaces
  • Note that this will only affect new pages!

Refactor existing notes

In Linux, to replace all tabs in your vault with 2 spaces (markdown default) you can use the following command:

  • Make sure to back up your notes!
find . -name '*.md' ! -type d -exec bash -c 'expand -t 2 "$0" | sponge "$0"' {} \;

Dependencies:

4 Likes