[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: customize according to mode
From: |
Greg Rowe |
Subject: |
Re: customize according to mode |
Date: |
Mon, 04 Apr 2005 08:06:19 -0400 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
Purnank wrote:
I need one help.
On my system, c-indent-new-comment-line is mapped to M-j
But i want it to map c-indent-new-comment-line to "Return" when i am typing
a comment and
map "Return" to newline-and-comment when i am editing C++ file.
You can use hooks to make mode based customizations. In your .emacs you
would put something like:
(add-hook 'c-mode-hook
(lambda ()
(local-set-key (kbd "RET") 'c-indent-new-comment-line)))
(add-hook 'c++mode-hook
(lambda ()
(local-set-key (kbd "RET") 'newline-and-comment)
Sometimes there are tabs inserted in my file. and some time spaces.
If i use C-j (newline-and-comment) no tabs are inserted.
but if i use indent-region, align-entire, tabs get inserted.
Is this the default behaviour? How can i overcome it to insert spaces
explicitly.
http://www.emacswiki.org/cgi-bin/wiki/NoTabs
How can i have Hungary Delete by default.
(add-hook 'c-mode-hook
(lambda ()
(c-toggle-hungry-state 1)))
Is it possible to delete trailing spaces? In some other editor i used
previously, it was possible to remove trailing spaces. The last inserted
space can be deleted from the same. Is is possible for Emacs also?
Try M-x delete-trailing-whitespace. The documentations says it deletes
all trailing whitespace across the current buffer.
Is it possible to have bookmarks in emacs.
http://www.emacswiki.org/cgi-bin/wiki/BookMarks
is it possible to insert comment block by default like,
/**
* <cursor is here>
*
* @author ....
* @file .... some file.
* @date ... TODAY.
* (C) some company.
*//* ****************************** */
http://doxymacs.sourceforge.net/
Hope this helps
--
Home is where the .bashrc is.