Skip to content

Instantly share code, notes, and snippets.

@frondeus
Created May 5, 2018 13:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frondeus/3de6dc9bdb45f1da0383f103bf609ef0 to your computer and use it in GitHub Desktop.
Save frondeus/3de6dc9bdb45f1da0383f103bf609ef0 to your computer and use it in GitHub Desktop.
Omnisharp n dotnet config
;;; init-dotnet.el --- konfiguracja dotnet
;;; Commentary:
;;; Code:
(use-package csharp-mode
:mode ("\\.cs\\'" . csharp-mode)
:config
(setq indent-tabs-mode nil
c-syntactic-indentation t
c-basic-offset 4
truncate-lines t
tab-width 4
evil-shift-width 4))
(use-package omnisharp
:delight (omnisharp-mode " O")
:hook (csharp-mode . omnisharp-mode)
:config
(nmap
:keymaps 'omnisharp-mode-map
:prefix "g"
"d" 'omnisharp-go-to-definition-other-window
"u" 'omnisharp-find-usages
"I" 'omnisharp-find-implementations
"R" 'omnisharp-rename
"F" 'omnisharp-code-format-entire-file
"r" 'omnisharp-run-code-action-refactoring)
(eval-after-load 'company '(add-to-list 'company-backends #'company-omnisharp))
(c-set-style "ellemtel"))
(use-package dotnet
:delight (dotnet-mode " D")
:hook (csharp-mode . dotnet-mode))
(add-to-list 'auto-mode-alist
'("\\.csproj\\'" . (lambda () (xml-mode))))
(provide 'init-dotnet)
;;; init-dotnet.el ends here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment