The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [text-editing]

Questions about editing or manipulating text inside of Emacs.

Filter by
Sorted by
Tagged with
2
votes
1answer
58 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 ...
2
votes
3answers
142 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 ...
2
votes
1answer
142 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 ...
2
votes
1answer
100 views

Insert Text Leftwards in Overwrite Mode

How can I insert text so that the cursor stays in the same position while text I type is shifted to the left, overwriting existing text? For example: row_title: some words old_title: letters ...
2
votes
1answer
72 views

How to wrap yanked text

In org-mode if I am typing the lines will wrap to the next line at around 70 characters. However if I yank text from the OS clipboard into the org-mode buffer, then the text will not wrap but be on ...
1
vote
3answers
783 views

How to delete all instances of a character in a bunch of files?

I was given a directory of files in which I was asked to make some systematic changes. Because it was a one-off task, and because there were only a few hundred files I thought I'd use an Emacs ...
1
vote
2answers
128 views

Macro-like feature in emacs?

If I need to remove everything in a parenthesis {...}, I do Put the cursor on { Click C-space (set mark) Click C-M-right (go to the }) Click C-w (remove selection) How can I automatize these steps? ...
1
vote
3answers
765 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 ...
1
vote
1answer
175 views

Transform selected text like a Python macro

I've only just started with Emacs (about 6 weeks now) so I'm not really familiar with its coding language. I was wondering if it was possible to write, for Emacs, the equivalent of a Python macro I ...
1
vote
1answer
441 views

How to delete word in next line with evil-mode?

I use evil-mode (from spacemacs) and I get a strange behaviour which I'm not sure if it is right or a bug. If I delete words (with dw, i think it calls evil-delete), it works until I arrive at the ...
1
vote
1answer
180 views

Kill a line deletes the line but leaves a blank newline character

On deleting a line in Emacs using C-k, Emacs removes the line contents but it leaves a blank newline character. To remove this, I again press C-k. How can I delete the complete line with no traces ...
1
vote
1answer
27 views

Replace placeholder by incremental value [duplicate]

Windows 10 Emacs 26.1 I has the next text [ { "id": N, "name": "Agent#N", "address": "N Tabernacle St, London EC2A 4DD, UK" }, { "id": N, "name": "Agent#N", "address": "...
1
vote
2answers
65 views

Writing a small elisp function

Could someone here write a small Elisp function for me? What I would like Emacs to do is the following: I have a region like this: [0.04579] [0.06569] [0.09507] [0.12696] [0.27929] [0....
1
vote
1answer
72 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?
1
vote
2answers
92 views

Deleting whole variable name on M-backspace

Is there a way to configure emacs, so that when I hit M-backspace it would actually remove the whole variable? If I have a variable like my_dummy_variable I need to hit M-backspace three times in ...
1
vote
1answer
53 views

Intelligently edit draft with emacs

I have a co-worker to edit LaTeX document. The co-worker uses LaTeX \color and \sout command to make the changs visible in pdf file. For example, Hello world becomes Hell{\color{red}\sout{o}a} ...
1
vote
1answer
111 views

Does “Edit with Emacs” saves a local file of current edit buffer?

I'm using Edit with Emacs to edit Stack Overflow and Stack Exchange sites. Currently I'm doing it with this message ;-) When I click on the button under the text area of Chrome browser, I get a new ...
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
2answers
45 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 ...
1
vote
1answer
108 views

Regexp not working

I messed up my latex code; I need to replace \cite[42]{source}. with .\cite[42]{source} and \cite{source}. with .\cite{source}. I tried \\cite\(.*\)\}\. -> .\\cite\1\} but I got an error: Invalid ...
1
vote
1answer
42 views

Dual-language text mode using the original interpretation of tabs

Does there exist an Emacs mode that replaces the contemporary interpretation of tabs (move to 8, 16, 24, .. or a multiple of some constant) with their original typewriter interpretation (set stops at ...
1
vote
1answer
46 views

Turn array from one-line into element-per-line

Say I have PHP array like this: $arr = ['one', 'two', 'three']; and I want to convert it to $arr = [ 'one', 'two', 'three' ]; real quick. Is there any ready to use soluions?
1
vote
1answer
56 views

In-sync editing the same file in two frames

For a lecture, I'll have a setup with two frames (one on my notebooks's screen, the other on the projector) showing the same file. When editing the file in the "master" frame I need the "slave" frame ...
1
vote
1answer
843 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
103 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 ...
1
vote
1answer
109 views

Iterate over string in YAS Snippet?

