How to auto add icon to folders and notes?

Would something like the following work for you:

.nav-folder .nav-folder-title-content:before {
  content: "\1F4C2"; /* open folder character  */
  padding-right: 8px;
}

.nav-folder.is-collapsed .nav-folder-title-content:before {
  content: "\1F4C1" ;    
  padding-right: 8px;
}

.nav-file-title-content:before {
  content: "\1F5D2";
  padding-right: 8px;
}

This shows as the following in my test vault:

image

If you like that, save the CSS above into something like vault/.obsidian/snippets/folderIcon.css, and enable that css under Settings > Appearance (CSS snippets) > folderIcon.css.

If your font doesn’t like those unicode character, replace them with something of your liking.

14 Likes