Auto indent C++11 lambda functions Vim

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











up vote
3
down vote

favorite












Is there any way to get Vim to auto indent C++11 lambda functions correctly?



I have tried many different permutations of smartindent, cindent, etc. in .vimrc.



enter image description here










share|improve this question

















  • 1




    I think it's related to your standards such as old style C, camel case, and so on. please refer to your standard and adjust vim according to your standard,
    – PersianGulf
    Feb 21 '14 at 12:33










  • Please, don't post images of text. Are we supposed to re-type that complex code when testing?
    – Kusalananda
    yesterday














up vote
3
down vote

favorite












Is there any way to get Vim to auto indent C++11 lambda functions correctly?



I have tried many different permutations of smartindent, cindent, etc. in .vimrc.



enter image description here










share|improve this question

















  • 1




    I think it's related to your standards such as old style C, camel case, and so on. please refer to your standard and adjust vim according to your standard,
    – PersianGulf
    Feb 21 '14 at 12:33










  • Please, don't post images of text. Are we supposed to re-type that complex code when testing?
    – Kusalananda
    yesterday












up vote
3
down vote

favorite









up vote
3
down vote

favorite











Is there any way to get Vim to auto indent C++11 lambda functions correctly?



I have tried many different permutations of smartindent, cindent, etc. in .vimrc.



enter image description here










share|improve this question













Is there any way to get Vim to auto indent C++11 lambda functions correctly?



I have tried many different permutations of smartindent, cindent, etc. in .vimrc.



enter image description here







vim c++ vimrc






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 21 '14 at 0:18









frickskit

164115




164115







  • 1




    I think it's related to your standards such as old style C, camel case, and so on. please refer to your standard and adjust vim according to your standard,
    – PersianGulf
    Feb 21 '14 at 12:33










  • Please, don't post images of text. Are we supposed to re-type that complex code when testing?
    – Kusalananda
    yesterday












  • 1




    I think it's related to your standards such as old style C, camel case, and so on. please refer to your standard and adjust vim according to your standard,
    – PersianGulf
    Feb 21 '14 at 12:33










  • Please, don't post images of text. Are we supposed to re-type that complex code when testing?
    – Kusalananda
    yesterday







1




1




I think it's related to your standards such as old style C, camel case, and so on. please refer to your standard and adjust vim according to your standard,
– PersianGulf
Feb 21 '14 at 12:33




I think it's related to your standards such as old style C, camel case, and so on. please refer to your standard and adjust vim according to your standard,
– PersianGulf
Feb 21 '14 at 12:33












Please, don't post images of text. Are we supposed to re-type that complex code when testing?
– Kusalananda
yesterday




Please, don't post images of text. Are we supposed to re-type that complex code when testing?
– Kusalananda
yesterday










2 Answers
2






active

oldest

votes

















up vote
1
down vote













Here is piece of my ~/.vim/vimrc configuration file:



set cindent " enable specific indenting for C code
set cino+=j1,(0,ws,Ws " enable partial c++11 (lambda) support





share|improve this answer










New contributor




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
























    up vote
    0
    down vote













    One workaround (not answer) is to declare the lambda and pass the func ptr into the receiving function... dilutes the convenience of lambdas though.






    share|improve this answer






















      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: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      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%2funix.stackexchange.com%2fquestions%2f116199%2fauto-indent-c11-lambda-functions-vim%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








      up vote
      1
      down vote













      Here is piece of my ~/.vim/vimrc configuration file:



      set cindent " enable specific indenting for C code
      set cino+=j1,(0,ws,Ws " enable partial c++11 (lambda) support





      share|improve this answer










      New contributor




      Andrey A. Ugolnik 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













        Here is piece of my ~/.vim/vimrc configuration file:



        set cindent " enable specific indenting for C code
        set cino+=j1,(0,ws,Ws " enable partial c++11 (lambda) support





        share|improve this answer










        New contributor




        Andrey A. Ugolnik 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










          up vote
          1
          down vote









          Here is piece of my ~/.vim/vimrc configuration file:



          set cindent " enable specific indenting for C code
          set cino+=j1,(0,ws,Ws " enable partial c++11 (lambda) support





          share|improve this answer










          New contributor




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









          Here is piece of my ~/.vim/vimrc configuration file:



          set cindent " enable specific indenting for C code
          set cino+=j1,(0,ws,Ws " enable partial c++11 (lambda) support






          share|improve this answer










          New contributor




          Andrey A. Ugolnik 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 answer



          share|improve this answer








          edited yesterday









          perror

          1,83241834




          1,83241834






          New contributor




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









          answered yesterday









          Andrey A. Ugolnik

          112




          112




          New contributor




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





          New contributor





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






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






















              up vote
              0
              down vote













              One workaround (not answer) is to declare the lambda and pass the func ptr into the receiving function... dilutes the convenience of lambdas though.






              share|improve this answer


























                up vote
                0
                down vote













                One workaround (not answer) is to declare the lambda and pass the func ptr into the receiving function... dilutes the convenience of lambdas though.






                share|improve this answer
























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  One workaround (not answer) is to declare the lambda and pass the func ptr into the receiving function... dilutes the convenience of lambdas though.






                  share|improve this answer














                  One workaround (not answer) is to declare the lambda and pass the func ptr into the receiving function... dilutes the convenience of lambdas though.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Feb 21 '14 at 13:54

























                  answered Feb 21 '14 at 13:16









                  frickskit

                  164115




                  164115



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f116199%2fauto-indent-c11-lambda-functions-vim%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






                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Displaying single band from multi-band raster using QGIS

                      How many registers does an x86_64 CPU actually have?