Guest User

.spacemacs

a guest
Sep 26th, 2021
32
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 my-desktop-save-hook (&rest args) (edebug))
  6. ;; (advice-add 'desktop-save :before 'my-desktop-save-hook)
  7.  
  8. (defun dotspacemacs/layers ()
  9. "Layer configuration:
  10. This function should only modify configuration layer settings."
  11. (setq-default
  12. dotspacemacs-distribution 'spacemacs
  13. dotspacemacs-enable-lazy-installation 'unused
  14. dotspacemacs-ask-for-lazy-installation t
  15. dotspacemacs-configuration-layer-path '()
  16. dotspacemacs-configuration-layers
  17. '(javascript
  18. php
  19. html
  20. gtags
  21. auto-completion
  22. emacs-lisp
  23. git
  24. sql
  25. gpu
  26. markdown
  27. (shell :variables shell-default-shell 'eshell)
  28. evil-commentary
  29. c-c++
  30. semantic
  31. debug
  32. (erc :variables
  33. erc-server-list
  34. '(("irc.eu.libera.chat"
  35. :port "6697"
  36. :ssl t
  37. :nick "dokma")))
  38. helm
  39. )
  40. dotspacemacs-additional-packages
  41. '(
  42. (eshell-autojump :location (recipe :fetcher github :repo "coldnew/eshell-autojump"))
  43. )
  44. dotspacemacs-frozen-packages '()
  45. dotspacemacs-excluded-packages '(evil-escape)
  46. dotspacemacs-install-packages 'used-only))
  47.  
  48. (defun dotspacemacs/init ()
  49. "Initialization:
  50. This function is called at the very beginning of Spacemacs startup,
  51. before layer configuration.
  52. It should only modify the values of Spacemacs settings."
  53. ;; This setq-default sexp is an exhaustive list of all the supported
  54. ;; spacemacs settings.
  55. (setq-default
  56. ;; If non-nil then enable support for the portable dumper. You'll need
  57. ;; to compile Emacs 27 from source following the instructions in file
  58. ;; EXPERIMENTAL.org at to root of the git repository.
  59. ;; (default nil)
  60. dotspacemacs-enable-emacs-pdumper nil
  61.  
  62. ;; Name of executable file pointing to emacs 27+. This executable must be
  63. ;; in your PATH.
  64. ;; (default "emacs")
  65. dotspacemacs-emacs-pdumper-executable-file "emacs"
  66.  
  67. ;; Name of the Spacemacs dump file. This is the file will be created by the
  68. ;; portable dumper in the cache directory under dumps sub-directory.
  69. ;; To load it when starting Emacs add the parameter `--dump-file'
  70. ;; when invoking Emacs 27.1 executable on the command line, for instance:
  71. ;; ./emacs --dump-file=$HOME/.emacs.d/.cache/dumps/spacemacs-27.1.pdmp
  72. ;; (default (format "spacemacs-%s.pdmp" emacs-version))
  73. dotspacemacs-emacs-dumper-dump-file (format "spacemacs-%s.pdmp" emacs-version)
  74.  
  75. ;; If non-nil ELPA repositories are contacted via HTTPS whenever it's
  76. ;; possible. Set it to nil if you have no way to use HTTPS in your
  77. ;; environment, otherwise it is strongly recommended to let it set to t.
  78. ;; This variable has no effect if Emacs is launched with the parameter
  79. ;; `--insecure' which forces the value of this variable to nil.
  80. ;; (default t)
  81. dotspacemacs-elpa-https t
  82.  
  83. ;; Maximum allowed time in seconds to contact an ELPA repository.
  84. ;; (default 5)
  85. dotspacemacs-elpa-timeout 5
  86.  
  87. ;; Set `gc-cons-threshold' and `gc-cons-percentage' when startup finishes.
  88. ;; This is an advanced option and should not be changed unless you suspect
  89. ;; performance issues due to garbage collection operations.
  90. ;; (default '(100000000 0.1))
  91. dotspacemacs-gc-cons '(100000000 0.1)
  92.  
  93. ;; Set `read-process-output-max' when startup finishes.
  94. ;; This defines how much data is read from a foreign process.
  95. ;; Setting this >= 1 MB should increase performance for lsp servers
  96. ;; in emacs 27.
  97. ;; (default (* 1024 1024))
  98. dotspacemacs-read-process-output-max (* 1024 1024)
  99.  
  100. ;; If non-nil then Spacelpa repository is the primary source to install
  101. ;; a locked version of packages. If nil then Spacemacs will install the
  102. ;; latest version of packages from MELPA. Spacelpa is currently in
  103. ;; experimental state please use only for testing purposes.
  104. ;; (default nil)
  105. dotspacemacs-use-spacelpa nil
  106.  
  107. ;; If non-nil then verify the signature for downloaded Spacelpa archives.
  108. ;; (default t)
  109. dotspacemacs-verify-spacelpa-archives t
  110.  
  111. ;; If non-nil then spacemacs will check for updates at startup
  112. ;; when the current branch is not `develop'. Note that checking for
  113. ;; new versions works via git commands, thus it calls GitHub services
  114. ;; whenever you start Emacs. (default nil)
  115. dotspacemacs-check-for-update nil
  116.  
  117. ;; If non-nil, a form that evaluates to a package directory. For example, to
  118. ;; use different package directories for different Emacs versions, set this
  119. ;; to `emacs-version'. (default 'emacs-version)
  120. dotspacemacs-elpa-subdirectory 'emacs-version
  121.  
  122. ;; One of `vim', `emacs' or `hybrid'.
  123. ;; `hybrid' is like `vim' except that `insert state' is replaced by the
  124. ;; `hybrid state' with `emacs' key bindings. The value can also be a list
  125. ;; with `:variables' keyword (similar to layers). Check the editing styles
  126. ;; section of the documentation for details on available variables.
  127. ;; (default 'vim)
  128. dotspacemacs-editing-style 'vim
  129.  
  130. ;; If non-nil show the version string in the Spacemacs buffer. It will
  131. ;; appear as (spacemacs version)@(emacs version)
  132. ;; (default t)
  133. dotspacemacs-startup-buffer-show-version t
  134.  
  135. ;; Specify the startup banner. Default value is `official', it displays
  136. ;; the official spacemacs logo. An integer value is the index of text
  137. ;; banner, `random' chooses a random text banner in `core/banners'
  138. ;; directory. A string value must be a path to an image format supported
  139. ;; by your Emacs build.
  140. ;; If the value is nil then no banner is displayed. (default 'official)
  141. dotspacemacs-startup-banner 'official
  142.  
  143. ;; List of items to show in startup buffer or an association list of
  144. ;; the form `(list-type . list-size)`. If nil then it is disabled.
  145. ;; Possible values for list-type are:
  146. ;; `recents' `recents-by-project' `bookmarks' `projects' `agenda' `todos'.
  147. ;; List sizes may be nil, in which case
  148. ;; `spacemacs-buffer-startup-lists-length' takes effect.
  149. ;; The exceptional case is `recents-by-project', where list-type must be a
  150. ;; pair of numbers, e.g. `(recents-by-project . (7 . 5))', where the first
  151. ;; number is the project limit and the second the limit on the recent files
  152. ;; within a project.
  153. dotspacemacs-startup-lists '((recents . 5)
  154. (projects . 7))
  155.  
  156. ;; True if the home buffer should respond to resize events. (default t)
  157. dotspacemacs-startup-buffer-responsive t
  158.  
  159. ;; Show numbers before the startup list lines. (default t)
  160. dotspacemacs-show-startup-list-numbers t
  161.  
  162. ;; The minimum delay in seconds between number key presses. (default 0.4)
  163. dotspacemacs-startup-buffer-multi-digit-delay 0.4
  164.  
  165. ;; Default major mode for a new empty buffer. Possible values are mode
  166. ;; names such as `text-mode'; and `nil' to use Fundamental mode.
  167. ;; (default `text-mode')
  168. dotspacemacs-new-empty-buffer-major-mode 'text-mode
  169.  
  170. ;; Default major mode of the scratch buffer (default `text-mode')
  171. dotspacemacs-scratch-mode 'text-mode
  172.  
  173. ;; If non-nil, *scratch* buffer will be persistent. Things you write down in
  174. ;; *scratch* buffer will be saved and restored automatically.
  175. dotspacemacs-scratch-buffer-persistent nil
  176.  
  177. ;; If non-nil, `kill-buffer' on *scratch* buffer
  178. ;; will bury it instead of killing.
  179. dotspacemacs-scratch-buffer-unkillable nil
  180.  
  181. ;; Initial message in the scratch buffer, such as "Welcome to Spacemacs!"
  182. ;; (default nil)
  183. dotspacemacs-initial-scratch-message nil
  184.  
  185. ;; List of themes, the first of the list is loaded when spacemacs starts.
  186. ;; Press `SPC T n' to cycle to the next theme in the list (works great
  187. ;; with 2 themes variants, one dark and one light)
  188. dotspacemacs-themes '(ir-black gruvbox)
  189.  
  190. ;; Set the theme for the Spaceline. Supported themes are `spacemacs',
  191. ;; `all-the-icons', `custom', `doom', `vim-powerline' and `vanilla'. The
  192. ;; first three are spaceline themes. `doom' is the doom-emacs mode-line.
  193. ;; `vanilla' is default Emacs mode-line. `custom' is a user defined themes,
  194. ;; refer to the DOCUMENTATION.org for more info on how to create your own
  195. ;; spaceline theme. Value can be a symbol or list with additional properties.
  196. ;; (default '(spacemacs :separator wave :separator-scale 1.5))
  197. ;; dotspacemacs-mode-line-theme '(spacemacs :separator arrow :separator-scale 1.2)
  198. dotspacemacs-mode-line-theme '(spacemacs :separator arrow) ;; :separator-scale 1.2)
  199.  
  200. ;; If non-nil the cursor color matches the state color in GUI Emacs.
  201. ;; (default t)
  202. dotspacemacs-colorize-cursor-according-to-state t
  203.  
  204. ;; Default font or prioritized list of fonts. The `:size' can be specified as
  205. ;; a non-negative integer (pixel size), or a floating-point (point size).
  206. ;; Point size is recommended, because it's device independent. (default 10.0)
  207. dotspacemacs-default-font '("Source Code Pro"
  208. :size 14
  209. :weight normal
  210. :width normal)
  211. ;;:powerline-scale 1.1)
  212.  
  213. ;; The leader key (default "SPC")
  214. dotspacemacs-leader-key "SPC"
  215.  
  216. ;; The key used for Emacs commands `M-x' (after pressing on the leader key).
  217. ;; (default "SPC")
  218. dotspacemacs-emacs-command-key "SPC"
  219.  
  220. ;; The key used for Vim Ex commands (default ":")
  221. dotspacemacs-ex-command-key ":"
  222.  
  223. ;; The leader key accessible in `emacs state' and `insert state'
  224. ;; (default "M-m")
  225. dotspacemacs-emacs-leader-key "M-m"
  226.  
  227. ;; Major mode leader key is a shortcut key which is the equivalent of
  228. ;; pressing `<leader> m`. Set it to `nil` to disable it. (default ",")
  229. dotspacemacs-major-mode-leader-key ","
  230.  
  231. ;; Major mode leader key accessible in `emacs state' and `insert state'.
  232. ;; (default "C-M-m" for terminal mode, "<M-return>" for GUI mode).
  233. ;; Thus M-RET should work as leader key in both GUI and terminal modes.
  234. ;; C-M-m also should work in terminal mode, but not in GUI mode.
  235. dotspacemacs-major-mode-emacs-leader-key (if window-system "<M-return>" "C-M-m")
  236.  
  237. ;; These variables control whether separate commands are bound in the GUI to
  238. ;; the key pairs `C-i', `TAB' and `C-m', `RET'.
  239. ;; Setting it to a non-nil value, allows for separate commands under `C-i'
  240. ;; and TAB or `C-m' and `RET'.
  241. ;; In the terminal, these pairs are generally indistinguishable, so this only
  242. ;; works in the GUI. (default nil)
  243. dotspacemacs-distinguish-gui-tab nil
  244.  
  245. ;; Name of the default layout (default "Default")
  246. dotspacemacs-default-layout-name "Default"
  247.  
  248. ;; If non-nil the default layout name is displayed in the mode-line.
  249. ;; (default nil)
  250. dotspacemacs-display-default-layout nil
  251.  
  252. ;; If non-nil then the last auto saved layouts are resumed automatically upon
  253. ;; start. (default nil)
  254. dotspacemacs-auto-resume-layouts t
  255.  
  256. ;; If non-nil, auto-generate layout name when creating new layouts. Only has
  257. ;; effect when using the "jump to layout by number" commands. (default nil)
  258. dotspacemacs-auto-generate-layout-names nil
  259.  
  260. ;; Size (in MB) above which spacemacs will prompt to open the large file
  261. ;; literally to avoid performance issues. Opening a file literally means that
  262. ;; no major mode or minor modes are active. (default is 1)
  263. dotspacemacs-large-file-size 1
  264.  
  265. ;; Location where to auto-save files. Possible values are `original' to
  266. ;; auto-save the file in-place, `cache' to auto-save the file to another
  267. ;; file stored in the cache directory and `nil' to disable auto-saving.
  268. ;; (default 'cache)
  269. dotspacemacs-auto-save-file-location 'cache
  270.  
  271. ;; Maximum number of rollback slots to keep in the cache. (default 5)
  272. dotspacemacs-max-rollback-slots 5
  273.  
  274. ;; If non-nil, the paste transient-state is enabled. While enabled, after you
  275. ;; paste something, pressing `C-j' and `C-k' several times cycles through the
  276. ;; elements in the `kill-ring'. (default nil)
  277. dotspacemacs-enable-paste-transient-state nil
  278.  
  279. ;; Which-key delay in seconds. The which-key buffer is the popup listing
  280. ;; the commands bound to the current keystroke sequence. (default 0.4)
  281. dotspacemacs-which-key-delay 0.4
  282.  
  283. ;; Which-key frame position. Possible values are `right', `bottom' and
  284. ;; `right-then-bottom'. right-then-bottom tries to display the frame to the
  285. ;; right; if there is insufficient space it displays it at the bottom.
  286. ;; (default 'bottom)
  287. dotspacemacs-which-key-position 'bottom
  288.  
  289. ;; Control where `switch-to-buffer' displays the buffer. If nil,
  290. ;; `switch-to-buffer' displays the buffer in the current window even if
  291. ;; another same-purpose window is available. If non-nil, `switch-to-buffer'
  292. ;; displays the buffer in a same-purpose window even if the buffer can be
  293. ;; displayed in the current window. (default nil)
  294. dotspacemacs-switch-to-buffer-prefers-purpose nil
  295.  
  296. ;; If non-nil a progress bar is displayed when spacemacs is loading. This
  297. ;; may increase the boot time on some systems and emacs builds, set it to
  298. ;; nil to boost the loading time. (default t)
  299. dotspacemacs-loading-progress-bar t
  300.  
  301. ;; If non-nil the frame is fullscreen when Emacs starts up. (default nil)
  302. ;; (Emacs 24.4+ only)
  303. dotspacemacs-fullscreen-at-startup nil
  304.  
  305. ;; If non-nil `spacemacs/toggle-fullscreen' will not use native fullscreen.
  306. ;; Use to disable fullscreen animations in OSX. (default nil)
  307. dotspacemacs-fullscreen-use-non-native nil
  308.  
  309. ;; If non-nil the frame is maximized when Emacs starts up.
  310. ;; Takes effect only if `dotspacemacs-fullscreen-at-startup' is nil.
  311. ;; (default nil) (Emacs 24.4+ only)
  312. dotspacemacs-maximized-at-startup nil
  313.  
  314. ;; If non-nil the frame is undecorated when Emacs starts up. Combine this
  315. ;; variable with `dotspacemacs-maximized-at-startup' in OSX to obtain
  316. ;; borderless fullscreen. (default nil)
  317. dotspacemacs-undecorated-at-startup t
  318.  
  319. ;; A value from the range (0..100), in increasing opacity, which describes
  320. ;; the transparency level of a frame when it's active or selected.
  321. ;; Transparency can be toggled through `toggle-transparency'. (default 90)
  322. dotspacemacs-active-transparency 90
  323.  
  324. ;; A value from the range (0..100), in increasing opacity, which describes
  325. ;; the transparency level of a frame when it's inactive or deselected.
  326. ;; Transparency can be toggled through `toggle-transparency'. (default 90)
  327. dotspacemacs-inactive-transparency 90
  328.  
  329. ;; If non-nil show the titles of transient states. (default t)
  330. dotspacemacs-show-transient-state-title t
  331.  
  332. ;; If non-nil show the color guide hint for transient state keys. (default t)
  333. dotspacemacs-show-transient-state-color-guide t
  334.  
  335. ;; If non-nil unicode symbols are displayed in the mode line.
  336. ;; If you use Emacs as a daemon and wants unicode characters only in GUI set
  337. ;; the value to quoted `display-graphic-p'. (default t)
  338. dotspacemacs-mode-line-unicode-symbols t
  339.  
  340. ;; If non-nil smooth scrolling (native-scrolling) is enabled. Smooth
  341. ;; scrolling overrides the default behavior of Emacs which recenters point
  342. ;; when it reaches the top or bottom of the screen. (default t)
  343. dotspacemacs-smooth-scrolling t
  344.  
  345. ;; Show the scroll bar while scrolling. The auto hide time can be configured
  346. ;; by setting this variable to a number. (default t)
  347. dotspacemacs-scroll-bar-while-scrolling nil
  348.  
  349. ;; Control line numbers activation.
  350. ;; If set to `t', `relative' or `visual' then line numbers are enabled in all
  351. ;; `prog-mode' and `text-mode' derivatives. If set to `relative', line
  352. ;; numbers are relative. If set to `visual', line numbers are also relative,
  353. ;; but lines are only visual lines are counted. For example, folded lines
  354. ;; will not be counted and wrapped lines are counted as multiple lines.
  355. ;; This variable can also be set to a property list for finer control:
  356. ;; '(:relative nil
  357. ;; :visual nil
  358. ;; :disabled-for-modes dired-mode
  359. ;; doc-view-mode
  360. ;; markdown-mode
  361. ;; org-mode
  362. ;; pdf-view-mode
  363. ;; text-mode
  364. ;; :size-limit-kb 1000)
  365. ;; When used in a plist, `visual' takes precedence over `relative'.
  366. ;; (default nil)
  367. dotspacemacs-line-numbers 'relative
  368.  
  369. ;; Code folding method. Possible values are `evil', `origami' and `vimish'.
  370. ;; (default 'evil)
  371. dotspacemacs-folding-method 'evil
  372.  
  373. ;; If non-nil and `dotspacemacs-activate-smartparens-mode' is also non-nil,
  374. ;; `smartparens-strict-mode' will be enabled in programming modes.
  375. ;; (default nil)
  376. dotspacemacs-smartparens-strict-mode nil
  377.  
  378. ;; If non-nil smartparens-mode will be enabled in programming modes.
  379. ;; (default t)
  380. dotspacemacs-activate-smartparens-mode t
  381.  
  382. ;; If non-nil pressing the closing parenthesis `)' key in insert mode passes
  383. ;; over any automatically added closing parenthesis, bracket, quote, etc...
  384. ;; This can be temporary disabled by pressing `C-q' before `)'. (default nil)
  385. dotspacemacs-smart-closing-parenthesis nil
  386.  
  387. ;; Select a scope to highlight delimiters. Possible values are `any',
  388. ;; `current', `all' or `nil'. Default is `all' (highlight any scope and
  389. ;; emphasis the current one). (default 'all)
  390. dotspacemacs-highlight-delimiters 'all
  391.  
  392. ;; If non-nil, start an Emacs server if one is not already running.
  393. ;; (default nil)
  394. dotspacemacs-enable-server nil
  395.  
  396. ;; Set the emacs server socket location.
  397. ;; If nil, uses whatever the Emacs default is, otherwise a directory path
  398. ;; like \"~/.emacs.d/server\". It has no effect if
  399. ;; `dotspacemacs-enable-server' is nil.
  400. ;; (default nil)
  401. dotspacemacs-server-socket-dir nil
  402.  
  403. ;; If non-nil, advise quit functions to keep server open when quitting.
  404. ;; (default nil)
  405. dotspacemacs-persistent-server nil
  406.  
  407. ;; List of search tool executable names. Spacemacs uses the first installed
  408. ;; tool of the list. Supported tools are `rg', `ag', `pt', `ack' and `grep'.
  409. ;; (default '("rg" "ag" "pt" "ack" "grep"))
  410. dotspacemacs-search-tools '("rg" "ag" "pt" "ack" "grep")
  411.  
  412. ;; Format specification for setting the frame title.
  413. ;; %a - the `abbreviated-file-name', or `buffer-name'
  414. ;; %t - `projectile-project-name'
  415. ;; %I - `invocation-name'
  416. ;; %S - `system-name'
  417. ;; %U - contents of $USER
  418. ;; %b - buffer name
  419. ;; %f - visited file name
  420. ;; %F - frame name
  421. ;; %s - process status
  422. ;; %p - percent of buffer above top of window, or Top, Bot or All
  423. ;; %P - percent of buffer above bottom of window, perhaps plus Top, or Bot or All
  424. ;; %m - mode name
  425. ;; %n - Narrow if appropriate
  426. ;; %z - mnemonics of buffer, terminal, and keyboard coding systems
  427. ;; %Z - like %z, but including the end-of-line format
  428. ;; If nil then Spacemacs uses default `frame-title-format' to avoid
  429. ;; performance issues, instead of calculating the frame title by
  430. ;; `spacemacs/title-prepare' all the time.
  431. ;; (default "%I@%S")
  432. dotspacemacs-frame-title-format "%I@%S"
  433.  
  434. ;; Format specification for setting the icon title format
  435. ;; (default nil - same as frame-title-format)
  436. dotspacemacs-icon-title-format nil
  437.  
  438. ;; Show trailing whitespace (default t)
  439. dotspacemacs-show-trailing-whitespace t
  440.  
  441. ;; Delete whitespace while saving buffer. Possible values are `all'
  442. ;; to aggressively delete empty line and long sequences of whitespace,
  443. ;; `trailing' to delete only the whitespace at end of lines, `changed' to
  444. ;; delete only whitespace for changed lines or `nil' to disable cleanup.
  445. ;; (default nil)
  446. dotspacemacs-whitespace-cleanup 'trailing
  447.  
  448. ;; If non nil activate `clean-aindent-mode' which tries to correct
  449. ;; virtual indentation of simple modes. This can interfer with mode specific
  450. ;; indent handling like has been reported for `go-mode'.
  451. ;; If it does deactivate it here.
  452. ;; (default t)
  453. dotspacemacs-use-clean-aindent-mode t
  454.  
  455. ;; Accept SPC as y for prompts if non nil. (default nil)
  456. dotspacemacs-use-SPC-as-y nil
  457.  
  458. ;; If non-nil shift your number row to match the entered keyboard layout
  459. ;; (only in insert state). Currently supported keyboard layouts are:
  460. ;; `qwerty-us', `qwertz-de' and `querty-ca-fr'.
  461. ;; New layouts can be added in `spacemacs-editing' layer.
  462. ;; (default nil)
  463. dotspacemacs-swap-number-row nil
  464.  
  465. ;; Either nil or a number of seconds. If non-nil zone out after the specified
  466. ;; number of seconds. (default nil)
  467. dotspacemacs-zone-out-when-idle nil
  468.  
  469. ;; Run `spacemacs/prettify-org-buffer' when
  470. ;; visiting README.org files of Spacemacs.
  471. ;; (default nil)
  472. dotspacemacs-pretty-docs nil
  473.  
  474. ;; If nil the home buffer shows the full path of agenda items
  475. ;; and todos. If non nil only the file name is shown.
  476. dotspacemacs-home-shorten-agenda-source nil
  477.  
  478. ;; If non-nil then byte-compile some of Spacemacs files.
  479. dotspacemacs-byte-compile t))
  480.  
  481. (defun dotspacemacs/user-env ()
  482. "Environment variables setup.
  483. This function defines the environment variables for your Emacs session. By
  484. default it calls `spacemacs/load-spacemacs-env' which loads the environment
  485. variables declared in `~/.spacemacs.env' or `~/.spacemacs.d/.spacemacs.env'.
  486. See the header of this file for more information."
  487. (spacemacs/load-spacemacs-env))
  488.  
  489. (defun dotspacemacs/user-init ()
  490. "Initialization for user code:
  491. This function is called immediately after `dotspacemacs/init', before layer
  492. configuration.
  493. It is mostly for variables that should be set before packages are loaded.
  494. If you are unsure, try setting them in `dotspacemacs/user-config' first."
  495. (setq c-default-style "bsd")
  496. (setq c-basic-offset 2)
  497. (setq tab-width 2)
  498. (setq mouse-yank-at-point t)
  499. ;; (setq spacemacs-useless-buffers-regexp '("^\\*.*\\*$"))
  500. (setq powerline-default-separator 'arrow)
  501.  
  502. (setq sqlfmt-options '("-u"))
  503.  
  504. (setq lisp-indent-offset 2)
  505.  
  506. ;; Reopen files after restart
  507. (setq custom-file "~/.emacs.d/.cache/.custom-settings")
  508. (load custom-file))
  509.  
  510.  
  511. (defun dotspacemacs/user-load ()
  512. "Library to load while dumping.
  513. This function is called only while dumping Spacemacs configuration. You can
  514. `require' or `load' the libraries of your choice that will be included in the
  515. dump.")
  516.  
  517.  
  518. (defun dotspacemacs/user-config ()
  519. "Configuration for user code:
  520. This function is called at the very end of Spacemacs startup, after layer
  521. configuration.
  522. Put your configuration code here, except for variables that should be set
  523. before packages are loaded."
  524.  
  525. ;; Setting scroll-margin in user-init does not work.
  526. (setq scroll-margin 10)
  527.  
  528. ;; Key binding to select the current function in C++
  529. (evil-define-key 'normal c++-mode-map (kbd ", v f") 'mark-defun)
  530.  
  531. (require 'eshell-autojump)
  532.  
  533. (defun fetch-newest-file-in-directory (path)
  534. (let ((e (f-entries path)))
  535. (car (sort e (lambda (a b)
  536. (not (time-less-p (aj-mtime a)
  537. (aj-mtime b))))))))
  538. (defun aj-mtime (f) (let ((attrs (file-attributes f))) (nth 5 attrs)))
  539. (defun insert-newest-file-in-current-directory () (interactive) (insert (shell-quote-argument (fetch-newest-file-in-directory (eshell/pwd)))))
  540. (add-hook 'eshell-mode-hook
  541. (lambda()
  542. (setq-local scroll-margin 0)
  543. (evil-define-key 'insert eshell-mode-map (kbd "C-x m") 'insert-newest-file-in-current-directory)))
  544.  
  545. ;; Put my IRC text across the entire width of the window
  546. (add-hook 'window-configuration-change-hook
  547. '(lambda ()
  548. (setq erc-fill-column (- (window-width) 2))))
  549.  
  550. (display-time-mode 1)
  551.  
  552. ;; Underlining the current line annoys me.
  553. (spacemacs/toggle-highlight-current-line-globally-off)
  554. (spacemacs/toggle-semantic-stickyfunc-globally-off))
  555.  
RAW Paste Data