Open Pavllick opened 4 years ago
Hi @Pavllick
I am not using omnisharp-server-native formatting features, but the one from csharp-mode
.
My init.el contains this code:
(defun sm-csharp-mode-setup ()
(setq indent-tabs-mode nil)
(setq c-syntactic-indentation t)
(c-set-style "ellemtel")
(setq c-basic-offset 4)
(setq truncate-lines t)
(setq tab-width 4)
(setq evil-shift-width 4))
(add-hook 'csharp-mode-hook 'sm-csharp-mode-setup t)
I then do:
M-x c-indent-line-or-region
-- bound to TAB key in csharp modeThis does indentation for me using the "ellemtel" C-indentation style which I find most suitable for my code style.
Not sure omnisharp-code-format-entire-file' behaves, to be honest, -- hopefully my hint on
(c-set-style "ellemtel")` is helpful to you.
Thank you Saulius for your hint. It's very helpful ) But still not exactly what I'm looking for. It solves a half of the problem. The function omnisharp-code-format-entire-file is not the panacea but format file, not only indent, it move brackets on it's places and so on. I'm not that advanced user of emacs and still explore it, so any other advises on how to do that would be appreciated.
Cannot figure out how to config emacs to format code to any other styles other that to default. Can, please, anyone help me with configuration which on call omnisharp-code-format-entire-file format code to for instance "k&r" style?