How can I get mouse selection to work in emacs and iTerm2 on Mac?

For Emacs in iTerm 2, I’ve found that the following bit in my ~/.emacs file works very well, providing the ability to insert the character at an arbitrary location, mark a region, and use the scroll wheel: ;; Enable mouse support (unless window-system (require ‘mouse) (xterm-mouse-mode t) (global-set-key [mouse-4] (lambda () (interactive) (scroll-down 1))) (global-set-key … Read more

iTerm 2 profiles

iTerm2 supports a custom escape code that changes the profile on the fly. Put it in your .bashrc or .bash_profile. <esc>]50;SetProfile=X^G where X is the profile. For instance, to change the profile to one called “Foo”, us this shell script: #!/bin/bash echo -e “\033]50;SetProfile=Foo\a” To change it back when you log out, put code to … Read more

How to delete a word in iTerm in mac os

Go to your iTerm preferences select “profiles” then “key” and change your presets in “Natural Text Editing” It should work immediately after. It works with iTerm version 3.3.12 Edit: In version 3.4, there’s a slight UI change. So you need to go specifically to your iTerm preferences select Profiles > Keys > Key Mappings > … Read more