Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; Packages
- (require 'package)
- (add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/"))
- (add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/"))
- (package-initialize)
- ;; AC
- (require 'auto-complete)
- (define-globalized-minor-mode real-global-auto-complete-mode
- auto-complete-mode (lambda ()
- (if (not (minibufferp (current-buffer)))
- (auto-complete-mode 1))
- ))
- (real-global-auto-complete-mode t)
- ;; Slime
- (setq inferior-lisp-program "/usr/bin/sbcl")
- (add-to-list 'load-path "/opt/slime/")
- (require 'slime-autoloads)
- (slime-setup '(slime-fancy))
- ;; AC-Slime
- (require 'ac-slime)
- (add-hook 'slime-mode-hook 'set-up-slime-ac)
- (add-hook 'slime-repl-mode-hook 'set-up-slime-ac)
- (eval-after-load "auto-complete"
- '(add-to-list 'ac-modes 'slime-repl-mode))
- ;; Fix fuckken slime history keys
- (add-hook 'slime-repl-mode-hook
- (lambda ()
- (local-set-key (kbd "C-x <up>") 'slime-repl-backward-input)
- (local-set-key (kbd "C-x <down>") 'slime-repl-forward-input)))
- ;; Custom
- (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.
- '(backup-directory-alist (quote ((".*" . "~/.saves/"))))
- '(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.
- )
- ;; Tabs suck
- (setq-default indent-tabs-mode nil)
- ;;;; Copypaste for X
- ;; http://hugoheden.wordpress.com/2009/03/08/copypaste-with-emacs-in-terminal/
- ;; I prefer using the "clipboard" selection (the one the
- ;; typically is used by c-c/c-v) before the primary selection
- ;; (that uses mouse-select/middle-button-click)
- (setq x-select-enable-clipboard t)
- ;; If emacs is run in a terminal, the clipboard- functions have no
- ;; effect. Instead, we use of xsel, see
- ;; http://www.vergenet.net/~conrad/software/xsel/ -- "a command-line
- ;; program for getting and setting the contents of the X selection"
- (unless window-system
- (when (getenv "DISPLAY")
- ;; Callback for when user cuts
- (defun xsel-cut-function (text &optional push)
- ;; Insert text to temp-buffer, and "send" content to xsel stdin
- (with-temp-buffer
- (insert text)
- ;; I prefer using the "clipboard" selection (the one the
- ;; typically is used by c-c/c-v) before the primary selection
- ;; (that uses mouse-select/middle-button-click)
- (call-process-region (point-min) (point-max) "xsel" nil 0 nil "--clipboard" "--input")))
- ;; Call back for when user pastes
- (defun xsel-paste-function()
- ;; Find out what is current selection by xsel. If it is different
- ;; from the top of the kill-ring (car kill-ring), then return
- ;; it. Else, nil is returned, so whatever is in the top of the
- ;; kill-ring will be used.
- (let ((xsel-output (shell-command-to-string "xsel --clipboard --output")))
- (unless (string= (car kill-ring) xsel-output)
- xsel-output )))
- ;; Attach callbacks to hooks
- (setq interprogram-cut-function 'xsel-cut-function)
- (setq interprogram-paste-function 'xsel-paste-function)
- ;; Idea from
- ;; http://shreevatsa.wordpress.com/2006/10/22/emacs-copypaste-and-x/
- ;; http://www.mail-archive.com/help-gnu-emacs@gnu.org/msg03577.html
- ))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement