I’m a bit of a stickler for trying to stick to default apps and tools wherever possible, and Xcode is so close to being serviceable as a general text editor with its vim mode and “External Build System” (Makefile) support, but has a pretty limited list of languages it can do syntax highlighting for, and the smart indentation seems broken for unsupported languages.
BBEdit seems like a good second choice. Does it feel as native as it looks? Any rough edges that bother you?