Emacs remember text selection

前端 未结 5 722
梦如初夏
梦如初夏 2021-01-13 17:54

I decided that I was ready to try something new, after a few years of using gEdit for most of my coding needs, and try to learn using Emacs. I knew this would be difficult,

5条回答
  •  走了就别回头了
    2021-01-13 18:14

    You can do this with something like the following:

    
    (add-hook 'text-mode-hook (lambda ()
                                (set (make-local-variable 'indent-region-function)
                                     (lambda (s e)
                                       (indent-rigidly s e tab-width)))))
    
    

    Then selecting a region and hitting TAB. will indent the region by a tab-width. You can then exchange point and mark with C-x C-x and hit TAB again to repeat.

    I do, however, agree with the previous answers that suggest using indent-rigidly directly.

提交回复
热议问题