Issue with gist indentation
When creating a Gist on Github there is a setting for indentation (tabs or spaces; size 2, 4, or 8). After setting indents to tabs size 4, it changes to tabs size 8 after I save it. Editing it afterwords doesn't do anything. Other settings don't produce the expected result either. Am I misunderstanding this feature somehow? Can't find any documentation regarding this.
github gist
add a comment |
When creating a Gist on Github there is a setting for indentation (tabs or spaces; size 2, 4, or 8). After setting indents to tabs size 4, it changes to tabs size 8 after I save it. Editing it afterwords doesn't do anything. Other settings don't produce the expected result either. Am I misunderstanding this feature somehow? Can't find any documentation regarding this.
github gist
Did you figure it out? Im getting the same problem
– ueeiieu
Apr 2 '18 at 14:24
2
Unfortunately not :/
– f0rsman
Apr 7 '18 at 10:52
2
I'm getting the same issue :(
– onmyway133
Jun 21 '18 at 13:09
I'm experiencing the same issue.
– Jase Warner
Aug 22 '18 at 11:24
I think you found a bug! Let the good folks at support@github.com know about it!
– Kyle Macey
Nov 8 '18 at 16:40
add a comment |
When creating a Gist on Github there is a setting for indentation (tabs or spaces; size 2, 4, or 8). After setting indents to tabs size 4, it changes to tabs size 8 after I save it. Editing it afterwords doesn't do anything. Other settings don't produce the expected result either. Am I misunderstanding this feature somehow? Can't find any documentation regarding this.
github gist
When creating a Gist on Github there is a setting for indentation (tabs or spaces; size 2, 4, or 8). After setting indents to tabs size 4, it changes to tabs size 8 after I save it. Editing it afterwords doesn't do anything. Other settings don't produce the expected result either. Am I misunderstanding this feature somehow? Can't find any documentation regarding this.
github gist
github gist
asked Jul 12 '17 at 7:41
f0rsman
916
916
Did you figure it out? Im getting the same problem
– ueeiieu
Apr 2 '18 at 14:24
2
Unfortunately not :/
– f0rsman
Apr 7 '18 at 10:52
2
I'm getting the same issue :(
– onmyway133
Jun 21 '18 at 13:09
I'm experiencing the same issue.
– Jase Warner
Aug 22 '18 at 11:24
I think you found a bug! Let the good folks at support@github.com know about it!
– Kyle Macey
Nov 8 '18 at 16:40
add a comment |
Did you figure it out? Im getting the same problem
– ueeiieu
Apr 2 '18 at 14:24
2
Unfortunately not :/
– f0rsman
Apr 7 '18 at 10:52
2
I'm getting the same issue :(
– onmyway133
Jun 21 '18 at 13:09
I'm experiencing the same issue.
– Jase Warner
Aug 22 '18 at 11:24
I think you found a bug! Let the good folks at support@github.com know about it!
– Kyle Macey
Nov 8 '18 at 16:40
Did you figure it out? Im getting the same problem
– ueeiieu
Apr 2 '18 at 14:24
Did you figure it out? Im getting the same problem
– ueeiieu
Apr 2 '18 at 14:24
2
2
Unfortunately not :/
– f0rsman
Apr 7 '18 at 10:52
Unfortunately not :/
– f0rsman
Apr 7 '18 at 10:52
2
2
I'm getting the same issue :(
– onmyway133
Jun 21 '18 at 13:09
I'm getting the same issue :(
– onmyway133
Jun 21 '18 at 13:09
I'm experiencing the same issue.
– Jase Warner
Aug 22 '18 at 11:24
I'm experiencing the same issue.
– Jase Warner
Aug 22 '18 at 11:24
I think you found a bug! Let the good folks at support@github.com know about it!
– Kyle Macey
Nov 8 '18 at 16:40
I think you found a bug! Let the good folks at support@github.com know about it!
– Kyle Macey
Nov 8 '18 at 16:40
add a comment |
2 Answers
2
active
oldest
votes
This is happening because while writing the code, you used the tab key which inserted 8 spaces. Here's a solution that I use.
Copy all your code to a local file and open it in the vi editor.
cat>temp.js
ctrl+shift+v
to paste andctrl+d
to save.
vim temp.js
(Or change the extension as per your file.)
Run the following command that I found from here. This will half the existing space.
:%s;^(s+);=repeat(' ', len(submatch(0))/2);g
Press the
esc
key then:x
andenter
key to save and exit vi.Copy the code in your temp.js file and paste it in your gist with spaces as 4.
add a comment |
I replaced tabs with four spaces in Notepad++ (Ctrl+H), and it works. You can use any numbers of spaces.
Those tabs are automatically displayed as a 8-character-tab in Github Gist.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f45051383%2fissue-with-gist-indentation%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is happening because while writing the code, you used the tab key which inserted 8 spaces. Here's a solution that I use.
Copy all your code to a local file and open it in the vi editor.
cat>temp.js
ctrl+shift+v
to paste andctrl+d
to save.
vim temp.js
(Or change the extension as per your file.)
Run the following command that I found from here. This will half the existing space.
:%s;^(s+);=repeat(' ', len(submatch(0))/2);g
Press the
esc
key then:x
andenter
key to save and exit vi.Copy the code in your temp.js file and paste it in your gist with spaces as 4.
add a comment |
This is happening because while writing the code, you used the tab key which inserted 8 spaces. Here's a solution that I use.
Copy all your code to a local file and open it in the vi editor.
cat>temp.js
ctrl+shift+v
to paste andctrl+d
to save.
vim temp.js
(Or change the extension as per your file.)
Run the following command that I found from here. This will half the existing space.
:%s;^(s+);=repeat(' ', len(submatch(0))/2);g
Press the
esc
key then:x
andenter
key to save and exit vi.Copy the code in your temp.js file and paste it in your gist with spaces as 4.
add a comment |
This is happening because while writing the code, you used the tab key which inserted 8 spaces. Here's a solution that I use.
Copy all your code to a local file and open it in the vi editor.
cat>temp.js
ctrl+shift+v
to paste andctrl+d
to save.
vim temp.js
(Or change the extension as per your file.)
Run the following command that I found from here. This will half the existing space.
:%s;^(s+);=repeat(' ', len(submatch(0))/2);g
Press the
esc
key then:x
andenter
key to save and exit vi.Copy the code in your temp.js file and paste it in your gist with spaces as 4.
This is happening because while writing the code, you used the tab key which inserted 8 spaces. Here's a solution that I use.
Copy all your code to a local file and open it in the vi editor.
cat>temp.js
ctrl+shift+v
to paste andctrl+d
to save.
vim temp.js
(Or change the extension as per your file.)
Run the following command that I found from here. This will half the existing space.
:%s;^(s+);=repeat(' ', len(submatch(0))/2);g
Press the
esc
key then:x
andenter
key to save and exit vi.Copy the code in your temp.js file and paste it in your gist with spaces as 4.
answered Nov 12 '18 at 4:54
PRIYESH PATEL
564
564
add a comment |
add a comment |
I replaced tabs with four spaces in Notepad++ (Ctrl+H), and it works. You can use any numbers of spaces.
Those tabs are automatically displayed as a 8-character-tab in Github Gist.
add a comment |
I replaced tabs with four spaces in Notepad++ (Ctrl+H), and it works. You can use any numbers of spaces.
Those tabs are automatically displayed as a 8-character-tab in Github Gist.
add a comment |
I replaced tabs with four spaces in Notepad++ (Ctrl+H), and it works. You can use any numbers of spaces.
Those tabs are automatically displayed as a 8-character-tab in Github Gist.
I replaced tabs with four spaces in Notepad++ (Ctrl+H), and it works. You can use any numbers of spaces.
Those tabs are automatically displayed as a 8-character-tab in Github Gist.
answered 2 days ago
zeet
1,2481921
1,2481921
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f45051383%2fissue-with-gist-indentation%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Did you figure it out? Im getting the same problem
– ueeiieu
Apr 2 '18 at 14:24
2
Unfortunately not :/
– f0rsman
Apr 7 '18 at 10:52
2
I'm getting the same issue :(
– onmyway133
Jun 21 '18 at 13:09
I'm experiencing the same issue.
– Jase Warner
Aug 22 '18 at 11:24
I think you found a bug! Let the good folks at support@github.com know about it!
– Kyle Macey
Nov 8 '18 at 16:40