I'm new to emacs/LISP and would like guidance how to achieve the following output I'd like to type "color glass hat sport" in a single string ($1) that will be converted to the following: Color = "C"...
1
vote
0answers
26 views

fixed file size mode

Is there an emacs mode/package/whatever where a specific file size (and/or number of lines) is enforced in a visual way? Something like this: 1st line 2nd line where adding some text to the 2nd ...
1
vote
0answers
18 views

Why I can't delete first line after save *occur* buffer to separate file? [duplicate]

Windows 10, Emacs 26.1 I have file - file_first.txt: I want to find all line content word hello. So I use occur for this Nice. Now I want to save result to SEPARATE file: file_second.txt To do ...
1
vote
0answers
53 views

Align elements of a matrix to the right

I have a matrix in C++ Matrix<double> A = { {31, -13, 0, 0, 0, -10, 0, 0, 0}, {-13, 35, -9, 0, -11, 0, 0, 0, 0}, {0, -9, 31, -10, 0, 0, 0, 0, 0}, {0, 0, -10, 79, -30, 0, 0, 0, -...
1
vote
0answers
252 views

how to convert camel case to snake case with vanilla emacs

When editing for example a ruby file, can't emacs toggle CamelCase to snake_case out of the box? Example ruby file def SecDecGov puts "abort" end
1
vote
0answers
35 views

Quoting selected text using email conventions?

Is there any existing elisp function which will quote any selected text using email quoting conventions? For example, suppose the following text appears in a buffer ... This is some text that I want ...
1
vote
0answers
100 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. ...
1
vote
0answers
44 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'...
1
vote
1answer
193 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 ...
1
vote
0answers
36 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
106 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 ...
1
vote
0answers
200 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
0answers
34 views

“Mark all Misspellings” never stops

On my Emacs (Aquamacs on OSX, latest version) the command Edit -> Spelling -> Mark All Misspellings goes through the whole file (from 0% to 100%) and then starts again at 0%, and continues ad ...
1
vote
1answer
235 views

How to “auto” repeat evil-yank?

I'm not from a vim background so I remap a lot of the evil commands and keys to fit my needs. I know you can use evil-repeat but I like the following better to quickly kill a few lines: (defun evil-...
1
vote
0answers
103 views

Unbalanced quotes auto-inserted in AUCTeX mode

This seems like it should be a very basic question, but I cannot find an answer anywhere. When writing in AUCTeX mode the auto-inserted paired quotation marks are now unbalanced. That is, when I ...
1
vote
0answers
31 views

How to remove line breaks but retain paragraphs [duplicate]

I have fill-column set to 75 by default and use fill-paragraph to insert line breaks in the paragraphs of text that I write. On certain occasions though, I need to remove the line breaks but want to ...
0
votes
5answers
369 views

How to swap two tab-separated values on a line, and generalize the process?

My file has one book listed per line, title first followed by a tab character, followed by the author's name. TITLE<TAB>AUTHOR TITLE<TAB>AUTHOR ... I want to swap the two fields, such ...
0
votes
4answers
2k views

How to replace multiple newlines for single one in whole file?

I have file which has multiple newlines. I want to receive single newline in their place. I know how to do it in vim(found in google query): :%s/\n\n\n*/\r\r/ How can I do the same in Emacs? ...
0
votes
4answers
145 views

Can someone recommend a good text editor for Emacs? [closed]

I'm looking for a good way to edit text within Emacs. Can someone give some good recommendations for text-editors for Emacs.
0
votes
2answers
107 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 ...
0
votes
1answer
46 views

How to trim text on each line, starting with the first space

Windows 10, Emacs 25.1 Suppose I has text: Advertisment d184f52a-14d7-dddddddddd ZAnelik 1c970d12-6c67-44e1-cccccccccccc Avers b0f0dd6b-a43f-4e40-b0ebbbbbbbbb BAVERS_MIGOM_OLD ...
0
votes
1answer
26 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 ...
0
votes
2answers
173 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 ...
0
votes
1answer
70 views

How to search and replace a number starting with 0?

I know how to do a normal search and replace ,but say for instance that I want to replace all numbers in a buffer that starts with a 0 and the second number is a generic number, how do I match that ...
0
votes
1answer
37 views

How to combine change `key: foo`, `key: bar`, `key: baz` to `key: foo bar baz`?

To clarify this is what I'd like to do: Text Before: key: foo key: bar key: baz Text After: key: foo bar baz Wondering if anyone has a good technique for this type of operation (simpler the ...