Initial commit
This commit is contained in:
commit
8dc6802e29
119
emacs-init.el
Normal file
119
emacs-init.el
Normal file
@ -0,0 +1,119 @@
|
||||
;; no splash screen
|
||||
(setq inhibit-splash-screen t)
|
||||
|
||||
;; show matching parenthesis
|
||||
(show-paren-mode t)
|
||||
|
||||
;; answer with y/n
|
||||
(fset 'yes-or-no-p 'y-or-n-p)
|
||||
|
||||
;; stop blinking cursor
|
||||
(blink-cursor-mode 0)
|
||||
|
||||
;; overwrite marked text
|
||||
(delete-selection-mode t)
|
||||
|
||||
;; show column number in mode-line
|
||||
(column-number-mode t)
|
||||
|
||||
;; needed to use things downloaded with the package manager
|
||||
(package-initialize)
|
||||
|
||||
;; add mirrors for list-packages
|
||||
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
|
||||
("marmalade" . "http://marmalade-repo.org/packages/")
|
||||
("melpa" . "http://melpa.milkbox.net/packages/")))
|
||||
|
||||
;; choose a color-theme
|
||||
(load-theme 'wombat t)
|
||||
|
||||
;; get the default config for auto-complete (downloaded with
|
||||
;; package-manager)
|
||||
(require 'auto-complete-config)
|
||||
|
||||
;; load the default config of auto-complete
|
||||
(ac-config-default)
|
||||
|
||||
;; enable ido-mode, this changes the way files are selected in the
|
||||
;; minibuffer
|
||||
(ido-mode t)
|
||||
|
||||
;; no menubar
|
||||
(menu-bar-mode 0)
|
||||
|
||||
;; no toolbar either
|
||||
(tool-bar-mode 0)
|
||||
|
||||
;; scrollbar? no
|
||||
(scroll-bar-mode 0)
|
||||
|
||||
;; global-linum-mode shows line numbers in all buffers, exchange 0
|
||||
;; with 1 to enable this feature
|
||||
(global-linum-mode 0)
|
||||
|
||||
;; kills the active buffer, not asking what buffer to kill.
|
||||
(global-set-key (kbd "C-x k") 'kill-this-buffer)
|
||||
|
||||
;; adds all autosave-files (i.e #test.txt#, test.txt~) in one
|
||||
;; directory, avoid clutter in filesystem.
|
||||
(defvar emacs-autosave-directory "~/.emacs.d/autosaves/")
|
||||
(setq backup-directory-alist
|
||||
`((".*" . ,emacs-autosave-directory))
|
||||
auto-save-file-name-transforms
|
||||
`((".*" ,emacs-autosave-directory t)))
|
||||
|
||||
;; defining a function that sets more accessible keyboard-bindings to
|
||||
;; hiding/showing code-blocs
|
||||
(defun hideshow-on ()
|
||||
(local-set-key (kbd "C-c <right>") 'hs-show-block)
|
||||
(local-set-key (kbd "C-c C-<right>") 'hs-show-block)
|
||||
(local-set-key (kbd "C-c <left>") 'hs-hide-block)
|
||||
(local-set-key (kbd "C-c C-<left>") 'hs-hide-block)
|
||||
(local-set-key (kbd "C-c <up>") 'hs-hide-all)
|
||||
(local-set-key (kbd "C-c C-<up>") 'hs-hide-all)
|
||||
(local-set-key (kbd "C-c <down>") 'hs-show-all)
|
||||
(local-set-key (kbd "C-c C-<down>") 'hs-show-all)
|
||||
(hs-minor-mode t))
|
||||
|
||||
;; now we have to tell emacs where to load these functions. Showing
|
||||
;; and hiding codeblocks could be useful for all c-like programming
|
||||
;; (java is c-like) languages, so we add it to the c-mode-common-hook.
|
||||
(add-hook 'c-mode-common-hook 'hideshow-on)
|
||||
|
||||
;; adding shortcuts to java-mode, writing the shortcut folowed by a
|
||||
;; non-word character will cause an expansion.
|
||||
(defun java-shortcuts ()
|
||||
(define-abbrev-table 'java-mode-abbrev-table
|
||||
'(("psv" "public static void main(String[] args) {" nil 0)
|
||||
("sop" "System.out.printf" nil 0)
|
||||
("sopl" "System.out.println" nil 0)))
|
||||
(abbrev-mode t))
|
||||
|
||||
;; the shortcuts are only useful in java-mode so we'll load them to
|
||||
;; java-mode-hook.
|
||||
(add-hook 'java-mode-hook 'java-shortcuts)
|
||||
|
||||
;; defining a function that guesses a compile command and bindes the
|
||||
;; compile-function to C-c C-c
|
||||
(defun java-setup ()
|
||||
(set (make-variable-buffer-local 'compile-command)
|
||||
(concat "javac " (buffer-name)))
|
||||
(local-set-key (kbd "C-c C-c") 'compile))
|
||||
|
||||
;; this is a java-spesific function, so we only load it when entering
|
||||
;; java-mode
|
||||
(add-hook 'java-mode-hook 'java-setup)
|
||||
|
||||
;; defining a function that sets the right indentation to the marked
|
||||
;; text, or the entire buffer if no text is selected.
|
||||
(defun tidy ()
|
||||
"Ident, untabify and unwhitespacify current buffer, or region if active."
|
||||
(interactive)
|
||||
(let ((beg (if (region-active-p) (region-beginning) (point-min)))
|
||||
(end (if (region-active-p) (region-end) (point-max))))
|
||||
(whitespace-cleanup)
|
||||
(indent-region beg end nil)
|
||||
(untabify beg end)))
|
||||
|
||||
;; bindes the tidy-function to C-TAB
|
||||
(global-set-key (kbd "<C-tab>") 'tidy)
|
250
emacs-init.el.html
Normal file
250
emacs-init.el.html
Normal file
@ -0,0 +1,250 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>emacs-init.el</title>
|
||||
<meta name="generator" content="emacs 24.2.1; htmlfontify 0.21" />
|
||||
<style type="text/css"><!--
|
||||
body { font-family: Inconsolata; font-stretch: normal; font-weight: 500; font-style: normal; color: #eeeeec; background: #1d282b; font-size: 11pt; text-decoration: none; }
|
||||
span.default { font-family: Inconsolata; font-stretch: normal; font-weight: 500; font-style: normal; color: #eeeeec; background: #1d282b; font-size: 11pt; text-decoration: none; }
|
||||
span.default a { font-family: Inconsolata; font-stretch: normal; font-weight: 500; font-style: normal; color: #eeeeec; background: #1d282b; font-size: 11pt; text-decoration: underline; }
|
||||
span.doc { color: #888a85; font-family: Inconsolata; font-stretch: normal; font-weight: 500; font-style: normal; background: #1d282b; font-size: 11pt; text-decoration: none; }
|
||||
span.doc a { color: #888a85; font-family: Inconsolata; font-stretch: normal; font-weight: 500; font-style: normal; background: #1d282b; font-size: 11pt; text-decoration: underline; }
|
||||
span.function-name { color: #edd400; font-style: italic; font-weight: 700; font-family: Inconsolata; font-stretch: normal; background: #1d282b; font-size: 11pt; text-decoration: none; }
|
||||
span.function-name a { color: #edd400; font-style: italic; font-weight: 700; font-family: Inconsolata; font-stretch: normal; background: #1d282b; font-size: 11pt; text-decoration: underline; }
|
||||
span.variable-name { color: #eeeeec; font-family: Inconsolata; font-stretch: normal; font-weight: 500; font-style: normal; background: #1d282b; font-size: 11pt; text-decoration: none; }
|
||||
span.variable-name a { color: #eeeeec; font-family: Inconsolata; font-stretch: normal; font-weight: 500; font-style: normal; background: #1d282b; font-size: 11pt; text-decoration: underline; }
|
||||
span.constant { color: #8ae234; font-family: Inconsolata; font-stretch: normal; font-weight: 500; font-style: normal; background: #1d282b; font-size: 11pt; text-decoration: none; }
|
||||
span.constant a { color: #8ae234; font-family: Inconsolata; font-stretch: normal; font-weight: 500; font-style: normal; background: #1d282b; font-size: 11pt; text-decoration: underline; }
|
||||
span.keyword { color: #729fcf; font-weight: 700; font-family: Inconsolata; font-stretch: normal; font-style: normal; background: #1d282b; font-size: 11pt; text-decoration: none; }
|
||||
span.keyword a { color: #729fcf; font-weight: 700; font-family: Inconsolata; font-stretch: normal; font-style: normal; background: #1d282b; font-size: 11pt; text-decoration: underline; }
|
||||
span.string { color: #ad7fa8; font-style: italic; font-family: Inconsolata; font-stretch: normal; font-weight: 500; background: #1d282b; font-size: 11pt; text-decoration: none; }
|
||||
span.string a { color: #ad7fa8; font-style: italic; font-family: Inconsolata; font-stretch: normal; font-weight: 500; background: #1d282b; font-size: 11pt; text-decoration: underline; }
|
||||
span.comment { color: #888a85; font-family: Inconsolata; font-stretch: normal; font-weight: 500; font-style: normal; background: #1d282b; font-size: 11pt; text-decoration: none; }
|
||||
span.comment a { color: #888a85; font-family: Inconsolata; font-stretch: normal; font-weight: 500; font-style: normal; background: #1d282b; font-size: 11pt; text-decoration: underline; }
|
||||
span.comment-delimiter { color: #888a85; font-family: Inconsolata; font-stretch: normal; font-weight: 500; font-style: normal; background: #1d282b; font-size: 11pt; text-decoration: none; }
|
||||
span.comment-delimiter a { color: #888a85; font-family: Inconsolata; font-stretch: normal; font-weight: 500; font-style: normal; background: #1d282b; font-size: 11pt; text-decoration: underline; }
|
||||
--></style>
|
||||
|
||||
<script type="text/javascript"><!--
|
||||
// this function is needed to work around
|
||||
// a bug in IE related to element attributes
|
||||
function hasClass(obj)
|
||||
{
|
||||
var result = false;
|
||||
if (obj.getAttributeNode("class") != null)
|
||||
{
|
||||
result = obj.getAttributeNode("class").value;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function stripe(id)
|
||||
{
|
||||
// the flag we'll use to keep track of
|
||||
// whether the current row is odd or even
|
||||
var even = false;
|
||||
|
||||
// if arguments are provided to specify the colors
|
||||
// of the even & odd rows, then use the them;
|
||||
// otherwise use the following defaults:
|
||||
var evenColor = arguments[1] ? arguments[1] : "#fff";
|
||||
var oddColor = arguments[2] ? arguments[2] : "#ddd";
|
||||
|
||||
// obtain a reference to the desired table
|
||||
// if no such table exists, abort
|
||||
var table = document.getElementById(id);
|
||||
if (! table) { return; }
|
||||
|
||||
// by definition, tables can have more than one tbody
|
||||
// element, so we'll have to get the list of child
|
||||
// <tbody>s
|
||||
var tbodies = table.getElementsByTagName("tbody");
|
||||
|
||||
// and iterate through them...
|
||||
for (var h = 0; h < tbodies.length; h++)
|
||||
{
|
||||
// find all the <tr> elements...
|
||||
var trs = tbodies[h].getElementsByTagName("tr");
|
||||
|
||||
// ... and iterate through them
|
||||
for (var i = 0; i < trs.length; i++)
|
||||
{
|
||||
// avoid rows that have a class attribute
|
||||
// or backgroundColor style
|
||||
if (! hasClass(trs[i]) &&
|
||||
! trs[i].style.backgroundColor)
|
||||
{
|
||||
// get all the cells in this row...
|
||||
var tds = trs[i].getElementsByTagName("td");
|
||||
|
||||
// and iterate through them...
|
||||
for (var j = 0; j < tds.length; j++)
|
||||
{
|
||||
var mytd = tds[j];
|
||||
|
||||
// avoid cells that have a class attribute
|
||||
// or backgroundColor style
|
||||
if (! hasClass(mytd) &&
|
||||
! mytd.style.backgroundColor)
|
||||
{
|
||||
mytd.style.backgroundColor =
|
||||
even ? evenColor : oddColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
// flip from odd to even, or vice-versa
|
||||
even = ! even;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function toggle_invis( name )
|
||||
{
|
||||
var filter =
|
||||
{ acceptNode:
|
||||
function( node )
|
||||
{ var classname = node.id;
|
||||
if( classname )
|
||||
{ var classbase = classname.substr( 0, name.length );
|
||||
if( classbase == name ) { return NodeFilter.FILTER_ACCEPT; } }
|
||||
return NodeFilter.FILTER_SKIP; } };
|
||||
var walker = document.createTreeWalker( document.body ,
|
||||
NodeFilter.SHOW_ELEMENT ,
|
||||
filter ,
|
||||
false );
|
||||
while( walker.nextNode() )
|
||||
{
|
||||
var e = walker.currentNode;
|
||||
if( e.style.display == "none" ) { e.style.display = "inline"; }
|
||||
else { e.style.display = "none"; }
|
||||
}
|
||||
}
|
||||
--> </script>
|
||||
</head>
|
||||
<body onload="stripe('index'); return true;">
|
||||
|
||||
<pre><span class="comment-delimiter">;; </span><span class="comment">no splash screen
|
||||
</span>(setq inhibit-splash-screen t)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">show matching parenthesis
|
||||
</span>(show-paren-mode t)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">answer with y/n
|
||||
</span>(fset 'yes-or-no-p 'y-or-n-p)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">stop blinking cursor
|
||||
</span>(blink-cursor-mode 0)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">overwrite marked text
|
||||
</span>(delete-selection-mode t)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">show column number in mode-line
|
||||
</span>(column-number-mode t)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">needed to use things downloaded with the package manager
|
||||
</span>(package-initialize)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">add mirrors for list-packages
|
||||
</span>(setq package-archives '((<span class="string">"gnu"</span> . <span class="string">"http://elpa.gnu.org/packages/"</span>)
|
||||
(<span class="string">"marmalade"</span> . <span class="string">"http://marmalade-repo.org/packages/"</span>)
|
||||
(<span class="string">"melpa"</span> . <span class="string">"http://melpa.milkbox.net/packages/"</span>)))
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">choose a color-theme
|
||||
</span>(load-theme 'wombat t)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">get the default config for auto-complete (downloaded with
|
||||
</span><span class="comment-delimiter">;; </span><span class="comment">package-manager)
|
||||
</span>(<span class="keyword">require</span> '<span class="constant">auto-complete-config</span>)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">load the default config of auto-complete
|
||||
</span>(ac-config-default)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">enable ido-mode, this changes the way files are selected in the
|
||||
</span><span class="comment-delimiter">;; </span><span class="comment">minibuffer
|
||||
</span>(ido-mode t)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">no menubar
|
||||
</span>(menu-bar-mode 0)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">no toolbar either
|
||||
</span>(tool-bar-mode 0)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">scrollbar? no
|
||||
</span>(scroll-bar-mode 0)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">global-linum-mode shows line numbers in all buffers, exchange 0
|
||||
</span><span class="comment-delimiter">;; </span><span class="comment">with 1 to enable this feature
|
||||
</span>(global-linum-mode 0)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">kills the active buffer, not asking what buffer to kill.
|
||||
</span>(global-set-key (kbd <span class="string">"C-x k"</span>) 'kill-this-buffer)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">adds all autosave-files (i.e #test.txt#, test.txt~) in one
|
||||
</span><span class="comment-delimiter">;; </span><span class="comment">directory, avoid clutter in filesystem.
|
||||
</span>(<span class="keyword">defvar</span> <span class="variable-name">emacs-autosave-directory</span> <span class="string">"~/.emacs.d/autosaves/"</span>)
|
||||
(setq backup-directory-alist
|
||||
`((<span class="string">".*"</span> . ,emacs-autosave-directory))
|
||||
auto-save-file-name-transforms
|
||||
`((<span class="string">".*"</span> ,emacs-autosave-directory t)))
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">defining a function that sets more accessible keyboard-bindings to
|
||||
</span><span class="comment-delimiter">;; </span><span class="comment">hiding/showing code-blocs
|
||||
</span>(<span class="keyword">defun</span> <span class="function-name">hideshow-on</span> ()
|
||||
(local-set-key (kbd <span class="string">"C-c <right>"</span>) 'hs-show-block)
|
||||
(local-set-key (kbd <span class="string">"C-c C-<right>"</span>) 'hs-show-block)
|
||||
(local-set-key (kbd <span class="string">"C-c <left>"</span>) 'hs-hide-block)
|
||||
(local-set-key (kbd <span class="string">"C-c C-<left>"</span>) 'hs-hide-block)
|
||||
(local-set-key (kbd <span class="string">"C-c <up>"</span>) 'hs-hide-all)
|
||||
(local-set-key (kbd <span class="string">"C-c C-<up>"</span>) 'hs-hide-all)
|
||||
(local-set-key (kbd <span class="string">"C-c <down>"</span>) 'hs-show-all)
|
||||
(local-set-key (kbd <span class="string">"C-c C-<down>"</span>) 'hs-show-all)
|
||||
(hs-minor-mode t))
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">now we have to tell emacs where to load these functions. Showing
|
||||
</span><span class="comment-delimiter">;; </span><span class="comment">and hiding codeblocks could be useful for all c-like programming
|
||||
</span><span class="comment-delimiter">;; </span><span class="comment">(java is c-like) languages, so we add it to the c-mode-common-hook.
|
||||
</span>(add-hook 'c-mode-common-hook 'hideshow-on)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">adding shortcuts to java-mode, writing the shortcut folowed by a
|
||||
</span><span class="comment-delimiter">;; </span><span class="comment">non-word character will cause an expansion.
|
||||
</span>(<span class="keyword">defun</span> <span class="function-name">java-shortcuts</span> ()
|
||||
(define-abbrev-table 'java-mode-abbrev-table
|
||||
'((<span class="string">"psv"</span> <span class="string">"public static void main(String[] args) {"</span> nil 0)
|
||||
(<span class="string">"sop"</span> <span class="string">"System.out.printf"</span> nil 0)
|
||||
(<span class="string">"sopl"</span> <span class="string">"System.out.println"</span> nil 0)))
|
||||
(abbrev-mode t))
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">the shortcuts are only useful in java-mode so we'll load them to
|
||||
</span><span class="comment-delimiter">;; </span><span class="comment">java-mode-hook.
|
||||
</span>(add-hook 'java-mode-hook 'java-shortcuts)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">defining a function that guesses a compile command and bindes the
|
||||
</span><span class="comment-delimiter">;; </span><span class="comment">compile-function to C-c C-c
|
||||
</span>(<span class="keyword">defun</span> <span class="function-name">java-setup</span> ()
|
||||
(set (make-variable-buffer-local 'compile-command)
|
||||
(concat <span class="string">"javac "</span> (buffer-name)))
|
||||
(local-set-key (kbd <span class="string">"C-c C-c"</span>) 'compile))
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">this is a java-spesific function, so we only load it when entering
|
||||
</span><span class="comment-delimiter">;; </span><span class="comment">java-mode
|
||||
</span>(add-hook 'java-mode-hook 'java-setup)
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">defining a function that sets the right indentation to the marked
|
||||
</span><span class="comment-delimiter">;; </span><span class="comment">text, or the entire buffer if no text is selected.
|
||||
</span>(<span class="keyword">defun</span> <span class="function-name">tidy</span> ()
|
||||
<span class="doc">"Ident, untabify and unwhitespacify current buffer, or region if active."</span>
|
||||
(interactive)
|
||||
(<span class="keyword">let</span> ((beg (<span class="keyword">if</span> (region-active-p) (region-beginning) (point-min)))
|
||||
(end (<span class="keyword">if</span> (region-active-p) (region-end) (point-max))))
|
||||
(whitespace-cleanup)
|
||||
(indent-region beg end nil)
|
||||
(untabify beg end)))
|
||||
|
||||
<span class="comment-delimiter">;; </span><span class="comment">bindes the tidy-function to C-TAB
|
||||
</span>(global-set-key (kbd <span class="string">"<C-tab>"</span>) 'tidy)
|
||||
</pre>
|
||||
|
||||
</body>
|
||||
</html>
|
88
emacskurs-init-comments.el
Normal file
88
emacskurs-init-comments.el
Normal file
@ -0,0 +1,88 @@
|
||||
;; no splash screen
|
||||
|
||||
|
||||
;; show matching parenthesis
|
||||
|
||||
|
||||
;; answer with y/n
|
||||
|
||||
|
||||
;; stop blinking cursor
|
||||
|
||||
|
||||
;; overwrite marked text
|
||||
|
||||
|
||||
;; show column number in mode-line
|
||||
|
||||
|
||||
;; needed to use things downloaded with the package manager
|
||||
|
||||
|
||||
;; add mirrors for list-packages
|
||||
|
||||
|
||||
;; choose a color-theme (downloaded with package-manager)
|
||||
|
||||
|
||||
;; get the default config for auto-complete (downloaded with
|
||||
;; package-manager)
|
||||
|
||||
|
||||
;; load the default config of auto-complete
|
||||
|
||||
|
||||
;; enable ido-mode, this changes the way files are selected in the
|
||||
;; minibuffer
|
||||
|
||||
|
||||
;; no menubar
|
||||
|
||||
|
||||
;; no toolbar either
|
||||
|
||||
|
||||
;; scrollbar? no
|
||||
|
||||
|
||||
;; global-linum-mode shows line numbers in all buffers, exchange 0
|
||||
;; with 1 to enable this feature
|
||||
|
||||
|
||||
;; kills the active buffer, not asking what buffer to kill.
|
||||
|
||||
|
||||
;; adds all autosave-files (i.e #test.txt#, test.txt~) in one
|
||||
;; directory, avoid clutter in filesystem.
|
||||
|
||||
|
||||
;; defining a function that sets more accessible keyboard-bindings to
|
||||
;; hiding/showing code-blocs
|
||||
|
||||
|
||||
;; now we have to tell emacs where to load these functions. Showing
|
||||
;; and hiding codeblocks could be useful for all c-like programming
|
||||
;; (java is c-like) languages, so we add it to the c-mode-common-hook.
|
||||
|
||||
|
||||
;; adding shortcuts to java-mode, writing the shortcut folowed by a
|
||||
;; non-word character will cause an expansion.
|
||||
|
||||
|
||||
;; the shortcuts are only useful in java-mode so we'll load them to
|
||||
;; java-mode-hook.
|
||||
|
||||
|
||||
;; defining a function that guesses a compile command and bindes the
|
||||
;; compile-function to C-c C-c
|
||||
|
||||
|
||||
;; this is a java-spesific function, so we only load it when entering
|
||||
;; java-mode
|
||||
|
||||
|
||||
;; defining a function that sets the right indentation to the marked
|
||||
;; text, or the entire buffer if no text is selected.
|
||||
|
||||
|
||||
;; bindes the tidy-function to C-TAB
|
763
emacskurs.html
Normal file
763
emacskurs.html
Normal file
@ -0,0 +1,763 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>emacskurs</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
|
||||
<meta name="title" content="emacskurs"/>
|
||||
<meta name="generator" content="Org-mode"/>
|
||||
<meta name="generated" content="2013-08-01 03:06:33 CEST"/>
|
||||
<meta name="author" content="Lars Tveito"/>
|
||||
<meta name="description" content=""/>
|
||||
<meta name="keywords" content=""/>
|
||||
<style type="text/css">
|
||||
<!--/*--><![CDATA[/*><!--*/
|
||||
html { font-family: Times, serif; font-size: 12pt; }
|
||||
.title { text-align: center; }
|
||||
.todo { color: red; }
|
||||
.done { color: green; }
|
||||
.tag { background-color: #add8e6; font-weight:normal }
|
||||
.target { }
|
||||
.timestamp { color: #bebebe; }
|
||||
.timestamp-kwd { color: #5f9ea0; }
|
||||
.right {margin-left:auto; margin-right:0px; text-align:right;}
|
||||
.left {margin-left:0px; margin-right:auto; text-align:left;}
|
||||
.center {margin-left:auto; margin-right:auto; text-align:center;}
|
||||
p.verse { margin-left: 3% }
|
||||
pre {
|
||||
border: 1pt solid #AEBDCC;
|
||||
background-color: #F3F5F7;
|
||||
padding: 5pt;
|
||||
font-family: courier, monospace;
|
||||
font-size: 90%;
|
||||
overflow:auto;
|
||||
}
|
||||
table { border-collapse: collapse; }
|
||||
td, th { vertical-align: top; }
|
||||
th.right { text-align:center; }
|
||||
th.left { text-align:center; }
|
||||
th.center { text-align:center; }
|
||||
td.right { text-align:right; }
|
||||
td.left { text-align:left; }
|
||||
td.center { text-align:center; }
|
||||
dt { font-weight: bold; }
|
||||
div.figure { padding: 0.5em; }
|
||||
div.figure p { text-align: center; }
|
||||
div.inlinetask {
|
||||
padding:10px;
|
||||
border:2px solid gray;
|
||||
margin:10px;
|
||||
background: #ffffcc;
|
||||
}
|
||||
textarea { overflow-x: auto; }
|
||||
.linenr { font-size:smaller }
|
||||
.code-highlighted {background-color:#ffff00;}
|
||||
.org-info-js_info-navigation { border-style:none; }
|
||||
#org-info-js_console-label { font-size:10px; font-weight:bold;
|
||||
white-space:nowrap; }
|
||||
.org-info-js_search-highlight {background-color:#ffff00; color:#000000;
|
||||
font-weight:bold; }
|
||||
/*]]>*/-->
|
||||
</style><!-- configuration parameters -->
|
||||
<meta name="defaultView" content="slideshow" />
|
||||
<meta name="controlVis" content="hidden" />
|
||||
<!-- style sheet links -->
|
||||
<link rel="stylesheet" href="ui/railscast/slides.css" type="text/css" media="projection" id="slideProj" />
|
||||
<link rel="stylesheet" href="ui/default/outline.css" type="text/css" media="screen" id="outlineStyle" />
|
||||
<link rel="stylesheet" href="ui/default/print.css" type="text/css" media="print" id="slidePrint" />
|
||||
<link rel="stylesheet" href="ui/default/opera.css" type="text/css" media="projection" id="operaFix" />
|
||||
<!-- S5 JS -->
|
||||
<script src="ui/default/slides.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
<!--/*--><![CDATA[/*><!--*/
|
||||
function CodeHighlightOn(elem, id)
|
||||
{
|
||||
var target = document.getElementById(id);
|
||||
if(null != target) {
|
||||
elem.cacheClassElem = elem.className;
|
||||
elem.cacheClassTarget = target.className;
|
||||
target.className = "code-highlighted";
|
||||
elem.className = "code-highlighted";
|
||||
}
|
||||
}
|
||||
function CodeHighlightOff(elem, id)
|
||||
{
|
||||
var target = document.getElementById(id);
|
||||
if(elem.cacheClassElem)
|
||||
elem.className = elem.cacheClassElem;
|
||||
if(elem.cacheClassTarget)
|
||||
target.className = elem.cacheClassTarget;
|
||||
}
|
||||
/*]]>*///-->
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="preamble">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="layout">
|
||||
<div id="controls"><!-- no edit --></div>
|
||||
<div id="currentSlide"><!-- no edit --></div>
|
||||
<div id="header"></div>
|
||||
<div id="footer">
|
||||
<h1>Lars Tveito - emacskurs</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="presentation">
|
||||
<div class="slide">
|
||||
<h1>emacskurs</h1>
|
||||
<h1>Lars Tveito</h1>
|
||||
<h1>2013-08-01</h1>
|
||||
</div>
|
||||
<h1 class="title">emacskurs</h1>
|
||||
|
||||
|
||||
<div id="table-of-contents" class="slide">
|
||||
<h1>Table of Contents</h1>
|
||||
<div id="text-table-of-contents">
|
||||
<ul>
|
||||
<li><a href="#sec-1">1 Emacskurs</a>
|
||||
<ul>
|
||||
<li><a href="#sec-1-1">1.1 Intro</a>
|
||||
<ul>
|
||||
<li><a href="#sec-1-1-1">1.1.1 Hva er Emacs?</a></li>
|
||||
<li><a href="#sec-1-1-2">1.1.2 Buffere, vinduer og rammer</a></li>
|
||||
<li><a href="#sec-1-1-3">1.1.3 Modes</a></li>
|
||||
<li><a href="#sec-1-1-4">1.1.4 Tips</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#sec-1-2">1.2 Taster</a>
|
||||
<ul>
|
||||
<li><a href="#sec-1-2-1">1.2.1 Terminologi for taster</a></li>
|
||||
<li><a href="#sec-1-2-2">1.2.2 Prefikstaster</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#sec-1-3">1.3 Komme seg ut</a></li>
|
||||
<li><a href="#sec-1-4">1.4 Tekstredigering</a>
|
||||
<ul>
|
||||
<li><a href="#sec-1-4-1">1.4.1 Flytte markør</a></li>
|
||||
<li><a href="#sec-1-4-2">1.4.2 Bla rundt</a></li>
|
||||
<li><a href="#sec-1-4-3">1.4.3 Kill og yank</a></li>
|
||||
<li><a href="#sec-1-4-4">1.4.4 Feiloppretting</a></li>
|
||||
<li><a href="#sec-1-4-5">1.4.5 Markering av tekst</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#sec-1-5">1.5 Filer, vinduer og buffere</a>
|
||||
<ul>
|
||||
<li><a href="#sec-1-5-1">1.5.1 Filer</a></li>
|
||||
<li><a href="#sec-1-5-2">1.5.2 Vinduer</a></li>
|
||||
<li><a href="#sec-1-5-3">1.5.3 Buffere</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#sec-1-6">1.6 Kommandoer</a></li>
|
||||
<li><a href="#sec-1-7">1.7 Søking</a></li>
|
||||
<li><a href="#sec-1-8">1.8 Hjelp til selvhjelp</a></li>
|
||||
<li><a href="#sec-1-9">1.9 Programmering</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1" class="outline-1 slide">
|
||||
<h1 id="sec-1"><span class="section-number-1">1</span> Emacskurs</h1>
|
||||
<div class="outline-text-1" id="text-1">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-1" class="outline-2">
|
||||
<h2 id="sec-1-1"><span class="section-number-2">1.1</span> Intro</h2>
|
||||
<div class="outline-text-2" id="text-1-1">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-1-1" class="outline-3">
|
||||
<h3 id="sec-1-1-1"><span class="section-number-3">1.1.1</span> Hva er Emacs?</h3>
|
||||
<div class="outline-text-3" id="text-1-1-1">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>Teksteditor
|
||||
</li>
|
||||
<li>Utvidbar (Elisp)
|
||||
</li>
|
||||
<li>Over 30 år gammel
|
||||
</li>
|
||||
<li>Over 2500 innebygde kommandoer
|
||||
</li>
|
||||
<li>Fri programvare
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-1-2" class="outline-3">
|
||||
<h3 id="sec-1-1-2"><span class="section-number-3">1.1.2</span> Buffere, vinduer og rammer</h3>
|
||||
<div class="outline-text-3" id="text-1-1-2">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>Tekst vises i buffere
|
||||
</li>
|
||||
<li>Du kan ha så mange åpene buffere du vil
|
||||
</li>
|
||||
<li>En fil åpnes i et nytt buffer
|
||||
</li>
|
||||
<li>Minibufferet (nederste linje), brukes til å skrive inn filnavn,
|
||||
buffernavn, etc…
|
||||
|
||||
</li>
|
||||
<li>Emacs åpnes i en ramme
|
||||
</li>
|
||||
<li>En kan ha flere vinduer i samme ramme
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-1-3" class="outline-3">
|
||||
<h3 id="sec-1-1-3"><span class="section-number-3">1.1.3</span> Modes</h3>
|
||||
<div class="outline-text-3" id="text-1-1-3">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>Major modes
|
||||
<ul>
|
||||
<li>hvert buffer har kun én aktiv major mode
|
||||
</li>
|
||||
<li>en major mode gir deg funksjonalitet for en bestemt type
|
||||
tekstredigering
|
||||
</li>
|
||||
<li>de fleste programmeringsspråk har sin egen major mode
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
<li>Minor modes
|
||||
<ul>
|
||||
<li>du kan ha så mange aktive minor modes du ønsker
|
||||
</li>
|
||||
<li>en minor mode tilbyr tilleggsfunksjonalitet
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p>
|
||||
Modes tilføyer ofte egne tastekombinasjoner!
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-1-4" class="outline-3">
|
||||
<h3 id="sec-1-1-4"><span class="section-number-3">1.1.4</span> Tips</h3>
|
||||
<div class="outline-text-3" id="text-1-1-4">
|
||||
|
||||
|
||||
<p>
|
||||
Emacs er annerledes å bruke enn mange andre programmer, så det
|
||||
krever tilvenning.
|
||||
</p>
|
||||
<ul>
|
||||
<li>i begynnelsen
|
||||
<ul>
|
||||
<li>les og gjør «learn-by-doing tutorial» (C-h t)
|
||||
</li>
|
||||
<li>tving deg selv til å bruke de kommandoene du lærer til de
|
||||
sitter i fingrene
|
||||
</li>
|
||||
<li>unngå «pek og klikk»
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
<li>etter hvert (for spesielt interesserte)
|
||||
<ul>
|
||||
<li>skriv din egen configfil
|
||||
</li>
|
||||
<li>lær litt elisp, og skriv dine egne funksjoner
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
<li>annet
|
||||
<ul>
|
||||
<li>gjør CAPS-LOCK om til en ekstra Control (Ctrl)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-2" class="outline-2">
|
||||
<h2 id="sec-1-2"><span class="section-number-2">1.2</span> Taster</h2>
|
||||
<div class="outline-text-2" id="text-1-2">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-2-1" class="outline-3">
|
||||
<h3 id="sec-1-2-1"><span class="section-number-3">1.2.1</span> Terminologi for taster</h3>
|
||||
<div class="outline-text-3" id="text-1-2-1">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>C-<any>
|
||||
Control
|
||||
|
||||
</li>
|
||||
<li>M-<any>
|
||||
Meta er Alt på de fleste maskiner (alternativt ESC)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p>
|
||||
<any> betyr et vilkårlig tegn (eller tastekombinasjon)
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-2-2" class="outline-3">
|
||||
<h3 id="sec-1-2-2"><span class="section-number-3">1.2.2</span> Prefikstaster</h3>
|
||||
<div class="outline-text-3" id="text-1-2-2">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>C-x <any>
|
||||
prefiks for globale kommandoer
|
||||
|
||||
</li>
|
||||
<li>C-c <any>
|
||||
prefiks for lokale kommandoer
|
||||
(har ikke alltid samme funksjon!)
|
||||
|
||||
</li>
|
||||
<li>C-h <any>
|
||||
prefiks for hjelp
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p>
|
||||
Alle tastekombinasjon som ikke er en prefiks er bundet til en
|
||||
kommando!
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-3" class="outline-2">
|
||||
<h2 id="sec-1-3"><span class="section-number-2">1.3</span> Komme seg ut</h2>
|
||||
<div class="outline-text-2" id="text-1-3">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>C-x C-c
|
||||
avslutt emacs
|
||||
|
||||
</li>
|
||||
<li>C-g
|
||||
avbryt
|
||||
(bruk hvis du ikke skjønner hva emacs holder på med!)
|
||||
|
||||
</li>
|
||||
<li>ESC ESC ESC
|
||||
(bruk hvis C-g ikke hjalp)
|
||||
|
||||
</li>
|
||||
<li>C-<prefix> C-g
|
||||
er udefinert
|
||||
(Dvs. C-g kan brukes til å avbryte prefiks)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-4" class="outline-2">
|
||||
<h2 id="sec-1-4"><span class="section-number-2">1.4</span> Tekstredigering</h2>
|
||||
<div class="outline-text-2" id="text-1-4">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-4-1" class="outline-3">
|
||||
<h3 id="sec-1-4-1"><span class="section-number-3">1.4.1</span> Flytte markør</h3>
|
||||
<div class="outline-text-3" id="text-1-4-1">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>C-f, C-b
|
||||
flytt markøren ett tegn frem/tilbake
|
||||
|
||||
</li>
|
||||
<li>M-f, M-b
|
||||
flytt markøren ett ord frem/tilbake
|
||||
|
||||
</li>
|
||||
<li>C-a, C-e
|
||||
flytt markøren til begynnelsen/slutten av linja
|
||||
|
||||
</li>
|
||||
<li>C-p, C-n
|
||||
flytt markøren til forrige/neste linje
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-4-2" class="outline-3">
|
||||
<h3 id="sec-1-4-2"><span class="section-number-3">1.4.2</span> Bla rundt</h3>
|
||||
<div class="outline-text-3" id="text-1-4-2">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>C-v, M-v
|
||||
scroll ned/opp en side
|
||||
|
||||
</li>
|
||||
<li>M-<, M->
|
||||
gå til begynnelsen/slutten av bufferet
|
||||
|
||||
</li>
|
||||
<li>C-l
|
||||
vis slik at markøren er i senter/toppen/bunnen
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-4-3" class="outline-3">
|
||||
<h3 id="sec-1-4-3"><span class="section-number-3">1.4.3</span> Kill og yank</h3>
|
||||
<div class="outline-text-3" id="text-1-4-3">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>C-w
|
||||
kill, tilsvarer cut
|
||||
|
||||
</li>
|
||||
<li>C-y
|
||||
yank, tilsvarer paste
|
||||
|
||||
</li>
|
||||
<li>M-w
|
||||
lagre til kill-ring, tilsvarer copy
|
||||
|
||||
</li>
|
||||
<li>C-k
|
||||
kill, drepe resten av en linje
|
||||
|
||||
</li>
|
||||
<li>M-y, må etterfølges av C-y
|
||||
yank-pop, går lenger tilbake på kill-ring
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-4-4" class="outline-3">
|
||||
<h3 id="sec-1-4-4"><span class="section-number-3">1.4.4</span> Feiloppretting</h3>
|
||||
<div class="outline-text-3" id="text-1-4-4">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>C-d, M-d
|
||||
fjern neste bokstav/ord
|
||||
|
||||
</li>
|
||||
<li>C-_
|
||||
undo!
|
||||
|
||||
</li>
|
||||
<li>C-t, M-t
|
||||
bytt om to bokstaver/ord
|
||||
|
||||
</li>
|
||||
<li>C-x C-t
|
||||
bytt om to linjer
|
||||
|
||||
</li>
|
||||
<li>M-q
|
||||
plasserer om tekst i en paragraf slik at linjene ikke overstiger
|
||||
70 tegn (den ødelegger ikke syntaks i programmeringsmodes)
|
||||
|
||||
</li>
|
||||
<li>M-u, M-l, M-c
|
||||
gjør neste ord til UPPERCASE/lowercase/Capital-Case
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-4-5" class="outline-3">
|
||||
<h3 id="sec-1-4-5"><span class="section-number-3">1.4.5</span> Markering av tekst</h3>
|
||||
<div class="outline-text-3" id="text-1-4-5">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>C-SPC
|
||||
marker tekst
|
||||
|
||||
</li>
|
||||
<li>C-x h
|
||||
marker all tekst
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p>
|
||||
Bruk i kombinasjon med M-w, C-w og TAB
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-5" class="outline-2">
|
||||
<h2 id="sec-1-5"><span class="section-number-2">1.5</span> Filer, vinduer og buffere</h2>
|
||||
<div class="outline-text-2" id="text-1-5">
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-5-1" class="outline-3">
|
||||
<h3 id="sec-1-5-1"><span class="section-number-3">1.5.1</span> Filer</h3>
|
||||
<div class="outline-text-3" id="text-1-5-1">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>C-x C-f
|
||||
åpne fil
|
||||
(hvis den ikke finnes fra før opprettes den)
|
||||
|
||||
</li>
|
||||
<li>C-x C-s
|
||||
lagre buffer
|
||||
|
||||
</li>
|
||||
<li>C-x C-w
|
||||
skrive til fil (tilsvarende «lagre som…»)
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-5-2" class="outline-3">
|
||||
<h3 id="sec-1-5-2"><span class="section-number-3">1.5.2</span> Vinduer</h3>
|
||||
<div class="outline-text-3" id="text-1-5-2">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>C-x 2, C-x 3
|
||||
splitt et vindu vertikalt/horisontalt
|
||||
|
||||
</li>
|
||||
<li>C-x 1
|
||||
gjør det aktive vinduet til det eneste vinduet
|
||||
|
||||
</li>
|
||||
<li>C-x 0
|
||||
lukk det aktive vinduet
|
||||
|
||||
</li>
|
||||
<li>C-x o
|
||||
bytt fokus til et annet vindu
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-5-3" class="outline-3">
|
||||
<h3 id="sec-1-5-3"><span class="section-number-3">1.5.3</span> Buffere</h3>
|
||||
<div class="outline-text-3" id="text-1-5-3">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>C-x b RET
|
||||
bytt buffer
|
||||
(siste besøkte buffer er default)
|
||||
|
||||
</li>
|
||||
<li>C-x k RET
|
||||
drep (kill) buffer
|
||||
(det aktive bufferet er default)
|
||||
|
||||
</li>
|
||||
<li>C-x left, C-x right
|
||||
en annen måte å bytter buffer
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-6" class="outline-2">
|
||||
<h2 id="sec-1-6"><span class="section-number-2">1.6</span> Kommandoer</h2>
|
||||
<div class="outline-text-2" id="text-1-6">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>M-x function RET
|
||||
lar deg kalle en hvilken som helst kommando med navn
|
||||
|
||||
</li>
|
||||
<li>M-x replace-string RET erstatt RET med RET
|
||||
tilsvarer «search and replace»
|
||||
|
||||
</li>
|
||||
<li>M-x query-replace RET erstatt RET med RET … y/n
|
||||
samme som replace-string, men du kan velge hva som skal
|
||||
erstattes
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p>
|
||||
Bruk TAB for autocomplete!
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-7" class="outline-2">
|
||||
<h2 id="sec-1-7"><span class="section-number-2">1.7</span> Søking</h2>
|
||||
<div class="outline-text-2" id="text-1-7">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>C-s
|
||||
søk fremover i bufferet
|
||||
|
||||
</li>
|
||||
<li>C-r
|
||||
søk bakover i bufferet
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<p>
|
||||
Dette er en effektiv måte å flytte markøren!
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-8" class="outline-2">
|
||||
<h2 id="sec-1-8"><span class="section-number-2">1.8</span> Hjelp til selvhjelp</h2>
|
||||
<div class="outline-text-2" id="text-1-8">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>C-h k
|
||||
bruk hvis du lurer på hva en tastekombinasjon gjør
|
||||
|
||||
</li>
|
||||
<li>C-h f
|
||||
bruk hvis du kjenner navnet på en funksjon, men ikke vet hva hva
|
||||
den gjør
|
||||
|
||||
</li>
|
||||
<li>C-h m
|
||||
gir deg informasjon om moden du er i
|
||||
(bl.a tastekombinasjoner som er spesielle for moden)
|
||||
|
||||
</li>
|
||||
<li>C-h a
|
||||
apropos, lar deg søke i hjelpen
|
||||
|
||||
</li>
|
||||
<li>C-h C-h, C-h ?
|
||||
gir deg hjelp om hjelpen
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="outline-container-1-9" class="outline-2">
|
||||
<h2 id="sec-1-9"><span class="section-number-2">1.9</span> Programmering</h2>
|
||||
<div class="outline-text-2" id="text-1-9">
|
||||
|
||||
|
||||
<ul>
|
||||
<li>TAB indenterer riktig
|
||||
(dersom indenteringen er gal er det et tegn på at det er noe galt
|
||||
i koden!)
|
||||
|
||||
</li>
|
||||
<li>M-;
|
||||
kommenterer ut et markert område
|
||||
|
||||
</li>
|
||||
<li>M-x compile RET compile-command RET
|
||||
lar deg kompilere i Emacs
|
||||
(gir trykkbare linker til der feil oppstod)
|
||||
|
||||
</li>
|
||||
<li>M-g g <nr> RET
|
||||
flytter markøren til linjenummer <nr>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
268
emacskurs.org
Normal file
268
emacskurs.org
Normal file
@ -0,0 +1,268 @@
|
||||
* Emacskurs
|
||||
** Intro
|
||||
*** Hva er Emacs?
|
||||
|
||||
- Teksteditor
|
||||
- Utvidbar (Elisp)
|
||||
- Over 30 år gammel
|
||||
- Over 2500 innebygde kommandoer
|
||||
- Fri programvare
|
||||
|
||||
*** Buffere, vinduer og rammer
|
||||
|
||||
- Tekst vises i buffere
|
||||
- Du kan ha så mange åpene buffere du vil
|
||||
- En fil åpnes i et nytt buffer
|
||||
- Minibufferet (nederste linje), brukes til å skrive inn filnavn,
|
||||
buffernavn, etc...
|
||||
|
||||
- Emacs åpnes i en ramme
|
||||
- En kan ha flere vinduer i samme ramme
|
||||
|
||||
*** Modes
|
||||
|
||||
- Major modes
|
||||
- hvert buffer har kun én aktiv major mode
|
||||
- en major mode gir deg funksjonalitet for en bestemt type
|
||||
tekstredigering
|
||||
- de fleste programmeringsspråk har sin egen major mode
|
||||
|
||||
- Minor modes
|
||||
- du kan ha så mange aktive minor modes du ønsker
|
||||
- en minor mode tilbyr tilleggsfunksjonalitet
|
||||
|
||||
Modes tilføyer ofte egne tastekombinasjoner!
|
||||
|
||||
*** Tips
|
||||
|
||||
Emacs er annerledes å bruke enn mange andre programmer, så det
|
||||
krever tilvenning.
|
||||
|
||||
- i begynnelsen
|
||||
- les og gjør «learn-by-doing tutorial» (C-h t)
|
||||
- tving deg selv til å bruke de kommandoene du lærer til de
|
||||
sitter i fingrene
|
||||
- unngå «pek og klikk»
|
||||
|
||||
- etter hvert (for spesielt interesserte)
|
||||
- skriv din egen configfil
|
||||
- lær litt elisp, og skriv dine egne funksjoner
|
||||
|
||||
- annet
|
||||
- gjør CAPS-LOCK om til en ekstra Control (Ctrl)
|
||||
|
||||
** Taster
|
||||
*** Terminologi for taster
|
||||
|
||||
- C-<any>
|
||||
Control
|
||||
|
||||
- M-<any>
|
||||
Meta er Alt på de fleste maskiner (alternativt ESC)
|
||||
|
||||
<any> betyr et vilkårlig tegn (eller tastekombinasjon)
|
||||
|
||||
*** Prefikstaster
|
||||
|
||||
- C-x <any>
|
||||
prefiks for globale kommandoer
|
||||
|
||||
- C-c <any>
|
||||
prefiks for lokale kommandoer
|
||||
(har ikke alltid samme funksjon!)
|
||||
|
||||
- C-h <any>
|
||||
prefiks for hjelp
|
||||
|
||||
Alle tastekombinasjon som ikke er en prefiks er bundet til en
|
||||
kommando!
|
||||
|
||||
** Komme seg ut
|
||||
|
||||
- C-x C-c
|
||||
avslutt emacs
|
||||
|
||||
- C-g
|
||||
avbryt
|
||||
(bruk hvis du ikke skjønner hva emacs holder på med!)
|
||||
|
||||
- ESC ESC ESC
|
||||
(bruk hvis C-g ikke hjalp)
|
||||
|
||||
- C-<prefix> C-g
|
||||
er udefinert
|
||||
(Dvs. C-g kan brukes til å avbryte prefiks)
|
||||
|
||||
** Tekstredigering
|
||||
*** Flytte markør
|
||||
|
||||
- C-f, C-b
|
||||
flytt markøren ett tegn frem/tilbake
|
||||
|
||||
- M-f, M-b
|
||||
flytt markøren ett ord frem/tilbake
|
||||
|
||||
- C-a, C-e
|
||||
flytt markøren til begynnelsen/slutten av linja
|
||||
|
||||
- C-p, C-n
|
||||
flytt markøren til forrige/neste linje
|
||||
|
||||
*** Bla rundt
|
||||
|
||||
- C-v, M-v
|
||||
scroll ned/opp en side
|
||||
|
||||
- M-<, M->
|
||||
gå til begynnelsen/slutten av bufferet
|
||||
|
||||
- C-l
|
||||
vis slik at markøren er i senter/toppen/bunnen
|
||||
|
||||
*** Kill og yank
|
||||
|
||||
- C-w
|
||||
kill, tilsvarer cut
|
||||
|
||||
- C-y
|
||||
yank, tilsvarer paste
|
||||
|
||||
- M-w
|
||||
lagre til kill-ring, tilsvarer copy
|
||||
|
||||
- C-k
|
||||
kill, drepe resten av en linje
|
||||
|
||||
- M-y, må etterfølges av C-y
|
||||
yank-pop, går lenger tilbake på kill-ring
|
||||
|
||||
*** Feiloppretting
|
||||
|
||||
- C-d, M-d
|
||||
fjern neste bokstav/ord
|
||||
|
||||
- C-_
|
||||
undo!
|
||||
|
||||
- C-t, M-t
|
||||
bytt om to bokstaver/ord
|
||||
|
||||
- C-x C-t
|
||||
bytt om to linjer
|
||||
|
||||
- M-q
|
||||
plasserer om tekst i en paragraf slik at linjene ikke overstiger
|
||||
70 tegn (den ødelegger ikke syntaks i programmeringsmodes)
|
||||
|
||||
- M-u, M-l, M-c
|
||||
gjør neste ord til UPPERCASE/lowercase/Capital-Case
|
||||
|
||||
*** Markering av tekst
|
||||
|
||||
- C-SPC
|
||||
marker tekst
|
||||
|
||||
- C-x h
|
||||
marker all tekst
|
||||
|
||||
Bruk i kombinasjon med M-w, C-w og TAB
|
||||
|
||||
** Filer, vinduer og buffere
|
||||
*** Filer
|
||||
|
||||
- C-x C-f
|
||||
åpne fil
|
||||
(hvis den ikke finnes fra før opprettes den)
|
||||
|
||||
- C-x C-s
|
||||
lagre buffer
|
||||
|
||||
- C-x C-w
|
||||
skrive til fil (tilsvarende «lagre som...»)
|
||||
|
||||
*** Vinduer
|
||||
|
||||
- C-x 2, C-x 3
|
||||
splitt et vindu vertikalt/horisontalt
|
||||
|
||||
- C-x 1
|
||||
gjør det aktive vinduet til det eneste vinduet
|
||||
|
||||
- C-x 0
|
||||
lukk det aktive vinduet
|
||||
|
||||
- C-x o
|
||||
bytt fokus til et annet vindu
|
||||
|
||||
*** Buffere
|
||||
|
||||
- C-x b RET
|
||||
bytt buffer
|
||||
(siste besøkte buffer er default)
|
||||
|
||||
- C-x k RET
|
||||
drep (kill) buffer
|
||||
(det aktive bufferet er default)
|
||||
|
||||
- C-x left, C-x right
|
||||
en annen måte å bytter buffer
|
||||
|
||||
** Kommandoer
|
||||
|
||||
- M-x function RET
|
||||
lar deg kalle en hvilken som helst kommando med navn
|
||||
|
||||
- M-x replace-string RET erstatt RET med RET
|
||||
tilsvarer «search and replace»
|
||||
|
||||
- M-x query-replace RET erstatt RET med RET ... y/n
|
||||
samme som replace-string, men du kan velge hva som skal
|
||||
erstattes
|
||||
|
||||
Bruk TAB for autocomplete!
|
||||
|
||||
** Søking
|
||||
|
||||
- C-s
|
||||
søk fremover i bufferet
|
||||
|
||||
- C-r
|
||||
søk bakover i bufferet
|
||||
|
||||
Dette er en effektiv måte å flytte markøren!
|
||||
|
||||
** Hjelp til selvhjelp
|
||||
|
||||
- C-h k
|
||||
bruk hvis du lurer på hva en tastekombinasjon gjør
|
||||
|
||||
- C-h f
|
||||
bruk hvis du kjenner navnet på en funksjon, men ikke vet hva hva
|
||||
den gjør
|
||||
|
||||
- C-h m
|
||||
gir deg informasjon om moden du er i
|
||||
(bl.a tastekombinasjoner som er spesielle for moden)
|
||||
|
||||
- C-h a
|
||||
apropos, lar deg søke i hjelpen
|
||||
|
||||
- C-h C-h, C-h ?
|
||||
gir deg hjelp om hjelpen
|
||||
|
||||
** Programmering
|
||||
|
||||
- TAB indenterer riktig
|
||||
(dersom indenteringen er gal er det et tegn på at det er noe galt
|
||||
i koden!)
|
||||
|
||||
- M-;
|
||||
kommenterer ut et markert område
|
||||
|
||||
- M-x compile RET compile-command RET
|
||||
lar deg kompilere i Emacs
|
||||
(gir trykkbare linker til der feil oppstod)
|
||||
|
||||
- M-g g <nr> RET
|
||||
flytter markøren til linjenummer <nr>
|
||||
|
243
handout.html
Normal file
243
handout.html
Normal file
@ -0,0 +1,243 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>handout</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
||||
<meta name="title" content="handout"/>
|
||||
<meta name="generator" content="Org-mode"/>
|
||||
<meta name="generated" content="2013-03-17 22:01:20 CET"/>
|
||||
<meta name="author" content="Lars Tveito"/>
|
||||
<meta name="description" content=""/>
|
||||
<meta name="keywords" content=""/>
|
||||
<style type="text/css">
|
||||
<!--/*--><![CDATA[/*><!--*/
|
||||
html { font-family: Times, serif; font-size: 12pt; }
|
||||
.title { text-align: center; }
|
||||
.todo { color: red; }
|
||||
.done { color: green; }
|
||||
.tag { background-color: #add8e6; font-weight:normal }
|
||||
.target { }
|
||||
.timestamp { color: #bebebe; }
|
||||
.timestamp-kwd { color: #5f9ea0; }
|
||||
.right {margin-left:auto; margin-right:0px; text-align:right;}
|
||||
.left {margin-left:0px; margin-right:auto; text-align:left;}
|
||||
.center {margin-left:auto; margin-right:auto; text-align:center;}
|
||||
p.verse { margin-left: 3% }
|
||||
pre {
|
||||
border: 1pt solid #AEBDCC;
|
||||
background-color: #F3F5F7;
|
||||
padding: 5pt;
|
||||
font-family: courier, monospace;
|
||||
font-size: 90%;
|
||||
overflow:auto;
|
||||
}
|
||||
table { border-collapse: collapse; }
|
||||
td, th { vertical-align: top; }
|
||||
th.right { text-align:center; }
|
||||
th.left { text-align:center; }
|
||||
th.center { text-align:center; }
|
||||
td.right { text-align:right; }
|
||||
td.left { text-align:left; }
|
||||
td.center { text-align:center; }
|
||||
dt { font-weight: bold; }
|
||||
div.figure { padding: 0.5em; }
|
||||
div.figure p { text-align: center; }
|
||||
div.inlinetask {
|
||||
padding:10px;
|
||||
border:2px solid gray;
|
||||
margin:10px;
|
||||
background: #ffffcc;
|
||||
}
|
||||
textarea { overflow-x: auto; }
|
||||
.linenr { font-size:smaller }
|
||||
.code-highlighted {background-color:#ffff00;}
|
||||
.org-info-js_info-navigation { border-style:none; }
|
||||
#org-info-js_console-label { font-size:10px; font-weight:bold;
|
||||
white-space:nowrap; }
|
||||
.org-info-js_search-highlight {background-color:#ffff00; color:#000000;
|
||||
font-weight:bold; }
|
||||
/*]]>*/-->
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
<!--/*--><![CDATA[/*><!--*/
|
||||
function CodeHighlightOn(elem, id)
|
||||
{
|
||||
var target = document.getElementById(id);
|
||||
if(null != target) {
|
||||
elem.cacheClassElem = elem.className;
|
||||
elem.cacheClassTarget = target.className;
|
||||
target.className = "code-highlighted";
|
||||
elem.className = "code-highlighted";
|
||||
}
|
||||
}
|
||||
function CodeHighlightOff(elem, id)
|
||||
{
|
||||
var target = document.getElementById(id);
|
||||
if(elem.cacheClassElem)
|
||||
elem.className = elem.cacheClassElem;
|
||||
if(elem.cacheClassTarget)
|
||||
target.className = elem.cacheClassTarget;
|
||||
}
|
||||
/*]]>*///-->
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="preamble">
|
||||
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<!-- <h1 class="title">handout</h1> -->
|
||||
|
||||
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
|
||||
<caption></caption>
|
||||
<colgroup><col class="left" /><col class="left" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr><th scope="col" class="left">Tastekombinasjon</th><th scope="col" class="left">Beskrivelse</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td class="left">Prefikser</td><td class="left"></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">C-x</td><td class="left">Globale kommandoer</td></tr>
|
||||
<tr><td class="left">C-c</td><td class="left">Lokale kommandoer</td></tr>
|
||||
<tr><td class="left">C-h</td><td class="left">Hjelp</td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">Komme seg ut</td><td class="left"></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">C-x C-c</td><td class="left">save-buffers-kill-terminal</td></tr>
|
||||
<tr><td class="left">C-g</td><td class="left">keyboard-quit</td></tr>
|
||||
<tr><td class="left">ESC ESC ESC</td><td class="left">keyboard-escape-quit</td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">Flytte markør</td><td class="left"></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">C-f</td><td class="left">forward-char</td></tr>
|
||||
<tr><td class="left">C-b</td><td class="left">backward-char</td></tr>
|
||||
<tr><td class="left">M-f</td><td class="left">forward-word</td></tr>
|
||||
<tr><td class="left">M-b</td><td class="left">backward-word</td></tr>
|
||||
<tr><td class="left">C-a</td><td class="left">move-beginning-of-line</td></tr>
|
||||
<tr><td class="left">C-e</td><td class="left">move-end-of-line</td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">Bla Rundt</td><td class="left"></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">C-v</td><td class="left">scroll-up-command</td></tr>
|
||||
<tr><td class="left">M-v</td><td class="left">scroll-down-command</td></tr>
|
||||
<tr><td class="left">M-<</td><td class="left">beginning-of-buffer</td></tr>
|
||||
<tr><td class="left">M-></td><td class="left">end-of-buffer</td></tr>
|
||||
<tr><td class="left">C-l</td><td class="left">recenter-top-bottom</td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">Kill og yank</td><td class="left"></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">C-w</td><td class="left">kill-region</td></tr>
|
||||
<tr><td class="left">M-w</td><td class="left">kill-ring-save</td></tr>
|
||||
<tr><td class="left">C-k</td><td class="left">kill-line</td></tr>
|
||||
<tr><td class="left">C-y</td><td class="left">yank</td></tr>
|
||||
<tr><td class="left">M-y</td><td class="left">yank-pop</td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">Feiloppretting</td><td class="left"></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">C-d</td><td class="left">delete-char</td></tr>
|
||||
<tr><td class="left">M-d</td><td class="left">kill-word</td></tr>
|
||||
<tr><td class="left">C-_</td><td class="left">undo</td></tr>
|
||||
<tr><td class="left">C-t</td><td class="left">transpose-chars</td></tr>
|
||||
<tr><td class="left">M-t</td><td class="left">transpose-words</td></tr>
|
||||
<tr><td class="left">C-x C-t</td><td class="left">transpose-lines</td></tr>
|
||||
<tr><td class="left">M-q</td><td class="left">fill-paragraph</td></tr>
|
||||
<tr><td class="left">M-u</td><td class="left">upcase-word</td></tr>
|
||||
<tr><td class="left">M-l</td><td class="left">downcase-word</td></tr>
|
||||
<tr><td class="left">M-c</td><td class="left">capitalize-word</td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">Markering av tekst</td><td class="left"></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">C-SPC</td><td class="left">set-mark-command</td></tr>
|
||||
<tr><td class="left">C-x h</td><td class="left">mark-whole-buffer</td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">Lagre og sånt</td><td class="left"></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">C-x C-f</td><td class="left">find-file</td></tr>
|
||||
<tr><td class="left">C-x C-s</td><td class="left">save-buffer</td></tr>
|
||||
<tr><td class="left">C-x C-w</td><td class="left">write-file</td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">Vinduer</td><td class="left"></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">C-x 2</td><td class="left">split-window-below</td></tr>
|
||||
<tr><td class="left">C-x 3</td><td class="left">split-window-right</td></tr>
|
||||
<tr><td class="left">C-x 1</td><td class="left">delete-other-windows</td></tr>
|
||||
<tr><td class="left">C-x 0</td><td class="left">delete-window</td></tr>
|
||||
<tr><td class="left">C-x o</td><td class="left">other-window</td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">Buffere</td><td class="left"></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">C-x b</td><td class="left">switch-to-buffer</td></tr>
|
||||
<tr><td class="left">C-x k</td><td class="left">kill-buffer</td></tr>
|
||||
<tr><td class="left">C-x <left></td><td class="left">previous-buffer</td></tr>
|
||||
<tr><td class="left">C-x <right></td><td class="left">next-buffer</td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">Kommandoer</td><td class="left"></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">M-x</td><td class="left">execute-extended-command</td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">Søking</td><td class="left"></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">C-s</td><td class="left">isearch-forward</td></tr>
|
||||
<tr><td class="left">C-r</td><td class="left">isearch-backward</td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">Hjelp til selvhjelp</td><td class="left"></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">C-h k</td><td class="left">Info-goto-emacs-key-command-node</td></tr>
|
||||
<tr><td class="left">C-h f</td><td class="left">Info-goto-emacs-command-node</td></tr>
|
||||
<tr><td class="left">C-h m</td><td class="left">describe-mode</td></tr>
|
||||
<tr><td class="left">C-h a</td><td class="left">apropos-command</td></tr>
|
||||
<tr><td class="left">C-h C-h, C-h ?</td><td class="left">help-for-help</td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">Programmering</td><td class="left"></td></tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr><td class="left">TAB</td><td class="left">indent-for-tab-command</td></tr>
|
||||
<tr><td class="left">M-;</td><td class="left">comment-dwim</td></tr>
|
||||
<tr><td class="left">M-g g</td><td class="left">goto-line</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="postamble">
|
||||
<p class="date">Date: 2013-03-17 22:01:20 CET</p>
|
||||
<p class="author">Author: Lars Tveito</p>
|
||||
<p class="creator">Org version 7.8.11 with Emacs version 24</p>
|
||||
<!-- <a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a> -->
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
103
handout.org
Normal file
103
handout.org
Normal file
@ -0,0 +1,103 @@
|
||||
|---------------------+----------------------------------|
|
||||
| Tastekombinasjon | Beskrivelse |
|
||||
|---------------------+----------------------------------|
|
||||
| Prefikser | |
|
||||
|---------------------+----------------------------------|
|
||||
| C-x | Globale kommandoer |
|
||||
| C-c | Lokale kommandoer |
|
||||
| C-h | Hjelp |
|
||||
|---------------------+----------------------------------|
|
||||
| Komme seg ut | |
|
||||
|---------------------+----------------------------------|
|
||||
| C-x C-c | save-buffers-kill-terminal |
|
||||
| C-g | keyboard-quit |
|
||||
| ESC ESC ESC | keyboard-escape-quit |
|
||||
|---------------------+----------------------------------|
|
||||
| Flytte markør | |
|
||||
|---------------------+----------------------------------|
|
||||
| C-f | forward-char |
|
||||
| C-b | backward-char |
|
||||
| M-f | forward-word |
|
||||
| M-b | backward-word |
|
||||
| C-a | move-beginning-of-line |
|
||||
| C-e | move-end-of-line |
|
||||
|---------------------+----------------------------------|
|
||||
| Bla Rundt | |
|
||||
|---------------------+----------------------------------|
|
||||
| C-v | scroll-up-command |
|
||||
| M-v | scroll-down-command |
|
||||
| M-< | beginning-of-buffer |
|
||||
| M-> | end-of-buffer |
|
||||
| C-l | recenter-top-bottom |
|
||||
|---------------------+----------------------------------|
|
||||
| Kill og yank | |
|
||||
|---------------------+----------------------------------|
|
||||
| C-w | kill-region |
|
||||
| M-w | kill-ring-save |
|
||||
| C-k | kill-line |
|
||||
| C-y | yank |
|
||||
| M-y | yank-pop |
|
||||
|---------------------+----------------------------------|
|
||||
| Feiloppretting | |
|
||||
|---------------------+----------------------------------|
|
||||
| C-d | delete-char |
|
||||
| M-d | kill-word |
|
||||
| C-_ | undo |
|
||||
| C-t | transpose-chars |
|
||||
| M-t | transpose-words |
|
||||
| C-x C-t | transpose-lines |
|
||||
| M-q | fill-paragraph |
|
||||
| M-u | upcase-word |
|
||||
| M-l | downcase-word |
|
||||
| M-c | capitalize-word |
|
||||
|---------------------+----------------------------------|
|
||||
| Markering av tekst | |
|
||||
|---------------------+----------------------------------|
|
||||
| C-SPC | set-mark-command |
|
||||
| C-x h | mark-whole-buffer |
|
||||
|---------------------+----------------------------------|
|
||||
| Lagre og sånt | |
|
||||
|---------------------+----------------------------------|
|
||||
| C-x C-f | find-file |
|
||||
| C-x C-s | save-buffer |
|
||||
| C-x C-w | write-file |
|
||||
|---------------------+----------------------------------|
|
||||
| Vinduer | |
|
||||
|---------------------+----------------------------------|
|
||||
| C-x 2 | split-window-below |
|
||||
| C-x 3 | split-window-right |
|
||||
| C-x 1 | delete-other-windows |
|
||||
| C-x 0 | delete-window |
|
||||
| C-x o | other-window |
|
||||
|---------------------+----------------------------------|
|
||||
| Buffere | |
|
||||
|---------------------+----------------------------------|
|
||||
| C-x b | switch-to-buffer |
|
||||
| C-x k | kill-buffer |
|
||||
| C-x <left> | previous-buffer |
|
||||
| C-x <right> | next-buffer |
|
||||
|---------------------+----------------------------------|
|
||||
| Kommandoer | |
|
||||
|---------------------+----------------------------------|
|
||||
| M-x | execute-extended-command |
|
||||
|---------------------+----------------------------------|
|
||||
| Søking | |
|
||||
|---------------------+----------------------------------|
|
||||
| C-s | isearch-forward |
|
||||
| C-r | isearch-backward |
|
||||
|---------------------+----------------------------------|
|
||||
| Hjelp til selvhjelp | |
|
||||
|---------------------+----------------------------------|
|
||||
| C-h k | Info-goto-emacs-key-command-node |
|
||||
| C-h f | Info-goto-emacs-command-node |
|
||||
| C-h m | describe-mode |
|
||||
| C-h a | apropos-command |
|
||||
| C-h C-h, C-h ? | help-for-help |
|
||||
|---------------------+----------------------------------|
|
||||
| Programmering | |
|
||||
|---------------------+----------------------------------|
|
||||
| TAB | indent-for-tab-command |
|
||||
| M-; | comment-dwim |
|
||||
| M-g g | goto-line |
|
||||
|---------------------+----------------------------------|
|
||||
|
28
notater.org
Normal file
28
notater.org
Normal file
@ -0,0 +1,28 @@
|
||||
* Husk
|
||||
|
||||
Skru av ido-mode
|
||||
(set-face-attribute 'default nil :height 200)
|
||||
|
||||
** Plan
|
||||
|
||||
- del 1
|
||||
- en gjennomgang av hva Emacs er og hvordan man bruker det
|
||||
|
||||
- del 2
|
||||
- bruke det som ble gått gjennom i del 1
|
||||
- konfigurere Emacs
|
||||
|
||||
|
||||
* Del 2
|
||||
** Configurer Emacs
|
||||
|
||||
- Nyeste Emacs
|
||||
- .emacs og .emacs.d/
|
||||
- Nyttige configurasjoner
|
||||
- Hvordan installere utvidelser
|
||||
|
||||
** Tips og triks
|
||||
- eshell
|
||||
- ssh
|
||||
- compile
|
||||
- makro (project euler - problem 11)
|
Loading…
Reference in New Issue
Block a user