Guest User

Untitled

a guest
May 29th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 46.74 KB | None | 0 0
  1. ;; -*- mode: emacs-lisp; lexical-binding: t -*-
  2. ;; This file is loaded by Spacemacs at startup.
  3. ;; It must be stored in your home directory.
  4.  
  5. (defun dotspacemacs/layers ()
  6. "Layer configuration:
  7. This function should only modify configuration layer settings."
  8. (setq-default
  9. ;; Base distribution to use. This is a layer contained in the directory
  10. ;; `+distribution'. For now available distributions are `spacemacs-base'
  11. ;; or `spacemacs'. (default 'spacemacs)
  12. dotspacemacs-distribution 'spacemacs
  13.  
  14. ;; Lazy installation of layers (i.e. layers are installed only when a file
  15. ;; with a supported type is opened). Possible values are `all', `unused'
  16. ;; and `nil'. `unused' will lazy install only unused layers (i.e. layers
  17. ;; not listed in variable `dotspacemacs-configuration-layers'), `all' will
  18. ;; lazy install any layer that support lazy installation even the layers
  19. ;; listed in `dotspacemacs-configuration-layers'. `nil' disable the lazy
  20. ;; installation feature and you have to explicitly list a layer in the
  21. ;; variable `dotspacemacs-configuration-layers' to install it.
  22. ;; (default 'unused)
  23. dotspacemacs-enable-lazy-installation 'unused
  24.  
  25. ;; If non-nil then Spacemacs will ask for confirmation before installing
  26. ;; a layer lazily. (default t)
  27. dotspacemacs-ask-for-lazy-installation t
  28.  
  29. ;; List of additional paths where to look for configuration layers.
  30. ;; Paths must have a trailing slash (i.e. `~/.mycontribs/')
  31. dotspacemacs-configuration-layer-path '()
  32.  
  33. ;; List of configuration layers to load.
  34. dotspacemacs-configuration-layers
  35. '(
  36. ;; ----------------------------------------------------------------
  37. ;; Example of useful layers you may want to use right away.
  38. ;; Uncomment some layer names and press `SPC f e R' (Vim style) or
  39. ;; `M-m f e R' (Emacs style) to install them.
  40. ;; ----------------------------------------------------------------
  41. ;; auto-completion
  42. ;; better-defaults
  43. emacs-lisp
  44. html
  45. lua
  46. yaml
  47. git
  48. helm
  49. ;; lsp
  50. markdown
  51. multiple-cursors
  52. (org :variables org-want-todo-bindings t
  53. ;; +dragndrop 不成功
  54. ;; +pandoc ;先我x
  55. )
  56. ;; (shell :variables
  57. ;; shell-default-height 30
  58. ;; shell-default-position 'bottom)
  59. ;; spell-checking
  60. ;; syntax-checking
  61. treemacs
  62. ;; version-control
  63. ;;qy
  64. osx
  65. chrome
  66. search-engine
  67. (chinese :variables
  68. chinese-enable-fcitx t)
  69. (shell :variables shell-default-shell 'vterm)
  70. (shell :variables shell-default-term-shell "/bin/bash")
  71. )
  72.  
  73. ;; List of additional packages that will be installed without being
  74. ;; wrapped in a layer. If you need some configuration for these
  75. ;; packages, then consider creating a layer. You can also put the
  76. ;; configuration in `dotspacemacs/user-config'.
  77. ;; To use a local version of a package, use the `:location' property:
  78. ;; '(your-package :location "~/path/to/your-package/")
  79. ;; Also include the dependencies as they will not be resolved automatically.
  80. dotspacemacs-additional-packages
  81. '(
  82. ;;qy
  83. ;;fcitx
  84.  
  85. ;;org-chinese-utils
  86. ;;中国日历
  87. ;; cal-china-x-chinese-holidays
  88. ;; cal-china-x-japanese-holidays
  89. ;; holiday-lunar
  90. ;; holiday-solar-term
  91. ;;just qy
  92. ;;rime
  93. org-roam
  94. org-roam-server
  95. org-brain
  96. ox-gfm
  97. smart-input-source
  98. cal-china-x
  99. ;;自動保存
  100. auto-save-buffers-enhanced
  101. helm-osx-app
  102. helm-chrome
  103. helm-chrome-history
  104. helm-chrome-control
  105. anki-editor
  106. vterm
  107. )
  108.  
  109. ;; A list of packages that cannot be updated.
  110. dotspacemacs-frozen-packages '()
  111.  
  112. ;; A list of packages that will not be installed and loaded.
  113. dotspacemacs-excluded-packages '(
  114. helm-flyspell helm-c-yasnippet ace-jump-helm-line helm-make magithub helm-themes helm-swoop helm-purpose
  115.  
  116. )
  117.  
  118. ;; Defines the behaviour of Spacemacs when installing packages.
  119. ;; Possible values are `used-only', `used-but-keep-unused' and `all'.
  120. ;; `used-only' installs only explicitly used packages and deletes any unused
  121. ;; packages as well as their unused dependencies. `used-but-keep-unused'
  122. ;; installs only the used packages but won't delete unused ones. `all'
  123. ;; installs *all* packages supported by Spacemacs and never uninstalls them.
  124. ;; (default is `used-only')
  125. dotspacemacs-install-packages 'used-only))
  126.  
  127. (defun dotspacemacs/init ()
  128. "Initialization:
  129. This function is called at the very beginning of Spacemacs startup,
  130. before layer configuration.
  131. It should only modify the values of Spacemacs settings."
  132. ;; This setq-default sexp is an exhaustive list of all the supported
  133. ;; spacemacs settings.
  134. (setq-default
  135. ;; If non-nil then enable support for the portable dumper. You'll need
  136. ;; to compile Emacs 27 from source following the instructions in file
  137. ;; EXPERIMENTAL.org at to root of the git repository.
  138. ;; (default nil)
  139. dotspacemacs-enable-emacs-pdumper nil
  140.  
  141. ;; Name of executable file pointing to emacs 27+. This executable must be
  142. ;; in your PATH.
  143. ;; (default "emacs")
  144. dotspacemacs-emacs-pdumper-executable-file "emacs"
  145.  
  146. ;; Name of the Spacemacs dump file. This is the file will be created by the
  147. ;; portable dumper in the cache directory under dumps sub-directory.
  148. ;; To load it when starting Emacs add the parameter `--dump-file'
  149. ;; when invoking Emacs 27.1 executable on the command line, for instance:
  150. ;; ./emacs --dump-file=~/.emacs.d/.cache/dumps/spacemacs.pdmp
  151. ;; (default spacemacs.pdmp)
  152. dotspacemacs-emacs-dumper-dump-file "spacemacs.pdmp"
  153.  
  154. ;; If non-nil ELPA repositories are contacted via HTTPS whenever it's
  155. ;; possible. Set it to nil if you have no way to use HTTPS in your
  156. ;; environment, otherwise it is strongly recommended to let it set to t.
  157. ;; This variable has no effect if Emacs is launched with the parameter
  158. ;; `--insecure' which forces the value of this variable to nil.
  159. ;; (default t)
  160. dotspacemacs-elpa-https t
  161.  
  162. ;; Maximum allowed time in seconds to contact an ELPA repository.
  163. ;; (default 5)
  164. dotspacemacs-elpa-timeout 5
  165.  
  166. ;; Set `gc-cons-threshold' and `gc-cons-percentage' when startup finishes.
  167. ;; This is an advanced option and should not be changed unless you suspect
  168. ;; performance issues due to garbage collection operations.
  169. ;; (default '(100000000 0.1))
  170. dotspacemacs-gc-cons '(100000000 0.1)
  171.  
  172. ;; If non-nil then Spacelpa repository is the primary source to install
  173. ;; a locked version of packages. If nil then Spacemacs will install the
  174. ;; latest version of packages from MELPA. (default nil)
  175. dotspacemacs-use-spacelpa nil
  176.  
  177. ;; If non-nil then verify the signature for downloaded Spacelpa archives.
  178. ;; (default t)
  179. dotspacemacs-verify-spacelpa-archives t
  180.  
  181. ;; If non-nil then spacemacs will check for updates at startup
  182. ;; when the current branch is not `develop'. Note that checking for
  183. ;; new versions works via git commands, thus it calls GitHub services
  184. ;; whenever you start Emacs. (default nil)
  185. dotspacemacs-check-for-update nil
  186.  
  187. ;; If non-nil, a form that evaluates to a package directory. For example, to
  188. ;; use different package directories for different Emacs versions, set this
  189. ;; to `emacs-version'. (default 'emacs-version)
  190. dotspacemacs-elpa-subdirectory 'emacs-version
  191.  
  192. ;; One of `vim', `emacs' or `hybrid'.
  193. ;; `hybrid' is like `vim' except that `insert state' is replaced by the
  194. ;; `hybrid state' with `emacs' key bindings. The value can also be a list
  195. ;; with `:variables' keyword (similar to layers). Check the editing styles
  196. ;; section of the documentation for details on available variables.
  197. ;; (default 'vim)
  198. dotspacemacs-editing-style 'hybrid
  199.  
  200. ;; Specify the startup banner. Default value is `official', it displays
  201. ;; the official spacemacs logo. An integer value is the index of text
  202. ;; banner, `random' chooses a random text banner in `core/banners'
  203. ;; directory. A string value must be a path to an image format supported
  204. ;; by your Emacs build.
  205. ;; If the value is nil then no banner is displayed. (default 'official)
  206. dotspacemacs-startup-banner 'official
  207.  
  208. ;; List of items to show in startup buffer or an association list of
  209. ;; the form `(list-type . list-size)`. If nil then it is disabled.
  210. ;; Possible values for list-type are:
  211. ;; `recents' `bookmarks' `projects' `agenda' `todos'.
  212. ;; List sizes may be nil, in which case
  213. ;; `spacemacs-buffer-startup-lists-length' takes effect.
  214. dotspacemacs-startup-lists '((recents . 15)
  215. (projects . 7))
  216.  
  217. ;; True if the home buffer should respond to resize events. (default t)
  218. dotspacemacs-startup-buffer-responsive t
  219.  
  220. ;; Default major mode for a new empty buffer. Possible values are mode
  221. ;; names such as `text-mode'; and `nil' to use Fundamental mode.
  222. ;; (default `text-mode')
  223. dotspacemacs-new-empty-buffer-major-mode 'text-mode
  224.  
  225. ;; Default major mode of the scratch buffer (default `text-mode')
  226. dotspacemacs-scratch-mode 'text-mode
  227.  
  228. ;; Initial message in the scratch buffer, such as "Welcome to Spacemacs!"
  229. ;; (default nil)
  230. dotspacemacs-initial-scratch-message nil
  231.  
  232. ;; List of themes, the first of the list is loaded when spacemacs starts.
  233. ;; Press `SPC T n' to cycle to the next theme in the list (works great
  234. ;; with 2 themes variants, one dark and one light)
  235. dotspacemacs-themes '(spacemacs-dark
  236. spacemacs-light)
  237.  
  238. ;; Set the theme for the Spaceline. Supported themes are `spacemacs',
  239. ;; `all-the-icons', `custom', `doom', `vim-powerline' and `vanilla'. The
  240. ;; first three are spaceline themes. `doom' is the doom-emacs mode-line.
  241. ;; `vanilla' is default Emacs mode-line. `custom' is a user defined themes,
  242. ;; refer to the DOCUMENTATION.org for more info on how to create your own
  243. ;; spaceline theme. Value can be a symbol or list with additional properties.
  244. ;; (default '(spacemacs :separator wave :separator-scale 1.5))
  245. dotspacemacs-mode-line-theme '(spacemacs :separator wave :separator-scale 1.5)
  246.  
  247. ;; If non-nil the cursor color matches the state color in GUI Emacs.
  248. ;; (default t)
  249. dotspacemacs-colorize-cursor-according-to-state t
  250.  
  251. ;; Default font or prioritized list of fonts.
  252. ;; dotspacemacs-default-font '("Source Code Pro"
  253. ;; :size 20
  254. ;; :weight normal
  255. ;; :width normal)
  256. dotspacemacs-default-font
  257. '("Noto Sans Mono CJK SC" :size 20
  258. :weight normal
  259. :width normal
  260. :powerline-scale 1.1)
  261. ;; The leader key (default "SPC")
  262. dotspacemacs-leader-key "SPC"
  263.  
  264. ;; The key used for Emacs commands `M-x' (after pressing on the leader key).
  265. ;; (default "SPC")
  266. dotspacemacs-emacs-command-key "SPC"
  267.  
  268. ;; The key used for Vim Ex commands (default ":")
  269. dotspacemacs-ex-command-key ":"
  270.  
  271. ;; The leader key accessible in `emacs state' and `insert state'
  272. ;; (default "M-m")
  273. dotspacemacs-emacs-leader-key "M-m"
  274.  
  275. ;; Major mode leader key is a shortcut key which is the equivalent of
  276. ;; pressing `<leader> m`. Set it to `nil` to disable it. (default ",")
  277. dotspacemacs-major-mode-leader-key ","
  278.  
  279. ;; Major mode leader key accessible in `emacs state' and `insert state'.
  280. ;; (default "C-M-m")
  281. dotspacemacs-major-mode-emacs-leader-key "C-M-m"
  282.  
  283. ;; These variables control whether separate commands are bound in the GUI to
  284. ;; the key pairs `C-i', `TAB' and `C-m', `RET'.
  285. ;; Setting it to a non-nil value, allows for separate commands under `C-i'
  286. ;; and TAB or `C-m' and `RET'.
  287. ;; In the terminal, these pairs are generally indistinguishable, so this only
  288. ;; works in the GUI. (default nil)
  289. dotspacemacs-distinguish-gui-tab nil
  290.  
  291. ;; Name of the default layout (default "Default")
  292. dotspacemacs-default-layout-name "Default"
  293.  
  294. ;; If non-nil the default layout name is displayed in the mode-line.
  295. ;; (default nil)
  296. dotspacemacs-display-default-layout nil
  297.  
  298. ;; If non-nil then the last auto saved layouts are resumed automatically upon
  299. ;; start. (default nil)
  300. dotspacemacs-auto-resume-layouts nil
  301.  
  302. ;; If non-nil, auto-generate layout name when creating new layouts. Only has
  303. ;; effect when using the "jump to layout by number" commands. (default nil)
  304. dotspacemacs-auto-generate-layout-names nil
  305.  
  306. ;; Size (in MB) above which spacemacs will prompt to open the large file
  307. ;; literally to avoid performance issues. Opening a file literally means that
  308. ;; no major mode or minor modes are active. (default is 1)
  309. dotspacemacs-large-file-size 1
  310.  
  311. ;; Location where to auto-save files. Possible values are `original' to
  312. ;; auto-save the file in-place, `cache' to auto-save the file to another
  313. ;; file stored in the cache directory and `nil' to disable auto-saving.
  314. ;; (default 'cache)
  315. dotspacemacs-auto-save-file-location 'cache
  316.  
  317. ;; Maximum number of rollback slots to keep in the cache. (default 5)
  318. dotspacemacs-max-rollback-slots 5
  319.  
  320. ;; If non-nil, the paste transient-state is enabled. While enabled, after you
  321. ;; paste something, pressing `C-j' and `C-k' several times cycles through the
  322. ;; elements in the `kill-ring'. (default nil)
  323. dotspacemacs-enable-paste-transient-state nil
  324.  
  325. ;; Which-key delay in seconds. The which-key buffer is the popup listing
  326. ;; the commands bound to the current keystroke sequence. (default 0.4)
  327. dotspacemacs-which-key-delay 0.3
  328.  
  329. ;; Which-key frame position. Possible values are `right', `bottom' and
  330. ;; `right-then-bottom'. right-then-bottom tries to display the frame to the
  331. ;; right; if there is insufficient space it displays it at the bottom.
  332. ;; (default 'bottom)
  333. dotspacemacs-which-key-position 'bottom
  334.  
  335. ;; Control where `switch-to-buffer' displays the buffer. If nil,
  336. ;; `switch-to-buffer' displays the buffer in the current window even if
  337. ;; another same-purpose window is available. If non-nil, `switch-to-buffer'
  338. ;; displays the buffer in a same-purpose window even if the buffer can be
  339. ;; displayed in the current window. (default nil)
  340. dotspacemacs-switch-to-buffer-prefers-purpose nil
  341.  
  342. ;; If non-nil a progress bar is displayed when spacemacs is loading. This
  343. ;; may increase the boot time on some systems and emacs builds, set it to
  344. ;; nil to boost the loading time. (default t)
  345. dotspacemacs-loading-progress-bar t
  346.  
  347. ;; If non-nil the frame is fullscreen when Emacs starts up. (default nil)
  348. ;; (Emacs 24.4+ only)
  349. dotspacemacs-fullscreen-at-startup nil
  350.  
  351. ;; If non-nil `spacemacs/toggle-fullscreen' will not use native fullscreen.
  352. ;; Use to disable fullscreen animations in OSX. (default nil)
  353. dotspacemacs-fullscreen-use-non-native nil
  354.  
  355. ;; If non-nil the frame is maximized when Emacs starts up.
  356. ;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.
  357. ;; (default nil) (Emacs 24.4+ only)
  358. dotspacemacs-maximized-at-startup nil
  359.  
  360. ;; If non-nil the frame is undecorated when Emacs starts up. Combine this
  361. ;; variable with `dotspacemacs-maximized-at-startup' in OSX to obtain
  362. ;; borderless fullscreen. (default nil)
  363. dotspacemacs-undecorated-at-startup nil
  364.  
  365. ;; A value from the range (0..100), in increasing opacity, which describes
  366. ;; the transparency level of a frame when it's active or selected.
  367. ;; Transparency can be toggled through `toggle-transparency'. (default 90)
  368. dotspacemacs-active-transparency 90
  369.  
  370. ;; A value from the range (0..100), in increasing opacity, which describes
  371. ;; the transparency level of a frame when it's inactive or deselected.
  372. ;; Transparency can be toggled through `toggle-transparency'. (default 90)
  373. dotspacemacs-inactive-transparency 90
  374.  
  375. ;; If non-nil show the titles of transient states. (default t)
  376. dotspacemacs-show-transient-state-title t
  377.  
  378. ;; If non-nil show the color guide hint for transient state keys. (default t)
  379. dotspacemacs-show-transient-state-color-guide t
  380.  
  381. ;; If non-nil unicode symbols are displayed in the mode line.
  382. ;; If you use Emacs as a daemon and wants unicode characters only in GUI set
  383. ;; the value to quoted `display-graphic-p'. (default t)
  384. dotspacemacs-mode-line-unicode-symbols t
  385.  
  386. ;; If non-nil smooth scrolling (native-scrolling) is enabled. Smooth
  387. ;; scrolling overrides the default behavior of Emacs which recenters point
  388. ;; when it reaches the top or bottom of the screen. (default t)
  389. dotspacemacs-smooth-scrolling t
  390.  
  391. ;; Control line numbers activation.
  392. ;; If set to `t', `relative' or `visual' then line numbers are enabled in all
  393. ;; `prog-mode' and `text-mode' derivatives. If set to `relative', line
  394. ;; numbers are relative. If set to `visual', line numbers are also relative,
  395. ;; but lines are only visual lines are counted. For example, folded lines
  396. ;; will not be counted and wrapped lines are counted as multiple lines.
  397. ;; This variable can also be set to a property list for finer control:
  398. ;; '(:relative nil
  399. ;; :visual nil
  400. ;; :disabled-for-modes dired-mode
  401. ;; doc-view-mode
  402. ;; markdown-mode
  403. ;; org-mode
  404. ;; pdf-view-mode
  405. ;; text-mode
  406. ;; :size-limit-kb 1000)
  407. ;; When used in a plist, `visual' takes precedence over `relative'.
  408. ;; (default nil)
  409. dotspacemacs-line-numbers t
  410.  
  411. ;; Code folding method. Possible values are `evil' and `origami'.
  412. ;; (default 'evil)
  413. dotspacemacs-folding-method 'evil
  414.  
  415. ;; If non-nil `smartparens-strict-mode' will be enabled in programming modes.
  416. ;; (default nil)
  417. dotspacemacs-smartparens-strict-mode nil
  418.  
  419. ;; If non-nil pressing the closing parenthesis `)' key in insert mode passes
  420. ;; over any automatically added closing parenthesis, bracket, quote, etc...
  421. ;; This can be temporary disabled by pressing `C-q' before `)'. (default nil)
  422. dotspacemacs-smart-closing-parenthesis nil
  423.  
  424. ;; Select a scope to highlight delimiters. Possible values are `any',
  425. ;; `current', `all' or `nil'. Default is `all' (highlight any scope and
  426. ;; emphasis the current one). (default 'all)
  427. dotspacemacs-highlight-delimiters 'all
  428.  
  429. ;; If non-nil, start an Emacs server if one is not already running.
  430. ;; (default nil)
  431. ;; qy
  432. dotspacemacs-enable-server t
  433.  
  434. ;; Set the emacs server socket location.
  435. ;; If nil, uses whatever the Emacs default is, otherwise a directory path
  436. ;; like \"~/.emacs.d/server\". It has no effect if
  437. ;; `dotspacemacs-enable-server' is nil.
  438. ;; (default nil)
  439. dotspacemacs-server-socket-dir nil
  440.  
  441. ;; If non-nil, advise quit functions to keep server open when quitting.
  442. ;; (default nil)qy 持久化emacs服務器
  443. dotspacemacs-persistent-server t
  444.  
  445. ;; List of search tool executable names. Spacemacs uses the first installed
  446. ;; tool of the list. Supported tools are `rg', `ag', `pt', `ack' and `grep'.
  447. ;; (default '("rg" "ag" "pt" "ack" "grep"))
  448. dotspacemacs-search-tools '("rg" "ag" "pt" "ack" "grep")
  449.  
  450. ;; Format specification for setting the frame title.
  451. ;; %a - the `abbreviated-file-name', or `buffer-name'
  452. ;; %t - `projectile-project-name'
  453. ;; %I - `invocation-name'
  454. ;; %S - `system-name'
  455. ;; %U - contents of $USER
  456. ;; %b - buffer name
  457. ;; %f - visited file name
  458. ;; %F - frame name
  459. ;; %s - process status
  460. ;; %p - percent of buffer above top of window, or Top, Bot or All
  461. ;; %P - percent of buffer above bottom of window, perhaps plus Top, or Bot or All
  462. ;; %m - mode name
  463. ;; %n - Narrow if appropriate
  464. ;; %z - mnemonics of buffer, terminal, and keyboard coding systems
  465. ;; %Z - like %z, but including the end-of-line format
  466. ;; (default "%I@%S")
  467. dotspacemacs-frame-title-format "%I@%S"
  468.  
  469. ;; Format specification for setting the icon title format
  470. ;; (default nil - same as frame-title-format)
  471. dotspacemacs-icon-title-format nil
  472.  
  473. ;; Delete whitespace while saving buffer. Possible values are `all'
  474. ;; to aggressively delete empty line and long sequences of whitespace,
  475. ;; `trailing' to delete only the whitespace at end of lines, `changed' to
  476. ;; delete only whitespace for changed lines or `nil' to disable cleanup.
  477. ;; (default nil)
  478. dotspacemacs-whitespace-cleanup nil
  479.  
  480. ;; Either nil or a number of seconds. If non-nil zone out after the specified
  481. ;; number of seconds. (default nil)
  482. dotspacemacs-zone-out-when-idle nil
  483.  
  484. ;;qy
  485. ;; If non nil, `helm' will try to minimize the space it uses. (default nil)
  486. dotspacemacs-helm-resize nil
  487. ;; Controls fuzzy matching in helm. If set to `always', force fuzzy matching
  488. ;; in all non-asynchronous sources. If set to `source', preserve individual
  489. ;; source settings. Else, disable fuzzy matching in all sources.
  490. ;; (default 'always)
  491. dotspacemacs-helm-use-fuzzy 'always
  492.  
  493. ;;no qy
  494.  
  495. ;; Run `spacemacs/prettify-org-buffer' when
  496. ;; visiting README.org files of Spacemacs.
  497. ;; (default nil)
  498. dotspacemacs-pretty-docs nil))
  499.  
  500. (defun dotspacemacs/user-env ()
  501. "Environment variables setup.
  502. This function defines the environment variables for your Emacs session. By
  503. default it calls `spacemacs/load-spacemacs-env' which loads the environment
  504. variables declared in `~/.spacemacs.env' or `~/.spacemacs.d/.spacemacs.env'.
  505. See the header of this file for more information."
  506. (spacemacs/load-spacemacs-env)
  507. )
  508.  
  509. (defun dotspacemacs/user-init ()
  510. "Initialization for user code:
  511. This function is called immediately after `dotspacemacs/init', before layer
  512. configuration.
  513. It is mostly for variables that should be set before packages are loaded.
  514. If you are unsure, try setting them in `dotspacemacs/user-config' first."
  515. ;;qy no do
  516. ;; (setq configuration-layer--elpa-archives
  517. ;; '(("melpa-cn" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")
  518. ;; ("org-cn" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/org/")
  519. ;; ("gnu-cn" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")))
  520.  
  521. ;;(setq configuration-layer--elpa-archives
  522. ;; '(("melpa-cn" . "http://elpa.emacs-china.org/melpa/")
  523. ;; ("org-cn" . "http://elpa.emacs-china.org/org/")
  524. ;; ("gnu-cn" . "http://elpa.emacs-china.org/gnu/")))
  525.  
  526.  
  527. (setq-default
  528. configuration-layer--elpa-archives
  529. '(("gnu" . "http://elpa.emacs-china.org/gnu/")
  530. ("melpa" . "http://elpa.emacs-china.org/melpa/")
  531. ("melpa-stable" . "http://elpa.emacs-china.org/melpa-stable/")))
  532.  
  533. ;;qy wrong bug nowork
  534. ;;(global-evil-mc-mode 1) ;; Always enable evil multiple cursor
  535.  
  536. )
  537.  
  538. (defun dotspacemacs/user-load ()
  539. "Library to load while dumping.
  540. This function is called only while dumping Spacemacs configuration. You can
  541. `require' or `load' the libraries of your choice that will be included in the
  542. dump."
  543. ;; (add-to-list 'load-path "~/notdeft")
  544. ;; (load "notdeft-example")
  545. ;; (require 'notdeft-autoloads)
  546. ;; (autoload 'helm-chrome)
  547. (require 'helm-chrome)
  548. (require 'helm-chrome-history)
  549. (require 'helm-chrome-control)
  550. (require 'helm-osx-app)
  551. (setq helm-pattern "100")
  552. (setq helm--maybe-use-default-as-input nil)
  553.  
  554.  
  555. ;; (add-to-list 'load-path "~/bin/emacs-libvterm")
  556. ;; (require 'vterm)
  557. )
  558.  
  559. (defun dotspacemacs/user-config ()
  560. "Configuration for user code:
  561. This function is called at the very end of Spacemacs startup, after layer
  562. configuration.
  563. Put your configuration code here, except for variables that should be set
  564. before packages are loaded."
  565.  
  566. (use-package smart-input-source
  567. :config
  568. (setq smart-input-source-english-input-source
  569. "com.apple.keylayout.US")
  570. (setq smart-input-source-other-input-source
  571. "im.rime.inputmethod.Squirrel.Rime")
  572. (add-hook text-mode-hook #'smart-input-source-mode)
  573. (add-hook prog-mode-hook #'smart-input-source-mode)
  574. )
  575. ;;qy test 20200526 啟示清空
  576. (setq gc-cons-threshold 100000000)
  577. ;;(setq package-enable-at-startup nil)
  578. (defvar better-gc-cons-threshold 67108864 ; 64mb
  579. "The default value to use for `gc-cons-threshold'.
  580.  
  581. If you experience freezing, decrease this. If you experience stuttering, increase this.")
  582.  
  583. ;; (add-hook 'emacs-startup-hook
  584. ;; (lambda ()
  585. ;; (setq gc-cons-threshold better-gc-cons-threshold)
  586. ;; (setq file-name-handler-alist file-name-handler-alist-original)
  587. ;; (makunbound 'file-name-handler-alist-original)))
  588.  
  589. ;; ;;qy test 20200526 company 文字補全功能
  590. ;;https://github.com/MatthewZMD/.emacs.d#org322941d
  591. ;; (use-package company
  592. ;; :diminish company-mode
  593. ;; :hook ((prog-mode LaTeX-mode latex-mode ess-r-mode) . company-mode)
  594. ;; :bind
  595. ;; (:map company-active-map
  596. ;; ([tab] . smarter-yas-expand-next-field-complete)
  597. ;; ("TAB" . smarter-yas-expand-next-field-complete))
  598. ;; :custom
  599. ;; (company-minimum-prefix-length 1)
  600. ;; (company-tooltip-align-annotations t)
  601. ;; (company-begin-commands '(self-insert-command))
  602. ;; (company-require-match 'never)
  603. ;; ;; Don't use company in the following modes
  604. ;; (company-global-modes '(not shell-mode eaf-mode))
  605. ;; ;; Trigger completion immediately.
  606. ;; (company-idle-delay 0.1)
  607. ;; ;; Number the candidates (use M-1, M-2 etc to select completions).
  608. ;; (company-show-numbers t)
  609. ;; :config
  610. ;; (unless *clangd* (delete 'company-clang company-backends))
  611. ;; (global-company-mode 1)
  612. ;; (defun smarter-yas-expand-next-field-complete ()
  613. ;; "Try to `yas-expand' and `yas-next-field' at current cursor position.
  614.  
  615. ;; If failed try to complete the common part with `company-complete-common'"
  616. ;; (interactive)
  617. ;; (if yas-minor-mode
  618. ;; (let ((old-point (point))
  619. ;; (old-tick (buffer-chars-modified-tick)))
  620. ;; (yas-expand)
  621. ;; (when (and (eq old-point (point))
  622. ;; (eq old-tick (buffer-chars-modified-tick)))
  623. ;; (ignore-errors (yas-next-field))
  624. ;; (when (and (eq old-point (point))
  625. ;; (eq old-tick (buffer-chars-modified-tick)))
  626. ;; (company-complete-common))))
  627. ;; (company-complete-common))))
  628.  
  629. ;;qy test 20200526 org2md github風格
  630. (use-package ox-gfm :defer t)
  631. (eval-after-load "org"
  632. '(require 'ox-gfm nil t))
  633.  
  634.  
  635.  
  636.  
  637. ;; (setq vterm-shell "zsh")
  638. ;; (add-hook 'vterm-set-title-functions 'vterm--rename-buffer-as-title)
  639.  
  640.  
  641.  
  642.  
  643. (setq-default history-length 1000)
  644. ;;qy 避免锁定临时文件
  645. ;; (setq recentf-save-file (format "/tmp/recentf.%s" (emacs-pid)))
  646. ;; or
  647. ;; (setq recentf-save-file (format "%s.%s" recentf-save-file server-name))
  648. ;; (cancel-timer recentf-auto-save-timer)
  649.  
  650. ;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  651. ;; qy 试试 setup history of edited file
  652. ;; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  653. (savehist-mode 1)
  654. (setq savehist-file "~/.emacs.d/.savehist")
  655. (setq history-length t)
  656. (setq history-delete-duplicates t)
  657. (setq savehist-save-minibuffer-history 1)
  658. (setq savehist-additional-variables
  659. '(kill-ring
  660. search-ring
  661. regexp-search-ring))
  662.  
  663.  
  664. ;;多个 Emacs 打开同一份文件时,会自动产生一个 .#xxx 的文件,很烦人,去掉:
  665. (setq create-lockfiles nil)
  666.  
  667. ;;qy helm
  668. (require 'helm)
  669. (require 'helm-config)
  670. ;;qy helm 自动大小?
  671. (helm :variables helm-enable-auto-resize t)
  672. ;;qy 设置vim在helm中执行
  673. (setq hybrid-style-enable-hjkl-bindings t)
  674. ;; (setq basic-save-buffer "~/.emacs.d/helm.buffer")
  675. ;;qy ceshi
  676. (defun spacemacs//helm-hide-minibuffer-maybe ()
  677. "Hide minibuffer in Helm session if we use the header line as input field."
  678. (when (with-helm-buffer helm-echo-input-in-header-line)
  679. (let ((ov (make-overlay (point-min) (point-max) nil nil t)))
  680. (overlay-put ov 'window (selected-window))
  681. (overlay-put ov 'face
  682. (let ((bg-color (face-background 'default nil)))
  683. `(:background ,bg-color :foreground ,bg-color)))
  684. (setq-local cursor-type nil))))
  685.  
  686.  
  687. (add-hook 'helm-minibuffer-set-up-hook
  688. 'spacemacs//helm-hide-minibuffer-maybe)
  689.  
  690. (helm-mode 1)
  691.  
  692. ;;qy
  693. ;; Prevent error "No buffer named *helm*" triggered by
  694. ;; `helm-set-local-variable'.
  695. ;;(setq helm--force-updating-p nil)
  696. ;;(setq helm--buffer-in-new-frame-p nil)
  697. ;; Reset helm-pattern so that lambda's using it
  698. ;; before running helm will not start with its old value.
  699. ;;(setq helm-pattern "100")
  700. ;;(setq helm--ignore-errors t)
  701. ;;qy
  702.  
  703. ;; 指定ファイルを自動保存
  704. ;; (require 'auto-save-buffers-enhanced)
  705. ;; (setq auto-save-buffers-enhanced-include-regexps '("\\.\\(hpp\\|cpp\\|c\\|h\\|m\\|mm\\|pl\\|cgi\\|json\\|param\\|vsh\\|fsh\\)$"))
  706. ;; (setq auto-save-buffers-enhanced-interval 1)
  707. ;; (setq auto-save-buffers-enhanced-quiet-save-p t)
  708. ;; (auto-save-buffers-enhanced t)
  709.  
  710. ;; (setq howm-menu-lang 'en)
  711. ;; (global-set-key "\C-c,," 'howm-menu)
  712. ;; (autoload 'howm-menu "howm-mode" "Hitori Otegaru Wiki Modoki" t)
  713.  
  714.  
  715.  
  716. ;; 关闭启动画面
  717. (setq inhibit-startup-message t)
  718. ;;當前行高亮顯示
  719. (global-hl-line-mode 1)
  720. ;;顯示時間
  721. (display-time-mode t)
  722.  
  723. ;;qy setup utf-8
  724. ;; (set-language-environment "UTF-8")
  725. ;; (set-default-coding-systems 'utf-8)
  726. ;; ;;qy dibutiao
  727. ;; ;;(setq powerline-default-separator'utf-8)
  728. ;; (set-buffer-file-coding-system 'utf-8-unix)
  729. ;; (set-clipboard-coding-system 'utf-8-unix)
  730. ;; (set-file-name-coding-system 'utf-8-unix)
  731. ;; (set-keyboard-coding-system 'utf-8-unix)
  732. ;; (set-next-selection-coding-system 'utf-8-unix)
  733. ;; (set-selection-coding-system 'utf-8-unix)
  734. ;; (set-terminal-coding-system 'utf-8-unix)
  735. ;; (setq locale-coding-system 'utf-8)
  736. ;; (prefer-coding-system 'gb18030)
  737. ;; (prefer-coding-system 'utf-8)
  738.  
  739.  
  740.  
  741. ;; qy -- cofig fctix
  742. ;; (with-eval-after-load 'fcitx
  743. ;; ;; Make sure the following comes before `(fcitx-aggressive-setup)’
  744. ;; (setq fcitx-active-evil-states '(insert emacs hybrid))
  745. ;; ;; For Spacemacs use hybrid mode。 默认方式是 '(insert emacs)
  746. ;; (fcitx-aggressive-setup) ; 如果要在 minibuffer 里输入中文,就改成
  747. ;; (fcitx-default-setup)
  748. ;; (fcitx-prefix-keys-add "M-m") ; M-m is common in Spacemacs
  749. ;; ;;(setq fcitx-use-dbus t) ; uncomment if you’re using Linux
  750. ;; ;; remove all keybindings from insert-state keymap,it is VERY VERY important
  751. ;; (fcitx-prefix-keys-turn-off) ;
  752. ;; ;;(setcdr evil-insert-state-map t)
  753. ;; (fcitx-evil-turn-on)
  754. ;; (fcitx-isearch-turn-on)
  755. ;; )
  756. (use-package fcitx
  757. :ensure t
  758. :after exec-path-from-shell
  759. :init
  760. (fcitx-aggressive-setup)
  761. (fcitx-prefix-keys-turn-off))
  762.  
  763.  
  764.  
  765. ;;設置jk是行內上下行
  766. (define-key evil-normal-state-map (kbd "j") 'evil-next-visual-line)
  767. (define-key evil-normal-state-map (kbd "k") 'evil-previous-visual-line)
  768. ;;用我下面的Elisp函数来实现一键自动转换的功能 org 2 docx
  769. (defun org-export-docx ()
  770. (interactive)
  771. (let ((docx-file (concat (file-name-sans-extension (buffer-file-name)) ".docx"))
  772. (template-file "/Users/chinhant/org/template.docx"))
  773. (shell-command (format "pandoc %s -o %s --reference-doc=%s" (buffer-file-name) docx-file template-file))
  774. (message "Convert finish: %s" docx-file)))
  775.  
  776.  
  777. ;; ;;qy 20200526打
  778. ;; (use-package rime
  779.  
  780. ;; :bind
  781. ;; (:map rime-mode-map
  782. ;; ("C-`" . 'rime-send-keybinding))
  783. ;; )
  784. ;; ;; :custom
  785. ;; ;; (default-input-method "rime"))
  786. ;; ;; ;;; Code:
  787. ;; ;; (setq rime-user-data-dir "/Users/chinhant/Library/Rime")
  788.  
  789. ;; ;;(rime-librime-root "/Users/chinhant/.emacs.d/private/local/emacs-rime")
  790. ;; ;;(rime-lib-select-schema "cangjie6")
  791. ;; (setq rime-posframe-properties
  792. ;; (list :background-color "#000000"
  793. ;; :foreground-color "#dcdccc"
  794. ;; :font "WenQuanYi Micro Hei Mono-14"
  795. ;; :internal-border-width 10))
  796. ;; (bind-key "C-`" 'rime-send-keybinding rime-mode-map)
  797.  
  798. ;; ;;设置中国日历
  799. (require 'cal-china-x)
  800. (setq mark-holidays-in-calendar t)
  801. (setq cal-china-x-important-holidays cal-china-x-chinese-holidays)
  802. (setq cal-china-x-general-holidays '((holiday-lunar 1 15 "元宵节")))
  803. (setq calendar-holidays
  804. (append cal-china-x-important-holidays
  805. cal-china-x-general-holidays
  806. ))
  807.  
  808. ;;qy 中文日曆,週一第一天 => "Monday"
  809. (let ((system-time-locale "zh_CN.UTF-8"))
  810. (format-time-string "%A"))
  811. (setq calendar-week-start-day 1)
  812.  
  813. ;;qy org gtd setup
  814. (with-eval-after-load 'org
  815. ;; here goes your Org config :)
  816. ;; ....
  817.  
  818. ;;qy
  819. (define-key org-mode-map (kbd "M-c") 'org-mac-chrome-insert-frontmost-url)
  820. ;;不起效果(spacemacs/set-leader-keys "ig" 'org-mac-chrome-insert-frontmost-url)
  821. (add-hook 'org-mode-hook (lambda () (setq truncate-lines nil)));实现 org-mode 中的自动换行
  822. ;;qy (evil-org-set-key-theme '(todo))
  823.  
  824. ;;(type "漢字(z!)" "中醫(y!)" "文始道(d!)" "井通(t!)" "科技(j!)" "紅樓夢(m!)" "|")
  825. (setq org-todo-keywords
  826. '((sequence "TODO(t!)" "SOMEDAY(s)" "|" "DONE(d!)" "CANCEL(c @/!)")
  827. ))
  828.  
  829.  
  830. ;;qy [[file:/Users/chinhant/org/電腦配置.org][配置說明]]
  831. ;;; "* %?\nEntered on %U\n %i\n %a")
  832. ;; (setq org-capture-templates
  833. ;; '(("t" "Todo" entry (file+headline "~/org/待辦.org" "Inbox")
  834. ;; "* TODO [#B] %?\n %i\n %a %t")
  835. ;; ("s" "SOMEDAY" entry (file+headline "~/org/待辦.org" "Someday")
  836. ;; "* SOMEDAY %?\n %i\n %a %t"
  837. ;; :empty-lines 1)
  838. ;; ("n" "筆記" entry (file "~/org/筆記.org")
  839. ;; "* %? \n%U\n%a\n" :clock-in t :clock-resume t)
  840. ;; ("b" "書籤" entry (file "~/org/網摘.org" "書籤")
  841. ;; "* %?\nEntered on %U\n %i\n %a")
  842. ;; ("w" "網摘" entry (file "~/org/網摘.org" "網摘")
  843. ;; "* %?\nEntered on %U\n %i\n %a")
  844. ;; ("l" "靈感" entry (file "~/org/靈感.org")
  845. ;; "* %?\nEntered on %U\n %i\n %a")))
  846.  
  847.  
  848. ;; (defun generate-anki-note-body ()
  849. ;; (interactive)
  850. ;; (message "Fetching note types...")
  851. ;; (let ((note-types (sort (anki-editor-note-types) #'string-lessp))
  852. ;; (decks (sort (anki-editor-deck-names) #'string-lessp))
  853. ;; deck note-type fields)
  854. ;; (setq deck (completing-read "Choose a deck: " decks))
  855. ;; (setq note-type (completing-read "Choose a note type: " note-types))
  856. ;; (message "Fetching note fields...")
  857. ;; (setq fields (anki-editor--anki-connect-invoke-result "modelFieldNames" `((modelName . ,note-type))))
  858. ;; (concat " :PROPERTIES:\n"
  859. ;; " :ANKI_DECK: " deck "\n"
  860. ;; " :ANKI_NOTE_TYPE: " note-type "\n"
  861. ;; " :END:\n\n"
  862. ;; (mapconcat (lambda (str) (concat "** " str))
  863. ;; fields
  864. ;; "\n\n"))))
  865.  
  866.  
  867.  
  868.  
  869. ;;设置默认储存文件,否则出错qy
  870. ;; (setq org-default-notes-file "~/org/gtd/inbox.org")
  871.  
  872. (setq org-capture-templates '(
  873. ("i" "inbox" entry (file+headline "~/org/gtd/inbox.org" "inbox")
  874. "* TODO [#B] %i%? %t %^g\n %a" :empty-lines 1)
  875. ("s" "Someday" entry (file+headline "~/org/gtd/someday.org" "Someday")
  876. "* SOMEDAY %? %t %^g\n" :empty-lines 1)
  877. ("d" "iDea" entry (file+headline "~/org/gtd/someday.org" "idea")
  878. "* SOMEDAY %? %t %^g\n" :empty-lines 1)
  879. ("g" "GTD" entry (file+datetree "~/org/gtd/gtd.org")
  880. "* TODO [#B] %i%? %t %^g\n %a" :empty-lines 1)
  881.  
  882. ("r" "時習" entry (file+headline "~/org/學習.org" "時習")
  883. "* %? \n %c\n %i%T %a" :empty-lines 1)
  884. ("b" "書籤" entry (file+headline "~/org/webclip.org" "書籤")
  885. "* %? %(org-mac-chrome-get-frontmost-url) %^g\n %U " :empty-lines 1)
  886. ("w" "網摘" entry (file+headline "~/org/webclip.org" "網摘")
  887. "* %? %(org-mac-chrome-get-frontmost-url) %^g\n %c\n %U " :empty-lines 1)
  888.  
  889. ;; ("v" "Vocabulary" entry
  890. ;; (file+headline "~/org/anki.org" "V")
  891. ;; ,(concat "* %^{heading} :note:\n"
  892. ;; "%(generate-anki-note-body)\n"))
  893. ))
  894.  
  895.  
  896. ;; (setq org-capture-templates '(
  897. ;; ("i" "inbox" entry (file+headline "~/gtd/inbox.org" "inbox")
  898. ;; "* TODO [#B] %U %i%?" :empty-lines 1)
  899. ;; ("s" "someday" entry (file+headline "~/gtd/someday.org" "some day")
  900. ;; "* TODO [#C] %U %i%?" :empty-lines 1)
  901. ;; ("g" "GTD" entry (file+datetree "~/gtd/gtd.org")
  902. ;; "* TODO [#B] %U %i%?" :empty-lines 1)
  903. ;; ))
  904.  
  905. ;;转发到普通文件
  906. (setq org-refile-targets '(
  907. ("~/org/gtd/someday.org" :level . 1)
  908. ("~/org/gtd/gtd.org" :maxlevel . 3)
  909. ))
  910.  
  911. ;; ;;转发到 datetree 文件
  912. ;; (defun he/org-read-datetree-date (d)
  913. ;; (let ((dtmp (nthcdr 3 (parse-time-string d))))
  914. ;; (list (cadr dtmp) (car dtmp) (caddr dtmp))))
  915. ;;
  916. ;; ;; refile 一个 entry 到 gtd.org 文件
  917. ;; (defun he/org-refile-to-datetree (&optional bfn)
  918. ;; (interactive)
  919. ;; (require 'org-datetree)
  920. ;; (let* ((bfn (or bfn (find-file-noselect (expand-file-name "~/org/gtd/gtd.org"))))
  921. ;; (datetree-date (he/org-read-datetree-date (org-read-date t nil))))
  922. ;; (org-refile nil nil (list nil (buffer-file-name bfn) nil
  923. ;; (with-current-buffer bfn
  924. ;; (save-excursion
  925. ;; (org-datetree-find-date-create datetree-date)
  926. ;; (point)))))))
  927. ;;
  928.  
  929. ; config org-agenda
  930. (setq org-agenda-files '("~/org/gtd"))
  931. (setq org-agenda-files '("~/org/gtd/inbox.org"
  932. "~/org/gtd/gtd.org"
  933. "~/org/gtd/someday.org"))
  934.  
  935. ;;水木火土金,亂,無,有 “☯” “☰” “☱” “☲” “☳” “☴” “☵” “☶” “☷” “♠” “♣” “♥” “♦”
  936. (setq org-bullets-bullet-list '("☯" "♦" "▲" "■" "★" "✸" "○" "◉"))
  937. ;; 折叠时不再显示「...」
  938. (setq org-ellipsis "▼")
  939.  
  940.  
  941. ;; qy
  942. ;;(custom-set-variables
  943. ;; custom-set-variables was added by Custom.
  944. ;; If you edit it by hand, you could mess it up, so be careful.
  945. ;; Your init file should contain only one such instance.
  946. ;; If there is more than one, they won't work right.
  947. ;;'(blink-cursor-mode nil)
  948. ;;'(column-number-mode t)
  949. ;;'(org-agenda-files
  950. ;; (quote
  951. ;; ("~/org/notes.org")))
  952.  
  953. ;; qy add OS notification for org-pormodor https://github.com/MedicMedic/.spacemacs.d/blob/master/init.el
  954.  
  955. ;; (defun notify-osx (title message)
  956. ;; (call-process "terminal-notifier"
  957. ;; nil 0 nil
  958. ;; "-group" "Emacs"
  959. ;; "-title" title
  960. ;; "-sender" "org.gnu.Emacs"
  961. ;; "-message" message
  962. ;; "-activate" "org.gnu.Emacs"))
  963. ;;
  964. ;;
  965. ;; (require 'org-pomodoro)
  966. ;;
  967. ;; (add-hook 'org-pomodoro-finished-hook
  968. ;; (lambda ()
  969. ;; (notify-osx "Pomodoro completed!" "️Time for a break.")))
  970. ;; (add-hook 'org-pomodoro-break-finished-hook
  971. ;; (lambda ()
  972. ;; (notify-osx "Pomodoro Short Break Finished" "Ready for Another?")))
  973. ;; (add-hook 'org-pomodoro-long-break-finished-hook
  974. ;; (lambda ()
  975. ;; (notify-osx "Pomodoro Long Break Finished" "Ready for Another?")))
  976. ;; (add-hook 'org-pomodoro-killed-hook
  977. ;; (lambda ()
  978. ;; (notify-osx "Pomodoro Killed" "One does not simply kill a pomodoro!")))
  979. ;;
  980.  
  981. ;;(package! notdeft :recipe (:host github :repo "hasu/notdeft"))
  982. ;;(use-package! notdeft
  983. ;; :config
  984.  
  985. ;; qy org 結束
  986. )
  987.  
  988. ;;qy roam 20200529
  989. (defconst org-roam-packages
  990. '(org-roam))
  991.  
  992. (defun org-roam/init-org-roam ()
  993. (use-package org-roam
  994. :hook
  995. (after-init . org-roam-mode)
  996. :custom
  997. (org-roam-directory "/Users/chinhant/org/")
  998. :init
  999. (progn
  1000. (spacemacs/declare-prefix "ar" "org-roam")
  1001. (spacemacs/set-leader-keys
  1002. "arl" 'org-roam
  1003. "art" 'org-roam-dailies-today
  1004. "arf" 'org-roam-find-file
  1005. "arg" 'org-roam-graph)
  1006.  
  1007. (spacemacs/declare-prefix-for-mode 'org-mode "mr" "org-roam")
  1008. (spacemacs/set-leader-keys-for-major-mode 'org-mode
  1009. "rl" 'org-roam
  1010. "rt" 'org-roam-dailies-today
  1011. "rb" 'org-roam-switch-to-buffer
  1012. "rf" 'org-roam-find-file
  1013. "ri" 'org-roam-insert
  1014. "rg" 'org-roam-graph))))
  1015.  
  1016. ;; 只有当打开的文件超过100MB时,才产生警告
  1017. (setq large-file-warning-threshold 100000000)
  1018. ;;加快啓動速度
  1019. (setq tramp-ssh-controlmaster-options "-o ControlMaster=auto -o ControlPath='tramp.%%C' -o ControlPersist=no")
  1020.  
  1021. ;; 失去焦點,即可保存文件
  1022. (add-hook 'focus-out-hook 'save-buffer)
  1023.  
  1024. ;;qy notdeft 第一行解決創建中文文件名
  1025. (setq notdeft-notename-function '(lambda (str) str))
  1026.  
  1027. (setq notdeft-extensions "org")
  1028. ;; (setq notdeft-default-extension "org")
  1029. (setq notdeft-secondary-extensions '("md" "txt"))
  1030. (setq notdeft-directories '("~/org/note/nvaltnote"
  1031. "~/org/note/joplinoutput"
  1032. ))
  1033. ;;支持中文搜索
  1034. (setenv "XAPIAN_CJK_NGRAM" "1")
  1035. ;; :bind (:map notdeft-mode-map
  1036. ;; ("C-q" . notdeft-quit)
  1037. ;; ("C-r" . notdeft-refresh)
  1038. ;; )
  1039.  
  1040. ;; ;;設置notdeft顯示文件目錄名
  1041. ;; (setq notdeft-file-display-function
  1042. ;; (lambda (file w)
  1043. ;; (when (> w 30)
  1044. ;; (let* ((s (file-name-nondirectory
  1045. ;; (directory-file-name
  1046. ;; (notdeft-dir-of-file file))))
  1047. ;; (s (pcase s
  1048. ;; ("bibliography-notes" "bib")
  1049. ;; ("homepage-notes" "hp")
  1050. ;; (_ s)))
  1051. ;; (s (if (> (string-width s) 12)
  1052. ;; (truncate-string-to-width s 12)
  1053. ;; s)))
  1054. ;; (concat " " s)))))
  1055.  
  1056. ;;qy usr's /Users/chinhant/notdeftaaa /Users/chinhant/notdeft/xapian
  1057. )
  1058.  
  1059. ;; Do not write anything past this comment. This is where Emacs will
  1060. ;; auto-generate custom variable definitions.
  1061. (defun dotspacemacs/emacs-custom-settings ()
  1062. "Emacs custom settings.
  1063. This is an auto-generated function, do not modify its content directly, use
  1064. Emacs customize menu instead.
  1065. This function is called at the very end of Spacemacs initialization."
  1066. (custom-set-variables
  1067. ;; custom-set-variables was added by Custom.
  1068. ;; If you edit it by hand, you could mess it up, so be careful.
  1069. ;; Your init file should contain only one such instance.
  1070. ;; If there is more than one, they won't work right.
  1071. '(ansi-color-names-vector
  1072. ["#0a0814" "#f2241f" "#67b11d" "#b1951d" "#4f97d7" "#a31db1" "#28def0" "#b2b2b2"])
  1073. '(company-begin-commands (quote (self-insert-command)) t)
  1074. '(company-global-modes (quote (not shell-mode eaf-mode)) t)
  1075. '(company-idle-delay 0.1 t)
  1076. '(company-minimum-prefix-length 1 t)
  1077. '(company-require-match (quote never) t)
  1078. '(company-show-numbers t t)
  1079. '(company-tooltip-align-annotations t t)
  1080. '(custom-enabled-themes (quote (spacemacs-light)))
  1081. '(custom-safe-themes
  1082. (quote
  1083. ("fa2b58bb98b62c3b8cf3b6f02f058ef7827a8e497125de0254f56e373abee088" default)))
  1084. '(evil-want-Y-yank-to-eol nil)
  1085. '(hl-todo-keyword-faces
  1086. (quote
  1087. (("TODO" . "#dc752f")
  1088. ("NEXT" . "#dc752f")
  1089. ("THEM" . "#2d9574")
  1090. ("PROG" . "#4f97d7")
  1091. ("OKAY" . "#4f97d7")
  1092. ("DONT" . "#f2241f")
  1093. ("FAIL" . "#f2241f")
  1094. ("DONE" . "#86dc2f")
  1095. ("NOTE" . "#b1951d")
  1096. ("KLUDGE" . "#b1951d")
  1097. ("HACK" . "#b1951d")
  1098. ("TEMP" . "#b1951d")
  1099. ("FIXME" . "#dc752f")
  1100. ("XXX+" . "#dc752f")
  1101. ("\\?\\?\\?+" . "#dc752f"))))
  1102. '(notdeft-xapian-program "/Users/chinhant/notdeft/xapian/notdeft-xapian" t)
  1103. '(org-modules
  1104. (quote
  1105. (ol-docview ol-gnus org-habit ol-info ol-mhe ol-w3m org-learn org-mac-link org-notify org-screen)))
  1106. '(org-roam-directory "/Users/chinhant/org/")
  1107. '(package-selected-packages
  1108. (quote
  1109. (org-roam-server org-roam ox-gfm xterm-color shell-pop multi-term eshell-z eshell-prompt-extras esh-help vterm-toggle anki-editor 0blayout helm-osx-app helm-chrome-control helm-chrome-history helm-chrome notdeft org-wild-notifier cal-china-x yaml-mode ws-butler writeroom-mode winum which-key web-mode web-beautify volatile-highlights vi-tilde-fringe uuidgen use-package treemacs-projectile treemacs-magit treemacs-evil toc-org tagedit symon symbol-overlay string-inflection spaceline-all-the-icons smeargle slim-mode scss-mode sass-mode reveal-in-osx-finder restart-emacs rainbow-delimiters pyim pug-mode prettier-js popwin persp-mode pcre2el password-generator paradox pangu-spacing overseer osx-trash osx-dictionary osx-clipboard orgit org-projectile org-present org-pomodoro org-mime org-download org-cliplink org-bullets org-brain open-junk-file nameless move-text mmm-mode markdown-toc magit-svn magit-gitflow macrostep lua-mode lorem-ipsum link-hint launchctl indent-guide impatient-mode hybrid-mode hungry-delete hl-todo highlight-parentheses highlight-numbers highlight-indentation helm-xref helm-themes helm-swoop helm-purpose helm-projectile helm-org-rifle helm-org helm-mode-manager helm-make helm-ls-git helm-gitignore helm-git-grep helm-flx helm-descbinds helm-css-scss helm-ag google-translate golden-ratio gnuplot gmail-message-mode gitignore-templates gitconfig-mode gitattributes-mode git-timemachine git-messenger git-link gh-md font-lock+ flymd flycheck-package flx-ido find-by-pinyin-dired fill-column-indicator fcitx fancy-battery eyebrowse expand-region evil-visualstar evil-visual-mark-mode evil-unimpaired evil-tutor evil-textobj-line evil-surround evil-org evil-numbers evil-nerd-commenter evil-mc evil-matchit evil-magit evil-lisp-state evil-lion evil-indent-plus evil-iedit-state evil-goggles evil-exchange evil-escape evil-ediff evil-cleverparens evil-args evil-anzu eval-sexp-fu engine-mode emmet-mode elisp-slime-nav editorconfig edit-server dumb-jump dotenv-mode doom-modeline diminish devdocs deft column-enforce-mode clean-aindent-mode chinese-conv centered-cursor-mode auto-highlight-symbol auto-compile aggressive-indent ace-pinyin ace-link ace-jump-helm-line)))
  1110. '(pdf-view-midnight-colors (quote ("#b2b2b2" . "#292b2e"))))
  1111. (custom-set-faces
  1112. ;; custom-set-faces was added by Custom.
  1113. ;; If you edit it by hand, you could mess it up, so be careful.
  1114. ;; Your init file should contain only one such instance.
  1115. ;; If there is more than one, they won't work right.
  1116. )
  1117. )
Add Comment
Please, Sign In to add comment