Guest User

Untitled

a guest
Jan 22nd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.35 KB | None | 0 0
  1. ;;; Global config
  2.  
  3. (global-set-key "\r" 'newline-and-indent)
  4. ;; (setq scroll-step 1)
  5. (setq-default tab-width 4)
  6. (setq c-default-style "linux"
  7. c-basic-offset 2)
  8. ;;(setq-default c-basic-offset 2)
  9.  
  10. ;; Disallow tabs
  11. (setq-default indent-tabs-mode nil)
  12.  
  13. ;; Cut-paste uses clipboard
  14. (setq x-select-enable-clipboard t)
  15.  
  16. ;; Add hooks to load 80+ column highlighting in the following modes
  17. (add-hook 'c-mode-common-hook (lambda () (highlight-80+-mode t) ) )
  18. (add-hook 'text-mode-hook (lambda () (highlight-80+-mode t) ) )
  19. (add-hook 'emacs-lisp-mode-hook (lambda () (highlight-80+-mode t) ) )
  20. (add-hook 'python-mode-hook (lambda () (highlight-80+-mode t) ) )
  21. (add-hook 'javascript-mode-hook (lambda () (highlight-80+-mode t) ) )
  22. (add-hook 'html-mode-hook (lambda () (highlight-80+-mode t) ) )
  23.  
  24. ;;Disable startup message
  25. ;; (setq inhibit-startup-message t)
  26.  
  27. ;; Add the color-theme package to the load path (required for zenburn)
  28. (add-to-list 'load-path "~/.emacs.d/color-theme/")
  29.  
  30. ;;Load in special php-optimized library
  31. (load-library "~/.emacs.d/python-mode.el")
  32. (load-library "~/.emacs.d/php-mode.el")
  33. (load-library "~/.emacs.d/javascript.el")
  34. (load-library "~/.emacs.d/highlight-80+.el")
  35. (load-library "~/.emacs.d/zenburn.el")
  36.  
  37. ;; Set the 'zenburn' color-theme
  38. (color-theme-zenburn)
  39.  
  40. ;;Create a backup file directory
  41. ;;(defun make-backup-file-name (file)
  42. ;; (concat "~/.emacs_backups/" (file-name-nondirectory file) "~"))
  43.  
  44. ;;; Org Mode config
  45.  
  46. (defun org-summary-todo (n-done n-not-done)
  47. "Switch entry to DONE when all subentries are done, to TODO otherwise."
  48. (let (org-log-done org-log-states) ; turn off logging
  49. (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
  50.  
  51. (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
  52. (custom-set-variables
  53. ;; custom-set-variables was added by Custom.
  54. ;; If you edit it by hand, you could mess it up, so be careful.
  55. ;; Your init file should contain only one such instance.
  56. ;; If there is more than one, they won't work right.
  57. '(column-number-mode t)
  58. '(show-paren-mode t))
  59. (custom-set-faces
  60. ;; custom-set-faces was added by Custom.
  61. ;; If you edit it by hand, you could mess it up, so be careful.
  62. ;; Your init file should contain only one such instance.
  63. ;; If there is more than one, they won't work right.
  64. )
  65.  
  66. ;;; GNU Global config
  67.  
  68. (setq load-path (cons "/home/owner/global" load-path))
  69. (autoload 'gtags-mode "gtags" "" t)
  70. (setq c-mode-hook '(lambda () (gtags-mode 1) ) )
  71.  
  72. ;;; Python config
  73.  
  74. (setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist))
  75. (setq interpreter-mode-alist (cons '("python" . python-mode)
  76. interpreter-mode-alist))
  77. (autoload 'python-mode "python-mode" "Python editing mode." t)
  78.  
  79. ;; ElDoc mode
  80. (add-hook 'python-mode-hook '(lambda () (eldoc-mode 1)) t)
  81.  
  82. ;; Electric Pairs
  83. (add-hook 'python-mode-hook
  84. (lambda ()
  85. (define-key python-mode-map "\"" 'electric-pair)
  86. (define-key python-mode-map "\'" 'electric-pair)
  87. (define-key python-mode-map "(" 'electric-pair)
  88. (define-key python-mode-map "[" 'electric-pair)
  89. (define-key python-mode-map "{" 'electric-pair)))
  90. (defun electric-pair ()
  91. "Insert character pair without sournding spaces"
  92. (interactive)
  93. (let (parens-require-spaces)
  94. (insert-pair)))
  95.  
  96. ;; bind RET to py-newline-and-indent
  97. (add-hook 'python-mode-hook '(lambda ()
  98. (define-key python-mode-map "\C-m" 'newline-and-indent)))
Add Comment
Please, Sign In to add comment