Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [tabs]

The tag has no usage guidance.

20
votes
3answers
8k views

Browser-style 'tabs' for emacs?

I would like tabs like firefox but for emacs. I found this: http://emacswiki.org/emacs/TabBarMode But it just add to each buffer (window in Emacs terminology) a bar that shows currently open buffers....
7
votes
0answers
332 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 ...
5
votes
2answers
2k 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 ...
5
votes
1answer
659 views

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 ...
5
votes
1answer
209 views

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 ...
4
votes
1answer
1k views

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, ...
4
votes
1answer
103 views

How do I set a variable in all programming modes?

I'd like tab-width to be set to 2 in all programming modes. I use prelude (which might be one of the problems), but I have this in my custom.el (which is sort of the analogue to .emacs): (setq my-...
3
votes
0answers
134 views

Set tab width with no exceptions

I always want the tab width to be 4 spaces, no matter what. How do I do it?
3
votes
0answers
463 views

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 ...
2
votes
1answer
59 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 ...
2
votes
2answers
50 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
2answers
95 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
2
votes
1answer
2k 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, ...
2
votes
1answer
343 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/][...
2
votes
1answer
344 views

Emacs indent with tabs to 2 columns

Current with C, Javascript, Ruby, etc. when inserting a block with { <RETURN>, Emacs automatically indents the next line, but it does so with spaces. How do I change this behavior to tab ...
2
votes
1answer
252 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 ...
2
votes
2answers
534 views

Remove tabs from pasted text automatically?

I have emacs configured to refrain from inserting tabs for indentation purposes already. But this does not have any effect when I paste text containing a tab (from an external application, Google ...
2
votes
2answers
42 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 ...
1
vote
5answers
297 views

How to swap two tab-separated values on a line, and generalize the process?

My file has one book listed per line, title first followed by a tab character, followed by the author's name. TITLE<TAB>AUTHOR TITLE<TAB>AUTHOR ... I want to swap the two fields, such ...
1
vote
1answer
1k 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 ...
1
vote
2answers
401 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
808 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 ...
1
vote
1answer
135 views

Tabify: How does Emacs decides where to place tabs?

I understand how Emacs can remove tabs when using the untabify command (simply place a number of spaces in the place of the tabs) but what I can't understand is how does it place tabs in the place of ...
1
vote
1answer
466 views

Use spaces instead of tabs with use-package

This is more or less a question of putting the answer from Make web-mode always indent with spaces into the use-package declaration. I want to set tab indent to 2 spaces, and use the spaces ...
1
vote
1answer
188 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 ...
1
vote
1answer
157 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) (...
1
vote
1answer
135 views

Avoid extra tabs when generating Haskell code with ghc-mod

I'm following the Haskell Emacs Tutorial here and Emacs is annoying me with the way it adds some extra TAB characters. E.g. When I have this code: data ExampleType = ExampleType Int Int instance Eq ...
1
vote
1answer
16 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 ...
1
vote
1answer
228 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 ...
1
vote
1answer
120 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, ...
1
vote
0answers
118 views

Using cmd-N and cmd-T with emacs

I am using a Mac 10.9.5 and Emacs 24.4, installed with macports and aliased as alias emacs /Applications/MacPorts/Emacs.app/Contents/MacOS/Emacs At the moment, when I have an emacs file open and I ...
0
votes
2answers
68 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
1answer
33 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 ...
0
votes
1answer
194 views

Setup c-mode indentation, braces and tabs

I've been trying to setup cc-mode based files to behave in the way I want, but with so many varying opinions and suggested ways of doing things, I've not been able to get things just right. All I ...
0
votes
1answer
192 views

How to Self Insert Tab When Editing String In go-mode?

The title contains the crux of my question. In go-mode, tabs and auto-indentation generally works well, except when I am editing strings. When inside of a string, I'd like the tab key to self-insert. ...
0
votes
1answer
501 views

Interpretation of tabs in text copied from Emacs and pasted in other programs/editors

When you set Emacs to recognize 4 spaces as 1 tab, then copy text from an Emacs buffer to another program, will the other program see 4 spaces or interpret it as 1 tab (which may correspond to a ...
0
votes
1answer
44 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 ...
0
votes
1answer
476 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
2answers
37 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 ...
0
votes
1answer
37 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-...
0
votes
2answers
67 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
107 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
98 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: ...
0
votes
1answer
938 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). ...
0
votes
1answer
360 views

How to make the tab key act normally in C++ mode?

I'm switching over to Emacs as my C++ editor, and what I miss the most is when I use tab, it would write 8 spaces, I could use tab more than once and use it in the middle of code, when I pressed back ...
0
votes
1answer
106 views

can TAB behave like M-i?

I'm fairly new to aquamacs/emacs and while editing I noticed that it indents however it wants. In order to indent the way I want I end up using M-i, but that is pretty cumbersome. So, how do I make ...
0
votes
0answers
85 views

How to disable tabbar-ruler autohide menu-bar behavior?

I am using emacs 25.2 with tabbar-ruler. I also keep menu-bar-mode and tab-bar-mode enabled, at least until I become more familiar with emacs standard keybindings. Tabbar-ruler autohides both menu-bar ...
0
votes
0answers
451 views

use spaces over tabs everywhere

How do I use spaces instead of tabs everywhere? I noticed that web-mode was using tabs and could not figure out how to fix it. (Also, you may notice I was trying to set 2 tab spaces globally ...
0
votes
0answers
27 views

Translate TAB with C-q TAB [duplicate]

I'm an amateur in Emacs and I would like to change TAB with C-q TAB. I used the code: (define-key key-translation-map (kbd "TAB") (kbd"C-q TAB")) But by doing so, I need to press TAB twice in order ...
0
votes
1answer
134 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 ...