rendering a tab character as tab in moinmoin - moinmoin

I couldn't find anywhere how to render a tab in moinmoin
For example if I have
{{{#!highlight makefile
target:
command
}}}
(there really is a tab character at the beginning of the "command" line even if SO renders it as 4 spaces.
it renders with spaces instead of a tab.
target:
command
How to do this (so that a copy/paste contains tabs and not spaces)?
It would be for use on https://wiki.debian.org

Related

VSCODE - TAB right after the word not working as expected

vscode:
version - 1.40.2
On a normal text type file, type Hello and hit TAB.
All i want is when i hit tab vscode should register 2/4 spaces (what i have configured in the settings.json for the specific language) not a single space.
HelloTAB
Expected: Hello****|
Actual: Hello*|
Make sure you have unchecked Editor: Detect Indentation. Checking this option will override the Tab Size configuration. E.g. if the opened file has 1 space tab indentation but you have configured a 4 spaces tab indentation - the tab size will be 1 space.
Ctrl + , to open Settings.json
Enter in "spaces" in search
Uncheck Editor: Detect Indentation
Leave Editor: Insert spaces checked if you want to insert actual spaces instead of a tab (i.e. you need to do 4 backspaces if you made a mistake). Or unchecked it if you want to insert actual tabs.
Also, you can check what is the configured tab size for that particular opened file by looking at the bottom right of your editor:

indeneted files in my sublime don't show up indented correctly on github files

I have indented my files in my sublime text but when I push to github they don't look indented. How do I fix this?
The approach taken to indent file on sublime is:
select the code > Edit > Line > Reindent
looks like this on github:
Your issue looks to be caused by your use of literal tab characters for indenting as opposed to using spaces instead.
If there's a hotter holy war topic among developers than the debate of tabs versus spaces, it's probably related to how wide you should interpret a tab character to be for display purposes if you happen to use them.
In particular your images would appear to indicate that you think that tabs should be 2 characters wide and GitHub thinks they should be 8. As mentioned in this answer you can append an extra query field to the URL in GitHub in order to view the files the way you prefer them to be viewed.
As far as I'm aware that just changes how they're rendered on the page when you view and doesn't actually modify the file at all. If it's important that the file retain the same indent levels regardless of where or how you view the file, you should convert from tab indentation to space indentation instead since a space is unambiguously sized.
If you're using Sublime Text you can do that by clicking in the status bar where it says Tab Size: 2 and select Convert indentation to spaces; the status bar will switch to say Spaces: 2 to indicate that the indent has changed.

Eclipse: use both tabs and spaces for indentation

A project I'm working in has an indentation standard as follows:
A single tab-width is 4 space characters.
A double tab-width is a tab character displayed at 8 spaces wide.
Examples:
A singly-indented line begins with four spaces
A doubly-indented line begins with a tab character
A triply-indented line begins with a tab character followed by four spaces
A 4x indented line begins with two tab characters
...and so on
In Vim, the necessary configuration is achieved with:
:set tabstop=8 softtabstop=4 noexpandtab
How can I configure Eclipse to automatically enforce this indentation standard?
I don't believe Eclipse CDT supports this indentation style.
Eclipse is open source; you could consider contributing a patch to add support for this style.
Eclipse doesn't have that built-in, but it looks like the plug-in Vrapper (Vim) provides what you are looking for.
See Vrapper > Documentation > Configuration:
softtabstop - When using spaces for tabs, set this to the number of spaces inserted for each Tab key press and hitting
Backspace in InsertMode will delete that many spaces as if you had
deleted a tab character.
tabstop - Used by i_ctrl-t, i_ctrl-d, and :retab. Determines number of spaces to replace each tab character with when xpandtab is enabled.
expandtab/noexpandtab - Used by i_ctrl-t, i_ctrl-d, and :retab. Determines whether :retab should replace all tabs with spaces (true) or spaces with tabs (false). Also determines whether i_ctrl-t and i_ctrl-d will replace tabstop spaces with a tab.
Eclipse does support this natively.
My eclipse version:
The result (see in-image comments):
Step 1:
Step 2:
Step 3:
Step 4 (the most important step):

Convert Automatically Spaces to Tabs in Visual Studio Code

I have a file in Visual Studio Code in which I use only tabs for indentation. When I copy the contents of that file somewhere else and edit them, then when I paste them back all tabs are gone and spaces have taken their places.
How can I prevent the use of spaces for indentation and automatically spaces will be converted to tabs?
Also I have changed the preferences:
"editor.insertSpaces": false,
"editor.detectIndentation": false,
Unfortunately you can't (yet). I think it would be nice to get spaces/tabs converted upon file opening - like some editors do. You can quickly convert spaces by tabs by selecting the number of indentation spaces, pressing cmd+F2 in mac or ctrl-F2 in linux/windows (to find and select all occurrences of that amount of spaces), and then pressing tab key (only once). You can also give Untabfy (or Whitespacer) a try.

Can NetBeans remove trailing whitespace and change tabs to spaces on save?

I just started to use NetBeans, and am trying to work out how to:
Make it so that trailing whitespace is removed on save. I know that you can invoke it manually, but it’s annoying if you forget. Can it be done automatically on save? I want this done because it keeps the code neat, because it’s really annoying when you’re moving through code and the text cursor goes all over the place because of trailing whitespace you don’t see, and because trailing whitespace has unintended effects on HTML layouts and other stuff.
Make it so that tabs are automatically made into 4 spaces while you’re typing rather than converting on save, or, worse, only when manually invoked.
For the first question, NetBeans 7.0+ has now a built-in solution. You can find it in:
On NetBeans 7:
Tools > Options > Editor > General > When saving files > Remove Trailing Whitespace: Never / Always / For Modified Lines Only
On NetBeans 8 / 9:
Tools > Options > Editor > On Save > Remove Trailing Whitespace From: None / All Lines / Modified Lines Only
[Original] For your first question, how to set NetBeans to remove trailing whitespace, the answer is that there is no setting (at the moment) to control that. It happens automatically, but not to every line. Whitespace is only removed from the lines you edit (or from the entire file if invoked manually). See Petr Pisl's blog entry titled "Removing trailing spaces" for a more complete explaination. (Note that even though he is blogging about NetBeans' PHP features, this particular feature applies to the basic editor shared by all NetBeans supported languages.)
[Update] This feature has been made available as of version 7.0, as pointed out by others in comments and answers below.
For your second question, set the editor to automatically make tabs into spaces as you type, you can find that setting in the Editor Formatting options:
Click on the Tools menu, and choose Options
Click on Editor in the top row of icons
Click on the Formatting tab
In the Language field, ensure that All Languages is selected
In the Category field, ensure that Tabs And Indents is selected
Check the box for Expand Tabs to Spaces
For each additional language that is available in the Language field, check that either Override Global Options is not checked, or that Expand Tabs to Spaces is also checked for that language.
Click OK
That will make sure that when you hit the tab key the specified number of spaces is inserted rather than a tab character. As above with whitespace removal, any existing tabs in the file are left as-is unless you invoke the manual command to change the entire file. (Moreover, even if you edit a line with tabs on it--leaving the tabs in place--the editor will not convert them to spaces. Only new instances of hitting the TAB key are controlled by this option.)
Tools > Options > Editor > On Save > Remove Trailing Whitespace From: None / All Lines / Modified Lines Only
This is as of Netbeans 7.3, according to Webmut.
For netbeans 7.4+
Windows - Tools > Options > Editor > On Save > Remove Trailing Whitespace From: None / All Lines / Modified Lines Only
Mac - Netbeans > preferences > Options > Editor > On Save > Remove Trailing Whitespace From: None / All Lines / Modified Lines Only
Also you can set this as language specific.
You can also set reformat while saving.
if you want to remove all trailing spaces in the file manually ONLY ONCE, you can invoke action 'Remove Trailing Spaces' from Source menu manually.
Source -> Remove Trailing Spaces