UNLESS OTHERWISE NOTED, THE CONTENTS OF THESE PUBLIC GISTS ARE LICENSED UNDER THE CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE.
This section is a human-readable summary of (and not a substitute for) the full license included below.
| nmap <silent> <leader>s :set opfunc=SendToTmux<CR>g@ | |
| nmap <silent> <leader>ss :call SendLineToTmux()<CR> | |
| vmap <silent> <leader>s :<C-U>call SendToTmux(visualmode(), 1)<CR> | |
| function! SendLineToTmux() | |
| let line = line('.') | |
| let col = col('.') | |
| " TODO: this assumes the leader is ',' | |
| :normal 0,s$"" |
| /* | |
| map ,g :!gcc % -o %:r -lncurses && ./%:r <CR> | |
| */ | |
| #include <assert.h> | |
| #include <stdint.h> | |
| #include <ncurses.h> | |
| #include <sys/time.h> | |
| #include <time.h> | |
| #include <stdlib.h> |
| (defpackage :pacman | |
| (:use :cl)) | |
| (in-package :pacman) | |
| ;;; The charms/ll library contains all of the FFI bindings to Ncurses. | |
| (ql:quickload :cl-charms) | |
| ;;; Here are all of the functions I'll be using from Ncurses. | |
| (import '( |
| (defun make-vector (length elt) (make-array length :initial-element elt)) | |
| (defun vector-elt (vec i) (aref vec i)) | |
| (defun vector-set! (vec i elt) (setf (aref vec i) elt)) | |
| (defun matrix (m n vec) (list m n vec)) | |
| (defun matrix-m (m) (first m)) | |
| (defun matrix-n (m) (second m)) | |
| (defun matrix-vec (m) (third m)) | |
| (defun num-elements (m n) |
| (defun multiline? (string) | |
| (position ?\n string)) | |
| (defun multiline-comment (string) | |
| (concat "#||\n" string "\n||#\n")) | |
| ;; Note: Redefining to send the error message too. | |
| (defun chebert-eval-async (sexp &optional cont package) | |
| "Evaluate EXPR on the superior Lisp and call CONT with the result." | |
| (declare (indent 1)) |
| (defrecord machine-state | |
| ;; Registers | |
| pc sp a b c d e f h l | |
| ;; Memory Regions | |
| video-ram ext-ram work-ram sprite-ram mmap-i/o z-ram | |
| ;; Debug Fields | |
| ;; Lists of what the last instruction changed | |
| affected-regs affected-flags memory-updates | |
| ;; The instruction that was just disassembled this step. |
| /* | |
| map <leader>g :!gcc % -o %:r -lncurses && ./%:r <CR> | |
| gcc tetris.c -o tetris -lncurses | |
| ./tetris | |
| */ | |
| #include <stdint.h> | |
| #include <string.h> | |
| #include <stdlib.h> |
| /* | |
| map ,g :!gcc % -o %:r -lncurses && ./%:r <CR> | |
| gcc freecell.c -o freecell -lncurses | |
| ./freecell | |
| */ | |
| #include <assert.h> | |
| #include <stdint.h> | |
| #include <ncurses.h> |
| /* | |
| map ,g :!clang -DDEBUG % -o %:r -lncurses && ./%:r <CR> | |
| gcc pacman.c -o pacman -lncurses | |
| ./pacman | |
| */ | |
| /* | |
| * TODO | |
| * minor: ghosts should go all the way to their bottom positions (TILE_CENTER) |
UNLESS OTHERWISE NOTED, THE CONTENTS OF THESE PUBLIC GISTS ARE LICENSED UNDER THE CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE.
This section is a human-readable summary of (and not a substitute for) the full license included below.