Monday, February 23, 2015

Re: Combine . with @:

On Mon, Feb 23, 2015 at 06:46:07PM -0600, Tim Chase wrote:
> On 2015-02-23 15:47, Paolo Bolzoni wrote:
> > It is possible to change the meaning of . so it repeats the last
> > command, whatever it was a normal command or a ex command? I find
> > confusing that I can type dw..., but not :cNext<cr>..

> As others have mentioned, there's no way to expand the behavior of
> the "." command to include things other than normal-mode changes. But
> as you've found, using "@:" re-executes the last Ex command. However,
> since it's a macro, subsequent executions can be performed with "@@"
> which I find MUCH easier to type. And, as you detail, I do it
> frequently with ":cn"ext to browse the quick-fix results. On rare
> occasions where I'm doing a lot of them, I'll do a temporary
> (non-.vimrc) mapping, something like

> :nnoremap <space> :cn<cr>

> which lets me just hit the space-bar to jump to the next result.

I found a leader command useful:

let mapleader = ','
nnoremap <Leader>hhh :call HelpgrepScrollers()<CR>
function! HelpgrepScrollers()
silent! nmap <F6> :cnext<CR>
silent! nmap <S-F6> :cprev<CR>
echo 'helpgrep scrollers :cn and :cp mapped to F6 and S-F6'
endfunction


--
_|_ _ __|_|_ ._ o|
|_(_)(_)|_| ||_)||<
|

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment