Permanently display line numbers in emacs

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











up vote
1
down vote

favorite












I am asking this after having read this post:



How do I display line numbers in emacs (not in the mode line)?



I have tried using:
M-x linum-mode
and
display-line-numbers-mode



After closing emacs and reopening, they are gone. Is there not a way to have emacs permanently display the line numbers?










share|improve this question







New contributor




leeym is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    1
    down vote

    favorite












    I am asking this after having read this post:



    How do I display line numbers in emacs (not in the mode line)?



    I have tried using:
    M-x linum-mode
    and
    display-line-numbers-mode



    After closing emacs and reopening, they are gone. Is there not a way to have emacs permanently display the line numbers?










    share|improve this question







    New contributor




    leeym is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I am asking this after having read this post:



      How do I display line numbers in emacs (not in the mode line)?



      I have tried using:
      M-x linum-mode
      and
      display-line-numbers-mode



      After closing emacs and reopening, they are gone. Is there not a way to have emacs permanently display the line numbers?










      share|improve this question







      New contributor




      leeym is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I am asking this after having read this post:



      How do I display line numbers in emacs (not in the mode line)?



      I have tried using:
      M-x linum-mode
      and
      display-line-numbers-mode



      After closing emacs and reopening, they are gone. Is there not a way to have emacs permanently display the line numbers?







      line-numbers






      share|improve this question







      New contributor




      leeym is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      leeym is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      leeym is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 1 hour ago









      leeym

      63




      63




      New contributor




      leeym is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      leeym is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      leeym is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          3
          down vote













          In order for your changes to persist, you need to add them to your init file. If you've used any customize functionality, it probably generated one for you, and it's saved in ~/.emacs. If that isn't the case, you're better off putting it in ~/.emacs.d/init.el.



          In order to have line numbers in all buffers and have them persistently, you can put



          (global-display-line-numbers-mode)


          into your init file.






          share|improve this answer




















          • Both of those files are empty for me. And adding that line did nothing in both cases.
            – leeym
            51 mins ago










          • You either have to evaluate contents of your new init file to see the changes right away, or restart Emacs. Also, if you have both files, ~/.emacs will take precedence if I recall correctly, so make sure you have only one of these files.
            – DoMiNeLa10♦
            25 mins ago










          • Thank you for your continued help. I restarted everything. I am putting that line in an empty ~/.emacs file. And getting this error: Symbol's function definition is void: global-display-line-numbers-mode
            – leeym
            21 mins ago


















          up vote
          0
          down vote













          1. Menu Options > Show/Hide > Line Numbers for All Lines > Global Line Numbers Mode


          2. Menu Options > Save Options


          Menus are your friends. They can be a good way to discover Emacs features.



          You can also alternatively use Customize to set the equivalent option directly: M-x customize-option global-display-line-numbers-mode.






          share|improve this answer




















          • I only have a 'Line Numbers' completion (I do not see a 'Line Numbers for All Lines') under 'Show/Hide' and choosing that one simply toggles line number mode.
            – leeym
            10 mins ago










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "583"
          ;
          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
          );



          );






          leeym is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f45604%2fpermanently-display-line-numbers-in-emacs%23new-answer', 'question_page');

          );

          Post as a guest






























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote













          In order for your changes to persist, you need to add them to your init file. If you've used any customize functionality, it probably generated one for you, and it's saved in ~/.emacs. If that isn't the case, you're better off putting it in ~/.emacs.d/init.el.



          In order to have line numbers in all buffers and have them persistently, you can put



          (global-display-line-numbers-mode)


          into your init file.






          share|improve this answer




















          • Both of those files are empty for me. And adding that line did nothing in both cases.
            – leeym
            51 mins ago










          • You either have to evaluate contents of your new init file to see the changes right away, or restart Emacs. Also, if you have both files, ~/.emacs will take precedence if I recall correctly, so make sure you have only one of these files.
            – DoMiNeLa10♦
            25 mins ago










          • Thank you for your continued help. I restarted everything. I am putting that line in an empty ~/.emacs file. And getting this error: Symbol's function definition is void: global-display-line-numbers-mode
            – leeym
            21 mins ago















          up vote
          3
          down vote













          In order for your changes to persist, you need to add them to your init file. If you've used any customize functionality, it probably generated one for you, and it's saved in ~/.emacs. If that isn't the case, you're better off putting it in ~/.emacs.d/init.el.



          In order to have line numbers in all buffers and have them persistently, you can put



          (global-display-line-numbers-mode)


          into your init file.






          share|improve this answer




















          • Both of those files are empty for me. And adding that line did nothing in both cases.
            – leeym
            51 mins ago










          • You either have to evaluate contents of your new init file to see the changes right away, or restart Emacs. Also, if you have both files, ~/.emacs will take precedence if I recall correctly, so make sure you have only one of these files.
            – DoMiNeLa10♦
            25 mins ago










          • Thank you for your continued help. I restarted everything. I am putting that line in an empty ~/.emacs file. And getting this error: Symbol's function definition is void: global-display-line-numbers-mode
            – leeym
            21 mins ago













          up vote
          3
          down vote










          up vote
          3
          down vote









          In order for your changes to persist, you need to add them to your init file. If you've used any customize functionality, it probably generated one for you, and it's saved in ~/.emacs. If that isn't the case, you're better off putting it in ~/.emacs.d/init.el.



          In order to have line numbers in all buffers and have them persistently, you can put



          (global-display-line-numbers-mode)


          into your init file.






          share|improve this answer












          In order for your changes to persist, you need to add them to your init file. If you've used any customize functionality, it probably generated one for you, and it's saved in ~/.emacs. If that isn't the case, you're better off putting it in ~/.emacs.d/init.el.



          In order to have line numbers in all buffers and have them persistently, you can put



          (global-display-line-numbers-mode)


          into your init file.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 56 mins ago









          DoMiNeLa10♦

          1,8041516




          1,8041516











          • Both of those files are empty for me. And adding that line did nothing in both cases.
            – leeym
            51 mins ago










          • You either have to evaluate contents of your new init file to see the changes right away, or restart Emacs. Also, if you have both files, ~/.emacs will take precedence if I recall correctly, so make sure you have only one of these files.
            – DoMiNeLa10♦
            25 mins ago










          • Thank you for your continued help. I restarted everything. I am putting that line in an empty ~/.emacs file. And getting this error: Symbol's function definition is void: global-display-line-numbers-mode
            – leeym
            21 mins ago

















          • Both of those files are empty for me. And adding that line did nothing in both cases.
            – leeym
            51 mins ago










          • You either have to evaluate contents of your new init file to see the changes right away, or restart Emacs. Also, if you have both files, ~/.emacs will take precedence if I recall correctly, so make sure you have only one of these files.
            – DoMiNeLa10♦
            25 mins ago










          • Thank you for your continued help. I restarted everything. I am putting that line in an empty ~/.emacs file. And getting this error: Symbol's function definition is void: global-display-line-numbers-mode
            – leeym
            21 mins ago
















          Both of those files are empty for me. And adding that line did nothing in both cases.
          – leeym
          51 mins ago




          Both of those files are empty for me. And adding that line did nothing in both cases.
          – leeym
          51 mins ago












          You either have to evaluate contents of your new init file to see the changes right away, or restart Emacs. Also, if you have both files, ~/.emacs will take precedence if I recall correctly, so make sure you have only one of these files.
          – DoMiNeLa10♦
          25 mins ago




          You either have to evaluate contents of your new init file to see the changes right away, or restart Emacs. Also, if you have both files, ~/.emacs will take precedence if I recall correctly, so make sure you have only one of these files.
          – DoMiNeLa10♦
          25 mins ago












          Thank you for your continued help. I restarted everything. I am putting that line in an empty ~/.emacs file. And getting this error: Symbol's function definition is void: global-display-line-numbers-mode
          – leeym
          21 mins ago





          Thank you for your continued help. I restarted everything. I am putting that line in an empty ~/.emacs file. And getting this error: Symbol's function definition is void: global-display-line-numbers-mode
          – leeym
          21 mins ago











          up vote
          0
          down vote













          1. Menu Options > Show/Hide > Line Numbers for All Lines > Global Line Numbers Mode


          2. Menu Options > Save Options


          Menus are your friends. They can be a good way to discover Emacs features.



          You can also alternatively use Customize to set the equivalent option directly: M-x customize-option global-display-line-numbers-mode.






          share|improve this answer




















          • I only have a 'Line Numbers' completion (I do not see a 'Line Numbers for All Lines') under 'Show/Hide' and choosing that one simply toggles line number mode.
            – leeym
            10 mins ago














          up vote
          0
          down vote













          1. Menu Options > Show/Hide > Line Numbers for All Lines > Global Line Numbers Mode


          2. Menu Options > Save Options


          Menus are your friends. They can be a good way to discover Emacs features.



          You can also alternatively use Customize to set the equivalent option directly: M-x customize-option global-display-line-numbers-mode.






          share|improve this answer




















          • I only have a 'Line Numbers' completion (I do not see a 'Line Numbers for All Lines') under 'Show/Hide' and choosing that one simply toggles line number mode.
            – leeym
            10 mins ago












          up vote
          0
          down vote










          up vote
          0
          down vote









          1. Menu Options > Show/Hide > Line Numbers for All Lines > Global Line Numbers Mode


          2. Menu Options > Save Options


          Menus are your friends. They can be a good way to discover Emacs features.



          You can also alternatively use Customize to set the equivalent option directly: M-x customize-option global-display-line-numbers-mode.






          share|improve this answer












          1. Menu Options > Show/Hide > Line Numbers for All Lines > Global Line Numbers Mode


          2. Menu Options > Save Options


          Menus are your friends. They can be a good way to discover Emacs features.



          You can also alternatively use Customize to set the equivalent option directly: M-x customize-option global-display-line-numbers-mode.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 18 mins ago









          Drew

          45.7k460102




          45.7k460102











          • I only have a 'Line Numbers' completion (I do not see a 'Line Numbers for All Lines') under 'Show/Hide' and choosing that one simply toggles line number mode.
            – leeym
            10 mins ago
















          • I only have a 'Line Numbers' completion (I do not see a 'Line Numbers for All Lines') under 'Show/Hide' and choosing that one simply toggles line number mode.
            – leeym
            10 mins ago















          I only have a 'Line Numbers' completion (I do not see a 'Line Numbers for All Lines') under 'Show/Hide' and choosing that one simply toggles line number mode.
          – leeym
          10 mins ago




          I only have a 'Line Numbers' completion (I do not see a 'Line Numbers for All Lines') under 'Show/Hide' and choosing that one simply toggles line number mode.
          – leeym
          10 mins ago










          leeym is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          leeym is a new contributor. Be nice, and check out our Code of Conduct.












          leeym is a new contributor. Be nice, and check out our Code of Conduct.











          leeym is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f45604%2fpermanently-display-line-numbers-in-emacs%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          Long meetings (6-7 hours a day): Being “babysat” by supervisor

          Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

          Confectionery