OmniSharp / omnisharp-vim

Vim omnicompletion (intellisense) and more for C#
http://www.omnisharp.net
MIT License
1.7k stars 169 forks source link

Setting file encoding when creating files. #761

Closed DasGandlaf closed 2 years ago

DasGandlaf commented 2 years ago

Hi, My question is, is it possible to set the file encoding to "utf-8-BOM"? When I use code actions on a type, and select "Move type to .cs", then it creates a new file in the "utf-8" encoding, however, I would like for it to create the file in the "utf-8-BOM" encoding. Is this possible? I appreciate your help :)

nickspoons commented 2 years ago

I have no idea how to do this. Can you give me some examples of vim commands and outputs that use this file encoding, and on what OS? It is not listed under :h 'fileencodings'. How do you convert a file to the file encoding you are after? What does vim output if you enter :set fileencoding? in a file with the encoding you are describing?

I can see that the current file's encoding is not re-used when creating a new file during a code action, so I've made PR #762 to address that. Can you tell me if that PR helps?