3 ms·
> Python has one sub-style I dislike the most: using tabs for indentation, because how much EXTRA room they use on the screen. Can you not adjust your tab stop
by worik 2y ago
> Python has one sub-style I dislike the most: using tabs for indentation, because how much EXTRA room they use on the screen.
Can you not adjust your tab stops?
I hate it too, because tabs look like spaces and they have a different syntactic meaning
- csdvrx 2y agoI can, in vim it's simple. It just bothers me that it is the default and I have to take care of tabs with the rainbow, or a toggle shortcut like: function TabCollapse_Toggle() abort if &tabstop ==1 set tabstop=8 else set tabstop=1 endif endfunction BTW if you hate tabs looking like other characters and other invisible characters (like spaces at the end of line, non breaking spaces...), I have a solution in CuteVim (https://github.com/csdvrx/CuteVim https://github.com/csdvrx/CuteVim : just run the portable executable) where I mapped it by default to a Fxx key If you already use vim, here's the relevant part: assuming your Shift-F11 is free, add to your vimrc: " Default is off, `se list` to turn on and `se nolist` to turn off " Traditional with ISO-8859-1: "set listchars=tab:»·space:_,trail:·,eol:¶ " Or cuter with unicodes: set listchars=tab:↹⇥,space:_,nbsp:␣,trail:•,extends:⟩,precedes:⟨,eol:↲ set showbreak=↪ inoremap <silent> <S-F11> <Esc>:set list!<CR> noremap <silent> <S-F11> :set list!<CR> Shift-F11 will then become a toggle, to show you tabs: you will see ↹ where the tab starts, and ⇥ for how long it is
- fuzztester 2y ago>Can you not adjust your tab stops? I've used this in vim for years: :se expandtab tabstop=4 shiftwidth=4 (those can be abbreviated, check docs) Then: I use only tabs for indentation. All the tabs get expanded to four spaces each. Indenting and unindenting lines or blocks of lines, moves them by four spaces. Never had a problem. Maybe there are more fancy ways, but this works fine for me.
- worik 2y ago> I use only tabs for indentation. > All the tabs get expanded to four spaces each. Then Python will not work (?)
- fuzztester 2y agoSure it will work. Even before I discovered this method (which is simple), I was using four spaces typed manually, for indentation in Python, for years. Maybe it is you who "will not work". Did you try it before commenting? I already said it works fine.
- fuzztester 2y agoe.g. for tabstop, use ts, and for shiftwidth, use sw.