Using backslashes in vim abbreviations2019 Community Moderator Electionneovim iabbrev is shown as “invalid argument”Is it possible to abbreviate two words in vim by using the command abHow to abbrev “|” char?How to effectively work with multiple files in Vim?How to replace a character by a newline in Vim?Duplicate a whole line in VimHow do I move to end of line in Vim?Vim clear last search highlightingWhat is your most productive shortcut with Vim?What's a quick way to comment/uncomment lines in Vim?How to do case insensitive search in VimHow does the vim “write with sudo” trick work?How to exit the Vim editor?

Who deserves to be first and second author? PhD student who collected data, research associate who wrote the paper or supervisor?

Time travel short story where dinosaur doesn't taste like chicken

Is having access to past exams cheating and, if yes, could it be proven just by a good grade?

BitNot does not flip bits in the way I expected

Replacing Windows 7 security updates with anti-virus?

Do I really need to have a scientific explanation for my premise?

What to do when during a meeting client people start to fight (even physically) with each others?

How do I deal with a powergamer in a game full of beginners in a school club?

Good allowance savings plan?

What wound would be of little consequence to a biped but terrible for a quadruped?

Do items de-spawn in Diablo?

How could our ancestors have domesticated a solitary predator?

Finding algorithms of QGIS commands?

Peter's Strange Word

What are the best books to study Neural Networks from a purely mathematical perspective?

Subset counting for even numbers

Should I tell my boss the work he did was worthless

Making a sword in the stone, in a medieval world without magic

If the Captain's screens are out, does he switch seats with the co-pilot?

Are babies of evil humanoid species inherently evil?

How does airport security verify that you can carry a battery bank over 100 Wh?

Accountant/ lawyer will not return my call

Why would a jet engine that runs at temps excess of 2000°C burn when it crashes?

infinitive telling the purpose



Using backslashes in vim abbreviations



2019 Community Moderator Electionneovim iabbrev is shown as “invalid argument”Is it possible to abbreviate two words in vim by using the command abHow to abbrev “|” char?How to effectively work with multiple files in Vim?How to replace a character by a newline in Vim?Duplicate a whole line in VimHow do I move to end of line in Vim?Vim clear last search highlightingWhat is your most productive shortcut with Vim?What's a quick way to comment/uncomment lines in Vim?How to do case insensitive search in VimHow does the vim “write with sudo” trick work?How to exit the Vim editor?










9















I want to be able to write bit and have it expand to something in vim. How do I encode a backslash in the left-hand side of an abbreviation, though?



I tried all of these:



:iab bit replacement_text
:iab <Bslash>bit replacement_text
:iab <bs>bit replacement_text


but got E474: Invalid argument for all of these.



The map_backslash help-topic suggests <Bslash>, but this doesn't seem to work.










share|improve this question






















  • Aaarrgghh! It's a cracker. Your <Bslash>, I learned, is a rhs thing. In the lhs, "b" (w/o quotes) works, but the E474 is there when a second char is added "bi". "\" and "\b" are acceptable, but "\bi" is not. '"bit"' (w/o outer single quotes) works, but the double quotes are part of the ab. Like I said, "Aaarrgghh!" +1

    – Ewan Todd
    Nov 5 '09 at 1:45











  • if you stick this in an answer @Ewan I can vote this up, and it will be easier to see the quotes. This is interesting stuff...

    – Peter
    Nov 5 '09 at 6:45















9















I want to be able to write bit and have it expand to something in vim. How do I encode a backslash in the left-hand side of an abbreviation, though?



I tried all of these:



:iab bit replacement_text
:iab <Bslash>bit replacement_text
:iab <bs>bit replacement_text


but got E474: Invalid argument for all of these.



The map_backslash help-topic suggests <Bslash>, but this doesn't seem to work.










share|improve this question






















  • Aaarrgghh! It's a cracker. Your <Bslash>, I learned, is a rhs thing. In the lhs, "b" (w/o quotes) works, but the E474 is there when a second char is added "bi". "\" and "\b" are acceptable, but "\bi" is not. '"bit"' (w/o outer single quotes) works, but the double quotes are part of the ab. Like I said, "Aaarrgghh!" +1

    – Ewan Todd
    Nov 5 '09 at 1:45











  • if you stick this in an answer @Ewan I can vote this up, and it will be easier to see the quotes. This is interesting stuff...

    – Peter
    Nov 5 '09 at 6:45













9












9








9


4






I want to be able to write bit and have it expand to something in vim. How do I encode a backslash in the left-hand side of an abbreviation, though?



I tried all of these:



:iab bit replacement_text
:iab <Bslash>bit replacement_text
:iab <bs>bit replacement_text


but got E474: Invalid argument for all of these.



The map_backslash help-topic suggests <Bslash>, but this doesn't seem to work.










share|improve this question














I want to be able to write bit and have it expand to something in vim. How do I encode a backslash in the left-hand side of an abbreviation, though?



I tried all of these:



:iab bit replacement_text
:iab <Bslash>bit replacement_text
:iab <bs>bit replacement_text


but got E474: Invalid argument for all of these.



The map_backslash help-topic suggests <Bslash>, but this doesn't seem to work.







vim






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 5 '09 at 0:17









PeterPeter

83.5k41157196




83.5k41157196












  • Aaarrgghh! It's a cracker. Your <Bslash>, I learned, is a rhs thing. In the lhs, "b" (w/o quotes) works, but the E474 is there when a second char is added "bi". "\" and "\b" are acceptable, but "\bi" is not. '"bit"' (w/o outer single quotes) works, but the double quotes are part of the ab. Like I said, "Aaarrgghh!" +1

    – Ewan Todd
    Nov 5 '09 at 1:45











  • if you stick this in an answer @Ewan I can vote this up, and it will be easier to see the quotes. This is interesting stuff...

    – Peter
    Nov 5 '09 at 6:45

















  • Aaarrgghh! It's a cracker. Your <Bslash>, I learned, is a rhs thing. In the lhs, "b" (w/o quotes) works, but the E474 is there when a second char is added "bi". "\" and "\b" are acceptable, but "\bi" is not. '"bit"' (w/o outer single quotes) works, but the double quotes are part of the ab. Like I said, "Aaarrgghh!" +1

    – Ewan Todd
    Nov 5 '09 at 1:45











  • if you stick this in an answer @Ewan I can vote this up, and it will be easier to see the quotes. This is interesting stuff...

    – Peter
    Nov 5 '09 at 6:45
















Aaarrgghh! It's a cracker. Your <Bslash>, I learned, is a rhs thing. In the lhs, "b" (w/o quotes) works, but the E474 is there when a second char is added "bi". "\" and "\b" are acceptable, but "\bi" is not. '"bit"' (w/o outer single quotes) works, but the double quotes are part of the ab. Like I said, "Aaarrgghh!" +1

– Ewan Todd
Nov 5 '09 at 1:45





Aaarrgghh! It's a cracker. Your <Bslash>, I learned, is a rhs thing. In the lhs, "b" (w/o quotes) works, but the E474 is there when a second char is added "bi". "\" and "\b" are acceptable, but "\bi" is not. '"bit"' (w/o outer single quotes) works, but the double quotes are part of the ab. Like I said, "Aaarrgghh!" +1

– Ewan Todd
Nov 5 '09 at 1:45













if you stick this in an answer @Ewan I can vote this up, and it will be easier to see the quotes. This is interesting stuff...

– Peter
Nov 5 '09 at 6:45





if you stick this in an answer @Ewan I can vote this up, and it will be easier to see the quotes. This is interesting stuff...

– Peter
Nov 5 '09 at 6:45












5 Answers
5






active

oldest

votes


















9





+150









You can define your abbreviation on "bit", and then test if it is preceded by "", if so, return the new text, or "bit" otherwise.



function! s:Expr(default, repl)
if getline('.')[col('.')-2]==''
return "<bs>".a:repl
else
return a:default
endif
endfunction

:inoreab bit <c-r>=<sid>Expr('bit', 'foobar')<cr>


That's the kind of tricks I used in MapNoContext().



EDIT: see :h abbreviations for the reasons why what you asked can't be achieved directly.



EDIT2: It can be easily encapsulated this way:



function! s:DefIab(nore, ...)
let opt = ''
let i = 0
while i != len(a:000)
let arg = a:000[i]
if arg !~? '<buffer>|<silent>'
break
endif
let opt .= ' '.arg
let i += 1
endwhile

if i+2 != len(a:000)
throw "Invalid number of arguments"
endif
let lhs = a:000[i]
let rhs = a:000[i+1]

exe 'i'.a:nore.'ab'.opt.' '.lhs.' <c-r>=<sid>Expr('.string(lhs).', '.string(rhs).')<cr>'
endfunction

command! -nargs=+ InoreabBSlash call s:DefIab('nore', <f-args>)


And used with a simple:



InoreabBSlash <buffer> locbit foobar


or



InoreabBSlash bit foobar





share|improve this answer
































    2














    I suggest using backslash on both sides, vim is happy that way:



    inoreabbr bit replacement_text


    Note that I am using the "nore" version of abbr, better to be clear if you don't intend a recursive expansion. I have been using the below abbreviations for a long time and they work great:



    inoreabbr time <C-R>=strftime("%d-%b-%Y @ %H:%M")<CR>
    inoreabbr date <C-R>=strftime("%d-%b-%Y")<CR>





    share|improve this answer























    • Creative alternative. The trailing backslash turns this into an allowed non-id abbreviation.

      – Ingo Karkat
      Sep 25 '12 at 20:45


















    1














    you could



     inoremap bit replacementtext


    Also if you dont like the lag an alternative leader like backtick ` (above the tab for me)



     :iab `f foobar


    if you are not using them in your code often






    share|improve this answer

























    • This would work, but not exactly the same way. There'd be an annoying pause after every waiting for the rest of it. I don't quite see a way around that though.

      – sykora
      Nov 5 '09 at 0:54











    • yeah, I tried this myself - and didn't like it.

      – Peter
      Nov 5 '09 at 1:04











    • I have this for a couple of imaps (using <cr>= for some function processing) you get over the pause (it forces you just type faster :)

      – michael
      Nov 5 '09 at 2:03


















    0














    You can only use a backslash as a prefix for an abbreviation if it's only got a single character following it, so :iab b replacementtext will work.






    share|improve this answer






























      0














      :set iskeyword+=


      in vimrc_tex (or just vimrc) works perfectly.






      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%2f1677575%2fusing-backslashes-in-vim-abbreviations%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        5 Answers
        5






        active

        oldest

        votes








        5 Answers
        5






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        9





        +150









        You can define your abbreviation on "bit", and then test if it is preceded by "", if so, return the new text, or "bit" otherwise.



        function! s:Expr(default, repl)
        if getline('.')[col('.')-2]==''
        return "<bs>".a:repl
        else
        return a:default
        endif
        endfunction

        :inoreab bit <c-r>=<sid>Expr('bit', 'foobar')<cr>


        That's the kind of tricks I used in MapNoContext().



        EDIT: see :h abbreviations for the reasons why what you asked can't be achieved directly.



        EDIT2: It can be easily encapsulated this way:



        function! s:DefIab(nore, ...)
        let opt = ''
        let i = 0
        while i != len(a:000)
        let arg = a:000[i]
        if arg !~? '<buffer>|<silent>'
        break
        endif
        let opt .= ' '.arg
        let i += 1
        endwhile

        if i+2 != len(a:000)
        throw "Invalid number of arguments"
        endif
        let lhs = a:000[i]
        let rhs = a:000[i+1]

        exe 'i'.a:nore.'ab'.opt.' '.lhs.' <c-r>=<sid>Expr('.string(lhs).', '.string(rhs).')<cr>'
        endfunction

        command! -nargs=+ InoreabBSlash call s:DefIab('nore', <f-args>)


        And used with a simple:



        InoreabBSlash <buffer> locbit foobar


        or



        InoreabBSlash bit foobar





        share|improve this answer





























          9





          +150









          You can define your abbreviation on "bit", and then test if it is preceded by "", if so, return the new text, or "bit" otherwise.



          function! s:Expr(default, repl)
          if getline('.')[col('.')-2]==''
          return "<bs>".a:repl
          else
          return a:default
          endif
          endfunction

          :inoreab bit <c-r>=<sid>Expr('bit', 'foobar')<cr>


          That's the kind of tricks I used in MapNoContext().



          EDIT: see :h abbreviations for the reasons why what you asked can't be achieved directly.



          EDIT2: It can be easily encapsulated this way:



          function! s:DefIab(nore, ...)
          let opt = ''
          let i = 0
          while i != len(a:000)
          let arg = a:000[i]
          if arg !~? '<buffer>|<silent>'
          break
          endif
          let opt .= ' '.arg
          let i += 1
          endwhile

          if i+2 != len(a:000)
          throw "Invalid number of arguments"
          endif
          let lhs = a:000[i]
          let rhs = a:000[i+1]

          exe 'i'.a:nore.'ab'.opt.' '.lhs.' <c-r>=<sid>Expr('.string(lhs).', '.string(rhs).')<cr>'
          endfunction

          command! -nargs=+ InoreabBSlash call s:DefIab('nore', <f-args>)


          And used with a simple:



          InoreabBSlash <buffer> locbit foobar


          or



          InoreabBSlash bit foobar





          share|improve this answer



























            9





            +150







            9





            +150



            9




            +150





            You can define your abbreviation on "bit", and then test if it is preceded by "", if so, return the new text, or "bit" otherwise.



            function! s:Expr(default, repl)
            if getline('.')[col('.')-2]==''
            return "<bs>".a:repl
            else
            return a:default
            endif
            endfunction

            :inoreab bit <c-r>=<sid>Expr('bit', 'foobar')<cr>


            That's the kind of tricks I used in MapNoContext().



            EDIT: see :h abbreviations for the reasons why what you asked can't be achieved directly.



            EDIT2: It can be easily encapsulated this way:



            function! s:DefIab(nore, ...)
            let opt = ''
            let i = 0
            while i != len(a:000)
            let arg = a:000[i]
            if arg !~? '<buffer>|<silent>'
            break
            endif
            let opt .= ' '.arg
            let i += 1
            endwhile

            if i+2 != len(a:000)
            throw "Invalid number of arguments"
            endif
            let lhs = a:000[i]
            let rhs = a:000[i+1]

            exe 'i'.a:nore.'ab'.opt.' '.lhs.' <c-r>=<sid>Expr('.string(lhs).', '.string(rhs).')<cr>'
            endfunction

            command! -nargs=+ InoreabBSlash call s:DefIab('nore', <f-args>)


            And used with a simple:



            InoreabBSlash <buffer> locbit foobar


            or



            InoreabBSlash bit foobar





            share|improve this answer















            You can define your abbreviation on "bit", and then test if it is preceded by "", if so, return the new text, or "bit" otherwise.



            function! s:Expr(default, repl)
            if getline('.')[col('.')-2]==''
            return "<bs>".a:repl
            else
            return a:default
            endif
            endfunction

            :inoreab bit <c-r>=<sid>Expr('bit', 'foobar')<cr>


            That's the kind of tricks I used in MapNoContext().



            EDIT: see :h abbreviations for the reasons why what you asked can't be achieved directly.



            EDIT2: It can be easily encapsulated this way:



            function! s:DefIab(nore, ...)
            let opt = ''
            let i = 0
            while i != len(a:000)
            let arg = a:000[i]
            if arg !~? '<buffer>|<silent>'
            break
            endif
            let opt .= ' '.arg
            let i += 1
            endwhile

            if i+2 != len(a:000)
            throw "Invalid number of arguments"
            endif
            let lhs = a:000[i]
            let rhs = a:000[i+1]

            exe 'i'.a:nore.'ab'.opt.' '.lhs.' <c-r>=<sid>Expr('.string(lhs).', '.string(rhs).')<cr>'
            endfunction

            command! -nargs=+ InoreabBSlash call s:DefIab('nore', <f-args>)


            And used with a simple:



            InoreabBSlash <buffer> locbit foobar


            or



            InoreabBSlash bit foobar






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 14 '09 at 0:07

























            answered Nov 5 '09 at 14:13









            Luc HermitteLuc Hermitte

            25.9k44963




            25.9k44963























                2














                I suggest using backslash on both sides, vim is happy that way:



                inoreabbr bit replacement_text


                Note that I am using the "nore" version of abbr, better to be clear if you don't intend a recursive expansion. I have been using the below abbreviations for a long time and they work great:



                inoreabbr time <C-R>=strftime("%d-%b-%Y @ %H:%M")<CR>
                inoreabbr date <C-R>=strftime("%d-%b-%Y")<CR>





                share|improve this answer























                • Creative alternative. The trailing backslash turns this into an allowed non-id abbreviation.

                  – Ingo Karkat
                  Sep 25 '12 at 20:45















                2














                I suggest using backslash on both sides, vim is happy that way:



                inoreabbr bit replacement_text


                Note that I am using the "nore" version of abbr, better to be clear if you don't intend a recursive expansion. I have been using the below abbreviations for a long time and they work great:



                inoreabbr time <C-R>=strftime("%d-%b-%Y @ %H:%M")<CR>
                inoreabbr date <C-R>=strftime("%d-%b-%Y")<CR>





                share|improve this answer























                • Creative alternative. The trailing backslash turns this into an allowed non-id abbreviation.

                  – Ingo Karkat
                  Sep 25 '12 at 20:45













                2












                2








                2







                I suggest using backslash on both sides, vim is happy that way:



                inoreabbr bit replacement_text


                Note that I am using the "nore" version of abbr, better to be clear if you don't intend a recursive expansion. I have been using the below abbreviations for a long time and they work great:



                inoreabbr time <C-R>=strftime("%d-%b-%Y @ %H:%M")<CR>
                inoreabbr date <C-R>=strftime("%d-%b-%Y")<CR>





                share|improve this answer













                I suggest using backslash on both sides, vim is happy that way:



                inoreabbr bit replacement_text


                Note that I am using the "nore" version of abbr, better to be clear if you don't intend a recursive expansion. I have been using the below abbreviations for a long time and they work great:



                inoreabbr time <C-R>=strftime("%d-%b-%Y @ %H:%M")<CR>
                inoreabbr date <C-R>=strftime("%d-%b-%Y")<CR>






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 13 '09 at 20:33









                haridsvharidsv

                4,12834142




                4,12834142












                • Creative alternative. The trailing backslash turns this into an allowed non-id abbreviation.

                  – Ingo Karkat
                  Sep 25 '12 at 20:45

















                • Creative alternative. The trailing backslash turns this into an allowed non-id abbreviation.

                  – Ingo Karkat
                  Sep 25 '12 at 20:45
















                Creative alternative. The trailing backslash turns this into an allowed non-id abbreviation.

                – Ingo Karkat
                Sep 25 '12 at 20:45





                Creative alternative. The trailing backslash turns this into an allowed non-id abbreviation.

                – Ingo Karkat
                Sep 25 '12 at 20:45











                1














                you could



                 inoremap bit replacementtext


                Also if you dont like the lag an alternative leader like backtick ` (above the tab for me)



                 :iab `f foobar


                if you are not using them in your code often






                share|improve this answer

























                • This would work, but not exactly the same way. There'd be an annoying pause after every waiting for the rest of it. I don't quite see a way around that though.

                  – sykora
                  Nov 5 '09 at 0:54











                • yeah, I tried this myself - and didn't like it.

                  – Peter
                  Nov 5 '09 at 1:04











                • I have this for a couple of imaps (using <cr>= for some function processing) you get over the pause (it forces you just type faster :)

                  – michael
                  Nov 5 '09 at 2:03















                1














                you could



                 inoremap bit replacementtext


                Also if you dont like the lag an alternative leader like backtick ` (above the tab for me)



                 :iab `f foobar


                if you are not using them in your code often






                share|improve this answer

























                • This would work, but not exactly the same way. There'd be an annoying pause after every waiting for the rest of it. I don't quite see a way around that though.

                  – sykora
                  Nov 5 '09 at 0:54











                • yeah, I tried this myself - and didn't like it.

                  – Peter
                  Nov 5 '09 at 1:04











                • I have this for a couple of imaps (using <cr>= for some function processing) you get over the pause (it forces you just type faster :)

                  – michael
                  Nov 5 '09 at 2:03













                1












                1








                1







                you could



                 inoremap bit replacementtext


                Also if you dont like the lag an alternative leader like backtick ` (above the tab for me)



                 :iab `f foobar


                if you are not using them in your code often






                share|improve this answer















                you could



                 inoremap bit replacementtext


                Also if you dont like the lag an alternative leader like backtick ` (above the tab for me)



                 :iab `f foobar


                if you are not using them in your code often







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 5 '09 at 2:22

























                answered Nov 5 '09 at 0:51









                michaelmichael

                9,92322225




                9,92322225












                • This would work, but not exactly the same way. There'd be an annoying pause after every waiting for the rest of it. I don't quite see a way around that though.

                  – sykora
                  Nov 5 '09 at 0:54











                • yeah, I tried this myself - and didn't like it.

                  – Peter
                  Nov 5 '09 at 1:04











                • I have this for a couple of imaps (using <cr>= for some function processing) you get over the pause (it forces you just type faster :)

                  – michael
                  Nov 5 '09 at 2:03

















                • This would work, but not exactly the same way. There'd be an annoying pause after every waiting for the rest of it. I don't quite see a way around that though.

                  – sykora
                  Nov 5 '09 at 0:54











                • yeah, I tried this myself - and didn't like it.

                  – Peter
                  Nov 5 '09 at 1:04











                • I have this for a couple of imaps (using <cr>= for some function processing) you get over the pause (it forces you just type faster :)

                  – michael
                  Nov 5 '09 at 2:03
















                This would work, but not exactly the same way. There'd be an annoying pause after every waiting for the rest of it. I don't quite see a way around that though.

                – sykora
                Nov 5 '09 at 0:54





                This would work, but not exactly the same way. There'd be an annoying pause after every waiting for the rest of it. I don't quite see a way around that though.

                – sykora
                Nov 5 '09 at 0:54













                yeah, I tried this myself - and didn't like it.

                – Peter
                Nov 5 '09 at 1:04





                yeah, I tried this myself - and didn't like it.

                – Peter
                Nov 5 '09 at 1:04













                I have this for a couple of imaps (using <cr>= for some function processing) you get over the pause (it forces you just type faster :)

                – michael
                Nov 5 '09 at 2:03





                I have this for a couple of imaps (using <cr>= for some function processing) you get over the pause (it forces you just type faster :)

                – michael
                Nov 5 '09 at 2:03











                0














                You can only use a backslash as a prefix for an abbreviation if it's only got a single character following it, so :iab b replacementtext will work.






                share|improve this answer



























                  0














                  You can only use a backslash as a prefix for an abbreviation if it's only got a single character following it, so :iab b replacementtext will work.






                  share|improve this answer

























                    0












                    0








                    0







                    You can only use a backslash as a prefix for an abbreviation if it's only got a single character following it, so :iab b replacementtext will work.






                    share|improve this answer













                    You can only use a backslash as a prefix for an abbreviation if it's only got a single character following it, so :iab b replacementtext will work.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 13 '09 at 12:51









                    Andrew AylettAndrew Aylett

                    31.3k45890




                    31.3k45890





















                        0














                        :set iskeyword+=


                        in vimrc_tex (or just vimrc) works perfectly.






                        share|improve this answer





























                          0














                          :set iskeyword+=


                          in vimrc_tex (or just vimrc) works perfectly.






                          share|improve this answer



























                            0












                            0








                            0







                            :set iskeyword+=


                            in vimrc_tex (or just vimrc) works perfectly.






                            share|improve this answer















                            :set iskeyword+=


                            in vimrc_tex (or just vimrc) works perfectly.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Mar 26 '18 at 15:00









                            Sterling Archer

                            16.1k116090




                            16.1k116090










                            answered Mar 26 '18 at 14:55









                            AlanRobertClarkAlanRobertClark

                            1




                            1



























                                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.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f1677575%2fusing-backslashes-in-vim-abbreviations%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

                                Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

                                2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

                                Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme