On Thu, May 21, 2009 at 3:32 AM, [email protected] <[email protected]> wrote: > > On May 18, 7:53 pm, Run Paint Run Run <[email protected]> wrote: >> Hi, >> >> I'm writing a "cookbook" for Vim athttp://vim.runpaint.org/. It's >> released under a Creative Commons license in PDF and HTML. >> >> If anybody has suggestions or comments, I'd love to hear them. :-) >> > > Is that an invitation to share some tips? :-)
By all means. :-) > " 1) better motion > nnoremap <c-k> <c-y><c-y><c-y> > nnoremap <c-j> <c-e><c-e><c-e> > > For some reason I don't care for the full screen or half screen > scrolling commands, I find them disorientating, and the one line > scrolling is just too slow. But setting up the above suits me just > perfectly, maybe because it moves the same amount as the turn of the > mousewheel. The idea behind writing out the motion 3 times instead of > using a repeat was that it would actually be a more gradual scroll > instead of a jerky motion. I have know idea if thats just nonsense > though. That's an interesting solution. Maybe as a tip in the Navigating the Viewport recipe? > " 2) search for last deleted/changed/yanked word > nnoremap gs /<c-r>"<cr> > > I don't really tend to think ahead, and quite often I'll change or > delete a word, or part of a word in my code, and then realise I need > to change it for the other occurrences as well. This combo will > automatically search for the next occurrence of the text you changed, > and you can just press . to repeat the change, and then n to move onto > the next. Thanks for the justification; that's really helpful. I'm not sure whether this is general enough. Again, maybe a tip on one of the searching recipes? > " More controversial: make vim more consistent > nnoremap Y y$ > nnoremap vv V > nnoremap V v$ > > The yank and visual commands now act more like the change and delete > commands, but some might not like it, as it changes the traditional > behaviour of the editor. I'm loath to suggest remapping defaults because I fear it would likely lead to confusion. Plus, it pushes a dialect of Vim, which isn't portable to other systems and applications that offer Vi-ish keybindings. > " One for linux console enthusiasts > if &term == "linux" || &term == "screen.linux" > set t_ve=^[[?25h^[[?17;16;64c > endif > > If you like to work within the linux console/framebuffer, depending on > your system you might be stuck with an blinky underline or something. > This changes it to a solid green block. You can change the colour, and > other parameters by messing around with the numbers (I can't remember > what corresponds to what) I can see the value in a recipe for the console/framebuffer that focuses on tweaks like this. I'll have to do some research as to what other issues such an environment raises. (It's quite some time since I've used Vim in a framebuffer for anything substantial). > " something a bit more radical > imap jk <esc> > imap kh <esc> > > One of the principles of vim is keeping your fingers on the home > keys. Another principle of vim is pressing escape a whole lot. These > two don't always work well together. Above is my current preferred > solution. I've seen many others. ctrl-[ works by default, as does > ctrl-l I think (though I've remapped mine). You could also remap > something like ctrl-space, or even remap your caps lock key to escape > (I have mine remapped to ctrl). But I've decided I don't like pressing > ctrl more than I have to, so prefer to escape with the above two > rarely occurring key combinations. One of the downsides though is > that when you do enter either a j or a k, the screen will appear to > hang as it waits for another key, you don't actually have to wait or > anything (another keypress will cancel the wait) but it can be a > little distracting. To fix this I also use the following: > > autocmd InsertEnter * set timeoutlen=160 > autocmd InsertLeave * set timeoutlen=3000 > > The important one is the first as it determines how much time you have > to enter the keypress combination to exit insert mode. You may want > to make it faster or slower according to your own preference. See my above comment about remapping defaults. :-) -- Run Paint Run Run <http://vim.runpaint.org/> / <http://twitter.com/runpaint> --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
