{"id":1655,"date":"2024-03-05T00:00:00","date_gmt":"2024-03-05T05:00:00","guid":{"rendered":"https:\/\/molecularsciences.org\/content\/?p=1655"},"modified":"2024-03-09T19:21:13","modified_gmt":"2024-03-10T00:21:13","slug":"emacs-cheat-sheet","status":"publish","type":"post","link":"https:\/\/molecularsciences.org\/content\/emacs-cheat-sheet\/","title":{"rendered":"emacs Cheat Sheet"},"content":{"rendered":"\n<p><code>Emacs<\/code> is a powerful and extensible text editor used in Unix-like operating systems. This cheat sheet covers essential commands for creating, editing, and navigating text files within the <code>Emacs<\/code> environment.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Introduction:<\/strong><\/h4>\n\n\n\n<p><code>Emacs<\/code> is known for its extensive features and customization options. It provides a wide range of commands and shortcuts for efficient text editing, making it a popular choice among developers and power users.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Basic Commands:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>emacs [file]<\/code><\/td><td>Open or create a file for editing.<\/td><\/tr><tr><td><code>C-x C-f [file]<\/code><\/td><td>Open or create a file using key sequences.<\/td><\/tr><tr><td><code>C-x C-s<\/code><\/td><td>Save changes to the current file.<\/td><\/tr><tr><td><code>C-x C-c<\/code><\/td><td>Exit Emacs. If changes are made, it will prompt to save.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Editing Text:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>C-x u<\/code><\/td><td>Undo the last action.<\/td><\/tr><tr><td><code>C-\/<\/code><\/td><td>Another way to undo the last action.<\/td><\/tr><tr><td><code>C-space<\/code><\/td><td>Set the mark to start selecting text.<\/td><\/tr><tr><td><code>C-w<\/code><\/td><td>Cut the selected text (after setting the mark).<\/td><\/tr><tr><td><code>M-w<\/code><\/td><td>Copy the selected text (after setting the mark).<\/td><\/tr><tr><td><code>C-y<\/code><\/td><td>Paste the cut or copied text.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Navigation:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>C-f<\/code><\/td><td>Move forward one character.<\/td><\/tr><tr><td><code>C-b<\/code><\/td><td>Move backward one character.<\/td><\/tr><tr><td><code>M-f<\/code><\/td><td>Move forward one word.<\/td><\/tr><tr><td><code>M-b<\/code><\/td><td>Move backward one word.<\/td><\/tr><tr><td><code>C-a<\/code><\/td><td>Move to the beginning of the line.<\/td><\/tr><tr><td><code>C-e<\/code><\/td><td>Move to the end of the line.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Searching and Replacing:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>C-s<\/code><\/td><td>Search for text in the file.<\/td><\/tr><tr><td><code>C-r<\/code><\/td><td>Reverse search for text in the file.<\/td><\/tr><tr><td><code>M-%<\/code><\/td><td>Replace text in the file.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Cut, Copy, and Paste:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>C-k<\/code><\/td><td>Cut text from the cursor position to the end of the line.<\/td><\/tr><tr><td><code>M-k<\/code><\/td><td>Cut text from the cursor position to the end of the sentence.<\/td><\/tr><tr><td><code>C-y<\/code><\/td><td>Paste the cut or copied text.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Miscellaneous:<\/strong><\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Command<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>C-g<\/code><\/td><td>Cancel the current command.<\/td><\/tr><tr><td><code>C-x u<\/code><\/td><td>Undo the last command.<\/td><\/tr><tr><td><code>C-h t<\/code><\/td><td>Open the Emacs tutorial.<\/td><\/tr><tr><td><code>C-h r<\/code><\/td><td>Open the Emacs manual.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<p><code>Emacs<\/code> is a feature-rich and extensible text editor with a vast array of commands. This cheat sheet covers essential commands for creating, editing, and navigating text files within the <code>Emacs<\/code> environment. Whether you are a developer or a power user, mastering these commands will enhance your efficiency in text editing using <code>Emacs<\/code>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Emacs is a powerful and extensible text editor used in Unix-like operating systems. This cheat sheet covers essential commands for creating, editing, and navigating text files within the Emacs environment. Introduction: Emacs is known for its extensive features and customization options. It provides a wide range of commands and shortcuts for efficient text editing, making [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1807,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,265],"tags":[35],"class_list":["post-1655","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-reference","tag-linux"],"_links":{"self":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/1655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/comments?post=1655"}],"version-history":[{"count":1,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/1655\/revisions"}],"predecessor-version":[{"id":1656,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/posts\/1655\/revisions\/1656"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/media\/1807"}],"wp:attachment":[{"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/media?parent=1655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/categories?post=1655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/molecularsciences.org\/content\/wp-json\/wp\/v2\/tags?post=1655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}