Skip to content

Instantly share code, notes, and snippets.

@10long
Last active August 29, 2015 14:13
Show Gist options
  • Save 10long/3e1817535217bc83254d to your computer and use it in GitHub Desktop.
Save 10long/3e1817535217bc83254d to your computer and use it in GitHub Desktop.
omnisharp設定
;;install unity
;;brew install mono
;;https://github.com/OmniSharp/omnisharp-server#osx--linux
;;unity sln sync
(add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
(add-hook 'csharp-mode-hook
#'(lambda ()
(omnisharp-mode)
(ac-common-setup)))
(global-auto-complete-mode t)
(require 'omnisharp)
(setq omnisharp-server-executable-path (expand-file-name "/usr/local/share/OmniSharpServer/OmniSharp/bin/Debug/OmniSharp.exe"))
(defun my-omnisharp-start (sln)
(interactive "fOpen sln: ")
(omnisharp-start-omnisharp-server (expand-file-name sln)))
(define-key omnisharp-mode-map "\C-c\C-s" 'my-omnisharp-start)
(define-key omnisharp-mode-map "\M-/" 'omnisharp-auto-complete)
(define-key omnisharp-mode-map "." 'omnisharp-add-dot-and-auto-complete)
(define-key omnisharp-mode-map "\C-c\C-c" 'omnisharp-build-in-emacs)
(define-key omnisharp-mode-map "\C-c\C-N" 'omnisharp-navigate-to-solution-member)
(define-key omnisharp-mode-map "\C-c\C-n" 'omnisharp-navigate-to-current-file-member)
(define-key omnisharp-mode-map "\C-c\C-f" 'omnisharp-navigate-to-solution-file)
(define-key omnisharp-mode-map "\C-c\C-g" 'omnisharp-go-to-definition)
(define-key omnisharp-mode-map "\C-c\C-r" 'omnisharp-rename)
(define-key omnisharp-mode-map "\C-c\C-v" 'omnisharp-run-code-action-refactoring)
(define-key omnisharp-mode-map "\C-c\C-o" 'omnisharp-auto-complete-overrides)
(define-key omnisharp-mode-map "\C-c\C-u" 'omnisharp-helm-find-symbols)
(define-key omnisharp-mode-map "\C-c\C-t\C-s" (lambda() (interactive) (omnisharp-unit-test "single")))
(define-key omnisharp-mode-map "\C-c\C-t\C-r" (lambda() (interactive) (omnisharp-unit-test "fixture")))
(define-key omnisharp-mode-map "\C-c\C-t\C-e" (lambda() (interactive) (omnisharp-unit-test "all")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment