Questions tagged [selection]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
42 views

How to select and replace the content of all specific org-headings?

I am trying to select each content-heading extracted with org-noter and then remove all erroneous newlines. This is my function. (defun sanitize-noter-import () "Sanitizes org-noter imports. ...
0
votes
0answers
16 views

xterm-mouse-mode inserting cursor information on drag

I'm running into a problem with emacs used via ssh. The problem occurs when I: Log in remotely using SSH on Konsole Run emacs -Q Invoke mouse mode with M-x xterm-mouse-mode When I click-and-drag on ...
0
votes
2answers
27 views

How to act on the currently highlighted search result with evil mode?

When using evil mode search, is there a way to act on the currently highlighted search result by... Converting it into a selection. Treating it as a text object. Having the ability to specify the end ...
6
votes
1answer
156 views

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 ...
0
votes
0answers
20 views

Line/word selection with emacs -nw and word wrap

When I attempt to select a line with emacs -nw that is word wrapped I only get the first part of the line. However when I try and select the same line in vi I get the desired behavior In addition. ...
1
vote
1answer
31 views

Replace selection in one movement

I'm getting started using spacemacs with vim bindings for editing and one thing I would like to do sometimes is replace some text with some other text. For example I might have k x = (1 + 1) * x and ...
4
votes
2answers
175 views

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 ...
4
votes
1answer
129 views

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 ...
0
votes
1answer
46 views

How can I fix shift-select-mode with own syntax-table

So I have modified syntax table for moving with C-<left>. (defvar my-wacky-syntax-table (let ((table (make-syntax-table))) (modify-syntax-entry ?\( "w" table) (modify-...
2
votes
2answers
140 views

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 ...
2
votes
2answers
338 views

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'...
1
vote
1answer
184 views

Identify buffer by part of its name

Is there a way to select a buffer by part of its name using elisp? For instance, the ag package may create a buffer called *ag search text:MyPtyhonClass dir:c:/projects/my_module/* or the realgud ...
2
votes
1answer
59 views

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.
0
votes
0answers
60 views

C-S-a doesn't select text to the line beginning

The Key combination Ctrl + Shift + a doesn't work in my GUI-Emacs to select a region from the position of pointer to the line start. Doing C-h k and the above key combination shows no documentation.
5
votes
3answers
266 views

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

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 ...
0
votes
1answer
171 views

auto-insert mode switch to new file

I managed to insert a template to certain sripts with autocomplete. Example: (auto-insert-mode) (setq auto-insert-query nil) (setq auto-insert-alist '(((ess-mode . "R script") nil "# R ...
0
votes
2answers
124 views

Function to highlight timestamp generated from org-time-stamp

We can create a timestamp (e.g., <2018-01-11 Thu>) by C-c . which runs the command org-time-stamp. How can we highlight (i.e., create a region) the whole timestamp when the cursor is on it?
0
votes
2answers
292 views

How to save the text selection and keep the selection highlight

In Emacs 25 how can I save the text selection and keep the selection highlighting when using Transient Mark mode? If I use kill-ring-save, the highlighting is switched off and I have to switch it on ...
0
votes
1answer
40 views

How can I constrain a predefined replacement-function to selected text?

When using replace-string from the M-x while having some text selected, it only operates on that selection (specifically, on an Evil visual selection, in my case). However, if I put the same ...
1
vote
2answers
288 views

How to evaluate the selection through Python and replace the selection with it's result?

Being more familiar with Python then elisp, I'd like to evaluate the selection as as Python snipped - as a short-cut to opening a calculator or Python prompt and copy-pasting between them. Is there a ...
1
vote
0answers
78 views

Make `insert` follow `(delete-selection-mode t)`

When I call helm-copy-to-buffer (which calls insert) with active region in my current buffer, the marked helm candidate is added after the active region. But I expect the active region to be replaced ...
2
votes
0answers
46 views

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 ...
2
votes
2answers
127 views

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?...
9
votes
2answers
597 views

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 ...
7
votes
3answers
3k views

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 ...
8
votes
3answers
554 views

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 ...