Questions tagged [text-editing]

Questions about editing or manipulating text inside of Emacs.

Filter by
Sorted by
Tagged with
0
votes
1answer
39 views

Wrap one line of text into a multiple line block

I have a very long line of text (8000 characters). I would like to format this nicely so it splits across multiple lines in a block. Where the line breaks occurs does not matter for this purpose. ...
3
votes
3answers
185 views

How to paste-then-copy?

I'm not sure whether anyone has ever implemented what I'm looking for, but maybe I'm just using the wrong terms to search for it. What I want to achieve is essentially a reverse copy and paste: I'm ...
2
votes
1answer
67 views

auto-loading ruler-mode while in text-mode

I have configured evolution to use Emacs for me to edit my replies to emails I receive. However, I need to limit my line length to around 72 characters to avoid the odd-ball line wrapping by the ...
0
votes
1answer
102 views

pressing return in paragraph-indent-text-mode deletes whitespace indenting beginning of paragraph

I'm currently using emacs 25.3 on Mac OSX installed using Homebrew, and without any modifications in my .emacs file or anywhere else. I think I may be fundamentally misunderstanding what paragraph-...
2
votes
3answers
149 views

Reorder function definitions in a file

Adapting to a rather functional programming style, I often end up with files consisting of a lot of individual function definitions. Oftentimes, I then decide at some later point that I want to ...
0
votes
2answers
115 views

Quick/electric text expansion

I've seen in some Emacs videos, the author would type #+BEGIN_SRC in their buffer, and emacs auto inserts #+END_SRC. Is this a feature I can "turn on" in vanilla Emacs? If not, which package can I ...
1
vote
0answers
113 views

Setting margins in `text-mode`

I use text files for most of my work. But for printing them on letterhead, I need to set margins to say 3 cm for upper margin and 2.5 cm for lower. Is there any way I can define them in text-mode. ...
0
votes
0answers
29 views

How do you remove the last few characters from all lines in a txt file in spacemacs?

How do you remove the last few characters from all lines in a text file? Example: 23193 123252 1 1238 123 1 34356363 11238080123 1 Should become: 23193 123252 1238 123 34356363 11238080123 I'm ...
5
votes
4answers
1k views

How to add a suffix to every line of a text?

Windows 10, Emacs 25.1 Suppose I have the following text (about 100 rows): ic_m_sales ic_m_activity_report ic_m_messanges ic_m_products_name ic_m_change_store ic_m_faq ... How ...
7
votes
1answer
238 views

Increment days / months / dates, etc. within buffer

In a text document, while editing, I often need to increment/ decrement calendar data. So, Friday will need to become Monday, December will need to become March, etc. Or 28 Apr after adding 5 will ...
0
votes
1answer
46 views

Swap text before and after “=” in properties file

Windows 10, Emacs 25.1 Suppose I have properties file: 1=10 2=BS.30 3=BS.20A Before "=" are numbers, but after "=" has any text(without spaces) I want to swap text before and after "=". So the ...
3
votes
1answer
167 views

Move selected sentence, word left/right by equivalent unit?

More broadly, should work by the selected semantic unit (incl. paragraphs in text mode, and the relevant units in other modes). I.e., if a sentence is selected, then the notional "move-left" would ...
0
votes
2answers
70 views

How do I track the number of lines added/deleted in an emacs session?

I am looking towards tracking the number of lines of text that I have added or removed in a session of emacs, is there any simple way to do this? If not what would be the right direction towards ...
0
votes
1answer
51 views

Yanking line copies past kill-ring lines along with current

