Help me brush up my first Vim script.

2012-09-03 Thread Oivvio Polite
I've been using Vim for a couple of years now and I've just written my first Vim script that is bit more ambitious than just cutting and pasting stuff I've found googling. It's a way to use the CLI task manager Taskwarrior (http://taskwarrior.org) from Vim. I've got some basic stuff working the

Renumber all buffers

2010-10-04 Thread Oivvio Polite
I use minibufexpl.vim all the time which gives me a listing of all buffers and their respective numbers on screen all the time. This makes it very convenient to switch to other buffers by their number. But since I'm usually in the same vim session for days on end my buffer numbers tend to get

Re: Renumber all buffers

2010-10-04 Thread Oivvio Polite
On Mon, Oct 04, 2010 at 01:46:12PM -0400, Charles E Campbell Jr wrote: Exit vim. Then edit all the buffers. Vim does not otherwise permit buffer renumbering. Hmm. at first that didn't seem very helpful, but when I realised I could pair it with mksession it actually works rather nicely.

Re: Find mappings for ctrl

2010-09-22 Thread Oivvio Polite
On Tue, Sep 21, 2010 at 11:07:22AM +0200, Asis Hallab wrote: Use: map c-w That gives my No mapping found although all of the window handling stuff is prefixed by ctrl-w as per default. oivvio -- http://pipedreams.polite.se/about/ -- You received this message from the vim_use maillist.

Re: Find mappings for ctrl

2010-09-21 Thread Oivvio Polite
On Tue, Sep 21, 2010 at 12:40:25AM +0400, ZyX wrote: There are no mappings starting with Ctrl, you can have only mappings starting with C-something (C-something sends one character). Mappings starting with either Space and escape can be viewed using `map Space | map Esc' (if you want to

Find mappings for ctrl

2010-09-20 Thread Oivvio Polite
:map S will show all mappings starting with W and :map , will show all mappings starting with , but how do I show all mappings starting with ctrl or space or escape? Oivvio -- http://pipedreams.polite.se/about/ -- You received this message from the vim_use maillist. Do not top-post!

Re: vim equivalent of save-excursion in emacs

2010-09-08 Thread Oivvio Polite
On Wed, Sep 08, 2010 at 09:05:42AM +1000, John Beckett wrote: Of course the par tool can do all sorts of clever things, but if all you want is wrapping and perhaps a little more, the Vim commands are good. To format the current paragraph type: gqip gq is format, ip is inner paragraph.

vim equivalent of save-excursion in emacs

2010-09-07 Thread Oivvio Polite
I came up with this mapping to reformat the current paragraph imap leader. Esc{V}!parCRi when the command is done the cursor will be at the beginning of the paragraph rather than where ever it was when the command was issued. In emacs I solve this with save-excursion. What do I do in vim?

Re: vim equivalent of save-excursion in emacs

2010-09-07 Thread Oivvio Polite
On Tue, Sep 07, 2010 at 11:47:03AM +0200, Oivvio Polite wrote: I came up with this mapping to reformat the current paragraph imap leader. Esc{V}!parCRi when the command is done the cursor will be at the beginning of the paragraph rather than where ever it was when the command

Re: vim equivalent of save-excursion in emacs

2010-09-07 Thread Oivvio Polite
nmap leader. ma{V}!parCR`a imap leader. Escma{V}!parCR`ai oops, that should be: nmap leader. ma{V}:!parCR`a imap leader. Escma{V}:!parCR`ai -- http://pipedreams.polite.se/about/ -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the

Re: Run lgrep then immediately open Location list

2010-08-28 Thread Oivvio Polite
On Sat, Aug 28, 2010 at 12:50:38PM -0700, Britton Kerin wrote: :command! -nargs=+ MyLgrep execute 'silent lgrep! args' | lopen 42 Thank you Britton! This bit of magic works remarkably well. Unfortunatly I've just realized that vimgrep/lgrep don't play well with my newfound love NERDTree.

Run lgrep then immediately open Location list

2010-08-27 Thread Oivvio Polite
I'm moving on from vim basics to the fun stuff. Just found out about vimgrep et. al. I've set grepprg to ack-grep and after executing :lgrep I'd like to go immediately to the Location list buffer, without having to press enter after the results come back from ack-grep and without having to

Insert one word then exit insert mode

2010-08-20 Thread Oivvio Polite
Hi, I'm transitioning to vim after 10+ years of emacs. Is there a way to enter insert mode and automatically leave insert mode after typing a complete word? I realize that this could be accomplished by defining a macro and mapping it to a key but I'd rather learn how to do it the vi-way so that