Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- ;; main init.el
- (setq emacs-config-basedir (file-name-directory user-init-file))
- (message "user-init-file: %s" user-init-file)
- (message "emacs-config-basedir: %s" emacs-config-basedir)
- (setq emacs-conf-dir (expand-file-name "emacs-config-01" emacs-config-basedir))
- (add-to-list 'load-path emacs-conf-dir)
- ;; (require 'keybindings)
- (message "user-login-name: %s" user-login-name)
- ;; melpa configuration - need to decide who this should be organized
- (require 'package)
- (let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
- (not (gnutls-available-p))))
- (url (concat (if no-ssl "http" "https") "://melpa.org/packages/")))
- (add-to-list 'package-archives (cons "melpa" url) t))
- (when (< emacs-major-version 24)
- ;; For important compatibility libraries like cl-lib
- (add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/")))
- (package-initialize)
- ;; helm - copied from installation notes, it will eventually change
- (message "required helm-config")
- ;; initial configuration from https://tuhdo.github.io/helm-intro.html
- (require 'helm)
- (require 'helm-config)
- ;; The default "C-x c" is quite close to "C-x C-c", which quits Emacs.
- ;; Changed to "C-c h". Note: We must set "C-c h" globally, because we
- ;; cannot change `helm-command-prefix-key' once `helm-config' is loaded.
- (global-set-key (kbd "C-c h") 'helm-command-prefix)
- (global-unset-key (kbd "C-x c"))
- (when (executable-find "curl")
- (setq helm-google-suggest-use-curl-p t))
- (setq helm-split-window-in-side-p t ; open helm buffer inside current window, not occupy whole other window
- helm-move-to-line-cycle-in-source t ; move to end or beginning of source when reaching top or bottom of source.
- helm-ff-search-library-in-sexp t ; search for library in `require' and `declare-function' sexp.
- helm-scroll-amount 8 ; scroll 8 lines other window using M-<next>/M-<prior>
- helm-ff-file-name-history-use-recentf t
- helm-echo-input-in-header-line t)
- (defun spacemacs//helm-hide-minibuffer-maybe ()
- "Hide minibuffer in Helm session if we use the header line as input field."
- (when (with-helm-buffer helm-echo-input-in-header-line)
- (let ((ov (make-overlay (point-min) (point-max) nil nil t)))
- (overlay-put ov 'window (selected-window))
- (overlay-put ov 'face
- (let ((bg-color (face-background 'default nil)))
- `(:background ,bg-color :foreground ,bg-color)))
- (setq-local cursor-type nil))))
- (add-hook 'helm-minibuffer-set-up-hook
- 'spacemacs//helm-hide-minibuffer-maybe)
- (setq helm-autoresize-max-height 0)
- (setq helm-autoresize-min-height 20)
- (helm-autoresize-mode 1)
- (helm-mode 1)
- (require 'helm-descbinds)
- (helm-descbinds-mode)
- ;; helm related key bindings - may have to be entered in a different section or block
- (global-set-key (kbd "C-x C-f") 'helm-find-files)
- ;; Enable projectile - based on https://tuhdo.github.io/helm-projectile.html
- (projectile-global-mode)
- (setq projectile-completion-system 'helm)
- (helm-projectile-on)
- ; enter fixes for addition of files from previous session to show up in C-x C-f
- (require 'recentf)
- (recentf-mode 1)
- (setq recentf-max-saved-items 50)
- (setq recentf-max-menu-items 20)
- (setq-default recent-save-file "~/.emacs.d/recentf")
- (run-at-time (current-time) 300 'recentf-save-list)
- ;; helm related keys
- (define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) ; rebind tab to run persistent action
- (define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) ; make TAB work in terminal
- (define-key helm-map (kbd "C-z") 'helm-select-action) ; list actions using C-z
- ;; evil-mode configuration
- ; (add-to-list 'load-path "~/.emacs.d/evil")
- (require 'evil)
- (evil-mode 1)
- ; enable evil-org
- (require 'evil-org)
- (add-hook 'org-mode-hook 'evil-org-mode)
- (evil-org-set-key-theme '(navigation insert textobjects additional))
- ; use line below to add all themes
- ; (evil-org-set-key-theme '(textobjects insert navigation additional shift todo heading))
- ;; which key configuration
- ; adding to load path is probably unnecessary as install from melpa
- (require 'which-key)
- (which-key-mode)
- ;;
- (add-to-list 'load-path "~/.emacs.d/rca_config/")
- (load "keybindings")
- (load "rca_misc_functions")
- (rca-key-bindings)
- (setq custom-file "~/.emacs.d/custom.el")
- (if
- (file-exists-p custom-file)
- (load custom-file)
- )
- ;; add show-paren-mode for parenthesis to be highlighted
- ;; smartparens will come later
- (show-paren-mode 1)
- ;; fontify source code blocks in org
- ; may be disabled at runtime until export syntax-highlighting is fixed
- (setq org-src-fontify-natively t)
- (require 'use-package)
- (use-package command-log-mode
- :ensure t
- :config
- (global-command-log-mode)
- )
- ;; keybindings
- (defun rca-key-bindings()
- ;; Fix SHIFT + arrow keys inside screen/tmux
- (define-key input-decode-map "\e[1;2A" [S-up])
- (define-key input-decode-map "\e[1;2B" [S-down])
- (define-key input-decode-map "\e[1;2C" [S-right])
- (define-key input-decode-map "\e[1;2D" [S-left])
- ;; Fix ALT + arrow keys inside screen/tmux
- (define-key input-decode-map "\e[1;3A" [M-up])
- (define-key input-decode-map "\e[1;3B" [M-down])
- (define-key input-decode-map "\e[1;3C" [M-right])
- (define-key input-decode-map "\e[1;3D" [M-left])
- ;; Fix CTRL + arrow keys inside screen/tmux
- (define-key input-decode-map "\e[1;5A" [C-up])
- (define-key input-decode-map "\e[1;5B" [C-down])
- (define-key input-decode-map "\e[1;5C" [C-right])
- (define-key input-decode-map "\e[1;5D" [C-left])
- )
- (provide 'rca-key-bindings)
- ;; rca_misc_functions
- ;; indent whole buffer from - http://emacsblog.org/2007/01/17/indent-whole-buffer/
- (defun rca-iwb ()
- "indent whole buffer"
- (interactive)
- (delete-trailing-whitespace)
- (indent-region (point-min) (point-max) nil)
- (untabify (point-min) (point-max)))
RAW Paste Data


