put cursor on found text in less or vi?

Little Girl littlergirl at gmail.com
Thu Sep 26 15:59:31 UTC 2024


Hey there,

Paul Smith wrote:
>Little Girl wrote:

>> I wouldn't know, because I run screaming from Emacs, Vi, and Vim
>> because their interfaces and the way to interact with them is so
>> alien to me, so I haven't become familiar with any of them.

>Huh.  I understand that reaction WRT vi, which is a modal editor and
>so extremely different from a "typical" editor.

Yeah. It's either that one or Vim that has a funny YouTube video
showing the problem all of us newcomers face when attempting to
exit the program and trying a million things quite unsuccessfully.
That was enough to scare me away. I believe Emacs also has a
non-standard exit that would leave me in a similar situation, but I
could be wrong. It's been a long time since I tried it.

>But Emacs and its interaction is largely the same as with any other
>editor, at a superficial level: you get a graphical window with
>menus, you use your mouse or keyboard to move around and select
>stuff, and when you type the text is inserted wherever the cursor is.

That would definitely be a plus for me.

>The major up-front difference between Emacs and "other" editors is
>that, since it predates Windows and its C-c/C-x/C-v copy/cut/paste
>model, Emacs uses those keys for something else.  You can rebind them
>(you can rebind anything in Emacs) but it's annoying for sure: C-c
>and C-x in particular are "command prefixes" in Emacs which means
>they are used EVERYWHERE.

I've got four requirements for any editor, all of which are accepted
as standards most of the time in Linux and Windows:

	* Shift+Del and Shift+Ins should cut and paste from and to the
	PRIMARY clipboard (CUA standard) and that should also be the
	editor's clipboard.

	* Home and End should take me to the beginning or end of
	  the current line and not the actual beginning or end of the
	  current sentence if it wraps onto another line (my cursor
	  should never change lines when doing either of those
	  operations).

	* Ctrl+Home and Ctrl+End should take me to the beginning or
	  end of the document.

	* Ins and Del should insert or delete at the position of the
	  cursor.

My understanding is that Emacs accepts my cut and paste
key-combinations, but they access the internal Emacs clipboard and
additional key-combinations are needed to access the PRIMARY
clipboard.

My understanding is also that Emacs uses a two-key key-combination to
get to the beginning and end of a line and it's still not clear to me
whether Emacs takes wrapping into account in determining where that
beginning or end is. I'm not sure whether it would accept my Home and
End keys for that.

My understanding is that Emacs uses Home and End to get to the
beginning and end of the document, which would conflict with my way
of getting to the beginning and end of the current line. I haven't
yet found out whether Emacs would accept my key-combinations for
those.

Any or all of those would be enough to send this creature of habit
scampering, because I do them from muscle-memory without thinking and
would like to continue doing that.

Geany gets the Home and End and Ctrl+Home and Ctrl+End backwards by
my standards by default and has to be reconfigured, which I always do
immediately when I install it. If Emacs can similarly be made
(through a one-time configuration) to accept my way of doing things,
then I'd be happy to give it another look. I hear so many good things
about it and get the impression that it's a very powerful program
that can do a lot more than edit text.

>Of course at the next level down there are large differences but
>that's true for any editor.

For those of us who stick mainly with the keys and key-combinations I
listed above, the basic daily experience in most editors seems to be
pretty much the same. It seems to be all the other stuff that varies
wildly.

>However, I have no interest in convincing people to change editors as
>they are the quintessential "personal opinion" topic :D

I'm always open to new experiences, so I'm willing to try recommended
stuff. It might be a good idea to give Emacs another try. It's been
years since I tried it and perhaps it's changed or perhaps there's a
simple way to get it to work the way I like.

>Any Git operation you do at the command line, and a lot you probably
>don't even know how to do (at least not without consulting the manual
>every time), is much simpler using Magit.

We all learn the basics, but you're right that I often have to
consult my notes when doing anything fancy with git.

>I know people who don't use Emacs, but they do use Magit: they start
>up an Emacs instance with a simple setup file that drops into Magit
>automatically, and use it as a kind of "Git interface stand-alone
>app".

Interesting. I found a YouTube video for it:

https://www.youtube.com/watch?v=X_iX5US1_xE

>The thing I don't like about these videos is they all start with "how
>to install and configure" which is always frustrating to me: what I'd
>love is just a video showing all the cool stuff you can do without
>worrying about gnarly low-level details of setup, discussing
>exceptions, keybindings, etc.  Save all that for some other video
>people can watch once you've convinced them it's worth it.  Sigh.

That guy above spends the first minute asking you what the one
feature is that could convince you to use Emacs and then, at about
the one-minute mark, gets right into it without showing installation
or configuration.

I can see why you like it, but I still prefer the command-line. Using
it would involve learning lots of new shortcuts. The only shortcuts
that have ever stuck inside this head are the ones above, but there
are tons and tons of full commands on my mental shelves. I guess I'm
just a terminal kind of girl at heart.

-- 
Little Girl

There is no spoon.




More information about the ubuntu-users mailing list