Questions tagged [selection]

33 questions
9
votes
2 answers

Selecting (i.e., as the region) the current match in incremental search

When searching for a string with C-s, I want to be able to hit some key to exit search mode but still maintain the selection of the match. That way I can immediately start typing and replace the last match. For example, say I have the following…
Ben
  • 587
  • 4
  • 11
8
votes
3 answers

How to select (and copy) a column of an org table *without* rectangle selection?

It seems to me that the normal way to copy a column of an org table is by rectangle selection (see here). That is, first the column is selected by marking all of it by hand, and then it is copied with org-table-copy-region or the like. What I would…
Timm
  • 1,549
  • 12
  • 23
8
votes
3 answers

Use avy to select distant word or line and paste at point

Is there a way to use avy or a similar in-buffer selection tool to quickly select a word or line to paste at the current point? For the following buffer an example workflow for proposed functionality would be: line 1 - reallyLongSymbol line 2 -…
Joe
  • 1,312
  • 1
  • 8
  • 19
7
votes
1 answer

Is there a convenient way to swap two words that aren't adjacent?

I've recently been editing some source code where I often want to swap elements in an array that spans multiple lines. Doing this manually is quite tedious, moving the cursor between both locations and copy-pasting twice. It's possible to write a…
ideasman42
  • 8,375
  • 1
  • 28
  • 105
5
votes
1 answer

Highlight rectangle and non-rectangle selection at the same time

By default, Emacs highlights the non-rectangular selection; alternatively, you can use (rectangle-mark-mode) to show the rectangular selection. Instead, I'd like to always show both, by highlighting the rectangle in one face, and the normal…
Cactus
  • 165
  • 4
5
votes
1 answer

Select a word in a PDF by double-clicking on it (with pdf-tools)

I use pdf-tools in Emacs to view PDF documents. I would like to be able to select words (mark their region and then copy them to the kill-ring) in the PDF by double-clicking on them. Is there a function in pdf-tools or elsewhere I could use to…
StarBug
  • 479
  • 4
  • 10
5
votes
3 answers

How to select (and highlight) non-consecutive blocks?

The title says it all. I'm looking for a C- or M- built-in way to select non-consecutive lines and blocks of text, like usual consecutive lines with Shift or C-SPC. I.e. I need a switch that turn selecting off and back on, but previous selections…
iantonuk
  • 151
  • 1
  • 4
4
votes
2 answers

Selecting punctuation, namely, periods, commas, question marks, exclamations, etc. in Emacs

I use Emacs mostly for writing text not code. This involves a great deal of selecting, deleting and editing, as one would expect. By default if I move forward by a word in Emacs, Emacs ignores basic punctuation such as . , ; ? ! ' ". This is…
Edman
  • 1,167
  • 7
  • 13
4
votes
1 answer

How to select last pasted text

How can I select the last pasted text with regular Emacs? I would like to do the same thing as this Q&A, but I don't use evil mode.
AhLeung
  • 1,083
  • 5
  • 14
2
votes
1 answer

Evil keyboard movement extends mouse selection

My Setup Emacs 28.1 Evil version 1.15.0 Gnome 42.4 wayland Observed Behavior In default emacs (GUI), with no init file, if you highlight a region with mouse 1 and then use a keyboard movement, the highlighted region disappears. If you load evil…
farnsy
  • 161
  • 4
2
votes
4 answers

How to count the number of characters in the marked (selected) region?

I know how to count the number of words. How to count the number of characters in the marked (selected) region?
Pedro Delfino
  • 1,369
  • 3
  • 13
2
votes
2 answers

Select region between empty lines

If I use (thing-at-point 'paragraph) (or mark-paragraph, for that matter), the selection isn't necessarily aware only about the empty lines. Especially, with lists and code blocks in org-mode. So, I need a function which returns the bounds which…
user3496846
  • 378
  • 1
  • 10
2
votes
2 answers

How to run selected bash commands

I have a large bash script and I need to rerun certain lines of code. Normally I would comment out any line I don't want to run and then execute the file on the shell. But that is rather cumbersome. I'd much rather select the lines I want to execute…
user2740
  • 539
  • 1
  • 5
  • 10
2
votes
0 answers

How to pre-select helm's pre-input?

In many other softwares (e.g., Chrome), when we initiate word search by Ctrl-F, the pre-input is pre-selected so that we can replace it by simply typing a new keyword, or append a new string to it by first pressing right-arrow key. Could we have the…
AhLeung
  • 1,083
  • 5
  • 14
2
votes
2 answers

How can I define a key to cancel selection only when I selecting something?

How can I define a key to cancel selection only when I'm selecting something? Because I use this key to do other thing in global-mode-map.. Is there any specific mode for mark and selecting something? I just tried something like this but it didn't…
Yu Su
  • 111
  • 4
1
2 3