* Providing all init files, loading them with require
* Moved load-file-if-exists to init-functions
* Added init-misc.el for random things that don't fit anywhere else
* Never any tabs, ever. Go away!
Bindings:
* quit Emacs -> C-x r q ("real quit")
* delete-frame -> C-x C-c
* make-frame -> C-x C-n
			
			
This commit is contained in:
		
							parent
							
								
									43a99dea3a
								
							
						
					
					
						commit
						503600091e
					
				
					 7 changed files with 43 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -44,3 +44,14 @@
 | 
			
		|||
 | 
			
		||||
;; Replace standard goto-line with goto-line-with-feedback
 | 
			
		||||
(global-set-key (kbd "M-g g") 'goto-line-with-feedback)
 | 
			
		||||
 | 
			
		||||
;; Goodness from @magnars
 | 
			
		||||
;; I don't need to kill emacs that easily
 | 
			
		||||
;; the mnemonic is C-x REALLY QUIT
 | 
			
		||||
(global-set-key (kbd "C-x r q") 'save-buffers-kill-terminal)
 | 
			
		||||
(global-set-key (kbd "C-x C-c") 'delete-frame)
 | 
			
		||||
 | 
			
		||||
;; Create new frame
 | 
			
		||||
(define-key global-map (kbd "C-x C-n") 'make-frame-command)
 | 
			
		||||
 | 
			
		||||
(provide 'init-bindings)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -96,3 +96,5 @@
 | 
			
		|||
  (interactive)
 | 
			
		||||
  (let ((inhibit-read-only t))
 | 
			
		||||
    (erase-buffer)))
 | 
			
		||||
 | 
			
		||||
(provide 'init-eshell)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,6 +43,10 @@
 | 
			
		|||
    (unless (file-exists-p fullpath)
 | 
			
		||||
      (async-shell-command (concat "git clone " url " " fullpath)))))
 | 
			
		||||
 | 
			
		||||
(defun load-file-if-exists (filename)
 | 
			
		||||
  (if (file-exists-p filename)
 | 
			
		||||
      (load filename)))
 | 
			
		||||
 | 
			
		||||
;; These come from magnars, he's got some awesome things.
 | 
			
		||||
 | 
			
		||||
(defun goto-line-with-feedback ()
 | 
			
		||||
| 
						 | 
				
			
			@ -127,3 +131,5 @@ Including indent-buffer, which should not be called automatically on save."
 | 
			
		|||
(defun speak (m &optional voice)
 | 
			
		||||
  (shell-command (if 'voice (concat "say -v " voice " \"" m "\"")
 | 
			
		||||
                   (concat "say " m))))
 | 
			
		||||
 | 
			
		||||
(provide 'init-functions)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										9
									
								
								init-misc.el
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								init-misc.el
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,9 @@
 | 
			
		|||
;; For everything that doesn't fit anywhere else.
 | 
			
		||||
 | 
			
		||||
;; Ignore .DS_Store files with ido mode
 | 
			
		||||
(add-to-list 'ido-ignore-files "\\.DS_Store")
 | 
			
		||||
 | 
			
		||||
;; Use aspell for spell checking: brew install aspell --lang=en
 | 
			
		||||
(setq ispell-program-name "/usr/local/bin/aspell")
 | 
			
		||||
 | 
			
		||||
(provide 'init-misc)
 | 
			
		||||
| 
						 | 
				
			
			@ -57,3 +57,5 @@
 | 
			
		|||
 | 
			
		||||
;; Transparently open compressed files
 | 
			
		||||
(auto-compression-mode t)
 | 
			
		||||
 | 
			
		||||
(provide 'init-modes)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -45,6 +45,8 @@
 | 
			
		|||
(add-to-list 'safe-local-variable-values '(lexical-binding . t))
 | 
			
		||||
(add-to-list 'safe-local-variable-values '(whitespace-line-column . 80))
 | 
			
		||||
 | 
			
		||||
(set-default 'indent-tabs-mode nil)
 | 
			
		||||
 | 
			
		||||
;; ido-mode is like magic pixie dust!
 | 
			
		||||
(ido-mode t)
 | 
			
		||||
(ido-ubiquitous t)
 | 
			
		||||
| 
						 | 
				
			
			@ -229,3 +231,5 @@ comment as a filename."
 | 
			
		|||
(global-set-key (kbd "C-c g") 'magit-status)
 | 
			
		||||
 | 
			
		||||
(remove-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function)
 | 
			
		||||
 | 
			
		||||
(provide 'init-settings)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										20
									
								
								init.el
									
										
									
									
									
								
							
							
						
						
									
										20
									
								
								init.el
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -46,24 +46,22 @@
 | 
			
		|||
  (when (not (package-installed-p p))
 | 
			
		||||
    (package-install p)))
 | 
			
		||||
 | 
			
		||||
;; Are we on a mac?
 | 
			
		||||
(setq is-mac (equal system-type 'darwin))
 | 
			
		||||
 | 
			
		||||
(load "~/.emacs.d/init-functions.el")
 | 
			
		||||
(add-to-list 'load-path user-emacs-directory)
 | 
			
		||||
 | 
			
		||||
(mapc 'require '(init-functions
 | 
			
		||||
                 init-settings
 | 
			
		||||
                 init-modes
 | 
			
		||||
                 init-bindings
 | 
			
		||||
                 init-eshell))
 | 
			
		||||
 | 
			
		||||
(add-to-list 'load-path "~/.emacs.d/scripts/")
 | 
			
		||||
 | 
			
		||||
(setq custom-file "~/.emacs.d/init-custom.el")
 | 
			
		||||
(load custom-file)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
(load "~/.emacs.d/init-settings.el")
 | 
			
		||||
(load "~/.emacs.d/init-modes.el")
 | 
			
		||||
(load "~/.emacs.d/init-bindings.el")
 | 
			
		||||
(load "~/.emacs.d/init-eshell.el")
 | 
			
		||||
 | 
			
		||||
(defun load-file-if-exists (filename)
 | 
			
		||||
  (if (file-exists-p filename)
 | 
			
		||||
      (load filename)))
 | 
			
		||||
 | 
			
		||||
;; A file with machine specific settings.
 | 
			
		||||
(load-file-if-exists "~/.emacs.d/init-local.el")
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue