(load-library "hideshow") (defun my-hs-setup () "enables hideshow and binds some commands" (hs-minor-mode 1) (define-key hs-minor-mode-map [f5] 'hs-hide-block) (define-key hs-minor-mode-map [f6] 'hs-show-block) )Then, u need to add this to your mode-hooks, for example for c-mode:
(add-hook 'c-mode-common-hook 'my-hs-setup)(c-mode-hook is also executed in c+-mode)
(defun switch-cc-to-h ()
(interactive)
(when (string-match "^\\(.*\\)\\.\\([^.]*\\)$" buffer-file-name)
(let ((name (match-string 1 buffer-file-name))
(suffix (match-string 2 buffer-file-name)))
(cond ((string-match suffix "c\\|cc\\|C\\|cpp")
(cond ((file-exists-p (concat name ".h"))
(find-file (concat name ".h"))
)
((file-exists-p (concat name ".hh"))
(find-file (concat name ".hh"))
)
))
((string-match suffix "h\\|hh")
(cond ((file-exists-p (concat name ".cc"))
(find-file (concat name ".cc"))
)
((file-exists-p (concat name ".C"))
(find-file (concat name ".C"))
)
))
)
)
)
)
(global-set-key '(meta h) 'switch-cc-to-h)
(load "recent-files") (recent-files-initialize) (setq recent-files-permanent-submenu t) (setq recent-files-number-of-entries 25)
(defvar yank-menu-length 30
"*Maximum length of an item in the menu for select-and-yank.")
(defun select-and-yank-filter (menu)
(let* ((count 0))
(append menu
(mapcar
#'(lambda (str)
(if (> (length str) yank-menu-length)
(setq str (substring str 0 yank-menu-length)))
(prog1
(vector
str
(list
'progn
'(push-mark (point))
(list 'insert (list 'current-kill count t)))
t)
(setq count (1+ count))))
kill-ring))))
(add-submenu '("Edit") '("Kill-Ring" :included kill-ring :filter select-and-yank-filter))