On Tue, Apr 20, 2010 at 4:31 PM, Gary Johnson <[email protected]> wrote: > On 2010-04-20, stosss wrote: >> On Tue, Apr 20, 2010 at 1:48 PM, Brett Stahlman wrote: >> > On Apr 19, 2:00 am, stosss <[email protected]> wrote: >> >> Again I have read :help visual-mode and :help map as in my other post >> >> about visual-mode I can't figure out how to make it work. >> >> >> >> Will some one enlighten me? >> > >> > Perhaps if you gave an example of what you were trying to >> > accomplish... >> > >> >> As I have declared in the few posts that I have sent to this list, I >> am still knew and learning. Maybe my approach is wrong or not as good >> as another approach. >> >> I figured out how to set up a map to wrap a word or an entire line in >> an HTML tag. Sometimes I want to wrap more than one word but less then >> the whole line. >> >> Although I am reading help I don't always know all the pieces needed >> to accomplish my task. > > As Brett tried to explain, no one can help you if they don't know > the "it" you are trying to make work. If something you are doing is > not working as you expect it to, then show here _exactly_ what you > are doing. That is, show _exactly_ the commands you are executing > or the sequence of keys you are typing. Include the text you are > attempting to edit. Then show or explain _exactly_ the results you > are getting and explain the results you expected to get. > > This may help. > > http://catb.org/~esr/faqs/smart-questions.html > > Even if you are looking for broader knowledge than just the answer > to a particular problem, a particular problem can be the starting > place. It will give people here a better idea of what you do and > do not know and will help them suggest specific areas of the Vim > documentation that you might benefit from reading.
Working with *any* HTML tag, here are some examples: <p> <b> <i> <h2> <br /> <a> I have several maps created. The ones I have created all work as expected. Take the <i> and <b> tags. I am able to use my maps to wrap one word or an entire line. What I don't know how to do, or even where to look, is make a map to wrap more than one word but less then the entire line with an HTML tag. I have created examples below. All the maps that I have created either work with one of the <F[2-9]> or have \ in the first keystroke of the map command. examples: in my ~/.vimrc I have: map #6 i<i><Esc>ea</i><Esc> " wraps one word map #7 i<b><Esc>ea</b><Esc> " wraps one word map \i8 0i<i><Esc>$a</i><Esc>0 " moves cursor to ^ wraps everything from ^ to $ and then moves cursor back to ^ One line of text with a lot of filler to <i>show</i> map results of the first map above. Second line of text with a lot of filler to <b>show</b> map results of the second map above. <i>Third line of text with a lot of filler to show map results of the third map above.</i> Forth <i>line of text</i> with <b>a lot of filler</b> to illustrate desired results. I don't know what to read to learn how to create a map that I can execute and then tell it how many words to wrap with the HTML tag. -- If we can but prevent the government from wasting the labours of the people, under the pretence of taking care of them, they must become happy. - Thomas Jefferson -- 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 Subscription settings: http://groups.google.com/group/vim_use/subscribe?hl=en
