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".
90
questions
0
votes
0
answers
24
views
show only file visiting buffers with certain file extension in centaur tabs
I am wondering for some time if it is possible to have centaur tabs display only buffers with the same file extension as the current buffer. After spending some time using infamous search engine and ...
0
votes
2
answers
54
views
Using TAB to flip between two windows
I have set TAB to flip between two windows using:-
(global-set-key (kbd "TAB") 'other-window)
This works sometimes, but not always. How should I define it?
0
votes
1
answer
110
views
When I type the tab key, I want a tab, and when I type the whitespace key, I want a whitespace. How can I ensure that?
In the fundamental mode, when I type the tab key, sometimes I got a tab and sometimes 4(?) whitespaces. When does which happen?
When I type the tab key, I want a tab, and when I type the whitespace ...
0
votes
0
answers
30
views
How to align source code section in both Org-src-edit-code, Org-mode, and exported PDF file?
How to configure emacs such that code (in this case :which-key) is aligned in both org-edit-src-code org-mode and exported PDF?
I'm guessing this is somewhat related to tabs getting different amount ...
1
vote
1
answer
115
views
Tabs like vim configuration
I'd like to know how to set emacs up to do the equivalent of what vim does when I have this configuration:
cat $HOME/.vimrc
set tabstop=4
set shiftwidth=4
set expandtab
So basically, whenever I hit ...
0
votes
0
answers
128
views
How to always use tabs when pressing the tab key?
I use an indentation sensitive language (imba) and I need to always use tabs.
I'm using doom emacs and I'm also writing a wip major mode for Imba. But I press tab and it adds indentation using tabs (a ...
0
votes
0
answers
12
views
How to show opened tab only on one side with tabs?
If enable tabs in .doom.d/init.el, when split window to two sides, the tab content showed the same on each side.
How to make it show new opened tab on one side only?
0
votes
1
answer
53
views
Emacs spacing format is inconsistent with my setup
emacs version: GNU Emacs 26.3
using specman_mode.el
most of the company uses gvim, i am using emacs, so the alignment are a bit different.
but, when i open the file with emacs -Q, the alignment is ...
3
votes
2
answers
273
views
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 ...
0
votes
1
answer
81
views
How can I prevent adding a TAB if inner block is already aligned, in `pine-script-mode`?
I am using pine-script-mode with a 4 space TAB.
Here is an inner block of an if statement that is already aligned. How can I prevent adding a TAB char (or 4 space chars) when I press TAB?
pine file:
...
1
vote
1
answer
93
views
What is the proper way to set tab-width in configuration block at end of file
I'm editing a file .bashrc-host25 and it's not going into bash editing mode, so I searched for a solution and found it at https://emacs.stackexchange.com/a/52083/16958.
My file now has the following ...
1
vote
1
answer
425
views
How to make tab-width 4 space in pine-script-mode?
I am using pine-script-mode for TradingView Pine script.
When I follow https://emacs.stackexchange.com/a/17565/18414 I have applied:
(defun my-custom-settings-fn ()
(setq indent-tabs-mode nil)
(...
0
votes
1
answer
41
views
Indentation without tabs
What is the difference between indent-tabs-mode and tab-always-indent?
1
vote
2
answers
186
views
Using tab key for inserting literal tabs
How can I use the TAB key for inserting literal tab characters (including multiple ones). With (setq-local indent-tabs-mode nil) I cannot introduce them because Emacs doesn't let me do so.
With the ...
2
votes
1
answer
972
views
How can I display tabs and spaces in Doom Emacs?
I have tried M-x whitespace-mode but it does not do anything.
1
vote
3
answers
171
views
How can I align indents for condition statements in AucTex algorithm section?
If possible, I want to align condition statements like: \If, \Else, \For statements in between \begin{algorithmic} ... \end{algorithmic} section.
example:
\begin{algorithmic}[1]
\For{a for statement} ...
1
vote
1
answer
1k
views
Emacs DOOM does not show tabs although 'centaur-tabs' is enabled
I'm currently using DOOM emacs.
I enabled 'centaur-tabs' in ~/.doom.d/init.el by using (tabs +centaur-tabs).
Configures are:
(after! centaur-tabs
:ensure t ...
1
vote
0
answers
25
views
Customized c-mode indentation style in Emacs 27.2
I would like to produce c code in the following format:
char *ft_strdup(const char *s1)
{
char *h;
size_t len;
...
}
Where I can tab after the type of the function signature and ...
3
votes
1
answer
2k
views
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 ...
1
vote
0
answers
134
views
Python indent alignment for the inner if condition
I am using tab for indent alignment, I believe its a built-in emacs behavior in python-mode. In most cases if cursor is at the beginning of the line and when I press TAB, first** cursor jumps to first ...
1
vote
2
answers
187
views
`dtrt-indent-mode` erroneously uses Tab characters
Here is an example file (/tmp/asdf.sh), for which I want dtrt-indent-mode to do the right thing.
#! /usr/bin/env bash
function asdf()
{
printf "asASDFASDF"
echo "1234"
}
...
1
vote
1
answer
192
views
Tex indentation with TAB
Recently, when editing files in LaTex, upon pressing TAB, I get a huge indentation. Instead, the default behavior used to be to align with respect to previous environment definition. :
I start with ...
0
votes
1
answer
86
views
How to stop Emacs from highlighting Linux Tab characters?
So I opened a c++ script made in Xubuntu and every tab character was highlighted with grey.
That doesn't happen when I open scripts made on Windows. How do I stop Emacs from highlighting them, it's ...
0
votes
1
answer
66
views
How to match emacs column count to gofmt column count?
I am writing Go code but the error messages do not agree with Emacs' column count.
Is there an off-the-shelf solution for this? I'm wondering about a minor mode or even a few lines for my .emacs file....
2
votes
1
answer
473
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
0
answers
48
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
3
answers
324
views
elpy (and evil-mode) do not react on TAB
This is my elpy-config
1Elpy Configuration
2 ...
1
vote
3
answers
929
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 ...
2
votes
1
answer
83
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
2
answers
154
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
0
answers
57
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
1
answer
239
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
0
answers
100
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
0
answers
1k
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 ...
1
vote
2
answers
399
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
2
answers
106
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
0
answers
17
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
...
4
votes
0
answers
174
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
1
answer
313
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
0
answers
79
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 ...
3
votes
2
answers
2k
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
1
answer
62
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
1
answer
346
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 ...
1
vote
0
answers
2k
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
2
answers
1k
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
1
answer
576
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
1
answer
215
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
2
answers
398
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 ...
2
votes
2
answers
4k
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
2
answers
254
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 ...