I personally stick to writing things in org-mode with flyspell-mode and langtool...
org-mode is fantastic for typing any sort of document quickly in Emacs, flyspell takes care of spelling, and langtool worries about the grammar. Everything is highly customizable too, so you can customize anything to your heart's content.
Here is a quick little type-up in ...
You can add a prefix with M-x string-rectangle, which is bound to C-x r t.
This is part of a series of commands that operates on rectangular selections; this one inserts text at every line in the rectangle.
Start by setting the mark at the beginning of the first line, and move your cursor to the first character of the last line you want to prefix:
You could use multiple-cursors-mode, to put a cursor on every line. Then, any text you type will be inserted on each line.
You would start out with the point at the beginning of the piece of code:
I am some code
Then hit C-> twice. (This is the suggested key binding; you have to set it up yourself.) This creates two extra cursors on the ...
It's even easier! Again, use rectangle commands. Move to one corner of the rectangle you want to delete, press C-SPC to set the mark. Move to the other corner of the rectangle and press C-x r d (delete-rectangle). For example, move to the first line you want to act on, press C-a or home to go to the beginning of the line, move down to the last line you want ...
Quoting from Emacs Wiki, by Stefan Monnier:
Unfilling a paragraph joins all the lines in a paragraph into a single
line. It is the contrary of FillParagraph.
It works where a line ends with a newline character (”\n”) and
paragraphs are separated by blank lines. To make a paragraph end in a
single newline then use the function below:
;;; It is ...
Very easily, fortunately.
Use C-M-% (which runs the command query-replace-regexp), use the regexp (regular expression) $ (this matches exactly at the end of line) and replace it with your text. And that's it!
Another possibility involves Magnars Sveen's excellent multiple-cursors.el : select lines, use M-x mc/edit-lines then hit C-e (end-of-line) and start ...
There are two cases I can think of: reactivating the region, and adjusting the size of the region.
I most often use this binding to reactivate the region after performing some command that deactivates it, or doing something that sets mark and moves point without activating the region.
For example, do a C-s and search forward for something. Hit RET to ...
Here's a function that will convert DOuble CApitals to Single Capitals. I'd originally suggested adding it to post-self-insert-hook, but below is an option for a glorified minor mode so that you only add to that hook when you really want it:
(defun dcaps-to-scaps ()
"Convert word in DOuble CApitals to Single Capitals."
(and (= ?w (char-...
Based on SU : How to remove smart quotes in copy Paste
You can try something like the following:
(defcustom smart-to-ascii '(("\x201C" . "\"")
("\x201D" . "\"")
("\x2018" . "'")
("\x2019" . "'")
("\x2013" . "-")
Ask Emacs: C-h r i exchange-point-and-mark RET or, better, C-h r i C-x C-x RET. This takes you to the information shown below.
This is what the Emacs manual, node Setting Mark says in answer to your question:
C-x C-x is useful when you are
satisfied with the position of point but want to move the other end of
the region (where the mark is). Using C-...
The EmacsWiki category Writing is the place to start.
It lists dozens of libraries that support writing text using Emacs, with one-liner descriptions and links to the detail pages.
There is no sense listing such info again here - consult it there.
(But perhaps others here will have specific recommendations.)
I will mention only the subcategory page ...
Another option is to use macros, which can handle more tasks than rectangular selections or multiple cursors, even if it's a little clunkier for this specific case.
Position the cursor at the beginning of the first line and hit F3 to start recording, insert the text, move the cursor to the beginning of the next line and hit F4 to stop recording. Now hit F4 ...
I write novels using Emacs, and have developed a workflow over time based on certain unique advantages of it. (Example: My most recent book was conceived, composed, and edited with Emacs.) That said, it is not a road without difficulties.
Org-mode is the reason I began using Emacs. Being able to fold and
unfold sections of a ~50K-words manuscript ...
Reading the GitHub discussion thread linked in @wvxvw’s comment, I discovered the variable inhibit-compacting-font-caches. Setting it to non-nil solves the issue:
(setq inhibit-compacting-font-caches t)
Now navigating point is fast. According to the variable’s documentation, inhibiting compacting font caches comes at the expense of more memory usage, which ...
From MasteringEmacs.com By Mickey Petersen:
This is a frequent question so I figured I’d mention the solution here:
You want to remove all empty (blank) lines from a buffer. How do you do it? Well, it’s super easy.
Mark what you want to change (or use C-x h to mark the whole buffer) and run this:
M-x flush-lines RET ^$ RET
And you’re done. So what does that ...
According to the manual node on Filling, several of the fill functions take an optional JUSTIFY argument that you can use. So, for example, to fill a paragraph with right justification, you can use (fill-paragraph 'right).
You can also use (justify-current-line 'right) for a single line.
If you plan to use these options a lot, you could wrap them in ...
Run emacs with XMODIFIERS set to @im=none:
I'm surprised this still happens; I found this workaround some time ago, and forgot about it. I would have assumed it would get fixed by now.
There are some bug reports around for this; I can't find the (Debian) one that I originally read to get this workaround, but one relevant to ...
If you want to copy some information to another buffer, and from then on let the buffers evolve independently, you can do just that.
But if you want the other buffer to reflect the original content in real time, then Emacs provides this with indirect buffers. An indirect buffer is another buffer that has the same content as the original (modifications in ...
Add (setq mouse-drag-and-drop-region t) in you init file.
Restart or C-c d R to reload if you're using Doom-Emacs.
I just find out (SURPRISINGLY) that Emacs as text drag and drop. And this since version 22.1 released in 2007.
This is actually a feature I didn't even dare to google to see if it's available.
Even Sublime Text can't (currently in Linux)
Spin off of the original answer to the linked question.
Grammar Check: I am not aware of any dedicated grammar parsers for emacs yet. I will mention writegood-mode available in MELPA which highlights weasel words and passive voice in the buffer. It gets you half the way there.
Another possibly useful library is dupwords.el which can highlight if a ...
I think this is a great question. I'm sure there are tons of super helpful modes that fiction writers don't know they need. I happened upon palimpsest-mode by accident, but now I couldn't live without it. I'd love to see what packages other fiction writers find useful.
Here are some that I use every day:
palimpsest-mode. Sends selected text to the bottom ...
You could install evil and do it in any number of vi-like ways - I prefer visual block selection using Ctrl + V to mark each line and then Shift + I to insert and then type the text you want to insert and finally hit ESC to exit insert mode and the text will be prepended to each line. This is very similar to emacs rectangle selections but a few less ...
The extend-rectangle-to-end function in the rectangle-utils package is what you want. It's on melpa.
It inserts spaces to make the current rectangle selection extend to cover the longest line in the region.
To get this behaviour, I've got this in my init.el. C-x r e is not bound to anything else in vanilla emacs
On Linux, and I assume Mac, you can pipe the region through the uniq shell command to get almost exactly what you want.
Mark the region
Sort the lines with M-x sort-lines
Call shell-command-on-region with the prefix key: C-u M-|
Enter uniq --count
The contents of the buffer will be replaced by:
3 THIS IS LINE A
2 THIS IS LINE B
1 THIS IS LINE C
I would recommend installing the expand-region package (available on Melpa too). It would be useful for editing situations mentioned in your example and lot more.
expand-region is intelligent. Based on the major mode, it will try to figure out what you are trying to select. I don't know from which language you have the example snippet so ...
If you are continuously typing text without making mistakes or editing, then the end result would be the same in both cases.
auto-fill-mode isn't so helpful when editing existing text, though (especially so when editing text which has already been filled). It is just inserting line breaks when the current column exceeds the fill column, but if you are ...