Questions tagged [text-editing]

Questions about editing or manipulating text inside of Emacs.

Filter by
Sorted by
Tagged with
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'...
2
votes
3answers
524 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
787 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
102 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
269 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
476 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
738 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
46 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\...
8
votes
1answer
598 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
187 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 ...
4
votes
3answers
149 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
35 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
104 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
141 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
129 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
194 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
69 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
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 ...
2
votes
1answer
135 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
579 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
65 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
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 ...
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
185 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
117 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
157 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
122 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
424 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
148 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....
2
votes
1answer
622 views

How can I use Emacs in a SSH sever that I logged in through emacs terminal?

I really like the emacs terminal but each time I use it to log into my server. I don't know how to use emacs to edit files on the server. Or it is not possible to do it? I can only edit files on ...
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 ...
4
votes
1answer
852 views

Drag selected text with the mouse

In many editors it is standard to move selected text by dragging and dropping it with the mouse. In emacs dragging selection with the mouse starts a new selection by default. This is extremely ...
1
vote
3answers
730 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
91 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
170 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 ...
5
votes
2answers
667 views

Incrementing characters in Emacs, next to numbers?

You can place a pointer on a number, like 1, and increment it to 2. There are many alternatives on this. See also the Emacs Wiki: https://www.emacswiki.org/emacs/IncrementNumber 7 alternatives to ...
0
votes
5answers
366 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 ...
2
votes
1answer
647 views

Can I write elisp code to act on the text in a buffer [closed]

I am fairly new to emacs and I want to learn emacs Lisp. In particular, is it possible to write elisp functions in, say, the scratch buffer to do some complex text-processing on my program file ...
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
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
106 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"...
0
votes
0answers
23 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 ...
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? ...
3
votes
0answers
114 views

Edit any input field in emacs buffer

Is it possible to make emacs as an input middle man for any text field in the system? It should work like this: 1 user focus the text input field of any gui program 2 a system hotkey brings up a ...
2
votes
1answer
97 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

Upcase whole buffer but ignore quoted strings

I want to type everything in lowercase, but have a command to turn the whole buffer into uppercase except for quoted strings. What is the command to tell emacs to ignore quoted strings?