So now you should be able to type another command in your document and execute it in your macro without leaving edit mode: You won't need to set that up again when writing another document. That should be saved when you quit vim, so the next time you reload vim it will still be available to you. Now you've set up a macro in register e in vim. ![]() Now press q to finish recording the macro Hit o to ensure you have a blank line at the end of the output.Ħ. Use the following to execute your command and read the output into your documentĥ. Use the following to visually select the command you just typed and yank it to the copy/paste buffer and move back to the line below:Ĥ. Now switch to command mode and start recording a macro in register eģ. means hit enter/return.Īlso this process is assuming that you're using $ at the start of the line to indicate a bash-prompt in your document:ģ. NOTE: In the blurb that follows - anything that is inside square brackets is a special key.Į.g. Offhand - I don't know of anything that does what you've described in xiki.īut it is possible to read in the results of shell commands in vim and it's not a complicated process.Īnd we can even set up a macro to use in vim to allow you to enter a command in your text, then after moving to the next line, you will be able to fire off the macro and it will execute the command you've entered in a shell and will read the results into the document. I've tried other text editors: Vim, gedit, leaf, etc., but I haven't found anything like it. This feature saves a lot of time when preparing long handouts and technical documents. It was not necessary to go from your editor to the shell, execute the command, copy the result, go back to the editor and continue working. You can edit the output like a normal text or continue editing your document. If, after typing the command, you press Enter, your command is treated as a normal line of text and you can continue editing your workbook.īut, if after the command you type Ctrl + Alt + Enter (I don't remember exactly which shortcut), the editor executes the command and returns the output to the body of your document. That's where xiki had a really cool improvement. In this document, in addition to comments, you want to include the shell commands you are presenting and their output. ![]() What I'm looking for is something like this: you're editing a handout with shell commands for your students.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |