Skip to content

Instantly share code, notes, and snippets.

@vonj
Created March 31, 2017 10:56
Show Gist options
  • Save vonj/dcd8210d772b4224fcc20b0ecc81ca35 to your computer and use it in GitHub Desktop.
Save vonj/dcd8210d772b4224fcc20b0ecc81ca35 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.
'(ansi-color-faces-vector
[default default default italic underline success warning error])
'(ansi-color-names-vector
["#2d3743" "#ff4242" "#74af68" "#dbdb95" "#34cae2" "#008b8b" "#00ede1" "#e1e1e0"])
'(c-basic-offset 4)
'(cua-mode t nil (cua-base))
'(custom-enabled-themes (quote (manoj-dark)))
'(inhibit-startup-screen t))
(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.
)
(add-hook 'c-mode-hook
(lambda ()
(c-set-style "linux")
(setq c-basic-offset 4)))
; Get rid of the startup message
(setq inhibit-startup-message t)
; Show file full path in title bar
(setq-default frame-title-format
(list '((buffer-file-name " %f"
(dired-directory
dired-directory
(revert-buffer-function " %b"
("%b - Dir: " default-directory)))))))
; Shows parenthesis
(show-paren-mode 1)
; Shows column number
(column-number-mode 1)
; Change default colors
;(set-background-color "grey14")
;(set-foreground-color "white")
;(set-cursor-color "white")
; No toolbar
(progn
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
; (menu-bar-mode -1)
(scroll-bar-mode -1)
)
; Various settings:
(add-to-list 'load-path "~/elisp") ;; Additional .el and .elc files can be placed here
(setq inhibit-splash-screen t) ;; Don't show initial Emacs-logo and info
(cua-mode 1) ;; Enable ^Z, ^X, ^C, ^V, select with mouse and shift-cursor-movement
(transient-mark-mode 1) ;; No region when it is not highlighted
(setq cua-keep-region-after-copy t) ;; Standard MS-Windows behaviour
;(require 'cygwin-mount) ;; Let emacs recognize cygwin ...
;(cygwin-mount-activate) ;; ...paths (e.g. /usr/local/lib)
(setq-default line-spacing 1) ;; Add 1 pixel between lines
(recentf-mode) ;; Add menu-item "File--Open recent"
; Define some additional "native-Windows" keystrokes (^tab, Alt/F4, ^A, ^F, ^O,
; ^S, ^W) and redefine (some of) the overridden Emacs functions.
(global-set-key [C-tab] 'other-window)
(global-set-key [M-f4] 'save-buffers-kill-emacs)
;(global-set-key "\C-a" 'mark-whole-buffer)
(global-set-key "\C-f" 'isearch-forward)
(global-set-key "\C-o" 'find-file)
(global-set-key "\C-s" 'save-buffer)
(global-set-key "\C-w" 'kill-this-buffer)
(global-set-key (kbd "C-S-o") 'open-line)
(global-set-key (kbd "C-S-w") 'kill-region)
(define-key global-map (kbd "RET") 'newline-and-indent) ; For programming language modes
(define-key isearch-mode-map "\C-f" 'isearch-repeat-forward)
; Default colours are too light (to see colour names do M-x list-colors-display
; and to see faces do M-x list-faces-display):
(set-face-foreground font-lock-type-face "dark green")
(set-face-foreground font-lock-builtin-face "Orchid4")
(set-face-foreground font-lock-constant-face "CadetBlue4")
(set-face-foreground font-lock-keyword-face "Purple4")
(set-face-foreground font-lock-string-face "IndianRed4")
(set-face-foreground font-lock-variable-name-face "SaddleBrown")
(global-linum-mode 1) ; Display line numbers in margin
;; I hate tabs!
(setq-default indent-tabs-mode nil)
(setq url-proxy-services '(("https" . "pxgot5.srv.volvo.com:8080")
("http" . "pxgot5.srv.volvo.com:8080")))
;; Enabling MELPA!
(when (>= emacs-major-version 24)
(require 'package)
(add-to-list
'package-archives
'("melpa" . "http://melpa.org/packages/")
t)
(package-initialize))
;;;;;;;;;;;;;;;;;;;;
;; set up unicode
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
;; This from a japanese individual. I hope it works.
(setq default-buffer-file-coding-system 'utf-8)
;; From Emacs wiki
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
;; MS Windows clipboard is UTF-16LE
(set-clipboard-coding-system 'utf-16le-dos)
(defun unfill-paragraph ()
"Replace newline chars in current paragraph by single spaces.
This command does the reverse of `fill-paragraph'."
(interactive)
(let ((fill-column 90002000))
(fill-paragraph nil)))
(defun unfill-region (start end)
"Replace newline chars in region by single spaces.
This command does the reverse of `fill-region'."
(interactive "r")
(let ((fill-column 90002000))
(fill-region start end)))
(add-hook 'markdown-mode-hook 'auto-fill-mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment