|
|
|
(require 'package)
|
|
|
|
|
|
|
|
(add-to-list 'package-archives '("elpa" . "http://tromey.com/elpa/") t)
|
|
|
|
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/") t)
|
|
|
|
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/") t)
|
|
|
|
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
|
|
|
|
(package-initialize)
|
|
|
|
|
|
|
|
;; emacs preferences
|
|
|
|
(setq-default cursor-type 'bar)
|
|
|
|
(global-hl-line-mode 1)
|
|
|
|
(menu-bar-mode -1)
|
|
|
|
(toggle-scroll-bar -1)
|
|
|
|
(tool-bar-mode -1)
|
|
|
|
(setq interprogram-cut-function nil)
|
|
|
|
(setq backup-directory-alist '(("" . "~/.emacs.d/backup")))
|
|
|
|
|
|
|
|
(eval-when-compile
|
|
|
|
(require 'use-package))
|
|
|
|
|
|
|
|
(setq package-check-signature nil)
|
|
|
|
(defun ensure-package-installed (&rest packages)
|
|
|
|
"Assure every package is installed, ask for installation if it’s not.
|
|
|
|
|
|
|
|
Return a list of installed packages or nil for every skipped package."
|
|
|
|
(mapcar
|
|
|
|
(lambda (package)
|
|
|
|
;; (package-installed-p 'evil)
|
|
|
|
(if (package-installed-p package)
|
|
|
|
nil
|
|
|
|
(if (y-or-n-p (format "Package %s is missing. Install it? " package))
|
|
|
|
(package-install package)
|
|
|
|
package)))
|
|
|
|
packages))
|
|
|
|
|
|
|
|
;; make sure to have downloaded archive description.
|
|
|
|
;; Or use package-archive-contents as suggested by Nicolas Dudebout
|
|
|
|
(or (file-exists-p package-user-dir)
|
|
|
|
(package-refresh-contents))
|
|
|
|
|
|
|
|
(ensure-package-installed 'use-package 'smex 'magit 'centaur-tabs 'eglot 'telephone-line 'dashboard 'multiple-cursors 'flycheck 'which-key 'restart-emacs 'doom-themes 'rainbow-delimiters 'neotree 'all-the-icons)
|
|
|
|
(package-initialize)
|
|
|
|
|
|
|
|
(use-package company)
|
|
|
|
(add-hook 'after-init-hook 'global-company-mode)
|
|
|
|
|
|
|
|
(use-package eglot :ensure t)
|
|
|
|
(add-hook 'c++-mode-hook 'eglot-ensure)
|
|
|
|
(add-hook 'c-mode-hook 'eglot-ensure)
|
|
|
|
|
|
|
|
(use-package centaur-tabs :init
|
|
|
|
(setq centaur-tabs-enable-key-bindings t
|
|
|
|
centaur-tabs-set-icons t
|
|
|
|
centaur-tabs-set-modified-marker t
|
|
|
|
centaur-tabs-style "chamfer"))
|
|
|
|
(centaur-tabs-headline-match)
|
|
|
|
(centaur-tabs-mode 1)
|
|
|
|
|
|
|
|
(add-hook 'after-init-hook #'global-flycheck-mode)
|
|
|
|
(add-hook 'prog-mode-hook #'rainbow-delimiters-mode)
|
|
|
|
|
|
|
|
(global-set-key (kbd "M-x") 'smex)
|
|
|
|
(global-set-key (kbd "M-X") 'smex-major-mode-commands)
|
|
|
|
|
|
|
|
(require 'telephone-line)
|
|
|
|
(telephone-line-mode 1)
|
|
|
|
(when (fboundp 'windmove-default-keybindings)
|
|
|
|
(windmove-default-keybindings))
|
|
|
|
|
|
|
|
(require 'which-key)
|
|
|
|
(which-key-mode)
|
|
|
|
|
|
|
|
(use-package dashboard
|
|
|
|
:ensure t
|
|
|
|
:config (dashboard-setup-startup-hook)
|
|
|
|
(setq dashboard-set-footer nil
|
|
|
|
dashboard-org-agenda-categories '("Tasks" "appointments")))
|
|
|
|
|
|
|
|
(require 'multiple-cursors)
|
|
|
|
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
|
|
|
|
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
|
|
|
|
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
|
|
|
|
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
|
|
|
|
|
|
|
|
(require 'neotree)
|
|
|
|
(global-set-key [f8] 'neotree-toggle)
|
|
|
|
|
|
|
|
;; org settings
|
|
|
|
(setq org-replace-disputed-keys t)
|
|
|
|
(define-key global-map "\C-cl" 'org-store-link)
|
|
|
|
(define-key global-map "\C-ca" 'org-agenda)
|
|
|
|
(setq org-log-done t)
|
|
|
|
|
|
|
|
(setq org-agenda-files (list "/home/local/ASUAD/rhnatysh/Seafile/Emacs/Org Notes/Notes.org"
|
|
|
|
"/home/local/ASUAD/rhnatysh/Seafile/Emacs/Org Notes/school.org"))
|
|
|
|
|
|
|
|
(add-hook 'diary-list-entries-hook 'diary-sort-entries t)
|
|
|
|
|
|
|
|
(setq custom-file (concat user-emacs-directory "custom.el"))
|
|
|
|
(load custom-file 'noerror)
|
|
|
|
|
|
|
|
(cond ((file-exists-p "~/.emacs_home.el") (load "~/.emacs_home.el")))
|
|
|
|
|
|
|
|
;;; .emacs ends here
|