----BEGIN CLASS---- [14:28] #startclass [14:28] Roll call [14:28] Ashish Kumar Mishra [14:28] Rayan Das [14:28] Pranjal Aswani [14:28] Shubham Sharma [14:28] Mayank Singhal [14:28] Bhavin Gandhi [14:28] Prabhu Sharan Singh [14:28] Shiva Saxena [14:28] Shital Mule [14:28] Rishikesh Bamdale [14:28] Anu Kumari Gupta [14:28] Jagannathan Tiruvallur Eachambadi [14:28] kumar vipin yadav [14:28] Ratan Kulshreshtha [14:28] <__rex__> Rakshit Airani [14:28] Priyanka Saggu [14:28] Kushal Das [14:28] Ashwani Gupta [14:28] Neeraj Kumar Arya [14:28] sahil [14:29] Bhavesh Gupta [14:29] pawan [14:29] Naman Sharma [14:29] Aastha [14:29] Sandeep Kumar Choudhary [14:29] Devesh Verma [14:29] Shaikh_farhan [14:29] tabrez khan [14:29] Manank Patni [14:29] Prashant Sharma [14:29] Amitrajit Bose [14:30] Hello, and welcome to the first of many sessions on GNU Emacs. I hope all of you have Emacs installed on your favourite OS. [14:30] The objective of this series is to get you started in using Emacs as your primary environment. [14:31] GNU Emacs is primarily written in C and Emacs Lisp. I will be using GNU Emacs 26.1 on Parabola GNU/Linux-libre (x86) [14:31] Souvik Haldar [14:31] We will try to cover as much of the basics as possible in the series, and you can then explore further based on your interests [14:32] Go ahead, and open Emacs from your desktop environment, or from a terminal (in X), you can use: [14:32] => emacs -Q [14:32] The commands I type, I will prefix with => in the IRC chat, so that you know those are commands to be run [14:33] I use the "-Q" option so that it does not pick any specific custom configuration. Emacs can be tweaked to your needs. [14:33] Just as a stitched shirt or pant will fit you perfectly, Emacs can be tailored to your needs. It is highly customizable and extensible. [14:34] You should see Emacs Frame like http://www.shakthimaan.com/images/emacs/final-emacs-default-text.png [14:34] You have the Menu bar on the top, followed by the Tool bar as seen in common applications. [14:34] pooja kumari singh [14:34] This is followed by the *scratch* buffer. The text might be different depending on the Emacs version you are using. [14:35] At the bottom is the Mode line, which lists information on the buffer you are using, which line, the cursor is, the applicable modes for this buffer, which all you can customize [14:35] At the very bottom is the mini-buffer, where the commands you type show up. [14:36] Whenever you are working in Emacs, you are always working in a buffer. A buffer can be a file, directory, remote directory, IRC session etc. [14:37] To exit Emacs, type: [14:37] => C-x C-c [14:37] C here stands for the "Control" key [14:37] You should now see the Emacs window closed. "M" stands for the Alt key. [14:38] Unlike some editors, Emacs has no notion of "state". You can use multiple modes in a buffer, depending on the file you are using. [14:38] Now, re-open Emacs again, and we will go through some basic navigation commands today. [14:39] ! [14:39] Piyush Aggarwal [14:39] next [14:39] where I have to write the command to exit Emacs, in the main buffer? [14:40] Pressing enter should close the Emacs? But it is not [14:40] priyankasaggu119, as soon as you type "Control", Emacs understands that you are giving a command to it. You will see it in the minibuffer. [14:40] priyankasaggu119, you can be writing text in the buffer, at the same time, giving instructions to Emacs using Control and Alt key combinations. [14:41] ohk mbuf [14:41] priyankasaggu119, were you able close Emacs, and re-open it again? [14:41] yes [14:42] After you have re-opened Emacs, you can use the following key to go to the previous line: [14:42] => C-p [14:42] 'p' here stands for previous, and as you learn the shortcuts, these are quite intuitive (you will see) [14:42] To move the cursor to the line below (or next line), use: [14:42] => C-n [14:42] where we have to type inside mini buffer? Not able to close. [14:43] prokbird, use "!" to ask a question [14:43] sorry [14:43] ! [14:43] next [14:43] prokbird, control commands go directly to the application, not to any buffer. Emacs will understand that. [14:43] i am not able to close Emacs,where should i type this C-c command? [14:44] prokbird, if Emacs is opened, just type it in your keyboard, and the application will understand it. [14:44] prokbird, it Control-x Control-c [14:44] Ah..now done. [14:45] thanks :) [14:45] The point is you can keep typing text inside Emacs buffer, but, if you want, you can also issue commands to Emacs [14:45] /msg nickserv register Liverpool@69 mynameischangezkhan@gmail.com [14:46] ChangezKhan, remove spaces from beginning :) [14:46] ok [14:46] You already have some text in this scratch buffer. You can move to the top line using C-p, and try the command to move forward one character using: [14:46] => C-f [14:47] Here 'f' is forward. Yo can move backward one character using: [14:47] => C-b [14:47] s/Yo/You/ [14:47] Again, here 'b' is for backward [14:47] You can move forward one word using: [14:48] => M-f [14:48] Here, M is Alt key or Meta key. [14:48] You can go back one word using: [14:48] => M-b [14:49] Think of meta as doing something more; so the same 'f' forward has a different meaning with control and meta. [14:49] As you learn more shortcuts, these will come naturally to you [14:49] ! [14:49] next [14:49] M-b is producing strange character on mac. [14:50] Like the 'integration' symbol. [14:50] souvikhaldar, you might need to see what is the Alt key for Emacs on Mac. Try othe other "Option" key, perhaps. [14:50] s/othe/the/ [14:51] Alt is the Option key. [14:51] souvikhaldar, okay [14:52] To move to the beginning of the line, you can use: [14:52] => C-a [14:52] To move to the end of the line, you can use: [14:52] => C-e [14:54] mbuf: resolved. [14:54] If you are using X server or any windowing system, you can copy text to clipboard. [14:54] You can then paste it inside GNU Emacs using: [14:54] => C-y [14:54] 'y' here stands for "yanking" [14:55] Go to https://en.wikipedia.org/wiki/GNU_Emacs and copy the history section from this Wikipedia article, and paste it inside your Emacs scratch buffer [14:56] To move one sentence forward, you can use: [14:56] => M-e [14:57] To move one sentence backward, you can use: [14:57] ! [14:57] => M-a [14:57] next [14:57] Doing the same says "Kill ring is empty" [14:57] ! [14:57] <__rex__> ! [14:58] souvikhaldar, How did you copy the text? [14:58] next [14:58] next [14:58] ! [14:58] cmd+C [14:58] <__rex__> what is the reason behind using C-a to get to the beginning of the line, I guess e in C-e means end, similarly what is significance of a ? [14:58] mbuf: doesn't yanking mean copying? [14:58] j605, yes [14:59] I was confused as to why is to used for pasting [14:59] j605, old Emacs terminology [14:59] j605, wait till we get to "barf" and "slurp" :) [15:00] souvikhaldar, check the clipboard if it is there when you do cmd+C [15:01] ! [15:01] mbuf: Yes it's there [15:01] __rex__, I am guessing "a" is the beginning of the alphabet, but, will need to check that [15:02] souvikhaldar, then, you need to see how to integrate the clipboard with Emacs on Mac. For now, type few paragraphs in the scratch buffer [15:02] next [15:02] mbuf, Any specific difference between C-a and M-a? [15:02] <__rex__> mbuf,alright [15:03] __rex__, https://unix.stackexchange.com/questions/179671/why-is-the-shortcut-ctrl-a-jumping-to-the-start-of-a-line-in-the-terminal [15:03] C-a jumps to the start of line and M-a jumps to the start of the sentence [15:03] jeet__, beginning of a line need not be the beginning of a sentence. [15:04] Alright. Got the point. [15:04] To move forward one paragraph, you can use: [15:04] => M-} [15:04] To move backward one paragraph, use: [15:04] => M-{ [15:04] You can scroll the buffer up using: [15:05] => C-v [15:05] You can scroll down using: [15:05] => M-v [15:06] You can move to the beginning of the buffer using: [15:06] => M-< [15:06] You can move to the end of the buffer or file using: [15:06] => M-> [15:07] Again note that the opening braces is for the beginning, and closing braces marks the end [15:07] You can go to a specific line using: [15:07] => M-x goto-line [15:08] You will have to type "goto-line" and you will see this in the mini-buffer, and then press the enter key, it will prompt for line number with the message "Goto line:", and you can give a line number. [15:08] You can go to the nth character using: [15:08] => M-l goto-char [15:09] If you have text that scrolls past the buffer, and you want the text around the cursor to be in the center of the screen, you can use: [15:09] => C-l [15:11] ! [15:11] next [15:11] next [15:11] got it cleared :) [15:11] M-e takes me a para ahead. Is it supposed to be like this? [15:12] ! [15:12] brute4s99, The text is probably word wrapped to form a single semantic sentence. [15:12] <__rex__> mbuf, nice read about the reason behind C-a :) [15:12] ! [15:12] ! [15:12] oh, okay. mbuf [15:12] next [15:12] next [15:12] next [15:12] M-l didn't work for me. M-x goto-char does [15:12] M-l and M-f, what is the difference? They both are moving a word ahead [15:12] M-l doesn't ask for goto-char [15:13] j605, same here [15:13] Sorry, it is M-x goto-char [15:13] => M-x goto-char [15:14] ! [15:14] ! [15:14] next [15:14] next [15:14] M-l and M-f, what is the difference? They both are moving a word ahead [15:14] C-e and M-e work similarly for me. How can I see them acting differently? [15:14] priyankasaggu119, M-l is lowercase [15:14] ! [15:15] ok mbuf, i got it. Thank you [15:15] brute4s99, the text you copies is probably line wrapped, so, bot the sentence and line are the same. Try to type some paragraph with sentences, and try. [15:15] next [15:16] If I do M-x goto-char and then if I pass number, then it takes curser to 10th character but on a first sentence [15:16] it doesn't take to the 10th character of the line where currently curser is [15:17] ChangezKhan, it is from the reference of the buffer origin [15:17] You can repeat a command by giving the prefix "C-u n", where n is the number. For example: [15:17] => C-u 4 C-f [15:17] This will move the cursor four characters forward from the present cursor position. [15:18] ChangezKhan, so, if you want you should use C-u 10 C-f [15:19] To save the current buffer to a file, you can use: [15:19] => C-x C-s [15:20] OR [15:20] => C-x C-w [15:20] ok let me check, it is confusing [15:20] Actually C-s is save, but, will write to file the first time. [15:20] so, when to use then M-x goto-char? [15:20] ChangezKhan, use "!" to ask question. [15:20] If you want to open a file, you can use: [15:20] oh, sorry [15:21] => C-x C-f [15:21] It will prompt in the minibuffer, for filename, where auto-completion will also work. [15:21] okay, mbuf . Works now! [15:21] ChangezKhan, you did not learn to read and write on day one of school? So, you need to be patient when learning. [15:22] We will stop here for today. I want you all to practice these commands. [15:22] I want to follow-up on the same, tomorrow, same time. [15:23] Any last minute questions, before we end today's session on Navigation? [15:23] yes [15:23] ! [15:23] related to your video link [15:23] ! [15:24] next [15:24] next [15:24] M-e and C-e works same for me. I tried writing a new paragraph with senteces [15:24] sentences* [15:25] ! [15:25] priyankasaggu119, try "M-q" (reformat paragraph) on the paragraph and try the commands again [15:26] ohk mbuf [15:26] priyankasaggu119, M-q will format the paragraph to 80 character width [15:26] => M-q [15:26] Then C-e will move to end of line. [15:26] ohk, I am trying. [15:27] Because of word wrap, and no newline, the end of the paragraph becomes the end of the line. [15:27] next [15:27] Which fingers do you use for Alt and Ctrl of both sides? [15:28] bhavin192, I use Dvorak layout, so only use Alt and Control on the left side of the keyboard mostly [15:29] mbuf, okay, thanks :) [15:29] bhavin192, and ergonomic keyboard; so left little finger for control [15:29] bhavin192, and left thumb for Alt [15:30] bhavin192, once you master the keyboard layout (including Alt and Control), the shortcuts will come naturally to you [15:30] bhavin192, you should only think of the Emacs shortcuts, and your fingers will automatically use left or right Control keys [15:30] next [15:31] mbuf, got it, thanks. [15:31] Your homework is to practice these commands in the scratch buffer, and you can also try it with your existing files :) [15:31] Roll call [15:31] Prashant Sharma [15:31] !! [15:31] ! [15:31] Mayank Singhal [15:31] Shaikh_farhan [15:31] Shiva Saxena [15:31] Pranjal Aswani [15:31] Priyanka Saggu [15:31] Rayan Das [15:31] Amitrajit Bose [15:31] Bhavin Gandhi [15:31] <__rex__> Rakshit Airani [15:31] tabrez khan [15:31] Bhavesh Gupta [15:31] Sohan Tirpude [15:31] kumar vipin yadav [15:31] Akshay Gaikwad [15:31] Kushal Das [15:31] Anu Kumari Gupta [15:32] Shital Mule [15:32] Jagannathan Tiruvallur Eachambadi [15:32] Sandeep Kumar choudhary [15:32] Neeraj kumar Arya ----END CLASS----