I'm using Emacs to create text to copy to another program, but I need to copy line by line. I'm using a variation of kill-ring-save I provide below. (defun my-kill-ring-save () (interactive) ...
3
votes
1answer
759 views

Prevent Emacs from overwriting text

In this example: If I add for example '0.5' where the cursor is, instead of adding '0.5' while moving the remaining text to the right, Emacs will delete the part '}{ckt1}' while adding '0.5'. Is it ...
0
votes
0answers
42 views

mirror/auto populate a section of text in another location in the same buffer/other file

Im looking for a way to to mirror/auto populate a section of text in another location in the same buffer and/or other file. for example, i manage my config files in org mode for multiple machines. i ...
0
votes
1answer
95 views

function to add/split a new line each time a dot (.) is present?

Im looking for a way (function) to add/split a new line each time a dot (.) is present? for example turn this When a user wants to communicate with the computer, the user interacts with an ...
1
vote
0answers
49 views

Tab or auto completion of command while editing a .tex file

Seeing if there is a way for auto or tab complete specifically while editing a .tex file. For example \text.... (tab or autocomplete) in some editors will allow you to quickly choose from '\textbf'...
2
votes
3answers
629 views

org - keyboard shortcut to promote text to heading

How to promote a text line to a heading in org-mode? ie: I start writing text and only later wants to structure it: here's a start typing some text. and continue on a 2nd line and even a 3rd line. ...
1
vote
1answer
964 views

How to permanently change the default spelling dictionary?

In Aquamacs, the Emacs for macs, the dictionary can be changed in the Menu by going to Edit -> Spelling -> Change Dictionary... In my case, I enter en_GB. How do I avoid doing this for every file ...
1
vote
1answer
110 views

Tracking instantaneous chages

is there any package that tracks changes made on an instantaneous basis? That is, just like handwriting captures edits, I would like to see all the changes as a buffer is developing. So, there is no ...
0
votes
1answer
304 views

In Spacemacs, how can I conditionally set line-wrapping on only for text files (i.e. in text mode)?

I want to have Spacemacs wrap around long lines, but only in text files (i.e. text mode), not in programming language files (i.e. program mode). How could one achieve that? I know that to turn on ...
4
votes
0answers
542 views

Send a text from Emacs to Grammarly

Is there a nice way to bind Emacs and Grammarly. This is what I wrote to myself. A very simple plugin that helps you to send a marked text to Grammarly. It is a very simple plugin, is there a better ...
1
vote
3answers
840 views

Insert the value of a variable into the buffer I'm editing

I asked How can I script emacs to install packages from list? and got this answer. (setq package-selected-packages '(async epl evil goto-chg helm helm-ag ...
0
votes
0answers
55 views

Is there a way to convert an array of bytes into a UTF-8 string?

There are now some files which contain raw bytes which are valid UTF-8 characters, e.g. a line of the file could be '@\u0915\u0941\u091b@ \u092c\u093f\u0902\u0926\u0941 \u0938\u095e\u0947\u0926 \u0939\...
9
votes
1answer
734 views

unicode.txt slowness

Moving around point (using the cursor keys) in Xah’s unicode.txt in fundamental-mode is noticeably slower than in an ordinary text file. Are the many non-ASCII characters the issue? Anything else? ...
1
vote
1answer
199 views

Binding a series of commands to a key

After a few trials and errors, I finally managed to find a series of customization for my Emacs to be the almost perfect distraction free environment. However, I don't want these settings to load ...
0
votes
1answer
27 views

Shift text after cursor to specified column

If I have a line like: vec3 pos; // May not be defined. And I want to shift the comment to a specific column number, say 27, such that I get: vec3 pos; // May not be defined. Is ...
3
votes
1answer
49 views

is there a `transpose-page` command?

Does Emacs or any packages provide a transpose-page command? I know the C-x [ and C-x ] and forward or backward page, but many times I just want to transpose two adjacent pages, especially when in ...
5
votes
3answers
171 views

What kinds of mistakes does transpose fix?

The only times I've ever found a use for transpose-words or transpose-chars is when I accidentally hit one of them unintentionally, in which case a backward-word followed by transpose-words again ...
1
vote
0answers
37 views

Is there a way to get copy & paste to be context-aware wrt whitespace and formatting?

When I copy a word and paste it at the end of an existing sentence (between the last word and the full stop), I'd like it to be pasted in such a way that the space between the pasted word and the ...
1
vote
0answers
110 views

Can I edit several files synchronously?

Emacs has the scroll-all-mode, which scrolls two buffers synchronously. I would like to edit about 8 files on 8 different hosts synchronously. This can be achieved by running vi in cssh. Is the ...
2
votes
1answer
148 views

Emacs - Lisp to parser text block to plantuml

Some document said emacs-lisp is more powerful than perl/Python to parser text file, but I still didn't see good example for reference. For example, if input below text block: 12-22 07:43:14.699 ...
4
votes
1answer
135 views

How can I execute a function every time I insert certain characters in the buffer?

I write a lot of text in German and English and I'm getting tired of switching the dictionary of my spell-checker all the time. In true Emacs spirit, I decided to do something about this and dusted ...
1
vote
2answers
2k views

Neovim inside of Emacs as an alternative to Evil mode

I'm a current Neovim user who happens to be interested in Emacs. I like Org mode, as well as some other features of Emacs. However, every time I've tried to use evil mode, it's felt crippled. (The ...
1
vote
0answers
214 views

Dictation in Mac OS doesn’t leave spaces between words in Emacs

I have tried to use the dictation feature of Mac OS in Emacs and it works quite well, except that it doesn’t seem to recognise spaces between words if I pause shortly and also omits spaces between ...
1
vote
1answer
81 views

pasting from websites results in 1 long line..anyway to keep the paragraph format?

when copy and pasting from any web site a paragraph and pasting into emacs with S-insert, the paragraph is always a very long line. is there anyway to keep the paragraph structure?
0
votes
1answer
27 views

looking for a way/function to kill/delete alll whitespace/empty area in a region to start of line

im looking for a way/function to kill/delete alll whitespace/empty area in a region to start of line. for example if i have this snippet (defhydra hydra-copy-paste (:color blue :columns 4 :hints ...
2
votes
1answer
156 views

advice on easy formating of hydra docstring

so i used to use the auto generation of hydra hints with the :hint nil and :column 3 argument i recently find a need to have better control on whats presented in the hint area of some huge hydras i ...
3
votes
2answers
602 views

Always remove brackets by pairs - fix hungry-delete-mode and smartparens-strict-mode conflict

Enabling smartparens-strict-mode breaks hungry-delete-mode as it overrides the hungry-delete remaps for C-d and C-h with smartparens specific functions. Hence, I have disabled smartparens-strict-mode ...
2
votes
3answers
67 views

Rearranging whitespace in sexps

When writing Lisp, I often encounter a long line such as the following. (map function (|apply append long-list-name1 long-list-name2 long-list-name3)) (where '|' denotes the point). This can be a ...
1
vote
2answers
47 views

Toggle between end of line and beginning of an inline comment

I'd like to change the default behaviour of pressing C-e so that, If I have an inline comment, pressing C-e should first go to the end of line and pressing it again should go to the beginning of the ...
16
votes
1answer
2k views

What am I giving up by activating CUA mode?

CUA mode is very close to the workflow I am used to outside Emacs, so I am tempted to activate it. But I have learned that Emacs may have useful gems hidden in its ways, and CUA mode seems something ...
3
votes
2answers
203 views

Detect changed files by content

When working with files changed on disk, there are two warnings ... changed on disk; really edit the buffer? ... has changed since visited or saved. Save anyway? They're useful, but get very ...
3
votes
1answer
124 views

Emacs auto fill on period

How can I tweak Emacs auto-fill to fill when a period is inserted? For example, with a (setq fill-column 10) the following will auto-fill when I press the space after "fill". ;; good fill ;; good ;;...
0
votes
2answers
200 views

M-x query-replace but replace all in a file [duplicate]

I can do M-x query-replace and replace all strings with another one. But it only replaces ones below the current cursor position. Is there any way to replace all the occurrences regardless the ...
3
votes
2answers
144 views

kill the current line and preserving cursor position

I'm using the slick-cut function (as answered here by itsjeyd) for killing the entire line with minimal keystrokes. It's defined like so :- (defun slick-cut (beg end) (interactive (if mark-...
2
votes
2answers
460 views

function to reshape a 1-column buffer list into N-columns with align-regexp

I wanted to display a list of strings in the emacs completing-read style, which displays a list of completion strings in a nicely aligned multi-column display. But I could not find an easy answer or ...
6
votes
4answers
2k views

Hightlighting all occurances of selected text

Within Visual Studio and Notepad++, when I select a symbol (using the shift key or mouse), other occurrences of it within the buffer are also highlighted in another color. When editing JavaScript or ...
0
votes
1answer
153 views

How to determine if there is really any delay in text input with company completion?

I use Company mode as completion. I like the gratification of instant completion popups. So I set the following setting: (setq company-idle-delay 0.0) So basically no delay before the pop-up appears....