Move emacs 27 to $XDG_CONFIG_HOME/emacs
This commit is contained in:
Symlink
+1
@@ -0,0 +1 @@
|
||||
config.org
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,42 @@
|
||||
;;; early-init.el --- -*- lexical-binding: t; -*-
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Emacs 27 introduces early-init.el, which is run before package and UI
|
||||
;; initialization happens.
|
||||
|
||||
;;; Code:
|
||||
|
||||
;; Defer the garbage collection during startup
|
||||
(setq gc-cons-threshold most-positive-fixnum)
|
||||
(add-hook 'emacs-startup-hook (lambda () (setq gc-cons-threshold 8000000)))
|
||||
|
||||
;; -------------------------------------
|
||||
|
||||
;; Base directory
|
||||
(setq user-emacs-directory (file-name-directory load-file-name))
|
||||
|
||||
;; -------------------------------------
|
||||
|
||||
;; Set package install location
|
||||
(setq package-user-dir (concat user-emacs-directory "elpa"))
|
||||
|
||||
;; Set package quickstart location
|
||||
(setq package-quickstart-file (concat
|
||||
(getenv "XDG_CACHE_HOME")
|
||||
"/emacs/package-quickstart.el"))
|
||||
|
||||
;; Precompute activation actions to speed up startup
|
||||
(setq package-quickstart t)
|
||||
|
||||
;; -------------------------------------
|
||||
|
||||
;; Disable frame bars before they're loaded in
|
||||
(push '(menu-bar-lines . 0) default-frame-alist)
|
||||
(push '(tool-bar-lines . 0) default-frame-alist)
|
||||
(push '(vertical-scroll-bars) default-frame-alist)
|
||||
|
||||
;; Do not resize the frame
|
||||
(setq frame-inhibit-implied-resize t)
|
||||
|
||||
;;; early-init.el ends here
|
||||
@@ -0,0 +1,26 @@
|
||||
;;; init.el --- -*- lexical-binding: t; -*-
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Setup package archives and build configuration file.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(require 'package)
|
||||
|
||||
;; Add the MELPA repository to the package manager
|
||||
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
|
||||
|
||||
;; Install the `use-package' dependency
|
||||
(unless (package-installed-p 'use-package)
|
||||
(package-refresh-contents)
|
||||
(package-install 'use-package))
|
||||
|
||||
;; -------------------------------------
|
||||
|
||||
;; Tangle and load configuration file
|
||||
(require 'org)
|
||||
(when (file-readable-p (concat user-emacs-directory "config.org"))
|
||||
(org-babel-load-file (concat user-emacs-directory "config.org")))
|
||||
|
||||
;;; init.el ends here
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: class
|
||||
# key: cls
|
||||
# --
|
||||
class ${1:Name} {
|
||||
public:
|
||||
${1:$(yas-c++-class-name yas-text)}();
|
||||
${2:virtual ~${1:$(yas-c++-class-name yas-text)}();}$0
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: constructor
|
||||
# key: ct
|
||||
# --
|
||||
${1:Name}::$1(${2:args}) ${3: : ${4:init}}
|
||||
{
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: define
|
||||
# key: d
|
||||
# --
|
||||
#define $0
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: destructor
|
||||
# key: dt
|
||||
# --
|
||||
${1:Name}::~$1()
|
||||
{
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: fun_declaration
|
||||
# key: f
|
||||
# --
|
||||
${1:type} ${2:name}(${3:args})${4: const};
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: fun_implementation
|
||||
# key: fim
|
||||
# --
|
||||
${1:type} ${2:name}(${3:args})${4: const}
|
||||
{
|
||||
$0
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: guard
|
||||
# key: grd
|
||||
# --
|
||||
#ifndef ${1:GUARD}_H
|
||||
#define ${1:$(yas-c++-class-name yas-text)}_H
|
||||
|
||||
$0
|
||||
|
||||
#endif // ${1:$(yas-c++-class-name yas-text)}_H
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: include
|
||||
# key: i
|
||||
# --
|
||||
#include $0
|
||||
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: namespace
|
||||
# key: ns
|
||||
# --
|
||||
namespace ${1:Namespace} {
|
||||
|
||||
$0
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: separator
|
||||
# key: spr
|
||||
# --
|
||||
// -----------------------------------------$0
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: mode
|
||||
# key: <mode
|
||||
# --
|
||||
# -*- mode: ${1:conf} -*-
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: begin
|
||||
# key: begin
|
||||
# --
|
||||
\begin{${1:environment}}
|
||||
$0
|
||||
\end{$1}
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: href
|
||||
# key: h
|
||||
# --
|
||||
\href{${1:src}}{${2:a}}$0
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: hyperref
|
||||
# key: hy
|
||||
# --
|
||||
\hyperref[sec:${1:name}]{${2:a}}$0
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: textit
|
||||
# key: i
|
||||
# --
|
||||
\textit{$1}$0
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: underline
|
||||
# key: u
|
||||
# --
|
||||
\underline{$1}$0
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: elisp-copy
|
||||
# key: <el
|
||||
# --
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
$0
|
||||
#+END_SRC
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: html
|
||||
# key: <html
|
||||
# --
|
||||
@@html:<${1:tag}>@@${2:content}@@html:</${1:$(yas-text)}>@@$0
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: source
|
||||
# key: <s
|
||||
# --
|
||||
#+BEGIN_SRC ${1:language}
|
||||
$0
|
||||
#+END_SRC
|
||||
Reference in New Issue
Block a user