Wednesday, April 20, 2011

Narrowing

Following commands seem to help very much.

In short, with "narrow" I leave only current defun in the buffer to edit, with "widen" I show complete file again.

C-x n d ...... Narrow down to the current defun (`narrow-to-defun').
C-x n w ...... Widen to make the entire buffer accessible again (`widen').

There are two more commands for region and page, but they are useless for me.
Anyway in Emacs' help one can find full description in the chapter called "Narrowing".

And yes, I added following three lines to my .emacs file to enable described functionality:
(put 'narrow-to-defun 'disabled nil)
(put 'narrow-to-page 'disabled nil)
(put 'narrow-to-region 'disabled nil)

Code folding

hs-minor-mode
show all ---------- C-c @ C-M-s
hide all ---------- C-c @ C-M-h
show block -------- C-c @ C-s
hide block -------- C-c @ C-h
toggle hide/show -- C-c @ C-c
toggle hide/show -- S-mouse-2

Another "a must": macros.

Here is a detailed description.

Friday, April 15, 2011

Tuesday, April 12, 2011

Another Emacs plugin: highlight-symbol

I guess, it is a must.



C-f3 - highlight-symbol-at-point
  f3 - highlight-symbol-next
S-f3 - highlight-symbol-prev
M-f3 - highlight-symbol-prev

Tuesday, April 5, 2011

On Switching Window Configurations in Emacs

I missed the stability in Emacs' layouts. In short, ESC ESC ESC command could break current layout. It was annoying. I missed some fixer to make my Emacs usable. I looked for it for a long time and finally found it: Windows And Registers. Also, the section Switching Window Configurations is interesting.

Short description:
  • C-x r w – stores the current configuration in a register
  • C-x r j – restores the configuration from a register
Example:
  • C-x r w 1 – store the current configuration
  • C-x 2 – split vertically
  • C-x 3 – split horizontally
  • C-x r j 1 – restore the stored window configuration

My Blog List