emacs - python-mode indentation not working upon hitting enter -


i installed python-mode elpa , when hit enter cursor goes straight beginning of next line. instance following code:

def hello_world():     print "hello world!"     in range(3):         print "hello again"     return 0 

i have hit tab after enter every time after hit enter go new-line (although interestingly tab sends cursor right place).

when installed python-mode got warning messages relating indentation don't understand, here link warning messages.

c-j key looking ('newline-and-indent' command). managed rebind enter putting following hook in init.el:

(add-hook 'python-mode-hook           (lambda ()              (define-key python-mode-map "\r" 'newline-and-indent))) 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -