Questions tagged [text-editing]

Questions about editing or manipulating text inside of Emacs.

Filter by
Sorted by
Tagged with
0
votes
4answers
207 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
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 ...
0
votes
1answer
28 views

How to transpose words backwards?

Transpose words (M-t) always swaps the word with the next. How can this be performed with the previous word?
0
votes
1answer
51 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
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 ...
0
votes
2answers
198 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
72 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
25 views

`Alt-f` or `Alt-b` then `d` deletes the forward word rather than putting character 'd' in front of the word. Why does emacs behave in this way?

I was doing some editing in Emacs. I was using Alt-f and Alt-b to traverse by word. I wanted to add the character d in front of a word. So I pressed Alt-b to get to the front of the word and then ...
0
votes
1answer
85 views

Why does emacs not apply some config settings when editing tex files?

I'm facing a rather peculiar situation where my emacs settings seem to be lost every time that I open a .tex file. That's doesn't happen when I'm editing .el or .py files. Heres some examples with ...
0
votes
1answer
41 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 ...
0
votes
1answer
55 views

How remove all rows contain specific text?

Windows 10, Emacs 25.1 Suppose I has the next text 111111111111111111 hello 22222222 aaaahello 3333333333333333333333333333333 aabbbbbbbbhellocccccdddddddd aaaaaaaaaaaaaaa cccccccccccccccc ...
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-...
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 ...
0
votes
1answer
45 views

smartparens how to stop behaviour of inserting backslash \ before I type a single quote '

I'm in C major mode, editing source files. Whenever I want to type a single quote ' smartparens automatically gives me the following: \'|\' , where | is the cursor position. What I want exactly is ...
0
votes
1answer
38 views

Stop automatic removal of space before point when inserting `.` (dot)

The following gif shows the behaviour quite nicely: Whenever I type a space followed by a dot (.) in any mode derived from text-mode, emacs will replace the space with the dot. I could not want this ...
0
votes
1answer
100 views

Why after save *Occur* buffer I can't edit editable file? [duplicate]

Emacs 26.1, Windows 10 (64 bit) I open file trace.log. User occur to find text. Save occur buffer to file NXS_ETH.txt. Do some manipulations. See screenshots. But I can't edit EDITABLE file. Here ...
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. ...
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 ...
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) ...
0
votes
1answer
303 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 ...
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 ...
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....
0
votes
1answer
379 views

Remove linebreak arrow and move last word to next line

When I write text in the emacs editor and the text reaches the right border of the program, emacs continues on the next line and puts an arrow on both sides of its borders. I want to know if its ...
0
votes
1answer
19 views

Insert aligned multi-line text in current buffer regardless of position?

I'm creating a function to easily insert ditaa boxes while drafting reports in org-mode. I have the meat of the function accomplished, but not sure how to implement it so that boxes can be inserted ...
0
votes
1answer
68 views

need help with very complex find and replace

I have a very complex (at least to my mind) text replacement task. ideally this would be a function or macro I could run over every org header in a buffer. I want to 1. move over any TODO state to a ...
0
votes
0answers
9 views

How to remove all console.logs() from the buffer and also how to comment all console.logs from the buffer?

When I do a regex-replace and replace with the empty string, the console.logs() are removed but the empty lines still remain. How would I remove these empty lines? Furthermore, how would I replace all ...
0
votes
2answers
35 views

how to convert 4 lines block text to 1 line space interrupted

I have a text file (name, surname, phone number) than I would import in excel and the play with column (name, surname...) The file was previously a docx file. I've converted it on as a text file. But ...
0
votes
2answers
29 views

Prepend to block of text, but ignore blank lines

How to add the string 'export ' to the beginning of each line of this text, with emacs: RBENV_VERSION="2.n.0" AUTHORIZE_NET_API_LOGIN_ID=example AUTHORIZE_NET_TRANSACTION_KEY=example # Google ...
0
votes
0answers
12 views

Electric pair delete with text between?

Suppose I have the piece of text (hello world). How can electric pair be made to work such that deleting the opening parenthesis automatically deletes the closing parenthesis? Some examples (the ...
0
votes
1answer
37 views

Punctuation abbrevs for writing prose, and automatic full stops at the end of line?

I'm a beginner Emacs user, and English isn't my first language so please bear with me. I use Emacs for writing prose, and I need help with punctuation. To put it short, I want to turn this: --hello ...
0
votes
0answers
44 views

Edit a portion of YAML file (a multi-line string) with a different mode

I'm constantly editing a big yaml file with many multi-line strings, which are BASH scripts. In org-mode I would use something like: #+begin_src sh echo "cool" #+end_src And then just to C-c ' (org-...
0
votes
0answers
18 views

reshape one column text of n rows into into m columns of n/m rows

I have tried the following function (defun test3 (size column cnt) (interactive "p") (if (eq cnt 0) (progn (setq start (point)) (forward-line (- (/ size column) 1)) ...
0
votes
1answer
89 views

ryo-modal defining keybind jump a word and insert character

I'm using the ryo-modal package that enables you to define your own keys in modal editing. I'm trying to makemf move the cursor to the end of the word, insert a whitespace and then exit the modal mode....
0
votes
0answers
492 views

Can I “insert” a backspace character into a buffer?

I'm trying to tail the output from a command into a buffer, and I just learned that the command occasionally uses long strings of ^H to backspace over previous lines. Like, the command stdout will ...
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 ...
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
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
0answers
54 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\...
0
votes
0answers
25 views

Adjust scrolling after font increase/decrease

After text-scale-decrease or text-scale-increase scrolling (e.g. with space, scroll-down) does not seem to take the text scaling into account. Is there a way to adjust the scroll commands to reflect ...