Questions tagged [tab-characters]
Question about how to handle white spaces tab characters with vim, insert them, remove them, convert them to space characters, etc...
69 questions
1 vote
0 answers
53 views
Is it possible to override vim's indentation to only count tabs?
I use Tabular to emulate elastic tabs (https://nick-gravgaard.com/elastic-tabstops/), so I have a keybinding to align all elastic tabs, which are marked as <Space><Tab>. In most cases, I ...
1 vote
2 answers
2k views
Why is Vim ignoring my `expandtab` setting?
In my vimrc, I have set expandtab. When I edit a Tex file, however, Vim inserts tab characters , instead of spaces , when I press tab. I figured noexpandtab must be set by the TeX ftplugin for some ...
1 vote
1 answer
103 views
change behaviour of > / < and >> / << to insert / remove only leading tabs
i want > / < and >> / << to simply insert and remove tab characters at the beginning of the line. variant: i would even prefer to have> / < and >>/ << insert / ...
0 votes
1 answer
67 views
Manually indenting lines with tabs
Lines can be indented with tab characters. And it is quite obvious the there are better ways to do that than manually adding a tab character to the beginning of each line. But how to discover these ...
1 vote
0 answers
49 views
Expand all non-leading tabs but keep leading tabs [duplicate]
I want to use tabs for indentation and spaces for alignment in the following way: keep tab characters (like noexpandtab) for all leading tabs of a file, but expand tabs (like expandtab) that occur ...
0 votes
3 answers
137 views
What is the setting for the strict tab adherence when running vim with no configuration?
When I run vim with no configuration (--clean), in a bash file I cannot move the cursor before any indented tabs. I remember being annoyed by this before I regularly used vim, but early on as I grew ...
2 votes
2 answers
321 views
How to get the right indent size in python lists?
In my vimrc I have filetype indent plugin on When I write python code, the indentation mostly looks good, but in lists it is too big: def fun(): return 'indent looks good' my_list = [ '...
0 votes
0 answers
194 views
How can i get visualize line indent every time i use tab or go to new line
I set set listchars=tab:\│\ set list to my vimrc and it shows like below But when I go to another file it doesn't have a vertical line indent. It just affected 1 file, I have no idea about this. ...
1 vote
1 answer
2k views
Can't enter a tab character when previous character is not a tab or space in insert mode
When pressing tab in any language in edit mode, nothing happens if the character before the cursor is not a space or a tab. Doing ctrl-v tab works, but I don't want to have to do that every time and ...
0 votes
3 answers
5k views
How to convert spaces on a line to tabs?
I know there's a way because it happened by accident. I was frenetically moving in a short region of text and at some point, with some wrong keystroke, the leading spaces on the line became a tab (and ...
2 votes
1 answer
605 views
Stop vim from deleting expanded tab as a block of spaces
I am on CentOS 8.1 and using vim 8.0.1763. When I open a python file, e.g. vim tmp.py, I type tab and it inserts 4 spaces (see .vimrc below). When I type delete, it deletes all 4 spaces. I want it ...
0 votes
1 answer
65 views
Why can't save file without tab key?
Configuration in my .vimrc: set tabstop=4 set expandtab set softtabstop=4 set shiftwidth=4 I have edit a file which contain tab,saved and reopen to have a look at it with set list,the tab key saved,...
1 vote
2 answers
429 views
Shouldn't `softtabstop` be set, when using option 2 in `:h tabstop` to configure Vim to use spaces for `<Tab>`s?
I want to configure Vim to use spaces for <Tab>s everywhere. Therefore, I've had a look at :h tabstop to figure out how to perform the configuration. Looking at the help text, option 2. seems ...
0 votes
1 answer
1k views
Neovim keeps reverting shiftwidth size after `after/ftplugin`
I like to code with 4 spaces as a tab. I added this to after/ftplugin/sass.vim: echom "before sass file settings" set shiftwidth=4 " <---- Problem setting, keeps changing back to 2 ...
1 vote
1 answer
14k views
Fixing tab and space inconsistency
I used < in visual model to do a shift+tab reverse for a code inside loop after I removed the try/except phrase. Now, I get an error: $ python clean_captions.py File "clean_captions.py"...