editorconfig-vim icon indicating copy to clipboard operation
editorconfig-vim copied to clipboard

editorconfig does not apply to [No Name] buffer

Open atamanroman opened this issue 8 years ago • 3 comments

# ~/.editorconfig
[*]
indent_style=space
indent_size=2
$ vim
:set tabstop
tabstop=8
$ vim doesnotexist
:set tabstop
tabstop=2

I'd expect that [*] also applies for the [No Name] buffer.

Use-case: I often open vim for notes and decide on the go if it's worth saving or not. My editorconfig should be applied in both cases.

atamanroman avatar Jan 12 '16 16:01 atamanroman

This is due to the limitation of the EditorConfig Core libraries, since a full path must be given. I can also implemented it as a path to "Untitled", then a modification to the EditorConfig core would not be required.

xuhdev avatar Jan 15 '16 06:01 xuhdev

+1 It would be great if there were a fix for this.

Perhaps it would be possible to assume the path of the previously active buffer when creating a new buffer?

kruncher avatar Feb 22 '16 17:02 kruncher

+1 This is something I'd like to see as well. It would also make sense to use vim's current working directory as the root path for the [No Name] buffer to search for the .editorconfig file. Additionally I often create a new buffer set the filetype do some edits then write the file to disk, it would be awesome to use the filetype to deduce the file extension too.

kbenzie avatar Mar 09 '16 21:03 kbenzie