[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: About Emacs features
From: |
Sivaram Neelakantan |
Subject: |
Re: About Emacs features |
Date: |
Wed, 15 Jan 2014 08:11:23 +0530 |
User-agent: |
Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (windows-nt) |
On Tue, Jan 14 2014,Alejandro Zamora Fonseca Alejandro Zamora Fonseca wrote:
> Hello!
> I´m a Emacs new user and I have a question.
> How I can auto-complete words and create 'macros'(code snipets rapid
> generation) like in Notepad++.?
>
> Thanks,
> Alejandro
>
>
try auto-complete which might be a bit more natural. And I got this
snippet from the list here a long time ago. TAB does some completions
--8<---------------cut here---------------start------------->8---
;;;;re-using tab
(defun indent-or-expand (arg)
"Either indent according to mode, or expand the word preceding
point."
(interactive "*P")
(if (and
(or (bobp) (= ?w (char-syntax (char-before))))
(or (eobp) (not (= ?w (char-syntax (char-after))))))
(dabbrev-expand arg)
(indent-according-to-mode)))
(defun my-tab-fix ()
(local-set-key [tab] 'indent-or-expand))
(add-hook 'c-mode-hook 'my-tab-fix)
(add-hook 'sh-mode-hook 'my-tab-fix)
(add-hook 'text-mode-hook 'my-tab-fix)
(add-hook 'emacs-lisp-mode-hook 'my-tab-fix)
--8<---------------cut here---------------end--------------->8---
[snipped 8 lines]
sivaram
--