Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (custom-set-variables
- ;; custom-set-variables 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.
- '(ansi-color-names-vector
- ["#2e3436" "#a40000" "#4e9a06" "#c4a000" "#204a87" "#5c3566" "#729fcf" "#eeeeec"])
- '(custom-enabled-themes (quote (tsdh-dark)))
- '(custom-safe-themes
- (quote
- ("4e753673a37c71b07e3026be75dc6af3efbac5ce335f3707b7d6a110ecb636a3" default)))
- '(org-agenda-files
- (quote
- ("c:/Users/nd04805/Documents/99_EMACS/work/list.org"
- "c:/Users/nd04805/Documents/99_EMACS/work/temp.org"
- "c:/Users/nd04805/Documents/99_EMACS/work/t2.org"
- "c:/Users/nd04805/Documents/99_EMACS/work/t1.org"
- "c:/Users/nd04805/AppData/Roaming/org/gtd.org"))))
- ;; Adding MELPA packages to the Emacs
- (when (>= emacs-major-version 24)
- (require 'package)
- (add-to-list
- 'package-archives
- '("melpa" . "http://melpa.org/packages/")
- t)
- (require 'package)
- (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
- (package-initialize))
- ;; Start Emacs window maximized
- (add-to-list 'default-frame-alist '(fullscreen . maximized))
- ;;Enabling Ido mode to do things interactively
- (require 'ido)
- (ido-mode t)
- (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.
- )
- ;; This is for org-mode agenda view activation
- (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
- ;; This is for key bindings to invoke agenda mode (see line-2)
- (global-set-key "\C-cl" 'org-store-link)
- (global-set-key "\C-ca" 'org-agenda)
- (global-set-key "\C-cc" 'org-capture)
- (global-set-key "\C-cb" 'org-iswitchb)
- (add-to-list 'load-path "C:\\Users\\nd04805\\Documents\\99_EMACS\\work\\PPT")
- (require 'ox-reveal)
- (setq org-reveal-root "file:///C:\\Users\\nd04805\\Documents\\99_EMACS\\work\\PPT\\reveal.js")
- ;; This will silence the annoying audio bell
- (setq visible-bell t)
- ;; Uncomment the code below just in case if you want to do away with the visible flash as well
- ;;(setq ring-bell-function 'ignore)
- ;; Remove the emphasis signs like * for BOLD and / for Italics etc
- (setq org-hide-emphasis-markers nil)
- ;; Display the org clock sum in terms of hours and not in units of days
- (setq org-time-clocksum-format (quote (:hours "%d" :require-hours t :minutes ":%02d" :require-minutes t)))
- ;; Change font and font size
- ;; (set-frame-font "Consolas 12" t)
- (add-to-list 'default-frame-alist
- '(font . "Consolas 14"))
- ;; '(font . "Inconsolata 14"))
- ;; switch to buffer list along with focus (no need to press C-x o after C-x C-b)
- (global-set-key (kbd "C-x C-b") 'ibuffer)
- (setq make-backup-files nil) ; stop creating backup~ files
- (setq auto-save-default nil) ; stop creating #autosave# files
- ;; Swiper for search
- (global-set-key "\C-s" 'swiper)
- ;; Browse kill ring
- (global-set-key "\C-cy" '(lambda ()
- (interactive)
- (popup-menu 'yank-menu)))
- ;; Kill the current buffer - rather than providing a list of buffer options to kill
- ;; Review the below code. In the buffers list (iBuffer) - unable to mark several buffers
- ;; After marking the first buffer - Emacs prompts for confirmation - Update from reddit
- ;; (global-set-key "\C-xk" 'kill-this-buffer)
- ;; Typing of Emacs - a game to improve typing speed
- (add-to-list 'load-path "C:\\Users\\nd04805\\AppData\\Roaming\\.emacs.d")
- (autoload 'typing-of-emacs "typing" "The Typing Of Emacs, a game." t)
- (put 'upcase-region 'disabled nil)
- (put 'downcase-region 'disabled nil)
- ;; Keep a recent list of opened files in emacs
- (require 'recentf)
- (setq recentf-max-saved-items 200
- recentf-max-menu-items 15)
- (recentf-mode +1)
- ;;
- ;; Use ido mode to display the list of recent files
- (defun recentf-ido-find-file ()
- "Find a recent file using ido."
- (interactive)
- (let ((file (ido-completing-read "Choose recent file: " recentf-list nil t)))
- (when file
- (find-file file))))
- ;; Keybinding for the recent-ido-find-file function
- (global-set-key (kbd "C-c f") 'recentf-ido-find-file)
- ;; Making org-mode not open the MS office files as ZIP archives
- (setq org-file-apps
- '(("\\.docx\\'" . default)
- ("\\.xlsx\\'" . default)
- ("\\.pptx\\'" . default)
- (auto-mode . emacs)))
- ;; Tabbar ruler - enables tabbar
- (setq tabbar-ruler-global-tabbar t) ; If you want tabbar
- (setq tabbar-ruler-global-ruler t) ; if you want a global ruler
- ;; (setq tabbar-ruler-popup-menu t) ; If you want a popup menu.
- ;; (setq tabbar-ruler-popup-toolbar t) ; If you want a popup toolbar
- ;; (setq tabbar-ruler-popup-scrollbar t) ; If you want to only show the
- ; scroll bar when your mouse is moving.
- (require 'tabbar-ruler)
- ;; Enable markdown mode when exporting
- (require 'ox-md)
- ;; location to capture templates and org-capture key definition
- (setq org-default-notes-file (concat org-directory "/notes.org"))
- (define-key global-map "\C-cc" 'org-capture)
- ;; Template configuration for ToDo list and Journal
- (setq org-capture-templates
- '(("t" "Todo" entry (file+headline "~/org/gtd.org" "Tasks")
- "* TODO %?\n %i\n %a")
- ("j" "Journal" entry (file+datetree "~/org/journal.org")
- "* %?\nEntered on %U\n %i\n %a")))
- ;; Enable hydra
- (require 'hydra)
- ;; Hydra window moving
- (global-set-key (kbd "C-M-o")
- (defhydra hydra-window ()
- "
- Movement^^ ^Split^ ^Switch^ ^Resize^
- ----------------------------------------------------------------
- _h_ ← _v_ertical _b_uffer _q_ X←
- _j_ ↓ _x_ horizontal _f_ind files _w_ X↓
- _k_ ↑ _z_ undo _a_ce 1 _e_ X↑
- _l_ → _Z_ reset _s_wap _r_ X→
- _F_ollow _D_lt Other _S_ave max_i_mize
- _SPC_ cancel _o_nly this _d_elete
- "
- ("h" windmove-left )
- ("j" windmove-down )
- ("k" windmove-up )
- ("l" windmove-right )
- ("q" hydra-move-splitter-left)
- ("w" hydra-move-splitter-down)
- ("e" hydra-move-splitter-up)
- ("r" hydra-move-splitter-right)
- ("b" helm-mini)
- ("f" helm-find-files)
- ("F" follow-mode)
- ("a" (lambda ()
- (interactive)
- (ace-window 1)
- (add-hook 'ace-window-end-once-hook
- 'hydra-window/body))
- )
- ("v" (lambda ()
- (interactive)
- (split-window-right)
- (windmove-right))
- )
- ("x" (lambda ()
- (interactive)
- (split-window-below)
- (windmove-down))
- )
- ("s" (lambda ()
- (interactive)
- (ace-window 4)
- (add-hook 'ace-window-end-once-hook
- 'hydra-window/body)))
- ("S" save-buffer)
- ("d" delete-window)
- ("D" (lambda ()
- (interactive)
- (ace-window 16)
- (add-hook 'ace-window-end-once-hook
- 'hydra-window/body))
- )
- ("o" delete-other-windows)
- ("i" ace-maximize-window)
- ("z" (progn
- (winner-undo)
- (setq this-command 'winner-undo))
- )
- ("Z" winner-redo)
- ("SPC" nil)
- ))
- ;;* Helpers
- (require 'windmove)
- (defun hydra-move-splitter-left (arg)
- "Move window splitter left."
- (interactive "p")
- (if (let ((windmove-wrap-around))
- (windmove-find-other-window 'right))
- (shrink-window-horizontally arg)
- (enlarge-window-horizontally arg)))
- (defun hydra-move-splitter-right (arg)
- "Move window splitter right."
- (interactive "p")
- (if (let ((windmove-wrap-around))
- (windmove-find-other-window 'right))
- (enlarge-window-horizontally arg)
- (shrink-window-horizontally arg)))
- (defun hydra-move-splitter-up (arg)
- "Move window splitter up."
- (interactive "p")
- (if (let ((windmove-wrap-around))
- (windmove-find-other-window 'up))
- (enlarge-window arg)
- (shrink-window arg)))
- (defun hydra-move-splitter-down (arg)
- "Move window splitter down."
- (interactive "p")
- (if (let ((windmove-wrap-around))
- (windmove-find-other-window 'up))
- (shrink-window arg)
- (enlarge-window arg)))
- ;; Helm package
- (require 'helm-config)
- (put 'dired-find-alternate-file 'disabled nil)
- ;; Enable org speed keys
- (setq org-use-speed-commands t)
- ;; Force for 4 space tabs over 8 space tabs
- (setq-default indent-tabs-mode nil)
- (setq-default tab-width 4)
- (setq indent-line-function 'insert-tab)
- ;; The following line was added by Emacs itself
- ;; when I tried to use the narrowing function
- (put 'narrow-to-region 'disabled nil)
- ;; Setting to support UTF-8 character support in files
- (set-language-environment "UTF-8")
- (set-default-coding-systems 'utf-8)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement