www-home/blog/20070522-emacs-tips.html

100 lines
4.3 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="/favicon.ico">
<link rel="canonical" href="https://www.mcmillen.dev/blog/20070522-emacs-tips.html">
<link rel="alternate" type="application/atom+xml" href="https://www.mcmillen.dev/feed.atom" title="Colin McMillen's Blog - Atom">
<title>Emacs Tips | Colin McMillen</title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Quicksand:wght@500;700&display=block" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Fira+Mono:500&display=block" rel="stylesheet">
<link rel="stylesheet" href="/pygments.css">
<link rel="stylesheet" href="/style.css">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@mcmillen">
<meta name="twitter:title" content="Emacs Tips | Colin McMillen">
<meta name="twitter:description" content="These are some emacs keybindings (and other functions) that I once found useful. Ive mostly used Sublime Text for the last few years, however. Editing">
</head>
<script>
function fixEmails() {
const mailtoArray = [
'm', 'a', 'i', 'l', 't', 'o', ':',
'c', 'o', 'l', 'i', 'n', '@',
'm', 'c', 'm', 'i', 'l', 'l', 'e', 'n',
'.', 'd', 'e', 'v'];
const mailtoLink = mailtoArray.join('');
const anchors = document.getElementsByTagName('a');
for (let i = 0; i < anchors.length; i++) {
const anchor = anchors[i];
if (anchor.href == 'mailto:email@example.com') {
anchor.href = mailtoLink;
if (anchor.innerText == 'colin at mcmillen dot dev') {
anchor.innerText = mailtoLink.substring(7);
}
}
}
}
</script>
<body onload="fixEmails()">
<div id="page-container">
<div id="content-wrap">
<div id="header">
<div class="content">
<a href="/" class="undecorated">Colin McMillen</a>
<span style="float: right;"><a href="/feed.atom"><img src="/img/rss.svg" alt="Atom feed" style="width: 17px; height: 17px; margin-bottom: 1px;"></a></span>
<span style="float: right;"><a href="https://twitter.com/mcmillen"><img src="/img/twitter.svg" alt="@mcmillen"></a></span>
</div>
</div>
<div class="content">
<h1 id="emacs-tips">Emacs Tips</h1>
<p><em>Posted 2007-05-22, updated 2021-07-01.</em></p>
<p>These are some emacs keybindings (and other functions) that I once found useful. I&rsquo;ve mostly used Sublime Text for the last few years, however.</p>
<h2 id="editing">Editing</h2>
<p><code>C-[SPC]</code>: set mark<br>
<code>C-x C-x</code>: exchange point and mark<br>
<code>C-w</code>: kill (AKA &ldquo;cut&rdquo;)<br>
<code>M-w</code>: kill-ring-save (AKA &ldquo;copy&rdquo;)<br>
<code>C-y</code>: yank (AKA &ldquo;paste&rdquo;)<br>
<code>M-h</code>: Put region around current paragraph (mark-paragraph).<br>
<code>C-x h</code>: Put region around the entire buffer (mark-whole-buffer).<br>
<code>C-u C-[SPC]</code>: Move in mark ring<br>
<code>M-d</code>: Kill word<br>
<code>M-[DEL]</code>: Kill word backwards<br>
<code>C-M-k</code>: Kill the following balanced expression (kill-sexp)</p>
<h2 id="registers">Registers</h2>
<p><code>C-x r r</code>: Save position of point in register r (point-to-register).<br>
<code>C-x r j r</code>: Jump to the position saved in register r (jump-to-register).<br>
<code>C-x r s r</code>: Copy region into register r (copy-to-register).<br>
<code>C-x r i r</code>: Insert text from register r (insert-register).</p>
<h2 id="bookmarks">Bookmarks</h2>
<p><code>C-x r m [RET]</code>: Set the bookmark for the visited file, at point.<br>
<code>C-x r m bookmark [RET]</code>: Set the bookmark named bookmark at point (bookmark-set).<br>
<code>C-x r b bookmark [RET]</code>: Jump to the bookmark named bookmark (bookmark-jump).<br>
<code>C-x r l</code>: List all bookmarks (list-bookmarks).<br>
<code>M-x bookmark-save</code>: Save all the current bookmark values in the default bookmark file.</p>
<h2 id="miscellaneous">Miscellaneous</h2>
<p><code>M-`</code> shows the menu.<br>
<code>M-x highlight-changes-mode</code> toggles showing the changes you&rsquo;ve made to the file since the last save.</p>
</div>
</div>
<div id="footer">
<div class="content">
&copy; 2023 <a href="/" class="undecorated">Colin McMillen</a>. No cookies, no tracking.
</div>
</div>
</div>
</body>
</html>