[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-team] emacs: dd comme vi
Hep ;)
Je me mets un peu à Emacs, pour rire, et y a une chose qui me manque déjà:
le "dd" de vi (càd supprimer une ligne).
Sous Emacs, je dois me taper M-a, \C-k, \C-k
(beginning-of-line, kill-line, kill-line)
J'ai essayé de me faire une macro pour ça dans mon ~/.emacs, mais ça marche
pas fort:
(defun kill-line-like-vi ()
"kill the whole line like a vi :dd"
(interactive)
(beginning-of-line)
(kill-line)
(kill-line)
)
(global-set-key [M-d] 'kill-line-like-vi)
Remarquez que je ne comprends que plus-ou-moins ce que je fais là ;-)
Quelle est la différence entre global-set-key et define-key ?
Et tant que j'y suis, qqn connaît le truc à ajouter au ~/.emacs pour
que le syntax highlighting (global font lock) soit automatiquement activé ?
(avec vim, c'est "syntax on" dans ~/.vimrc ;))
--
-o) / Pascal Bleser ATOS Payment Systems|
/\\ \ C++/UNIX Development Aachen, Germany|
_\_v \<guru@linuxbe.org> <pbleser@atos-group.com>|
---------------------------------------------------|
University, n.: :
Like a software house, except the software's free,:
and it's usable, and it works, and if it breaks:
they'll quickly tell you how to fix it, and ...:
---------------------------------------------------'
---------
Visit the Linux Supertore Online: http://www.redcorp.com !
If you want to be deleted from the list, send a mail to
majordomo@rtfm.be with "unsubscribe linux-team" in the body.
Archive of the list: http://tania.be.linux.org/