Last active
May 27, 2021 07:39
-
-
Save tzach/d85446696b7accd75755bc7c6ea62c09 to your computer and use it in GitHub Desktop.
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
(custom-set-faces | |
;; custom-set-faces was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
) | |
(let ((default-directory "~/emacs/")) | |
(normal-top-level-add-subdirs-to-load-path)) | |
(require 'better-defaults) | |
(setq user-name "Tzach Livyatan" | |
user-mail-address "tzach.livyatan@gmail.com") | |
(require 'package) | |
(setq package-archives | |
'( | |
("org" . "https://orgmode.org/elpa/") | |
("gnu" . "https://elpa.gnu.org/packages/") | |
("melpa" . "https://melpa.org/packages/") | |
)) | |
;; initialize built-in package management | |
(package-initialize) | |
;; update packages list if we are on a new install | |
(unless package-archive-contents | |
(package-refresh-contents)) | |
;; My Packages | |
(setq my-package-list '(magit ido-vertical-mode slime ivy yaml-mode flycheck-grammarly)) | |
;undo-tree | |
;; websocket | |
;; programmatically install/ensure installed | |
;; pkgs in your personal list | |
(dolist (package my-package-list) | |
(unless (package-installed-p package) | |
(package-install package))) | |
(package-install 'use-package) | |
;; Backup | |
(setq backup-directory-alist '(("." . "~/.emacs.d/backups"))) | |
(setq delete-old-versions -1) | |
(setq version-control t) | |
(setq vc-make-backup-files t) | |
(setq auto-save-file-name-transforms '((".*" "~/.emacs.d/auto-save-list/" t))) | |
(put 'dired-find-alternate-file 'disabled nil) | |
(add-hook 'dired-mode-hook | |
(lambda () | |
(define-key dired-mode-map (kbd "^") | |
(lambda () (interactive) (find-alternate-file ".."))) | |
; was dired-up-directory | |
)) | |
(transient-mark-mode 1) | |
(setq auto-mode-alist (cons '("\\.json\\'" . js-mode) auto-mode-alist)) | |
(autoload 'markdown-mode "markdown-mode" | |
"Major mode for editing Markdown files" t) | |
(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode)) | |
(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode)) | |
(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) | |
(add-to-list 'auto-mode-alist '("\\.yaml\\'" . yaml-mode)) | |
(add-to-list 'auto-mode-alist '("\\.yml\\'" . yaml-mode)) | |
(add-to-list 'auto-mode-alist '("\\.clj\\'" . paredit-mode)) | |
(add-to-list 'auto-mode-alist '("\\.clj\\'" . clojure-mode)) | |
(add-to-list 'auto-mode-alist '("\\.toml\\'" . toml-mode)) | |
(auto-fill-mode nil) | |
(add-hook 'text-mode-hook 'turn-off-auto-fill) | |
;; overwrite selected text | |
(delete-selection-mode 1) | |
(setq select-enable-primary nil) | |
;; magit | |
(global-set-key (kbd "C-x g") 'magit-status) | |
;; ido | |
(setq ido-enable-flex-matching t) | |
(setq ido-everywhere t) | |
(ido-mode 1) | |
(setq ido-use-filename-at-point 'guess) | |
(setq ido-create-new-buffer 'prompt) | |
(defun my-insert-file-name (filename &optional args) | |
"Insert name of file FILENAME into buffer after point. | |
Prefixed with \\[universal-argument], expand the file name to | |
its fully canocalized path. See `expand-file-name'. | |
Prefixed with \\[negative-argument], use relative path to file | |
name from current directory, `default-directory'. See | |
`file-relative-name'. | |
The default with no prefix is to insert the file name exactly as | |
it appears in the minibuffer prompt. | |
from https://www.emacswiki.org/emacs/InsertFileName" | |
;; Based on insert-file in Emacs -- ashawley 20080926 | |
(interactive "*fInsert file name: \nP") | |
(cond ((eq '- args) | |
(insert (file-relative-name filename))) | |
((not (null args)) | |
(insert (expand-file-name filename))) | |
(t | |
(insert filename)))) | |
(global-set-key "\C-c\C-i" 'my-insert-file-name) | |
(put 'downcase-region 'disabled nil) | |
(setq auto-window-vscroll nil) | |
(defun go-to-column (column) | |
(interactive "nColumn: ") | |
(move-to-column column t)) | |
(global-set-key (kbd "M-g M-c") 'go-to-column) | |
(global-set-key (kbd "C-x g") 'magit-status) | |
(setq frame-title-format | |
'(buffer-file-name "%f" | |
(dired-directory dired-directory "%b"))) | |
(put 'upcase-region 'disabled nil) | |
;; http://pragmaticemacs.com/emacs/get-that-spacemacs-look-without-spacemacs/ | |
(use-package spacemacs-theme | |
:defer t | |
;; :ensure t | |
:init | |
(load-theme 'spacemacs-dark t) | |
(setq spacemacs-theme-org-agenda-height nil) | |
(setq spacemacs-theme-org-height nil) | |
(setq-default dotspacemacs-themes '(heroku))) | |
(require 'ido-vertical-mode) | |
(ido-mode 1) | |
(ido-vertical-mode 1) | |
(setq ido-vertical-define-keys 'C-n-and-C-p-only) | |
;; scroll one line at a time (less "jumpy" than defaults) | |
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;; one line at a time | |
(setq mouse-wheel-progressive-speed nil) ;; don't accelerate scrolling | |
(setq mouse-wheel-follow-mouse 't) ;; scroll window under mouse | |
(setq scroll-step 1) ;; keyboard scroll one line at a time | |
(setq org-agenda-files '("~/org/agenda.org")) | |
;; CL | |
(setq inferior-lisp-program "sbcl") | |
(setq inhibit-startup-screen t | |
initial-buffer-choice nil) | |
;(global-undo-tree-mode) | |
(require 'grammarly) | |
(require 'flycheck-grammarly) | |
(use-package flycheck | |
:config | |
(flycheck-add-mode 'grammarly 'rst-mode) | |
(global-flycheck-mode t)) | |
;;(add-hook 'rst-local-vars-hook | |
;; (lambda () | |
;; (when (flycheck-may-enable-checker 'grammerly) | |
;; (flycheck-select-checker 'grammerly)))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment