Last active
January 20, 2024 00:59
-
-
Save amirrajan/b6952aa9671c397cdf8931288487a5c3 to your computer and use it in GitHub Desktop.
Emacs step by step
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; This buffer is for text that is not saved, and for Lisp evaluation. | |
;; To create a file, visit it with C-x C-f and enter text in its buffer. | |
;; This is a import that ships with emacs. | |
;; package is Emacs's package manager. | |
(require 'package) | |
;; Emacs has an official repository of packages and a more current | |
;; unofficial one. Melpa is the 'unoffical one' (which in this | |
;; case translates to more up to date, newer, and by extension, | |
;; a bit more volatile). The official repo is called org. This | |
;; repo is slow changing and extremely stable (but doesn't have | |
;; all the cool/cutting edge packages that are being used). | |
(push '("melpa" . "http://melpa.org/packages/") package-archives) | |
(push '("org" . "http://orgmode.org/elpa/") package-archives) | |
(push '("melpa-stable" . "https://stable.melpa.org/packages/") package-archives) | |
;; After the repositories have been set, initialize the package | |
;; manager. | |
(package-initialize) | |
(unless package-archive-contents (package-refresh-contents)) | |
(unless (package-installed-p 'use-package) (package-install 'use-package)) | |
(use-package evil | |
:ensure t | |
:init | |
(setq evil-want-C-i-jump nil) | |
:config | |
(evil-mode 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; This buffer is for text that is not saved, and for Lisp evaluation. | |
;; To create a file, visit it with C-x C-f and enter text in its buffer. | |
;; This is a import that ships with emacs. | |
;; package is Emacs's package manager. | |
(require 'package) | |
;; Emacs has an official repository of packages and a more current | |
;; unofficial one. Melpa is the 'unoffical one' (which in this | |
;; case translates to more up to date, newer, and by extension, | |
;; a bit more volatile). The official repo is called org. This | |
;; repo is slow changing and extremely stable (but doesn't have | |
;; all the cool/cutting edge packages that are being used). | |
(push '("melpa" . "http://melpa.org/packages/") package-archives) | |
(push '("org" . "http://orgmode.org/elpa/") package-archives) | |
(push '("melpa-stable" . "https://stable.melpa.org/packages/") package-archives) | |
;; After the repositories have been set, initialize the package | |
;; manager. | |
(package-initialize) | |
(unless package-archive-contents (package-refresh-contents)) | |
(unless (package-installed-p 'use-package) (package-install 'use-package)) | |
(use-package evil | |
:ensure t | |
:init | |
(setq evil-want-C-i-jump nil) | |
:config | |
(evil-mode 1)) | |
(defun say-hello-world () | |
(interactive) | |
(insert "hello world")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; This buffer is for text that is not saved, and for Lisp evaluation. | |
;; To create a file, visit it with C-x C-f and enter text in its buffer. | |
;; This is a import that ships with emacs. | |
;; package is Emacs's package manager. | |
(require 'package) | |
;; Emacs has an official repository of packages and a more current | |
;; unofficial one. Melpa is the 'unoffical one' (which in this | |
;; case translates to more up to date, newer, and by extension, | |
;; a bit more volatile). The official repo is called org. This | |
;; repo is slow changing and extremely stable (but doesn't have | |
;; all the cool/cutting edge packages that are being used). | |
(push '("melpa" . "http://melpa.org/packages/") package-archives) | |
(push '("org" . "http://orgmode.org/elpa/") package-archives) | |
(push '("melpa-stable" . "https://stable.melpa.org/packages/") package-archives) | |
;; After the repositories have been set, initialize the package | |
;; manager. | |
(package-initialize) | |
(unless package-archive-contents (package-refresh-contents)) | |
(unless (package-installed-p 'use-package) (package-install 'use-package)) | |
(use-package evil | |
:ensure t | |
:init | |
(setq evil-want-C-i-jump nil) | |
:config | |
(evil-mode 1)) | |
(use-package osx-clipboard | |
:ensure t | |
:config | |
(osx-clipboard-mode 1)) | |
(use-package evil-leader | |
:ensure t | |
:config | |
(defun say-hello-world () | |
(interactive) | |
(evil-normal-state) | |
(evil-goto-line) | |
(evil-open-below 1) | |
(evil-normal-state) | |
(insert "hello world")) | |
(global-evil-leader-mode) | |
(evil-leader/set-leader ",") | |
(evil-leader/set-key | |
"h" 'say-hello-world)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment