Skip to content

Instantly share code, notes, and snippets.

@omaciel
Last active January 17, 2017 22:07
Show Gist options
  • Save omaciel/a621a611e34c2da8c102305835a4ddb1 to your computer and use it in GitHub Desktop.
Save omaciel/a621a611e34c2da8c102305835a4ddb1 to your computer and use it in GitHub Desktop.
Notes so I don't forget stuff

Notes

Emacs

Weird characters displayed on terminal inside Emacs

First add the following lines to your .emacs file:

;; Use Emacs terminfo, not system terminfo
(setq system-uses-terminfo nil)

If this doesn't work, then do the following:

tic -o ~/.terminfo /Applications/Emacs.app/Contents/Resources/etc/e/eterm-color.ti

Use IPython for your Python Interpreter

Add the following lines to your .emacs file:

;; IPython
(setq python-shell-interpreter "ipython"
    python-shell-interpreter-args "-i")

Scroll on Terminal

C-c C-j  to go into line mode
C-c C-k  to get back into char mode to interact with the terminal

Use System Clipboard (MAC OS X)

(defun copy-from-osx ()
(shell-command-to-string "pbpaste"))

(defun paste-to-osx (text &optional push)
(let ((process-connection-type nil))
(let ((proc (start-process "pbcopy" "*Messages*" "pbcopy")))
(process-send-string proc text)
(process-send-eof proc))))

(setq interprogram-cut-function 'paste-to-osx)
(setq interprogram-paste-function 'copy-from-osx)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment