{"id":687,"date":"2012-06-04T11:10:11","date_gmt":"2012-06-04T05:40:11","guid":{"rendered":"http:\/\/asgaur.com\/wp\/?p=687"},"modified":"2012-06-04T11:10:11","modified_gmt":"2012-06-04T05:40:11","slug":"how-to-use-linux-editor-emacs-xemacs","status":"publish","type":"post","link":"http:\/\/www.asgaur.com\/wp\/how-to-use-linux-editor-emacs-xemacs\/","title":{"rendered":"How to use Linux Editor Emacs (Xemacs)"},"content":{"rendered":"<p>Emacs is the king of all editors.<\/p>\n<p>Emacs stands for Editor MACroS. (GNU)-Emacs was written and is maintained by Richard Stallman, the first version is form 1975. It has become a de facto standard alongside vi.<\/p>\n<p>Emacs is more than just a text editor. It is a complete system for development, communications, file management, and things you wouldn&#8217;t even imagine.<\/p>\n<p>Emacs has an active development community numbering in the hundreds, and runs on Windows , Linux and Unix.<a href=\"http:\/\/asgaur.com\/wp\/wp-content\/uploads\/2012\/06\/emacs.jpg\" target=\"_blank\" rel=\"noopener\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-full wp-image-691\" title=\"emacs\" src=\"http:\/\/asgaur.com\/wp\/wp-content\/uploads\/2012\/06\/emacs.jpg\" alt=\"\" width=\"612\" height=\"589\" \/><\/a><\/p>\n<h2>Files, Buffers and Windows<\/h2>\n<p><strong>Files<\/strong>:<\/p>\n<pre>C-x C-f  Reads a file into an Emacs buffer\nC-x C-s  Saves the current buffer\nC-x C-c  Saves all modified buffers and exits Emacs<\/pre>\n<p><strong>Buffers<\/strong>: In Emacs each open file is edited in a buffer.<br \/>\nCommands to switch between the different buffers<br \/>\n(there are also menu options):<\/p>\n<pre>C-x C-b  Prints a list of the available buffers\nC-x b    Asks you which buffer to select<\/pre>\n<p><strong>Windows<\/strong>: Buffers are displayed in windows (you can also use the mouse):<\/p>\n<pre>C-x 2    Splits the current window vertically into two.\nC-x 3    Splits the current window horizontally into two.\nC-x 1    Deletes all windows except the one with the cursor\nC-x o    Moves you into an other window on the screen<\/pre>\n<h2>Modes, Commands and Help<\/h2>\n<p>In emacs there is a <strong>mode<\/strong> for each file type<br \/>\n(among other uses, there is also a doctor mode).<\/p>\n<p>Each mode has its own commands and short-cut-keys.<br \/>\nType &#8220;M-x&#8221; (M=Meta=Alt) then a command name.<br \/>\nYou can use tab to complete or to get list of possible completions..<br \/>\nUse the command &#8220;describe-mode&#8221; for info of the mode of the current buffer.<\/p>\n<p><strong>Help<\/strong>:<\/p>\n<pre>C-h               Displays help window\nC-h C-h           Gives you help on help\nM-x help          Displays help window (alternate method)\nC-h t             Shows the tutorial\nC-h a             Shows commands matching a string\nC-h i             Enters the Gnu Info documentation browser\nA-x manual-entry  Manual-entry for string under cursor\nA-x ispell-buffer Spell checker\nA-x doctor        Doctor<\/pre>\n<p><strong>Panic<\/strong>: When things run out of control try:<\/p>\n<pre>C-g       Runs the command keyboard-quit\nC-_       Undo<\/pre>\n<h2>Editing<\/h2>\n<p>&nbsp;<\/p>\n<h3>Moving around in the buffer<\/h3>\n<table border=\"0\" cellpadding=\"4\">\n<colgroup>\n<col width=\"16%\" \/>\n<col width=\"16%\" \/>\n<col width=\"16%\" \/>\n<col width=\"16%\" \/>\n<col width=\"16%\" \/>\n<col width=\"16%\" \/> <\/colgroup>\n<tbody>\n<tr valign=\"top\">\n<th align=\"left\"><\/th>\n<th align=\"left\">By char:<\/th>\n<th align=\"left\">By word:<\/th>\n<th align=\"left\">By line:<\/th>\n<th align=\"left\">By S-exp:<\/th>\n<th align=\"left\">By page:<\/th>\n<\/tr>\n<tr valign=\"top\">\n<td align=\"left\">Forward:<\/td>\n<td align=\"left\"><code>C-f<\/code><\/td>\n<td align=\"left\"><code>M-f<\/code><\/td>\n<td align=\"left\"><code>C-n<\/code><\/td>\n<td align=\"left\"><code>C-M-f<\/code><\/td>\n<td align=\"left\"><code>C-v<\/code><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td align=\"left\">Backward:<\/td>\n<td align=\"left\"><code>C-b<\/code><\/td>\n<td align=\"left\"><code>M-b<\/code><\/td>\n<td align=\"left\"><code>C-p<\/code><\/td>\n<td align=\"left\"><code>C-M-b<\/code><\/td>\n<td align=\"left\"><code>M-v<\/code><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td align=\"left\">Beginning:<\/td>\n<td align=\"left\"><\/td>\n<td align=\"left\"><\/td>\n<td align=\"left\"><code>C-a<\/code><\/td>\n<td align=\"left\"><\/td>\n<td align=\"left\"><code>M-&lt;<\/code><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td align=\"left\">End:<\/td>\n<td align=\"left\"><\/td>\n<td align=\"left\"><\/td>\n<td align=\"left\"><code>C-e<\/code><\/td>\n<td align=\"left\"><\/td>\n<td align=\"left\"><code>M-&gt;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Deleting\/Killing (cutting text)<\/h3>\n<table border=\"0\" cellpadding=\"4\">\n<colgroup>\n<col width=\"16%\" \/>\n<col width=\"16%\" \/>\n<col width=\"16%\" \/>\n<col width=\"16%\" \/>\n<col width=\"16%\" \/>\n<col width=\"16%\" \/> <\/colgroup>\n<tbody>\n<tr valign=\"top\">\n<th align=\"left\"><\/th>\n<th align=\"left\">By char:<\/th>\n<th align=\"left\">By word:<\/th>\n<th align=\"left\">By line:<\/th>\n<th align=\"left\">By S-exp:<\/th>\n<th align=\"left\">By region:<\/th>\n<\/tr>\n<tr valign=\"top\">\n<td align=\"left\">Forward:<\/td>\n<td align=\"left\"><code>C-d<\/code><\/td>\n<td align=\"left\"><code>M-d<\/code><\/td>\n<td align=\"left\"><code>C-k<\/code><\/td>\n<td align=\"left\"><code>C-M-k<\/code><\/td>\n<td align=\"left\"><code>C-w<\/code><\/td>\n<\/tr>\n<tr valign=\"top\">\n<td align=\"left\">Backward:<\/td>\n<td align=\"left\"><code>Del<\/code><\/td>\n<td align=\"left\"><code>M-Del<\/code><\/td>\n<td align=\"left\"><\/td>\n<td align=\"left\"><\/td>\n<td align=\"left\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h3>Copy and Paste<\/h3>\n<pre>C-k       kill-line\nC-y       insert\nC-Space   mark\nA-w       copy\nC-w       cut<\/pre>\n<p>&nbsp;<\/p>\n<h2>Search and Replace<\/h2>\n<pre>C-s                  search\nC-r                  search-backward\nA-%                  query-replace\nA-x replace-string   replace-string\n\nC-M-s                isearch-forward-regexp\nC-M-r s              isearch-backward-regexp\nC-M-%                query-replace-regexp<\/pre>\n<p><a href=\"http:\/\/asgaur.com\/wp\/wp-content\/uploads\/2012\/06\/emacs-cheat-sheet.pdf\" target=\"_blank\" rel=\"noopener\">Emacs Cheat Sheet<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Emacs is the king of all editors. Emacs stands for Editor MACroS. (GNU)-Emacs was written and is maintained by Richard Stallman, the first version is form 1975. It has become a de facto standard alongside vi. Emacs is more than just a text editor. It is a complete system for development, communications, file management, and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[3,5],"tags":[],"class_list":["post-687","post","type-post","status-publish","format-standard","hentry","category-general","category-linux"],"_links":{"self":[{"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/posts\/687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/comments?post=687"}],"version-history":[{"count":0,"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/posts\/687\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/media?parent=687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/categories?post=687"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.asgaur.com\/wp\/wp-json\/wp\/v2\/tags?post=687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}