[Tutor] OT (probably): How to change default tab key value to 4 spaces in GNOME Terminal?
boB Stepp
robertvstepp at gmail.com
Sun Apr 26 19:41:41 EDT 2020
On Sun, Apr 26, 2020 at 6:30 PM Alan Gauld via Tutor <tutor at python.org> wrote:
>
> On 26/04/2020 22:28, Alex Kleider wrote:
> > On 2020-04-26 12:36, boB Stepp wrote:
> >> In vi's insert mode C-t inserts a tab. Now how do I get that to
> >> expand to 4 spaces without interfering with tab completion. On to
> >> your next response!
> >
> > What follows are the first few lines in my ~/.vimrc file.
> > They might help you get Vim to give you 4 spaces in response to the tab
> > key at the beginning of a line.
> >
> > set autoindent
> > set shiftwidth=4
> > set expandtab
> > set tabstop=4
> > set softtabstop=4
> > set textwidth=70
>
> Yes, but those are only read by vim.
> The readline library/bash shell only provides a vi keystroke
> emulation, it doesn't read the vimrc file. (At least I'm pretty
> sure it doesn't!)
>
> There may be equivalent settings you can use for readline
> (in the bashrc file maybe?)
In the GNU Readline Library docs at
https://tiswww.cwru.edu/php/chet/readline/rluserman.html#SEC9 it
discusses how to set vi-mode and configure a bunch of stuff. I figure
this will be the way to go into a vi keybinding direction. Since the
default configuration is emacs-mode, last night I played around in the
Python interpreter and verified that those Emacs keybindings that are
configured for the terminal by default (not all are the docs say)
worked fine at the Python prompt. So I have high hopes that if I
switch to vi-mode that the same will occur.
Anyway GNU Readlines looks for a .inputrc file for these
configurations. Like many terminal things it does not exist by
default, you have to create and populate it with your desired
settings. I have to say one great thing (amongst many) about *nix --
the devs that created all of this are nothing if not *consistent* in
how they implement things!
--
boB
More information about the Tutor
mailing list