pair programming with tmux spacemacs on Mac/Linux

212 views
Skip to first unread message

Sonny To

unread,
Oct 7, 2019, 10:28:10 AM10/7/19
to Clojure
This is not clojure specific but has anyone successfully used spacemacs to pair programming with tmux and spacemacs? My pairing partner uses a mac with french Canadian keyboard but when he ssh into my box
to pair, his key bindings don't work even though I used his init.el The meta key and paredit keybidings don't work for him.

The keybinding works for me but I'm on Linux with a standard US keyboard. Appreciate any help!

Below is ~/.emacs.d/init.el and ~/.tmux.conf

---init.el---
(setq gc-cons-threshold 100000000)
(global-set-key (kbd "<esc>") 'meta)

;;(set-keyboard-coding-system nil)
(set-terminal-coding-system 'utf-8)
(setq mac-command-modifier 'meta)
;;(setq mac-command-key-is-meta t)
(setq mac-option-modifier  'none)

(add-to-list 'auto-mode-alist '("\\.cljs\\.hl\\'" . clojurescript-mode))
(add-hook 'clojure-mode-hook
          '(lambda ()
             ;; Hoplon functions and macros
             (dolist (pair '((page . 'defun)
                             (loop-tpl . 'defun)
                             (if-tpl . '1)
                             (for-tpl . '1)
                             (case-tpl . '1)
                             (cond-tpl . 'defun)))
               (put-clojure-indent (car pair)
                                   (car (last pair))))))

(defconst spacemacs-version         "0.200.13" "Spacemacs version.")
(defconst spacemacs-emacs-min-version   "24.4" "Minimal version of Emacs.")

(if (not (version<= spacemacs-emacs-min-version emacs-version))
    (error (concat "Your version of Emacs (%s) is too old. "
                   "Spacemacs requires Emacs version %s or above.")
           emacs-version spacemacs-emacs-min-version)
  (load-file (concat (file-name-directory load-file-name)
                     "core/core-load-paths.el"))
  (require 'core-spacemacs)
  (spacemacs/init)
  (configuration-layer/sync)
  (spacemacs-buffer/display-startup-note)
  (spacemacs/setup-startup-hook)
  ;; BEGIN exec-path-from-shell
  (use-package exec-path-from-shell
  :ensure t
  :if (memq window-system '(mac ns x))
  :config
  (setq exec-path-from-shell-variables '("PATH" "SOLR_HOME"))
  (exec-path-from-shell-initialize))
  ;; END exec-path-from-shell
  (require 'server)
  (unless (server-running-p) (server-start)))
-----end init.el----

--.tmux.conf---
set -g prefix C-z
unbind-key C-b
bind-key C-z send-prefix
set-option -g default-terminal "xterm-256color"
set-window-option -g xterm-keys on

--end .tmux.conf---





Eli Naeher

unread,
Oct 7, 2019, 11:45:09 AM10/7/19
to 'Gerard Klijs' via Clojure
On Mon, Oct 7, 2019, at 10:28 AM, Sonny To wrote:
This is not clojure specific but has anyone successfully used spacemacs to pair programming with tmux and spacemacs? My pairing partner uses a mac with french Canadian keyboard but when he ssh into my box
to pair, his key bindings don't work even though I used his init.el The meta key and paredit keybidings don't work for him.

The keybinding works for me but I'm on Linux with a standard US keyboard. Appreciate any help!

When he runs Emacs locally, does he run it in a terminal or in GUI mode? If he is not in the habit of using Emacs from the terminal, it's likely his terminal emulator settings that are the culprit.

On a Mac he's likely using iterm2. The most common fix in that context for meta key issues is to go to iTerm2 -> Preferences -> Profiles -> Keys and set "Left Option Key" and "Right Option Key" both to "Esc+" (_not_ "Meta").

The C-<right> and C-<left> Paredit keybindings conflict with the default Mac Mission Control shortcuts. I have disabled these on my Mac in order to get Paredit working reliably in Emacs in a terminal. You can do this by going to System Preferences -> Keyboard -> Shortcuts -> Mission Control and unchecking "Move left a space" and "Move right a space."

-Eli
Reply all
Reply to author
Forward
0 new messages