logseq代码块的自动缩进怎么设置成tab或是4个space

logseq中写代码的话,如果遇到需要缩进的地方,logseq中会自动缩进两个空格,但很多编译器都是4个空格或是tab。所以我每次都要把两个空格删掉,自己再打一个tab,感觉很麻烦,有没有可以更改设置的方法?
例如:
logseq中在第一行while后按回车,下一行就会自动缩进两个空格

while True:
  print("hello world")

而在typora中则是缩进四个空格(一个tab)

while True:
    print("hello world")

同求,习惯就是4个空格,而且每次按到4个,输入完代码发现又被改回2个,还得再次手动加到4个

config.edn 里可以设置CodeMirror (Logseq使用的代码高亮库) 的配置,例如:

 ;; Extra CodeMirror options
 ;; :editor/extra-codemirror-options {:keyMap "emacs" :lineWrapping true}
 :editor/extra-codemirror-options
 {:indentWithTabs true
  :lineNumbers false
  :dragDrop false}

其中indentWithTabs就是用tab缩进。也可以调用多少个空格缩进,具体参看CodeMirror的配置文档:
https://codemirror.net/5/doc/manual.html#config

2 个赞

感谢 :heart:,是我想要的效果