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".

Filter by
Sorted by
Tagged with
0
votes
1answer
19 views

I am writing Fortran code in emacs but the tab key behaviour changes in F90 mode. Can I change it back?

On loading a f90 file, emacs changes to F90 mode, which changes some emacs behaviours. When I press <tab> emacs inserts two spaces at the left margin. Now when I use the backspace key it deletes ...
0
votes
0answers
30 views

Why is a TAB character added when using kill-rectangle and yank-rectangle to insert multiple rows into an org-mode table?

I noticed an annoying behaviour when copying multiple rows (a list) from a web page into an org-mode table, following a process inspired by Is it possible to copy /paste multiple lines of text into ...
0
votes
3answers
118 views

elpy (and evil-mode) do not react on TAB

This is my elpy-config 1Elpy Configuration 2 ...
0
votes
2answers
87 views

How to set js-mode indent in Emacs >= 27.1

I have my tab width set to two spaces and this has worked fine for many years. I have just upgraded to Emacs 27.1, and now js-mode is displaying tabs as three spaces wide, ignoring my preferred ...
1
vote
1answer
33 views

Emacs converting spaces to tabs when using X11 primary selection in a terminal window

When I use emacs in a terminal window on linux, I am often getting spaces unexpectedly converted to tabs when I cut and paste using the X11 primary selection. What reproduces the problem for me is the ...
1
vote
2answers
73 views

How to NOT Auto Indent when a specific Character is inputted?

So I recently encountered a problem programming in C that whenever I enter the left parenthesis character, (, Emacs auto-idents the code. [4 spaces here]DATA *SeqQueueOut( I know that there is this ...
0
votes
0answers
41 views

Make tabs be visually 4 spaces long but 1 column only

I indent my code with tabs and I want my tabs to be visually 4 spaces long but to be 1 column only. Currently with my configurations my tabs are 4 spaces long but also 4 columns long and I can't find ...
2
votes
1answer
81 views

How do I stop tab from being electric in Text mode?

When editing a plain-text document in Text mode when I press tab emacs inserts spaces until the cursor appears directly beneath the beginning of a word it finds in the line above. I don't want it to ...
0
votes
0answers
30 views

emacs sometimes inserts tabs at weird places

Sometimes when I am typing in emacs, I type a space and emacs actually inserts a tab instead of the space. For example, while typing "Four score and seven years ago" emacs actually inserts ...
0
votes
0answers
356 views

Make tabs behavior like in other IDEs

How can I force Emacs to use tab button and TAB character in "normal stupid way"[1], like in nano or VScode or JetBrain's IDEs. All I can find is smart-tabs package and indent-tabs-mode, but ...
0
votes
2answers
131 views

How do I disable Centaur Tabs in ispell Choices buffer

I need to disable the Centaur-Tabs in the Choices buffer of ispell/flyspell. In Centaur Tab's site it says to add a hook, so I tried this: (add-hook 'ispell-choices-buffer 'centaur-tabs-local-mode) ...
0
votes
2answers
48 views

Set tabs instead of spaces when programming

I have been using Emacs for a while and it has been one of my favorite editors of all time, even more so than Vim. However, I've had a problem in regards to setting tabs and spaces. Whenever I try to ...
0
votes
0answers
38 views

Emacs text-mode as generic, 2-space-<TAB>, plaintext editor: Trouble disabling relative-indent in text-mode, or auto-triggering outline-mode

I need some help getting custom indentation behavior with my .emacs config. In emacs text-mode / Fundamental Mode, by default a tab will take me to the location of the top line's next word (non ...
0
votes
0answers
16 views

TCL is adding different tab widths in the program

I am trying to rearrange the columns of below file input.txt, Contents of this file: Name Location Purpose --------------------------------------------- Andy US Business1 ...
3
votes
0answers
60 views

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 ...
0
votes
1answer
142 views

Missing tabs on Emacs

I have been using Emacs for one week, so all of it is really new for me. I saw that there are two types of commands in order to navigate in emacs : - Some "tabs" on the top - Commands like shortcuts ...
0
votes
0answers
53 views

Tabs on windows with custom buffers

I am new to Emacs and I am trying to set up a decent workflow for projects I already have. What I want to do is to be able to have tabs of buffers on each window (not frame). What I want ...
2
votes
1answer
557 views

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. ...
1
vote
1answer
48 views

Dual-language text mode using the original interpretation of tabs

Does there exist an Emacs mode that replaces the contemporary interpretation of tabs (move to 8, 16, 24, .. or a multiple of some constant) with their original typewriter interpretation (set stops at ...
1
vote
1answer
166 views

Previous indentation is discarded on newline

Let's say I have the following code: void foo(){ ~ } I have marked point with ~. When I press enter the electric indentation works as normal but it doesn't keep the indentation for the previous ...
2
votes
0answers
714 views

How can I make Emacs enter a TAB character when I press the TAB button, without modifying my config file?

I am looking for a command I can enter that will make the TAB key input an actual TAB character. I'm open to anything that is temporary or that will not stomp on TAB mappings that do things other ...
0
votes
1answer
429 views

CC mode: make Tab just insert one tab or complete, no auto-indenting

I am dissatisfied with current behaviour of Emacs in CC Mode. I'm not sure if this applies to other major modes, but that's one I'm currently struggling with. Here are my problems: When I press tab, ...
2
votes
1answer
288 views

How can I configure the tab width for TCL files

I set all tab-width parameters and indent parameters to 2, but Emacs always uses 8 for the tab space when I press the TAB key at the beginning of a line, if i opened one bracket. How can i set the ...
0
votes
1answer
117 views

Make `tab` key insert 5 space characters in Latex Mode

In Latex mode, the tab key runs the command indent-for-tab-command From the output of C-h k tab when in Latex mode I rarely need to indent lines in my Latex files, and so I want to disable this ...
1
vote
2answers
196 views

Convert tabs to spaces when copying text to external applications

I use tabs in C/C++ but want to convert those tabs to spaces when copying code that I'm going to paste into an external program. However, I want the original code to retain tabs. Additionally (if ...
0
votes
2answers
2k views

Confusion about space and tab characters in Emacs

I am confused by space (SPC) and TAB characters in Emacs. I am often using the default fundamental mode. When I select a region and indent the lines in the region by C-u 9 C-x TAB, I intend to ...
0
votes
2answers
117 views

How to configure C-M-q and TAB key to expand pre-existing TAB characters into spaces in C/C++ files

In C and C++ files, I want to configure the mode so that any time I request indentation, that it will always expand all of the embedded TAB characters in indentation (at the start of the line, and no ...
2
votes
2answers
136 views

Does typing TAB key provide a fixed length blank?

In Fundamental mode, I type a tab following typing each number, but it seems the separator between the numbers are not the same length. I was wondering why? 1 22 333 444
0
votes
1answer
124 views

How to reveal tabs in the indentation in a cpp file?

My friend and I collaborate on a C++ project and we agree to use 4 whiltespaces for indentation. I am using Emacs and this is my indentation setting (setq-default c-basic-offset 4) By doing this, I ...
3
votes
1answer
131 views

How do I keep the cursor from going to the beginning of the line when there's no text on said line?

I want the cursor to stay in the same column whilst moving up and down on tabbed lines. But instead the cursor goes to the beginning of the line if there's no text on that line. How do I get rid of ...
4
votes
1answer
978 views

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/][...
3
votes
2answers
164 views

Accessing the character in the line below

I am writing an Emacs Lisp function which needs to know the character directly under point in the line below, returning nil when no such character exists. I thus defined the function char-below, which ...
2
votes
1answer
687 views

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 ...
1
vote
1answer
466 views

Making AUCTeX use tabs for leading indentation doesn't work

This answer says how to make AUCTeX use tabs for leading indentation. However, it doesn't work for me and I don't understand why it doesn't. After adding the code to my init file, LaTeX-mode just ...
3
votes
2answers
800 views

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 ...
1
vote
1answer
2k views

How can you make conf-mode indent with tabs?

When I open a config file that has been indented with tabs, the mode shows as (Conf[Space] WS) and pressing Tab indents with spaces, even though the rest of the file is using tabs. How can I change ...
6
votes
0answers
751 views

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 ...
1
vote
1answer
2k views

How to detect tabs or spaces in Emacs

By default I want all indentation (when I hit the tab key) to be 2 spaces. However, when I am editing certain Python files (where I can not mix tabs and spaces) I would like to use whatever the ...
2
votes
1answer
6k views

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, ...
0
votes
1answer
54 views

How to account for tabs in `hl-line-range-function`?

To avoid conflicts with highlighting indentation, I made the highlight line begin after the current indentation. This works well, except when tabs are used as leading white space. How could the my-...
1
vote
1answer
666 views

How to indent the selected line one “tab” forward or backward [duplicate]

In a lot of text editors there is a keystroke used to move the selected lines one "tab" to the right, usually 4 whitespace or one "tab" to the left. How can I do this in emacs? I have only found ...
0
votes
2answers
102 views

Tab key getting bounded to forward-button

Launching emacs with the -Q option (default settings) shows TAB being correctly bound to indent-for-tab-command. If I launch emacs without the -Q, TAB is always being bound to forward-button which is ...
0
votes
1answer
169 views

Smart Tab : indenting with C-u <tab> does not work (beginning of a line)

(I haven't find any answer in previous topics) I am using Smart Tab globally, i.e. I have put the following code in my .emacs : (require 'smart-tab) (global-smart-tab-mode 1) I am writing a program ...
0
votes
1answer
190 views

modify tab length for eclim-java-format

So I'm trying to use eclim with spacemacs and I have this function called eclim-java-format which reformat the text as in eclipse. The problems is that it reformats tabs as tabs and not as space and ...
1
vote
1answer
273 views

Consistent tab alignment

As an evil I choose to use tabs. I'm having trouble getting them to work like they do in other editors. I want displayed tabs aligned to 2 columns (with no exceptions). I have tab-width set to 2, ...
0
votes
1answer
311 views

How to get rid of the red areas and what are they?

I have some code I copy-paste from somewhere. What is this how to get rid of them all at once? My emacs is setup to automatically cut the orange areas, but to get rid of these? update: ...
1
vote
1answer
739 views

tab and spaces shown aligned in emacs C++ mode, but not in other editors

In Emacs' C++ mode, I sometimes accidentally introduced a tab where I should use four whitespaces instead to create indentations. Adjacent lines with mixed uses of tabs and spaces for indentations are ...
0
votes
1answer
1k views

How to indent with tabs in php-mode?

I need to indent my code with (add-hook 'php-mode-hook 'php-enable-symfony2-coding-style) but using tabs for indenting (and spaces for aligning, see https://www.emacswiki.org/emacs/SmartTabs). ...
5
votes
3answers
4k views

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 ...
1
vote
1answer
225 views

tab-width and <lang>-indent-offset difference

I've setup the indentation for tabs in Rust to be 2 whitespaces. That's what I want. And in my config it looks like this: (add-hook 'rust-mode-hook (lambda () (setq indent-tabs-mode nil) (...