Is it possible to easily switch between tabs and spaces in nano?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
5
down vote

favorite












Normally I want nano to replace tabs with spaces, so I use set tabstospaces in my .nanorc file. Occasionally I'd like to use nano to make a quick edit to makefiles where I need real tab characters.



Is there any way to dynamically toggle tabstospaces? Most of the other options have keys to toggle them, but I can't find something for this. I've also tried using ^I (which by default is bound to the tab function) to insert a tab, but that honors the tabstospaces setting.



My current workaround is to take set tabstospaces out of my .nanorc file and to add shell aliases instead:



 alias nanotabs="$(which nano)"
alias nano="$(which nano) --tabstospaces"









share|improve this question



























    up vote
    5
    down vote

    favorite












    Normally I want nano to replace tabs with spaces, so I use set tabstospaces in my .nanorc file. Occasionally I'd like to use nano to make a quick edit to makefiles where I need real tab characters.



    Is there any way to dynamically toggle tabstospaces? Most of the other options have keys to toggle them, but I can't find something for this. I've also tried using ^I (which by default is bound to the tab function) to insert a tab, but that honors the tabstospaces setting.



    My current workaround is to take set tabstospaces out of my .nanorc file and to add shell aliases instead:



     alias nanotabs="$(which nano)"
    alias nano="$(which nano) --tabstospaces"









    share|improve this question

























      up vote
      5
      down vote

      favorite









      up vote
      5
      down vote

      favorite











      Normally I want nano to replace tabs with spaces, so I use set tabstospaces in my .nanorc file. Occasionally I'd like to use nano to make a quick edit to makefiles where I need real tab characters.



      Is there any way to dynamically toggle tabstospaces? Most of the other options have keys to toggle them, but I can't find something for this. I've also tried using ^I (which by default is bound to the tab function) to insert a tab, but that honors the tabstospaces setting.



      My current workaround is to take set tabstospaces out of my .nanorc file and to add shell aliases instead:



       alias nanotabs="$(which nano)"
      alias nano="$(which nano) --tabstospaces"









      share|improve this question















      Normally I want nano to replace tabs with spaces, so I use set tabstospaces in my .nanorc file. Occasionally I'd like to use nano to make a quick edit to makefiles where I need real tab characters.



      Is there any way to dynamically toggle tabstospaces? Most of the other options have keys to toggle them, but I can't find something for this. I've also tried using ^I (which by default is bound to the tab function) to insert a tab, but that honors the tabstospaces setting.



      My current workaround is to take set tabstospaces out of my .nanorc file and to add shell aliases instead:



       alias nanotabs="$(which nano)"
      alias nano="$(which nano) --tabstospaces"






      nano






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 11 mins ago

























      asked Jan 15 '15 at 18:16









      jamesdlin

      334312




      334312




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          The shortcut that toggles tabstospaces is
          Shift+Alt+Q (or Meta+Q).

          You will see the prompt changing to:



          [ Conversion of typed tabs to spaces disabled ]


          or



          [ Conversion of typed tabs to spaces enabled ]


          respectively.

          Another way (only for nano 1.3.1 or newer):

          You can insert a literal tab if you enter Verbatim Input mode with Shift+Alt+V (or Meta+V).

          If you then type Tab, nano will insert a literal tab character, irrespective of your .nanorc settings. It will then revert to regular input mode (so you'll have to enter Verbatim Input mode again if you need to type a second literal tab and so on).

          You can also add your own Verbatim Input mode shortcut to .nanorc, e.g. Ctrl+T:



          #Edit
          bind ^T verbatim main





          share|improve this answer






















          • Aha! I don't know how I missed seeing M-Q in the built-in help (curses at the inability to search nano's help).
            – jamesdlin
            Jan 15 '15 at 21:34











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f179313%2fis-it-possible-to-easily-switch-between-tabs-and-spaces-in-nano%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          4
          down vote



          accepted










          The shortcut that toggles tabstospaces is
          Shift+Alt+Q (or Meta+Q).

          You will see the prompt changing to:



          [ Conversion of typed tabs to spaces disabled ]


          or



          [ Conversion of typed tabs to spaces enabled ]


          respectively.

          Another way (only for nano 1.3.1 or newer):

          You can insert a literal tab if you enter Verbatim Input mode with Shift+Alt+V (or Meta+V).

          If you then type Tab, nano will insert a literal tab character, irrespective of your .nanorc settings. It will then revert to regular input mode (so you'll have to enter Verbatim Input mode again if you need to type a second literal tab and so on).

          You can also add your own Verbatim Input mode shortcut to .nanorc, e.g. Ctrl+T:



          #Edit
          bind ^T verbatim main





          share|improve this answer






















          • Aha! I don't know how I missed seeing M-Q in the built-in help (curses at the inability to search nano's help).
            – jamesdlin
            Jan 15 '15 at 21:34















          up vote
          4
          down vote



          accepted










          The shortcut that toggles tabstospaces is
          Shift+Alt+Q (or Meta+Q).

          You will see the prompt changing to:



          [ Conversion of typed tabs to spaces disabled ]


          or



          [ Conversion of typed tabs to spaces enabled ]


          respectively.

          Another way (only for nano 1.3.1 or newer):

          You can insert a literal tab if you enter Verbatim Input mode with Shift+Alt+V (or Meta+V).

          If you then type Tab, nano will insert a literal tab character, irrespective of your .nanorc settings. It will then revert to regular input mode (so you'll have to enter Verbatim Input mode again if you need to type a second literal tab and so on).

          You can also add your own Verbatim Input mode shortcut to .nanorc, e.g. Ctrl+T:



          #Edit
          bind ^T verbatim main





          share|improve this answer






















          • Aha! I don't know how I missed seeing M-Q in the built-in help (curses at the inability to search nano's help).
            – jamesdlin
            Jan 15 '15 at 21:34













          up vote
          4
          down vote



          accepted







          up vote
          4
          down vote



          accepted






          The shortcut that toggles tabstospaces is
          Shift+Alt+Q (or Meta+Q).

          You will see the prompt changing to:



          [ Conversion of typed tabs to spaces disabled ]


          or



          [ Conversion of typed tabs to spaces enabled ]


          respectively.

          Another way (only for nano 1.3.1 or newer):

          You can insert a literal tab if you enter Verbatim Input mode with Shift+Alt+V (or Meta+V).

          If you then type Tab, nano will insert a literal tab character, irrespective of your .nanorc settings. It will then revert to regular input mode (so you'll have to enter Verbatim Input mode again if you need to type a second literal tab and so on).

          You can also add your own Verbatim Input mode shortcut to .nanorc, e.g. Ctrl+T:



          #Edit
          bind ^T verbatim main





          share|improve this answer














          The shortcut that toggles tabstospaces is
          Shift+Alt+Q (or Meta+Q).

          You will see the prompt changing to:



          [ Conversion of typed tabs to spaces disabled ]


          or



          [ Conversion of typed tabs to spaces enabled ]


          respectively.

          Another way (only for nano 1.3.1 or newer):

          You can insert a literal tab if you enter Verbatim Input mode with Shift+Alt+V (or Meta+V).

          If you then type Tab, nano will insert a literal tab character, irrespective of your .nanorc settings. It will then revert to regular input mode (so you'll have to enter Verbatim Input mode again if you need to type a second literal tab and so on).

          You can also add your own Verbatim Input mode shortcut to .nanorc, e.g. Ctrl+T:



          #Edit
          bind ^T verbatim main






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 15 '15 at 21:07

























          answered Jan 15 '15 at 19:15









          don_crissti

          48k15126155




          48k15126155











          • Aha! I don't know how I missed seeing M-Q in the built-in help (curses at the inability to search nano's help).
            – jamesdlin
            Jan 15 '15 at 21:34

















          • Aha! I don't know how I missed seeing M-Q in the built-in help (curses at the inability to search nano's help).
            – jamesdlin
            Jan 15 '15 at 21:34
















          Aha! I don't know how I missed seeing M-Q in the built-in help (curses at the inability to search nano's help).
          – jamesdlin
          Jan 15 '15 at 21:34





          Aha! I don't know how I missed seeing M-Q in the built-in help (curses at the inability to search nano's help).
          – jamesdlin
          Jan 15 '15 at 21:34


















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f179313%2fis-it-possible-to-easily-switch-between-tabs-and-spaces-in-nano%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          The Forum (Inglewood, California)

          Palaiologos