Issue with gist indentation












13














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.










share|improve this question






















  • 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
















13














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.










share|improve this question






















  • 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














13












13








13


7





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.










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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


















  • 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












2 Answers
2






active

oldest

votes


















0














This is happening because while writing the code, you used the tab key which inserted 8 spaces. Here's a solution that I use.





  1. Copy all your code to a local file and open it in the vi editor.
    cat>temp.js
    ctrl+shift+v to paste and ctrl+d to save.



    vim temp.js (Or change the extension as per your file.)




  2. Run the following command that I found from here. This will half the existing space.



    :%s;^(s+);=repeat(' ', len(submatch(0))/2);g



  3. Press the esc key then :x and enter key to save and exit vi.


  4. Copy the code in your temp.js file and paste it in your gist with spaces as 4.







share|improve this answer





























    0














    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.






    share|improve this answer





















      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
      });


      }
      });














      draft saved

      draft discarded


















      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









      0














      This is happening because while writing the code, you used the tab key which inserted 8 spaces. Here's a solution that I use.





      1. Copy all your code to a local file and open it in the vi editor.
        cat>temp.js
        ctrl+shift+v to paste and ctrl+d to save.



        vim temp.js (Or change the extension as per your file.)




      2. Run the following command that I found from here. This will half the existing space.



        :%s;^(s+);=repeat(' ', len(submatch(0))/2);g



      3. Press the esc key then :x and enter key to save and exit vi.


      4. Copy the code in your temp.js file and paste it in your gist with spaces as 4.







      share|improve this answer


























        0














        This is happening because while writing the code, you used the tab key which inserted 8 spaces. Here's a solution that I use.





        1. Copy all your code to a local file and open it in the vi editor.
          cat>temp.js
          ctrl+shift+v to paste and ctrl+d to save.



          vim temp.js (Or change the extension as per your file.)




        2. Run the following command that I found from here. This will half the existing space.



          :%s;^(s+);=repeat(' ', len(submatch(0))/2);g



        3. Press the esc key then :x and enter key to save and exit vi.


        4. Copy the code in your temp.js file and paste it in your gist with spaces as 4.







        share|improve this answer
























          0












          0








          0






          This is happening because while writing the code, you used the tab key which inserted 8 spaces. Here's a solution that I use.





          1. Copy all your code to a local file and open it in the vi editor.
            cat>temp.js
            ctrl+shift+v to paste and ctrl+d to save.



            vim temp.js (Or change the extension as per your file.)




          2. Run the following command that I found from here. This will half the existing space.



            :%s;^(s+);=repeat(' ', len(submatch(0))/2);g



          3. Press the esc key then :x and enter key to save and exit vi.


          4. Copy the code in your temp.js file and paste it in your gist with spaces as 4.







          share|improve this answer












          This is happening because while writing the code, you used the tab key which inserted 8 spaces. Here's a solution that I use.





          1. Copy all your code to a local file and open it in the vi editor.
            cat>temp.js
            ctrl+shift+v to paste and ctrl+d to save.



            vim temp.js (Or change the extension as per your file.)




          2. Run the following command that I found from here. This will half the existing space.



            :%s;^(s+);=repeat(' ', len(submatch(0))/2);g



          3. Press the esc key then :x and enter key to save and exit vi.


          4. Copy the code in your temp.js file and paste it in your gist with spaces as 4.








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 12 '18 at 4:54









          PRIYESH PATEL

          564




          564

























              0














              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.






              share|improve this answer


























                0














                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.






                share|improve this answer
























                  0












                  0








                  0






                  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.






                  share|improve this answer












                  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.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 2 days ago









                  zeet

                  1,2481921




                  1,2481921






























                      draft saved

                      draft discarded




















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      這個網誌中的熱門文章

                      Xamarin.form Move up view when keyboard appear

                      Post-Redirect-Get with Spring WebFlux and Thymeleaf

                      Anylogic : not able to use stopDelay()