LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   creating my own shortcut (https://www.linuxquestions.org/questions/linux-software-2/creating-my-own-shortcut-56826/)

nakkaya 04-26-2003 02:52 AM

creating my own shortcut
 
i use emacs for all sorts of typing and txt stuff problem is i mostly use command that dont have a keyboard shortcut so how can i create my try google but got only tutorials on emacs none explains my problem thx.
(like compile function from the menu)

vladkrack 05-12-2003 03:10 PM

You could use Control with C (C-c) as it is reserved for user definition of commands. The following lines will define a prefix, a keymap and set a global key for accessing the keymap.

(defun Ctl-C-prefix ())
(setq Ctl-C-keymap (make-keymap))
(global-set-key "\C-c" (Ctl-C-prefix))

Here are some examples of how is used:

(define-key Ctl-C-keymap "c" 'compile)
(define-key Ctl-C-keymap "e" 'eval-buffer)
(define-key Ctl-C-keymap "n" 'next-error)
(define-key Ctl-C-keymap "f" 'auto-fill-mode)
(define-key Ctl-C-keymap "g" 'goto-line)
(define-key Ctl-C-keymap "$" 'ispell-buffer)
(define-key Ctl-C-keymap "-" 'dabbrev-expand)

nakkaya 05-12-2003 05:45 PM

thx i got one more question do you know how to activate the c++ highlight mode during execution of the program?

Tinkster 05-12-2003 05:48 PM

Meta-x font-lock-mode


Gülle Gülle,
Tink

nakkaya 05-13-2003 01:24 AM

Quote:

Originally posted by Tinkster
Meta-x font-lock-mode


Gülle Gülle,
Tink

thks but it is with just one 'l' Güle Güle,

:) :) :)


All times are GMT -5. The time now is 09:35 PM.