[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Indenting with the tab key like everyone else
From: |
R. Diez |
Subject: |
Indenting with the tab key like everyone else |
Date: |
Sun, 2 Jun 2019 21:19:45 +0000 (UTC) |
Hi all:
I want to change the indenting behaviour of the tab key when writing source
code like C++, Perl or Bash. But I am a little confused, so I need some help.
When in C mode, the Tab key is bound to c-indent-line-or-region . When in Perl
mode, it is bound to indent-for-tab-command, which is a rather complicated
function.
I want the same behaviour as most other IDEs I know: If I just press tab, it
should "intelligently" indent the current line of code as usual. But if I
select several lines with the shift key, I want to rigidly indent the selected
block of lines. At the moment, Emacs tries to reindent the selected lines,
which often does nothing, because it thinks the lines are already properly
indented.
If I want to intelligently reindent a block of lines, I would rather manually
call the right function, something like "reindent-code". I could create an
alias or a new function just for that purpose.
I never got used to Emacs "prefix" mechanism, so I do not want to use it. And I
do not want to retrain my "muscle memory". I want the same behaviour as
everywhere else.
What would be the best way to achieve this? I know a little Lisp, but not
enough for complex things.
Many thanks in advance,
rdiez
- Indenting with the tab key like everyone else,
R. Diez <=