Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
1answer
58 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, ...
21
votes
4answers
9k 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....
1
vote
1answer
56 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 ...
6
votes
3answers
240 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 ...
1
vote
1answer
36 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 ...
0
votes
1answer
43 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 ...
0
votes
0answers
63 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
45 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 ...
2
votes
2answers
48 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
165 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 ...
3
votes
1answer
517 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/][...
0
votes
2answers
57 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
119 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
56 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 ...
2
votes
1answer
76 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
1answer
340 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
58 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 ...
1
vote
1answer
282 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 ...
2
votes
2answers
486 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
1k 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 ...
2
votes
1answer
3k 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, ...
6
votes
0answers
384 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 ...
0
votes
1answer
39 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
287 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
70 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
0answers
43 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
128 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
160 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
141 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
130 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
516 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). ...
4
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 ...
1
vote
1answer
180 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) (...
0
votes
5answers
348 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 ...
3
votes
0answers
150 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?
0
votes
1answer
231 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 ...
1
vote
0answers
123 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
1answer
422 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 ...
2
votes
2answers
563 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 ...
0
votes
1answer
203 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. ...
3
votes
1answer
114 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-...
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, ...
2
votes
1answer
360 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 ...
1
vote
1answer
155 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 ...
4
votes
0answers
486 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 ...
5
votes
1answer
697 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 ...
1
vote
1answer
148 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
526 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 ...