C-a
brings me back to the beginning of the line. But I would like C-a
to bring me back to the beginning of the text when writing python code.
if(test) :
print 'this is a test' # here i want to C-a
Now, at the end of the line starting with print
i would like to press C-a
to go to the p of print
, not to the beginning of the line. Which function does this in emacs?
infact there is a direct global key binding for this M-m
There is 'misc-cmds.el' by Drew Adams which has the command beginning-or-indentation
. It's probably what you are looking for. From the docstring:
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.
Find it at http://www.emacswiki.org/cgi-bin/wiki/misc-cmds.el.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With