Skip to content

Instantly share code, notes, and snippets.

@2016rshah
Last active January 27, 2023 17:39
Show Gist options
  • Save 2016rshah/3661fe7820e35815dbd1f29bdfe68f5e to your computer and use it in GitHub Desktop.
Save 2016rshah/3661fe7820e35815dbd1f29bdfe68f5e to your computer and use it in GitHub Desktop.
Default emacs setup
;; Don't forget to
;; - update to latest version of emacs, mac osx default is super old
;; - go to terminal preferences and use option key as meta or something like that
;; https://melpa.org/#/getting-started
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
;; 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 "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 '("gnu" . (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
;; Preferences/keybindings
(global-set-key (kbd "C-c /") 'comment-or-uncomment-region) ;; C-c / to comment regions
(setq column-number-mode t) ;; Display column number
(global-set-key (kbd "M-h") 'windmove-left) ; move to left window
(global-set-key (kbd "M-l") 'windmove-right) ; move to right window
(global-set-key (kbd "M-k") 'windmove-up) ; move to upper window
(global-set-key (kbd "M-j") 'windmove-down) ; move to lower window
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment