On Jun 21, 10:53 pm, aleCodd <[email protected]> wrote: > Jeremy Conlin-2 wrote: > > > I have defined an abbreviation as: > > > :iab bi Bible > > > This works fine when I type <space>ib<space> but doesn't work when ib > > is preceded by a parenthesis or any other character. How can I create > > an abbreviation that will work regardless of what precedes it? > > as long as the character before the left-hand-side(lhs) is not a keyword, > there sould NOT be a problem. > please check the output for the following command: > :echo &iskeyword
The result of doing this command seems to change depending on where I am in the file. I get one of two responses: @,48-57,192-255,: or !_~,^*,^|,^",192-255 I don't understand what either of those mean, but maybe it has significance to you. > the other thing you may want to notice is that if the lhs is only one > character (for example: iab q Quran) it will work ONLY after a space or a > tab or -otherwise, when you want still the abbreviation after any character- > you would have to exit insert mode (i.e. <esc>), and then start insert mode > again BEFORE you type the lhs. > see :help :ab. (map.txt, look from line 847). Thanks for pointing me to that part of the help section. After reading, I realized that the problem is not what comes before I enter the abbreviation, but what is already after it. For example, I will often (but not always) open and close a parenthesis, then move inside it to execute my abbreviation. I believe Vim doesn't expand the abbreviation because there is a close parenthesis immediately after the abbreviation. If I close the abbreviation with a <CR> instead of a space, then it works, but I get an extra <CR> which is not wanted either. Any idea how to get around this? Jeremy -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php
