all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ext-chunye.wang@nokia.com
Subject: Re: Hard to switch from vi
Date: Mon, 09 Oct 2006 02:03:32 GMT	[thread overview]
Message-ID: <uk63atfdx.fsf@nokia.com> (raw)
In-Reply-To: TTfWg.140$6G7.60@newsfe05.lga

Wen Weng <WenWeng@charter.net> writes:
I am a emacsen who is used to be a vimer.
the longer you use VI, the harder to switch.

anyway, I can answer some of your question.
> Hi, I am a vi user for years and am now trying emacs.
> I find it hard to get efficient. Can someone teach me some
> commands?
> 
> 1. In vi, to delete a line, I do, "dd" and to delete 5
> lines, I do "5dd". In emacs, how do I delete a complete
> line? C-k only delete
> from cursor to the end of line. Adding a C-a is really too much work.

of course, we can write a piece of elisp and bind it to some keys. It is a
problem for me that there is no such key to bind.

(defun delete-line()
  (interactive)
  (beginning-of-line)
  (call-interactively 'kill-line))


> 2. Is there a repeat last command command like the dot command in vi?
> 
C-x z or M-x repeat. this is not really same as vi dot command, because
it repeat everything, including next-line. if you want repeat many
times, press C-x z z z z z z z ....

> 3. In vi, to find a pairing brace I use the "%" command, is there a
> command like thins in emacs?
>
there are many solution for this problem. I've got my own.
further more, it is more than "%" command. please refer to 
http://ann77.stu.cdut.edu.cn/EmacsEditTips.html.
I hope you can read chinese. if not, feel free to contact me.

(define-key global-map (kbd "C-3") 'wcy-mark-some-thing-at-point)
(defun wcy-mark-some-thing-at-point()
  (interactive)
  (let* ((from (point))
         (a (mouse-start-end from from 1))
         (start (car a))
         (end (cadr a))
         (goto-point (if (= from start )
                            end 
                       start)))
    (if (or (eq last-command 'wcy-mark-some-thing-at-point)
            (and transient-mark-mode mark-active))
        (progn 
          ;; exchange mark and point
          (goto-char (mark-marker))
          (set-marker (mark-marker) from))
      (push-mark (if (= goto-point start) end start) nil t)
      (when (and (interactive-p) (null transient-mark-mode))
        (goto-char (mark-marker))
        (sit-for 0 500 nil))
      (goto-char goto-point))))

> 4. Should I really need to switch to emacs?
> 
If you are curious about Emacs, it is worth to do that. but you should
change the way you are thinking in VI. Emacs is different way. 
Anyway, both VI and Emacs are a powerful tools, just make it confortable
for you.


> Thanks
> Wen

  parent reply	other threads:[~2006-10-09  2:03 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-08 23:32 Hard to switch from vi Wen Weng
2006-10-09  0:12 ` Ignacio Mondino
2006-10-09  7:10   ` Lennart Borgman
2006-10-09 10:57     ` Jeremy Hankins
2006-10-09 14:47       ` Lennart Borgman
2006-10-09 17:49         ` Jeremy Hankins
     [not found]     ` <mailman.7914.1160393911.9609.help-gnu-emacs@gnu.org>
2006-10-10 13:03       ` Hadron Quark
2006-10-10 13:50         ` Pascal Bourguignon
2006-10-13 10:36           ` Hadron Quark
2006-10-10 14:11         ` Jeremy Hankins
     [not found]   ` <mailman.7909.1160377822.9609.help-gnu-emacs@gnu.org>
2006-10-10  1:39     ` Wen Weng
     [not found] ` <mailman.7907.1160352764.9609.help-gnu-emacs@gnu.org>
2006-10-09  0:40   ` Wen Weng
2006-10-09  1:48     ` Ajit Mylavarapu
2006-10-09  2:03 ` ext-chunye.wang [this message]
2006-10-09  2:09   ` Pascal Bourguignon
2006-10-09  2:44     ` Wen Weng
2006-10-10 12:59       ` Hadron Quark
2006-10-09  2:04 ` Pascal Bourguignon
2006-10-10 11:53   ` Hadron Quark
2006-10-11 13:35   ` martin
2006-10-09  8:52 ` Markus Triska
2006-10-09  8:53   ` David Kastrup
2006-10-09 16:28     ` Harald Hanche-Olsen
2006-10-10  1:36   ` Wen Weng
2006-10-10 11:16     ` Markus Triska
2006-10-10 13:05     ` Hadron Quark
2006-10-10 14:02       ` Pascal Bourguignon
2006-10-10 12:20   ` Hadron Quark
2006-10-10 12:32     ` Pascal Bourguignon
2006-10-10 12:38     ` Markus Triska
2006-10-10 12:57       ` Hadron Quark
2006-10-09 12:01 ` lgfang
2006-10-10  1:17   ` Wen Weng
2006-10-09 13:28 ` Ken Goldman
2006-10-09 15:06   ` Malte Spiess
2006-10-10  7:18   ` Giorgos Keramidas
     [not found] ` <45299CB0.5090003@speakeasy.net>
     [not found]   ` <4529A0E4.60403@charter.net>
2006-10-09  9:58     ` ken
2006-10-10  0:50     ` Stefan Monnier
     [not found]     ` <mailman.7911.1160387922.9609.help-gnu-emacs@gnu.org>
2006-10-10  1:22       ` Wen Weng
2006-10-10  2:23         ` Micha Feigin
2006-10-21 17:25         ` don provan
2006-10-22 19:36           ` Lennart Borgman
     [not found]           ` <mailman.132.1161545823.27805.help-gnu-emacs@gnu.org>
2006-10-23 17:15             ` don provan
2006-10-23 17:53               ` Lennart Borgman
2006-10-23 18:56               ` Floyd L. Davidson
2006-10-24  9:01                 ` Mathias Dahl
2006-10-24 10:12                   ` Floyd L. Davidson
2006-10-24 11:25                     ` Mathias Dahl
2006-10-24 18:23                       ` Floyd L. Davidson
2006-10-25 14:21                         ` Mathias Dahl
2006-10-21 21:00         ` Dieter Wilhelm
2006-10-11 22:21 ` John Sullivan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=uk63atfdx.fsf@nokia.com \
    --to=ext-chunye.wang@nokia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.