Skip to content

Instantly share code, notes, and snippets.

@Bobbias

Bobbias/.emacs Secret

Created September 18, 2019 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bobbias/1aef4132d868fde4c6576c9c34a5df01 to your computer and use it in GitHub Desktop.
Save Bobbias/1aef4132d868fde4c6576c9c34a5df01 to your computer and use it in GitHub Desktop.
(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.
'(custom-enabled-themes (quote (solarized-dark)))
'(custom-safe-themes
(quote
("d91ef4e714f05fff2070da7ca452980999f5361209e679ee988e3c432df24347" "0598c6a29e13e7112cfbc2f523e31927ab7dce56ebb2016b567e1eff6dc1fd4f" default)))
'(global-linum-mode t)
'(linum-format (quote dynamic)))
(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.
)
;;highlight matching parens
(show-paren-mode 1)
;;save windows and buffers when closing, restore when you open emacs again
(desktop-save-mode 1)
;;ctrl tab to switch windows -- holy shit, it worked right the first time
(global-set-key (kbd "C-<tab>") 'other-window)
;;broken, why? "wrong type argument: commandp, insert-python-main" -- oh yeah, i forgot i was trying to do this. i suck at elisp
(defun insert-python-main ()
"Insert python main script snippet"
((insert "if __name__ == '__main__':\n")
(indent-for-tab-command)
(insert "main()")))
(global-set-key (kbd "C-S-m") 'insert-python-main)
;;ensure my theme is actually loaded when emacs starts
(add-hook 'after-init-hook (lambda () (load-theme 'solarized-dark t)))
;; Add MELPA repository for additional packages
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
(when no-ssl
(warn "\
Your version of Emacs does not support SSL connections,
which is unsafe because it allows man-in-the-middle attacks.
There are two things you can do about this warning:
1. Install an Emacs version that does support SSL and be safe.
2. Remove this warning from your init file so you won't see it again."))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
(add-to-list 'package-archives (cons "org" (concat proto "://orgmode.org/elpa/")))
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.gnu.org/packages/")))
(add-to-list 'package-archives (cons "elpy" (concat proto "://jorgenschaefer.github.io/packages/")))))
(package-initialize)
(defvar myPackages
'(elpy)
'(orglink))
(dolist (p myPackages)
(when (not (package-installed-p p))
(package-install p)))
(setq python-shell-interpreter "python3") ;;why is python2 still a thing anyway?
;;(elpy-enable)
;; from http://emacs.rubikitch.com/orglink/ -- doesn't give any errors, also doesnt do fuck all
(setq orglink-activate-in-modes
'(emacs-lisp-mode python-mode))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment