What is difference between w and W in escape mode of vim?












16















I am looking at the vim help quickref commands for moving cursor. Following lines confuse me because I find both of them working same. Could some one elaborate me difference with an example.



N  w            N words forward
N W N blank-separated WORDS forward


Same question is true for e and E as well.










share|improve this question





























    16















    I am looking at the vim help quickref commands for moving cursor. Following lines confuse me because I find both of them working same. Could some one elaborate me difference with an example.



    N  w            N words forward
    N W N blank-separated WORDS forward


    Same question is true for e and E as well.










    share|improve this question



























      16












      16








      16


      3






      I am looking at the vim help quickref commands for moving cursor. Following lines confuse me because I find both of them working same. Could some one elaborate me difference with an example.



      N  w            N words forward
      N W N blank-separated WORDS forward


      Same question is true for e and E as well.










      share|improve this question
















      I am looking at the vim help quickref commands for moving cursor. Following lines confuse me because I find both of them working same. Could some one elaborate me difference with an example.



      N  w            N words forward
      N W N blank-separated WORDS forward


      Same question is true for e and E as well.







      vim






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 24 '13 at 1:20









      slm

      252k70531685




      252k70531685










      asked Dec 24 '13 at 0:07









      rahul.deshmukhpatilrahul.deshmukhpatil

      19719




      19719






















          4 Answers
          4






          active

          oldest

          votes


















          28














          According to this cheat sheet it would seem to come down to punctuation.



          w   jump by start of words (punctuation considered words)
          W jump by words (spaces separate words)
          e jump to end of words (punctuation considered words)
          E jump to end of words (no punctuation)


          Example



          demo using w



                    ss of w



          demo using W



                    ss of W



          Notice in the first demo how when w is continuously hit that the cursor lands on the punctuation, while in the 2nd demo the punctuation is skipped. This is the difference between the lowercase commands and their upper case equivalents.






          share|improve this answer


























          • @slm: thanks a lot for such a great demo. with such demo no need to read ans as well

            – rahul.deshmukhpatil
            Dec 24 '13 at 13:19



















          4














          It's actually fairly simple, w just skips to the next word, but any sort of punctuation or whitespace breaks up words. W is like the industrial-strength next-word command, words are only delimited by whitespace, be it tab, space or newline. w stops at the delimiting punctuation also, in case you want to deal with that.



          I find the difference useful most often with hostnames:



          birdman.cartoons.fictional.com # Fictional host



          With w, you stop on each part of the hostname and the dots. W just skips the entire hostname and goes onto the #. These both also apply to d and c for deleting and changing words.



          If positioned at the beginning of the above line, if you wanted to replace birdman.cartoons with something else, you would use 3cw to replace both of the first two parts and the dot in the middle. You couldn't do it with W without retyping the whole hostname.






          share|improve this answer































            2














            It is a difference that is best understood by considering how punctuation can impact on Vim's concept of what delimits a word.



            In the case of this example text:



            This line is space separated with no commas
            however, this line is—note—comma, separated,see


            w will happily skip to the first letter of each word in the first line, as there is only space to negotiate. It will fail badly on line 2 with the punctuation, alighting on the first letters of each word and the commas and en dashes. To move from word to word on line 2, you would need to use Shiftw1.



            1. Even then, Vim sees "is–note–comma" as a single word.






            share|improve this answer































              0














              The difference can be found within the vim's internal help pages.
              Lets's first get a description of w and W with :help w or :help W:




              • w [count] words forward. |exclusive| motion.

              • W [count] WORDS forward. |exclusive| motion.


              Now we want to know what are the definitions of word and WORD. Lookup the manual again with :help word and :help WORD, we find them.




              • A word consists of a sequence of letters, digits and underscores, or a
                sequence of other non-blank characters, separated with white space
                (spaces,
                tabs, ). This can be changed with the 'iskeyword' option. An empty line
                is also considered to be a word.

              • A WORD consists of a sequence of non-blank characters, separated with white
                space
                . An empty line is also considered to be a WORD.





              share








              New contributor




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




















                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',
                autoActivateHeartbeat: false,
                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%2f106425%2fwhat-is-difference-between-w-and-w-in-escape-mode-of-vim%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                28














                According to this cheat sheet it would seem to come down to punctuation.



                w   jump by start of words (punctuation considered words)
                W jump by words (spaces separate words)
                e jump to end of words (punctuation considered words)
                E jump to end of words (no punctuation)


                Example



                demo using w



                          ss of w



                demo using W



                          ss of W



                Notice in the first demo how when w is continuously hit that the cursor lands on the punctuation, while in the 2nd demo the punctuation is skipped. This is the difference between the lowercase commands and their upper case equivalents.






                share|improve this answer


























                • @slm: thanks a lot for such a great demo. with such demo no need to read ans as well

                  – rahul.deshmukhpatil
                  Dec 24 '13 at 13:19
















                28














                According to this cheat sheet it would seem to come down to punctuation.



                w   jump by start of words (punctuation considered words)
                W jump by words (spaces separate words)
                e jump to end of words (punctuation considered words)
                E jump to end of words (no punctuation)


                Example



                demo using w



                          ss of w



                demo using W



                          ss of W



                Notice in the first demo how when w is continuously hit that the cursor lands on the punctuation, while in the 2nd demo the punctuation is skipped. This is the difference between the lowercase commands and their upper case equivalents.






                share|improve this answer


























                • @slm: thanks a lot for such a great demo. with such demo no need to read ans as well

                  – rahul.deshmukhpatil
                  Dec 24 '13 at 13:19














                28












                28








                28







                According to this cheat sheet it would seem to come down to punctuation.



                w   jump by start of words (punctuation considered words)
                W jump by words (spaces separate words)
                e jump to end of words (punctuation considered words)
                E jump to end of words (no punctuation)


                Example



                demo using w



                          ss of w



                demo using W



                          ss of W



                Notice in the first demo how when w is continuously hit that the cursor lands on the punctuation, while in the 2nd demo the punctuation is skipped. This is the difference between the lowercase commands and their upper case equivalents.






                share|improve this answer















                According to this cheat sheet it would seem to come down to punctuation.



                w   jump by start of words (punctuation considered words)
                W jump by words (spaces separate words)
                e jump to end of words (punctuation considered words)
                E jump to end of words (no punctuation)


                Example



                demo using w



                          ss of w



                demo using W



                          ss of W



                Notice in the first demo how when w is continuously hit that the cursor lands on the punctuation, while in the 2nd demo the punctuation is skipped. This is the difference between the lowercase commands and their upper case equivalents.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Dec 24 '13 at 3:39

























                answered Dec 24 '13 at 0:30









                slmslm

                252k70531685




                252k70531685













                • @slm: thanks a lot for such a great demo. with such demo no need to read ans as well

                  – rahul.deshmukhpatil
                  Dec 24 '13 at 13:19



















                • @slm: thanks a lot for such a great demo. with such demo no need to read ans as well

                  – rahul.deshmukhpatil
                  Dec 24 '13 at 13:19

















                @slm: thanks a lot for such a great demo. with such demo no need to read ans as well

                – rahul.deshmukhpatil
                Dec 24 '13 at 13:19





                @slm: thanks a lot for such a great demo. with such demo no need to read ans as well

                – rahul.deshmukhpatil
                Dec 24 '13 at 13:19













                4














                It's actually fairly simple, w just skips to the next word, but any sort of punctuation or whitespace breaks up words. W is like the industrial-strength next-word command, words are only delimited by whitespace, be it tab, space or newline. w stops at the delimiting punctuation also, in case you want to deal with that.



                I find the difference useful most often with hostnames:



                birdman.cartoons.fictional.com # Fictional host



                With w, you stop on each part of the hostname and the dots. W just skips the entire hostname and goes onto the #. These both also apply to d and c for deleting and changing words.



                If positioned at the beginning of the above line, if you wanted to replace birdman.cartoons with something else, you would use 3cw to replace both of the first two parts and the dot in the middle. You couldn't do it with W without retyping the whole hostname.






                share|improve this answer




























                  4














                  It's actually fairly simple, w just skips to the next word, but any sort of punctuation or whitespace breaks up words. W is like the industrial-strength next-word command, words are only delimited by whitespace, be it tab, space or newline. w stops at the delimiting punctuation also, in case you want to deal with that.



                  I find the difference useful most often with hostnames:



                  birdman.cartoons.fictional.com # Fictional host



                  With w, you stop on each part of the hostname and the dots. W just skips the entire hostname and goes onto the #. These both also apply to d and c for deleting and changing words.



                  If positioned at the beginning of the above line, if you wanted to replace birdman.cartoons with something else, you would use 3cw to replace both of the first two parts and the dot in the middle. You couldn't do it with W without retyping the whole hostname.






                  share|improve this answer


























                    4












                    4








                    4







                    It's actually fairly simple, w just skips to the next word, but any sort of punctuation or whitespace breaks up words. W is like the industrial-strength next-word command, words are only delimited by whitespace, be it tab, space or newline. w stops at the delimiting punctuation also, in case you want to deal with that.



                    I find the difference useful most often with hostnames:



                    birdman.cartoons.fictional.com # Fictional host



                    With w, you stop on each part of the hostname and the dots. W just skips the entire hostname and goes onto the #. These both also apply to d and c for deleting and changing words.



                    If positioned at the beginning of the above line, if you wanted to replace birdman.cartoons with something else, you would use 3cw to replace both of the first two parts and the dot in the middle. You couldn't do it with W without retyping the whole hostname.






                    share|improve this answer













                    It's actually fairly simple, w just skips to the next word, but any sort of punctuation or whitespace breaks up words. W is like the industrial-strength next-word command, words are only delimited by whitespace, be it tab, space or newline. w stops at the delimiting punctuation also, in case you want to deal with that.



                    I find the difference useful most often with hostnames:



                    birdman.cartoons.fictional.com # Fictional host



                    With w, you stop on each part of the hostname and the dots. W just skips the entire hostname and goes onto the #. These both also apply to d and c for deleting and changing words.



                    If positioned at the beginning of the above line, if you wanted to replace birdman.cartoons with something else, you would use 3cw to replace both of the first two parts and the dot in the middle. You couldn't do it with W without retyping the whole hostname.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Dec 24 '13 at 3:34









                    kurtmkurtm

                    4,13511619




                    4,13511619























                        2














                        It is a difference that is best understood by considering how punctuation can impact on Vim's concept of what delimits a word.



                        In the case of this example text:



                        This line is space separated with no commas
                        however, this line is—note—comma, separated,see


                        w will happily skip to the first letter of each word in the first line, as there is only space to negotiate. It will fail badly on line 2 with the punctuation, alighting on the first letters of each word and the commas and en dashes. To move from word to word on line 2, you would need to use Shiftw1.



                        1. Even then, Vim sees "is–note–comma" as a single word.






                        share|improve this answer




























                          2














                          It is a difference that is best understood by considering how punctuation can impact on Vim's concept of what delimits a word.



                          In the case of this example text:



                          This line is space separated with no commas
                          however, this line is—note—comma, separated,see


                          w will happily skip to the first letter of each word in the first line, as there is only space to negotiate. It will fail badly on line 2 with the punctuation, alighting on the first letters of each word and the commas and en dashes. To move from word to word on line 2, you would need to use Shiftw1.



                          1. Even then, Vim sees "is–note–comma" as a single word.






                          share|improve this answer


























                            2












                            2








                            2







                            It is a difference that is best understood by considering how punctuation can impact on Vim's concept of what delimits a word.



                            In the case of this example text:



                            This line is space separated with no commas
                            however, this line is—note—comma, separated,see


                            w will happily skip to the first letter of each word in the first line, as there is only space to negotiate. It will fail badly on line 2 with the punctuation, alighting on the first letters of each word and the commas and en dashes. To move from word to word on line 2, you would need to use Shiftw1.



                            1. Even then, Vim sees "is–note–comma" as a single word.






                            share|improve this answer













                            It is a difference that is best understood by considering how punctuation can impact on Vim's concept of what delimits a word.



                            In the case of this example text:



                            This line is space separated with no commas
                            however, this line is—note—comma, separated,see


                            w will happily skip to the first letter of each word in the first line, as there is only space to negotiate. It will fail badly on line 2 with the punctuation, alighting on the first letters of each word and the commas and en dashes. To move from word to word on line 2, you would need to use Shiftw1.



                            1. Even then, Vim sees "is–note–comma" as a single word.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Dec 24 '13 at 0:50









                            jasonwryanjasonwryan

                            50.2k14134189




                            50.2k14134189























                                0














                                The difference can be found within the vim's internal help pages.
                                Lets's first get a description of w and W with :help w or :help W:




                                • w [count] words forward. |exclusive| motion.

                                • W [count] WORDS forward. |exclusive| motion.


                                Now we want to know what are the definitions of word and WORD. Lookup the manual again with :help word and :help WORD, we find them.




                                • A word consists of a sequence of letters, digits and underscores, or a
                                  sequence of other non-blank characters, separated with white space
                                  (spaces,
                                  tabs, ). This can be changed with the 'iskeyword' option. An empty line
                                  is also considered to be a word.

                                • A WORD consists of a sequence of non-blank characters, separated with white
                                  space
                                  . An empty line is also considered to be a WORD.





                                share








                                New contributor




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

























                                  0














                                  The difference can be found within the vim's internal help pages.
                                  Lets's first get a description of w and W with :help w or :help W:




                                  • w [count] words forward. |exclusive| motion.

                                  • W [count] WORDS forward. |exclusive| motion.


                                  Now we want to know what are the definitions of word and WORD. Lookup the manual again with :help word and :help WORD, we find them.




                                  • A word consists of a sequence of letters, digits and underscores, or a
                                    sequence of other non-blank characters, separated with white space
                                    (spaces,
                                    tabs, ). This can be changed with the 'iskeyword' option. An empty line
                                    is also considered to be a word.

                                  • A WORD consists of a sequence of non-blank characters, separated with white
                                    space
                                    . An empty line is also considered to be a WORD.





                                  share








                                  New contributor




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























                                    0












                                    0








                                    0







                                    The difference can be found within the vim's internal help pages.
                                    Lets's first get a description of w and W with :help w or :help W:




                                    • w [count] words forward. |exclusive| motion.

                                    • W [count] WORDS forward. |exclusive| motion.


                                    Now we want to know what are the definitions of word and WORD. Lookup the manual again with :help word and :help WORD, we find them.




                                    • A word consists of a sequence of letters, digits and underscores, or a
                                      sequence of other non-blank characters, separated with white space
                                      (spaces,
                                      tabs, ). This can be changed with the 'iskeyword' option. An empty line
                                      is also considered to be a word.

                                    • A WORD consists of a sequence of non-blank characters, separated with white
                                      space
                                      . An empty line is also considered to be a WORD.





                                    share








                                    New contributor




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










                                    The difference can be found within the vim's internal help pages.
                                    Lets's first get a description of w and W with :help w or :help W:




                                    • w [count] words forward. |exclusive| motion.

                                    • W [count] WORDS forward. |exclusive| motion.


                                    Now we want to know what are the definitions of word and WORD. Lookup the manual again with :help word and :help WORD, we find them.




                                    • A word consists of a sequence of letters, digits and underscores, or a
                                      sequence of other non-blank characters, separated with white space
                                      (spaces,
                                      tabs, ). This can be changed with the 'iskeyword' option. An empty line
                                      is also considered to be a word.

                                    • A WORD consists of a sequence of non-blank characters, separated with white
                                      space
                                      . An empty line is also considered to be a WORD.






                                    share








                                    New contributor




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








                                    share


                                    share






                                    New contributor




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









                                    answered 8 mins ago









                                    user9154844user9154844

                                    1




                                    1




                                    New contributor




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





                                    New contributor





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






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






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                        • 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%2funix.stackexchange.com%2fquestions%2f106425%2fwhat-is-difference-between-w-and-w-in-escape-mode-of-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

                                        Histoire des bourses de valeurs

                                        Why is there Russian traffic in my log files?

                                        Rename multiple files to decrement number in file name?