Skip to content

Commit 723e9cd

Browse files
committed
update
1 parent 5b777a7 commit 723e9cd

File tree

7 files changed

+112
-11
lines changed

7 files changed

+112
-11
lines changed

config/init-lspmode.el

+7-7
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,22 @@
2828
("C-c C-b" . pop-tag-mark)
2929
("C-c s s" . lsp-restart-workspace)
3030
("C-c C-c" . lsp-find-references)
31-
("C-." . lsp-execute-code-action)))
32-
;; :hook (prog-mode . lsp-deferred))
31+
("C-." . lsp-execute-code-action))
32+
:hook (prog-mode . lsp-deferred))
3333

3434
; csharp
35-
;; (use-package tree-sitter)
36-
;; (use-package tree-sitter-langs)
37-
;; (use-package tree-sitter-indent)
35+
(use-package tree-sitter)
36+
(use-package tree-sitter-langs)
37+
(use-package tree-sitter-indent)
3838

3939
;; (use-package csharp-mode
4040
;; :ensure t
4141
;; :config
4242
;; ;(setq tree-sitter-indent-offset 4)
4343
;; ;(tree-sitter-mode)
4444
;; ;; (add-to-list 'auto-mode-alist '("\\.cs\\'" . tree-sitter-mode))
45-
;; )
46-
;; (setq lsp-csharp-omnisharp-roslyn-server-dir "/opt/omnisharp-osx/"))
45+
;; :hook
46+
;; (csharp-mode . lsp))
4747

4848

4949
;; (use-package py-autopep8

config/init-org.el

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"calc" "asymptote" "dot" "gnuplot" "ledger" "lilypond" "mscgen"
2222
"octave" "oz" "plantuml" "R" "sass" "screen" "sql" "awk" "ditaa"
2323
"haskell" "latex" "lisp" "matlab" "ocaml" "org" "perl" "ruby"
24-
"scheme" "sqlite")))
24+
"scheme" "sqlite" "csharp")))
2525
(list (ido-completing-read "Source code type: " src-code-types))))
2626
(progn
2727
(newline-and-indent)
@@ -63,4 +63,8 @@
6363
(global-set-key (kbd "C-c w d") 'open-my-doc-file)
6464
(global-set-key (kbd "C-c w p") 'open-my-password-file)
6565

66+
;;add export markdown
67+
(use-package ox-gfm)
68+
(require 'ox-gfm)
69+
6670
(provide 'init-org)

config/init-project.el

+10
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,14 @@
1616
("C-c C-p" . projectile-switch-project)
1717
("C-c p r" . projectile-discover-projects-in-search-path)))
1818

19+
(defun binwan-load-archpc-project()
20+
(interactive)
21+
(append projectile-project-search-path '("/ssh:fnlinker-archpc:/home/binwan/Documents/fnlinker/" "/ssh:fnlinker-archpc:/home/binwan/Documents/binwan-dev/"))
22+
(projectile-discover-projects-in-search-path))
23+
24+
(defun binwan-unload-archpc-project()
25+
(interactive)
26+
(remove projectile-project-search-path '("/ssh:fnlinker-archpc:/home/binwan/Documents/fnlinker/" "/ssh:fnlinker-archpc:/home/binwan/Documents/binwan-dev/"))
27+
(projectile-discover-projects-in-search-path))
28+
1929
(provide 'init-project)

config/init-themes.el

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
;; Corrects (and improves) org-mode's native fontification.
2121
(doom-themes-org-config))
2222

23+
(use-package nyan-mode
24+
:config
25+
(nyan-mode))
26+
2327
(use-package doom-modeline
2428
:ensure t
2529
:init

config/init-ui.el

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
(global-subword-mode 1) ;Word移动支持 FooBar 的格式
1313
(prefer-coding-system 'utf-8-unix)
1414
(define-coding-system-alias 'UTF-8 'utf-8)
15-
(pixel-scroll-precision-mode 1) ;
15+
;(pixel-scroll-precision-mode 1) ;
1616

1717
; 设置透明函数
1818
(defun binwan-toggle-frame-transparency ()
@@ -21,7 +21,7 @@
2121
(set-frame-parameter nil 'alpha 94)
2222
(set-frame-parameter nil 'alpha 100)))
2323

24-
(set-frame-parameter nil 'alpha 94)
24+
(set-frame-parameter nil 'alpha 100)
2525

2626
; 开启窗口序号管理
2727
(use-package window-numbering

init.el

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
;; Your init file should contain only one such instance.
1414
;; If there is more than one, they won't work right.
1515
'(package-selected-packages
16-
'(eaf-browser edbi cnfonts yasnippet window-numbering which-key use-package tree-sitter-langs tree-sitter-indent rust-mode rainbow-mode rainbow-delimiters quelpa protobuf-mode olivetti mmm-mode meow mc-extras magit lsp-ui hungry-delete helm-projectile helm-gtags go-projectile flycheck exec-path-from-shell doom-themes doom-modeline dashboard csharp-mode conda company)))
16+
'(c++-mode ob-csharp ox-gfm nyan-mode eaf-browser edbi cnfonts yasnippet window-numbering which-key use-package tree-sitter-langs tree-sitter-indent rust-mode rainbow-mode rainbow-delimiters quelpa protobuf-mode olivetti mmm-mode meow mc-extras magit lsp-ui hungry-delete helm-projectile helm-gtags go-projectile flycheck exec-path-from-shell doom-themes doom-modeline dashboard csharp-mode conda company)))
1717
(custom-set-faces
1818
;; custom-set-faces was added by Custom.
1919
;; If you edit it by hand, you could mess it up, so be careful.

local-package/ob-csharp.el

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
;;; ob-csharp.el --- org-babel functions for csharp evaluation
2+
3+
;; Copyright (C) 2011-2015 Free Software Foundation, Inc.
4+
5+
;; Original Author: Eric Schulte (ob-java.el)
6+
;; Author: thomas "at" friendlyvillagers.com
7+
;; Keywords: literate programming, reproducible research
8+
;; Homepage: http://orgmode.org
9+
10+
;; This file is NOT YET part of GNU Emacs.
11+
12+
;; GNU Emacs is free software: you can redistribute it and/or modify
13+
;; it under the terms of the GNU General Public License as published by
14+
;; the Free Software Foundation, either version 3 of the License, or
15+
;; (at your option) any later version.
16+
17+
;; GNU Emacs is distributed in the hope that it will be useful,
18+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+
;; GNU General Public License for more details.
21+
22+
;; You should have received a copy of the GNU General Public License
23+
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24+
25+
;;; Commentary:
26+
27+
;; Currently this only supports the external compilation and execution
28+
;; of csharp code blocks (i.e., no session support).
29+
30+
;;; Code:
31+
(require 'ob)
32+
33+
(defvar org-babel-tangle-lang-exts)
34+
(add-to-list 'org-babel-tangle-lang-exts '("csharp" . "cs"))
35+
36+
(defcustom org-babel-csharp-command "mono"
37+
"Name of the csharp command.
38+
May be either a command in the path, like mono
39+
or an absolute path name, like /usr/local/bin/mono
40+
parameters may be used, like mono -verbose"
41+
:group 'org-babel
42+
:version "24.3"
43+
:type 'string)
44+
45+
(defcustom org-babel-csharp-compiler "gmcs"
46+
"Name of the csharp compiler.
47+
May be either a command in the path, like mcs
48+
or an absolute path name, like /usr/local/bin/mcs
49+
parameters may be used, like mcs -warnaserror+"
50+
:group 'org-babel
51+
:version "24.3"
52+
:type 'string)
53+
54+
55+
(defun org-babel-execute:csharp (body params)
56+
(let* ((full-body (org-babel-expand-body:generic body params))
57+
(cmpflag (or (cdr (assoc :cmpflag params)) ""))
58+
(cmdline (or (cdr (assoc :cmdline params)) ""))
59+
(src-file (org-babel-temp-file "csharp-src-" ".cs"))
60+
(exe-file (concat (file-name-sans-extension src-file) ".exe"))
61+
(compile
62+
(progn (with-temp-file src-file (insert full-body))
63+
(org-babel-eval
64+
(concat org-babel-csharp-compiler " " cmpflag " " src-file) ""))))
65+
(let ((results (org-babel-eval (concat org-babel-csharp-command " " cmdline " " exe-file) "")))
66+
(org-babel-reassemble-table
67+
(org-babel-result-cond (cdr (assoc :result-params params))
68+
(org-babel-read results)
69+
(let ((tmp-file (org-babel-temp-file "c-")))
70+
(with-temp-file tmp-file (insert results))
71+
(org-babel-import-elisp-from-file tmp-file)))
72+
(org-babel-pick-name
73+
(cdr (assoc :colname-names params)) (cdr (assoc :colnames params)))
74+
(org-babel-pick-name
75+
(cdr (assoc :rowname-names params)) (cdr (assoc :rownames params)))))))
76+
77+
(defun org-babel-prep-session:csharp (session params)
78+
"Return an error because csharp does not support sessions."
79+
(error "Sessions are not (yet) supported for CSharp"))
80+
81+
82+
(provide 'ob-csharp)
83+
;;; ob-csharp.el ends here

0 commit comments

Comments
 (0)