This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax on | |
filetype plugin indent on | |
" On pressing tab, insert 2 spaces | |
set expandtab | |
" show existing tab with 2 spaces width | |
set tabstop=2 | |
set softtabstop=2 | |
" when indenting with '>', use 2 spaces width | |
set shiftwidth=2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; --- Package-management --- | |
;; Set up package.el to work with MELPA | |
(require 'package) | |
(add-to-list 'package-archives | |
'("melpa" . "https://melpa.org/packages/")) | |
(package-initialize) | |
(package-refresh-contents) | |
;; --- Optimizations --- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SPC | |
SPC: find file | |
, switch buffer | |
. browse files | |
: MX | |
; EX | |
< switch buffer | |
` eval | |
u universal arg | |
x pop up scratch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------- | |
Normal mode | |
------------------------- | |
--- Navigation --- | |
h Move cursor 1 char to the left | |
j Move cursor 1 char down | |
k Move cursor 1 char up | |
l Move cursor 1 char to the right | |
NOTE: When in Visual Char/Line/Block Mode, these navigation keys highlight stuff | |
w or e Sort of like "Ctrl ->" in typical text editors to move from word to word (I forgot the subtle diff between the 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; | |
;; NS CHEATSHEET | |
;; | |
;; * :require makes functions available with a namespace prefix | |
;; and optionally can refer functions to the current ns. | |
;; | |
;; * :import refers Java classes to the current namespace. | |
;; | |
;; * :refer-clojure affects availability of built-in (clojure.core) | |
;; functions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn getPromiseFn | |
[aPromise] | |
(fn [num] (Thread/sleep 10000) | |
(deliver aPromise (str num " done")))) | |
(def proms [(promise) (promise) (promise)]) | |
(def promFns (map getPromiseFn proms)) | |
(future (map deref proms)) | |
(future (map promFn (range 0 (count proms)))) |