Questions tagged [tabs]

Questions about the inserting/manipulating/displaying TAB characters in Emacs files. Do not use this tag for questions related to browser style "tabs".

Browser style tabs don't have a tag of their own, although the tabbar tag probably applies in many cases. Use the tab-key tag for questions related to using the physical TAB key on your keyboard (i.e., for keybindings).

88 questions
8
votes
3 answers

Is there a way to set a list of display tab stops?

I have a tab-delimited data file I maintain in emacs. Much of the data has more than seven characters per field, so at the top, I have the following line: -*- tab-width: 30 -*- This keeps things nicely aligned; unfortunately it wastes a lot of…
cpcallen
  • 183
  • 3
6
votes
1 answer

Display tab characters as arrows of varying length

I would like to make tab characters ("\t") display as arrows of varying length, just like in editors such as Notepad++, gedit, Geany, etc. Here is an example with tab width set to 4 and space characters displayed as dots: Is there a way to achieve…
user15894
  • 61
  • 2
5
votes
1 answer

Make emacs format Java more consistently

When I open Java files originally created and edited in Emacs, the indentation shows up correctly, as in the image below: However, when I open the same file in Sublime Text, or any other editor besides Emacs, the indentation is messed up, and I can…
Adam R
  • 53
  • 3
5
votes
3 answers

change python indent in a specific file

I have a piece of legacy code in Python that uses inconsistent tabs - 2 spaces in some instances and 4 in others. I have my defaults set in my .emacs file to use 4 spaces, but in this case emacs finds the inconsistent spacing and uses a tab width…
J Jones
  • 153
  • 1
  • 4
5
votes
1 answer

Trouble adjusting tab-width

When I write Python code, I personally prefer indenting with 4 spaces instead of a tab. However, in my day job I work with a codebase that uses only tabs. When I open one of these files in emacs, tabs display eight spaces wide. I have tried adding…
elethan
  • 4,755
  • 3
  • 29
  • 56
4
votes
0 answers

Markdown equivalent of `org-indent-mode`?

What's the simplest way of ensuring that the text below a headline in a Markdown file is aligned with the headline? In org-mode you can accomplish this by calling org-indent-mode. Is there a similar function for Markdown? At the moment, using…
apc
  • 309
  • 2
  • 8
4
votes
1 answer

Org external link - can I indicate which browser/tab to be used

Suppose I have several browsers running at any given time. Google Chrome Google Chrome Canary Chromium Opera Safari How can I indicate in my org mode links [[https://www.gnu.org/software/emacs/][GNU Emacs]] which browser should be used when (C-c…
american-ninja-warrior
  • 3,773
  • 2
  • 21
  • 40
4
votes
1 answer

Python mode indentation

Working on .py files, I know how to get emacs to use 4 spaces as an indent by default. I also know how to get it to use the tab character by default. I'd like to leave it at using spaces by default, but recognize when tab characters are used and use…
Andrew Lamarra
  • 191
  • 2
  • 9
4
votes
0 answers

How to make indent-region keep the TAB in Makefile buffer?

A very simple Makefile: all: gcc -o hello hello.c And I already set: (add-hook 'before-save-hook '(lambda () (delete-trailing-whitespace) ;; indent the whole buffer before-save (when (derived-mode-p…
CodyChan
  • 2,599
  • 1
  • 19
  • 33
3
votes
2 answers

Emacs Lisp to view text file like a table

I'd like to write a mode, or at least some Lisp functions, to view a tab-separated file like a table. What I mean is lines like this: foo\t123\tbar yabba dabba\t12345\treally long field here Should display something like: | foo | 123 | bar…
Rob N
  • 547
  • 2
  • 12
3
votes
1 answer

How to set the default indentation width globally?

By default Emacs uses tab instead of spaces for indentation, so I changed these 2 variables to change this behavior, (setq-default indent-tabs-mode nil) ;; Disable indent with tabs (setq default-tab-width 4) ;; Set default…
apoorv569
  • 113
  • 8
3
votes
2 answers

How to change shell-script-mode indentation not to use tabs?

To reproduce my issue, open your .bashrc or a .sh file and type the following: if while echo The if has no indentation. Good. The while has the default four spaces of indentation. Good. The echo has a tab character for indentation.…
Ness
  • 165
  • 7
3
votes
2 answers

org-mode setting to preserve spacing in SRC code, with verbatim latex output to pdf

Like this post, when I indent within a SRC code block in org-mode, 8 consecutive spaces are converted to a tab. Moreover, when I export to LaTeX 8 consecutive spaces are converted to tabs in the resultant .tex output. This is a problem as my LaTeX…
Jason Hemann
  • 143
  • 6
3
votes
2 answers

css-mode: use tabs and not spaces

How do I make it so tabs are used instead of spaces when TAB is pressed? I've tried setting indent-tabs-mode to t but no dice. On my other modes, such as php-mode and c-mode, tabs are inserted. CSS mode seems to be ignoring. God I hate spaces so…
Dellowar
  • 143
  • 7
3
votes
0 answers

Set tab width with no exceptions

I always want the tab width to be 4 spaces, no matter what. How do I do it?
drfels
  • 31
  • 1
1
2 3 4 5 6