2015-03-06 20:14:27 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
2013-08-01 01:11:08 +00:00
|
|
|
<head>
|
2015-03-06 20:14:27 +00:00
|
|
|
<meta charset="utf-8"/>
|
|
|
|
<title>Emacskurs</title>
|
|
|
|
<meta name="author" content="(Lars Tveito)"/>
|
|
|
|
|
|
|
|
<link rel="stylesheet" href="./reveal.js/css/reveal.min.css"/>
|
|
|
|
<link rel="stylesheet" href="./reveal.js/css/theme/moon.css" id="theme"/>
|
|
|
|
|
|
|
|
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
|
|
|
|
<script>
|
|
|
|
if( window.location.search.match( /print-pdf/gi ) ) {
|
|
|
|
var link = document.createElement( 'link' );
|
|
|
|
link.rel = 'stylesheet';
|
|
|
|
link.type = 'text/css';
|
|
|
|
link.href = './reveal.js/css/print/pdf.css';
|
|
|
|
document.getElementsByTagName( 'head' )[0].appendChild( link );
|
|
|
|
}
|
2013-08-01 01:11:08 +00:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2015-03-06 20:14:27 +00:00
|
|
|
<div class="reveal">
|
|
|
|
<div class="slides">
|
|
|
|
<section>
|
|
|
|
<h1>Emacskurs</h1>
|
|
|
|
<h2>Lars Tveito</h2>
|
|
|
|
<h2><a href="mailto:larstvei@ifi.uio.no">larstvei@ifi.uio.no</a></h2>
|
|
|
|
<h2></h2></section>
|
|
|
|
<section>
|
|
|
|
<h2>Table of Contents</h2><ul>
|
|
|
|
<li>
|
|
|
|
<a href="#sec-1">Intro</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#sec-2">Taster</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#sec-3">Filer, vinduer og buffere</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#sec-4">Kommandoer</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#sec-5">Søking</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#sec-6">Hjelp til selvhjelp</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#sec-7">Programmering</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#sec-8">Makroer</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#sec-9">Pakker</a>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
|
|
<a href="#sec-10">Til slutt</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</section>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<section>
|
|
|
|
<section id="sec-1" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h2>Intro</h2>
|
|
|
|
</section>
|
|
|
|
<section id="sec-1-1" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Plan for kurset</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in">Før pause:<br />
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li>Innføring i Emacs<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li>Nyttige kommander<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
|
|
|
|
<li class="fragment roll-in">Etter pause:<br />
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li>Sette opp Emacs på Ifi's maskiner<br />
|
|
|
|
</li>
|
|
|
|
<li>Skrive en enkel konfigurasjonsfil<br />
|
|
|
|
</li>
|
|
|
|
<li>Bruke det vi lærte før pause<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section id="sec-1-2" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Hva er Emacs?</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in">Teksteditor<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in">Utvidbar (Emacs Lisp)<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in">Over 30 år gammel<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in">Over 2500 innebygde kommandoer<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in">Fri programvare<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section id="sec-1-3" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Rammer, vinduer og buffere</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in">Emacs åpnes i en ramme<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in">Man kan ha flere vinduer i samme ramme<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in">Tekst vises i buffere<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in">Du kan ha så mange åpne buffere du vil<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in">En fil åpnes i et nytt buffer<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in">Minibufferet (nederste linje), brukes til å skrive inn filnavn, buffernavn, etc…<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section id="sec-1-4" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Modes</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in">Major modes<br />
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li>hvert buffer har kun én aktiv major mode<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li>en major mode gir deg funksjonalitet for en bestemt type<br />
|
|
|
|
tekstredigering<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li>de fleste programmeringsspråk har sin egen major mode<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
|
|
|
|
<li class="fragment roll-in">Minor modes<br />
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li>du kan ha så mange aktive minor modes du ønsker<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li>en minor mode tilbyr tilleggsfunksjonalitet<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
2015-03-06 20:14:27 +00:00
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in">Modes tilføyer ofte egne tastekombinasjoner!<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section id="sec-1-5" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Tips</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li>Emacs er annerledes å bruke enn mange andre programmer, så det krever tilvenning.<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in">i begynnelsen:<br />
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li>les og gjør «learn-by-doing tutorial» (<code>C-h t</code>)<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li>tving deg selv til å bruke de kommandoene du lærer til de sitter i fingrene<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li>unngå «pek og klikk»<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
2015-03-06 20:14:27 +00:00
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in">etter hvert (for spesielt interesserte):<br />
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li>skriv din egen config-fil<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li>lær litt Emacs lisp, og skriv dine egne funksjoner<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
2015-03-06 20:14:27 +00:00
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in">annet:<br />
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li>gjør <code>CAPS-LOCK</code> om til en ekstra Control (<code>Ctrl</code>)<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
2015-03-06 20:14:27 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</section>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<section id="sec-2" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h2>Taster</h2>
|
|
|
|
</section>
|
|
|
|
<section id="sec-2-1" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Terminologi for taster</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><code>C-<any></code><br />
|
|
|
|
Control<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>M-<any></code><br />
|
|
|
|
Meta er <code>Alt</code> på de fleste maskiner (alternativt <code>ESC</code>)<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code><any></code> betyr et vilkårlig tegn (eller tastekombinasjon)<br />
|
|
|
|
</li>
|
|
|
|
</ul>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section id="sec-2-2" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Prefikstaster</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><code>C-x <any></code><br />
|
|
|
|
prefiks for globale kommandoer<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-c <any></code><br />
|
|
|
|
prefiks for lokale kommandoer<br />
|
|
|
|
(har ikke alltid samme funksjon!)<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-h <any></code><br />
|
|
|
|
prefiks for hjelp<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
|
|
|
|
<li class="fragment roll-in">Alle tastekombinasjoner som ikke er en prefiks er bundet til en kommando!<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section id="sec-2-3" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Komme seg ut</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><code>C-x C-c</code><br />
|
|
|
|
avslutt Emacs<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-g</code><br />
|
|
|
|
avbryt<br />
|
|
|
|
(bruk hvis du ikke skjønner hva Emacs holder på med!)<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>ESC ESC ESC</code><br />
|
|
|
|
(bruk hvis <code>C-g</code> ikke hjalp)<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
|
|
|
|
<li class="fragment roll-in"><code>C-<prefix> C-g</code><br />
|
|
|
|
er udefinert<br />
|
|
|
|
(Dvs. <code>C-g</code> kan brukes til å avbryte prefiks)<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section id="sec-2-4" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Tekstredigering</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><code>C-f</code>, <code>C-b</code><br />
|
|
|
|
flytt markøren ett tegn frem/tilbake<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>M-f</code>, <code>M-b</code><br />
|
|
|
|
flytt markøren ett ord frem/tilbake<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-a</code>, <code>C-e</code><br />
|
|
|
|
flytt markøren til begynnelsen/slutten av linja<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-p</code>, <code>C-n</code><br />
|
|
|
|
flytt markøren til forrige/neste linje<br />
|
|
|
|
</li>
|
|
|
|
</ul>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section id="sec-2-5" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Bla rundt</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><code>C-v</code>, <code>M-v</code><br />
|
|
|
|
scroll ned/opp en side<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>M-<</code>, <code>M-></code><br />
|
|
|
|
gå til begynnelsen/slutten av bufferet<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-l</code><br />
|
|
|
|
vis slik at markøren er i senter/toppen/bunnen<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section id="sec-2-6" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Kill og yank</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><code>C-w</code><br />
|
|
|
|
kill, tilsvarer cut<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-y</code><br />
|
|
|
|
yank, tilsvarer paste<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>M-w</code><br />
|
|
|
|
lagre til kill-ring, tilsvarer copy<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-k</code><br />
|
|
|
|
kill, drepe resten av en linje<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>M-y</code>, må etterfølges av <code>C-y</code><br />
|
|
|
|
yank-pop, går lenger tilbake på kill-ring<br />
|
|
|
|
</li>
|
|
|
|
</ul>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section id="sec-2-7" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Feiloppretting</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><code>C-d</code>, <code>M-d</code><br />
|
|
|
|
fjern neste bokstav/ord<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-_</code>, <code>C-/</code>, <code>C-x u</code><br />
|
|
|
|
undo!<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-t</code>, <code>M-t</code><br />
|
|
|
|
bytt om to bokstaver/ord<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-x C-t</code><br />
|
|
|
|
bytt om to linjer<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>M-q</code><br />
|
|
|
|
plasserer om tekst i en paragraf slik at linjene ikke overstiger 70 tegn (den ødelegger ikke syntaks i programmeringmodes)<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
|
|
|
|
<li class="fragment roll-in"><code>M-u</code>, <code>M-l</code>, <code>M-c</code><br />
|
|
|
|
gjør neste ord til UPPERCASE/lowercase/Capital-Case<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section id="sec-2-8" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Markering av tekst</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><code>C-SPC</code><br />
|
|
|
|
markerer tekst<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-x h</code><br />
|
|
|
|
markerer all tekst<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>M-h</code><br />
|
|
|
|
markerer en paragraf<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
|
|
|
|
<li class="fragment roll-in">Bruk i kombinasjon med <code>M-w</code>, <code>C-w</code> og <code>TAB</code><br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<section id="sec-3" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h2>Filer, vinduer og buffere</h2>
|
|
|
|
</section>
|
|
|
|
<section id="sec-3-1" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Filer</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><code>C-x C-f</code><br />
|
|
|
|
åpne fil<br />
|
|
|
|
(hvis den ikke finnes fra før åpnes et tomt buffer med det nye filnavnet)<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-x C-s</code><br />
|
|
|
|
lagre buffer<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-x C-w</code><br />
|
|
|
|
skrive til fil (tilsvarende «lagre som…»)<br />
|
|
|
|
</li>
|
|
|
|
</ul>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section id="sec-3-2" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Vinduer</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><code>C-x 2</code>, <code>C-x 3</code><br />
|
|
|
|
splitt et vindu horisontalt/vertikalt<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-x 1</code><br />
|
|
|
|
gjør det aktive vinduet til det eneste vinduet<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-x 0</code><br />
|
|
|
|
lukk det aktive vinduet<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-x o</code><br />
|
|
|
|
bytt fokus til et annet vindu<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section id="sec-3-3" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Buffere</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><code>C-x b RET</code><br />
|
|
|
|
bytt buffer<br />
|
|
|
|
(siste besøkte buffer er default)<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-x k RET</code><br />
|
|
|
|
drep (kill) buffer<br />
|
|
|
|
(det aktive bufferet er default)<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-x left</code>, <code>C-x right</code><br />
|
|
|
|
en annen måte å bytter buffer på<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
</ul>
|
|
|
|
</section>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<section id="sec-4" >
|
|
|
|
|
|
|
|
<h2>Kommandoer</h2>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><code>M-x function RET</code><br />
|
|
|
|
lar deg kalle en vilkårlig kommando med navn<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>M-x replace-string RET erstatt RET med RET</code><br />
|
|
|
|
tilsvarer «search and replace»<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>M-x query-replace RET erstatt RET med RET</code> … <code>y/n</code><br />
|
|
|
|
samme som replace-string, men du kan velge hva som skal erstattes (kan også kjøres med <code>M-%</code>!)<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
|
|
|
|
<li class="fragment roll-in">Bruk <code>TAB</code> for autocomplete!<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<section id="sec-5" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h2>Søking</h2>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><code>C-s</code><br />
|
|
|
|
søk fremover i bufferet<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-r</code><br />
|
|
|
|
søk bakover i bufferet<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
|
|
|
|
<li class="fragment roll-in">Dette er en <i>svært</i> effektiv måte å flytte markøren på!<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<section id="sec-6" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h2>Hjelp til selvhjelp</h2>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><code>C-h k</code><br />
|
|
|
|
bruk hvis du lurer på hva en tastekombinasjon gjør<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-h f</code><br />
|
|
|
|
bruk hvis du kjenner navnet på en funksjon, men ikke vet hva den gjør<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-h m</code><br />
|
|
|
|
gir deg informasjon om moden du er i (bl.a. tastekombinasjoner som er spesielle for moden)<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-h a</code><br />
|
|
|
|
apropos, lar deg søke i hjelpen<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
|
|
|
|
<li class="fragment roll-in"><code>C-h C-h</code> (eller: <code>C-h ?</code>)<br />
|
|
|
|
gir deg hjelp om hjelpen<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<section id="sec-7" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h2>Programmering</h2>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><code>TAB</code><br />
|
|
|
|
indenterer riktig (dersom indenteringen er gal er det et tegn på at det er noe galt i koden!)<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>M-;</code><br />
|
|
|
|
kommenterer ut et markert område<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>M-x compile RET compile-command RET</code><br />
|
|
|
|
lar deg kompilere i Emacs<br />
|
|
|
|
(gir trykkbare linker til der feil oppstod)<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
|
|
|
|
<li class="fragment roll-in"><code>M-g g <nr> RET</code><br />
|
|
|
|
flytter markøren til linjenummer <code><nr></code><br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<section id="sec-8" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h2>Makroer</h2>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in">Makroer er en måte å "ta opp" en rekke kommandoer på<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-x (</code><br />
|
|
|
|
definer en makro<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code><f3></code><br />
|
|
|
|
definer en makro <i>eller</i> sett inn løpenummer<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-x )</code>, <code><f4></code><br />
|
|
|
|
ferdigstill makroen<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>C-x e</code><br />
|
|
|
|
utfør makroen<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
|
|
|
|
<li class="fragment roll-in"><code>e</code><br />
|
|
|
|
gjenta makroen<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<section id="sec-9" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h2>Pakker</h2>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in">Emacs 24 kommer med innebygd pakkebehandler<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in">det finnes tusenvis av pakker<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><code>M-x list-packages</code><br />
|
|
|
|
bla gjennom pakker<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<ul class="org-ul">
|
|
|
|
<li><code>i</code> installere<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li><code>U</code> oppgrader alle<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li><code>d</code> slett<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li><code>x</code> utfør installering/oppgradering/sletting<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
</ul>
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section id="sec-9-1" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Anbefalinger</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li><a href="https://github.com/auto-complete/auto-complete">Auto-Complete</a><br />
|
|
|
|
viser mulige fullføringer<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li><a href="https://github.com/emacsmirror/undo-tree">Undo-Tree</a><br />
|
|
|
|
et mer standard undo-system, med trestruktur<br />
|
|
|
|
</li>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<li><a href="https://github.com/magnars/multiple-cursors.el">Multiple cursors</a> (<a href="http://emacsrocks.com/e13.html">demo</a>)<br />
|
|
|
|
lar deg kontrollere flere markører samtidig!<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
|
|
|
|
<li><a href="https://github.com/oneKelvinSmith/monokai-emacs">Monokai</a><br />
|
|
|
|
et fargetema (hentet fra Sublime)<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section>
|
|
|
|
<section id="sec-10" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h2>Til slutt</h2>
|
|
|
|
</section>
|
|
|
|
<section id="sec-10-1" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Nyttige lenker</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in"><a href="http://www.gnu.org/software/emacs/manual/html_node/emacs/index.html#Top">Emacs manualen</a><br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><a href="http://termvakt.ifi.uio.no/Emacs">Termvaktens guide til Emacs</a><br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><a href="http://www.masteringemacs.org/reading-guide/">En flott blogg om Emacs</a><br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><a href="http://www.ic.unicamp.br/~helio/disciplinas/MC102/Emacs_Reference_Card.pdf">En cheat-sheet for Emacs</a><br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in"><a href="https://github.com/larstvei/dot-emacs">Min konfigurasjonsfil</a><br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
<section id="sec-10-2" >
|
2013-08-01 01:11:08 +00:00
|
|
|
|
2015-03-06 20:14:27 +00:00
|
|
|
<h3>Spørsmål?</h3>
|
|
|
|
<ul class="org-ul">
|
|
|
|
<li class="fragment roll-in">Noen spørsmål nå?<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in">Kom ned i pausen hvis dere har spørsmål eller ønske for neste time!<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
2015-03-06 20:14:27 +00:00
|
|
|
<li class="fragment roll-in">Gjerne send mail til <a href="mailto:larstvei@ifi.uio.no">larstvei@ifi.uio.no</a>!<br />
|
2013-08-01 01:11:08 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
2015-03-06 20:14:27 +00:00
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<script src="./reveal.js/lib/js/head.min.js"></script>
|
|
|
|
<script src="./reveal.js/js/reveal.min.js"></script>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
// Full list of configuration options available here:
|
|
|
|
// https://github.com/hakimel/reveal.js#configuration
|
|
|
|
Reveal.initialize({
|
|
|
|
|
|
|
|
controls: true,
|
|
|
|
progress: true,
|
|
|
|
history: false,
|
|
|
|
center: true,
|
|
|
|
slideNumber: true,
|
|
|
|
rollingLinks: false,
|
|
|
|
keyboard: true,
|
|
|
|
overview: true,
|
|
|
|
|
|
|
|
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
|
|
|
|
transition: Reveal.getQueryHash().transition || 'linear', // default/cube/page/concave/zoom/linear/fade/none
|
|
|
|
transitionSpeed: 'fast',
|
|
|
|
|
|
|
|
// Optional libraries used to extend on reveal.js
|
|
|
|
dependencies: [
|
|
|
|
{ src: './reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } },
|
|
|
|
{ src: './reveal.js/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
|
|
|
{ src: './reveal.js/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
|
|
|
{ src: './reveal.js/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
|
|
|
|
{ src: './reveal.js/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
|
|
|
|
{ src: './reveal.js/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
|
|
|
|
]
|
|
|
|
});
|
|
|
|
</script>
|
2013-08-01 01:11:08 +00:00
|
|
|
</body>
|
|
|
|
</html>
|