daily pastebin goal
66%
SHARE
TWEET

init.el

Woadray Mar 15th, 2019 208 in 7 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;; ================================================== MELPA ====================================================
  2.  
  3. (require 'package)
  4. (let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
  5.                     (not (gnutls-available-p))))
  6.        (proto (if no-ssl "http" "https")))
  7.   (when no-ssl
  8.     (warn "\
  9. Your version of Emacs does not support SSL connections,
  10. which is unsafe because it allows man-in-the-middle attacks.
  11. There are two things you can do about this warning:
  12. 1. Install an Emacs version that does support SSL and be safe.
  13. 2. Remove this warning from your init file so you won't see it again."))
  14.   ;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
  15.   (add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
  16.   ;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
  17.   (when (< emacs-major-version 24)
  18.     ;; For important compatibility libraries like cl-lib
  19.     (add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.gnu.org/packages/")))))
  20. (package-initialize)
  21.  
  22. ;; ================================================ SETTINGS ===================================================
  23.  
  24. ;; Font-size
  25. (set-default-font "Inconsolata 25")
  26.  
  27. ;; Hide scrollbar, toolbar, menu bar
  28. (scroll-bar-mode -1)
  29. (tool-bar-mode -1)
  30. (menu-bar-mode -1)
  31.  
  32. ;; No splash screen
  33. (setq inhibit-splash-screen t
  34.       initial-scratch-message nil
  35.       initial-major-mode 'org-mode)
  36.  
  37. ;; Line by line scrolling
  38. (setq scroll-step 1)
  39.  
  40. ;; Mouse wheel scrolling
  41. (mouse-wheel-mode t)
  42.  
  43. ;; No backup, no auto-save
  44. (setq make-backup-files nil)
  45. (setq auto-save-default nil)
  46.  
  47. ;; Auto-fill mode
  48. (setq auto-fill-mode 1)
  49.  
  50. ;; Pasting with middle mouse button
  51. (setq mouse-yank-qt-point t)
  52.  
  53. ;; Toggle window split
  54. (defun toggle-window-split ()
  55.   (interactive)
  56.     (if (= (count-windows) 2)
  57.       (let* ((this-win-buffer (window-buffer))
  58.             (next-win-buffer (window-buffer (next-window)))
  59.             (this-win-edges (window-edges (selected-window)))
  60.             (next-win-edges (window-edges (next-window)))
  61.             (this-win-2nd
  62.              (not (and (<= (car this-win-edges)
  63.                         (car next-win-edges))
  64.                     (<= (cadr this-win-edges)
  65.                         (cadr next-win-edges)))))
  66.          (splitter
  67.           (if (= (car this-win-edges)
  68.                  (car (window-edges (next-window))))
  69.               'split-window-horizontally
  70.             'split-window-vertically)))
  71.     (delete-other-windows)
  72.     (let ((first-win (selected-window)))
  73.       (funcall splitter)
  74.       (if this-win-2nd (other-window 1))
  75.       (set-window-buffer (selected-window) this-win-buffer)
  76.       (set-window-buffer (next-window) next-win-buffer)
  77.       (select-window first-win)
  78.       (if this-win-2nd (other-window 1))))))
  79. (define-key ctl-x-4-map "t" 'toggle-window-split)
  80.  
  81. ;; Tab
  82. (setq tab-always-indent 'complete)
  83.  
  84. ;; Read only prompt
  85. (setq comint-prompt-read-only t)
  86.  
  87. ;; Flycheck
  88. (global-flycheck-mode)
  89.  
  90. ;; Company-mode
  91. (setq company-idle-delay 0)
  92. (setq company-minimum-prefix-length 2)
  93. (global-company-mode t)
  94.  
  95. ;; Helm
  96. (require 'helm-mode)
  97. (require 'helm-config)
  98. (helm-mode 1)
  99. (define-key helm-map (kbd "TAB") #'helm-execute-persistent-action)
  100. (define-key helm-map (kbd "<tab>") #'helm-execute-persistent-action)
  101. (global-set-key (kbd "C-x C-b") 'helm-buffers-list)
  102. (global-set-key (kbd "C-x r b") 'helm-filtered-bookmarks)
  103. (global-set-key (kbd "C-x C-f") 'helm-find-files)
  104. (global-set-key (kbd "M-x") 'helm-M-x)
  105.  
  106. ;; =============================================================================================================
  107.  
  108. (custom-set-variables
  109.  ;; custom-set-variables was added by Custom.
  110.  ;; If you edit it by hand, you could mess it up, so be careful.
  111.  ;; Your init file should contain only one such instance.
  112.  ;; If there is more than one, they won't work right.
  113.  '(custom-enabled-themes (quote (spacemacs-dark)))
  114.  '(custom-safe-themes
  115.    (quote
  116.     ("bffa9739ce0752a37d9b1eee78fc00ba159748f50dc328af4be661484848e476" default))))
  117. (custom-set-faces
  118.  ;; custom-set-faces was added by Custom.
  119.  ;; If you edit it by hand, you could mess it up, so be careful.
  120.  ;; Your init file should contain only one such instance.
  121.  ;; If there is more than one, they won't work right.
  122.  )
  123.  
  124. ;; =============================================================================================================
  125.  
  126. ;; PYTHON
  127. (setq python-shell-interpreter "/home/ralinoro/.local/bin/ipython3"
  128.       python-shell-interpreter-args "-i --simple-prompt --no-banner --nosep")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top