epwalsh / obsidian.nvim

Obsidian 🤝 Neovim
Apache License 2.0
3.3k stars 150 forks source link

A little Windows CRLF problem #584

Open RaidOpe opened 1 month ago

RaidOpe commented 1 month ago

🐛 Describe the bug

I think I find the key of warning commanding git add . by GIt Bash where less person build that work flow

fatal: CRLF would be replaced by LF in 100-ComputerKnowledge/Python/python_funcCode.md

Use cat -e <filename>

---^M$
id: test^M$
aliases: []^M$
tags: []^M$
---^M$
^M$
^M$

It comes from note.lua

 table.concat(note:frontmatter_lines(), "\n"),
      table.concat({
        "---",
        "id: note_with_additional_metadata",
        "aliases: []",
        "tags: []",
        "foo: bar",
        "---",
      }, "\n")
    )

Nvim in Windows using $ when editing, This may not be a bug, but Windows is using CRLF, and I have to create a new file in dos2unix every time. I know I can turn off the autocrlf to use .gitattributes to tell Git what to do . but still, it may be personal.

Config

None

Environment

None