2011-12-07 5 views
5

C-a me lleva de vuelta al principio de la línea. Pero me gustaría C-a para llevarme de vuelta al principio del texto al escribir el código python.C-a para ir al primer personaje en emacs usando ipython-mode

if(test) : 
    print 'this is a test' # here i want to C-a 

Ahora, al final de la línea que comienza con print me gustaría pulse C-a para ir a la página de print, no al principio de la línea. ¿Qué función hace esto en emacs?

+0

Este es un duplicado: http://stackoverflow.com/questions/6035872/moving-to-the-start-of-a-code-line-emacs – GeneralBecos

Respuesta

11

de hecho hay una llave directa mundial vinculante para este Mm

+0

punta Absolutamente útil! ¡Gracias! :-) (Uno nunca deja de aprender cuando se trata de Emacs). –

1

Hay 'misc-cmds.el' de Drew Adams que tiene el comando beginning-or-indentation. Es probable que sea lo que estás buscando. Desde la cadena de documentación:

Move cursor to beginning of this line or to its indentation. 
If at indentation position of this line, move to beginning of line. 
If at beginning of line, move to beginning of previous line. 
Else, move to indentation position of this line. 

Encuéntrela en http://www.emacswiki.org/cgi-bin/wiki/misc-cmds.el.

0

utilizo

back-to-indentation 

I unido a CxCa en mis .emacs:

(global-set-key "\C-x\C-a" 'back-to-indentation) 
0

Hice una pequeña función personalizada para hacer esto en mi configuración Cuando presiono C-a y no está en la sangría, vuelve a la sangría. Si lo es, va al comienzo de la línea.

;; Remap C-a to more useful behaviour (a press anywhere other than at the indentation preforms the effect of back-to-indetation, otherwise, the normal C-a behaviour is used. 
(global-set-key (kbd "C-a") (lambda() (interactive) 
        (let ((previous-point (point))) 
        (back-to-indentation) 
       (if (equal (point) previous-point) (move-beginning-of-line 1))))) 
Cuestiones relacionadas