News for hackers. Stuff that matters.
Re:How to boost your Vim productivity by joelthelion on Tuesday June 02, 2015 @11:46AM (#9646627)
Why don't people seem to use the F keys? I have mappings for very frequent functions on F1-F5, and it really helps:

    map  <F1> <Esc>:w<CR>|      "Fast save
    imap <F1> <Esc>:w<CR>|      "Fast save
    map  <F2> :make<Up><CR>|    "Fast compile
    map  <F3> :bn<CR>
    map  <S-F3> :bp<CR>
    " Same mapping for gnome-terminal ( see     http://stackoverflow.com/q/12813126/164171 )
    map ^[O1;2R :bp<CR>

    map  <F4> :bd<CR>|          "Close buffer

    map  <F5> :cnext<cr>
    map  <S-F5> :cprev<cr>
    imap  <F5> <Esc>:cnext<cr>
    imap  <S-F5> <Esc>:cprev<cr>
Re:How to boost your Vim productivity by leephillips on Tuesday June 02, 2015 @12:32PM (#9647007)
"Why don't people seem to use the F keys?"

Probably because that doesn't fit well with touch typing. A great thing about vim is that you can do everything as a touch typist, without reaching for the outlying districts of the keyboard (assuming you've remapped the escape key to capslock, or learned to use ^[, or mapped it).

Re:How to boost your Vim productivity by pyre on Tuesday June 02, 2015 @02:28PM (#9647936)
Additionally, on many keyboards (specifically Apple keyboards), you have to hit a modifier key plus the function key. For example, you have to hit Fn + F1 to get F1 because otherwise it's the "Lower LCD Brightness" hotkey. This makes them even less useful.
Re:How to boost your Vim productivity by floatboth on Tuesday June 02, 2015 @03:32PM (#9648360)
FYI: there is a setting that flips everything around – F1 to get F1, Fn+F1 to lower the brightness.
Re:How to boost your Vim productivity by Qwertious on Tuesday June 02, 2015 @11:51PM (#9650472)
Not always useful if e.g. you're locked out of the BIOS, the setting constantly auto-resets for no apparent reason, the keyboard is partially broken.

The sad thing is that I've personally experienced all three of these problems. #%^$ whoever decided that the Function keys should be brightness etc by default.

Re:How to boost your Vim productivity by pyre on Tuesday June 02, 2015 @04:20PM (#9648664)
But it's also not the default (at least on OSX).
Re:How to boost your Vim productivity by NeutronBoy on Tuesday June 02, 2015 @10:58PM (#9650296)
'It's not the default' is a terrible argument in a thread specifically about customising vi to the Nth degree ;)
Re:How to boost your Vim productivity by MichaelGG on Tuesday June 02, 2015 @04:48PM (#9648852)
Does Apple not offer Fn Lock? Most keyboards in the last many years seem to be going this way, but it's always easy to switch it off. I certainly press F5 more often than change brightness.
Re:How to boost your Vim productivity by andrewstuart2 on Tuesday June 02, 2015 @11:52AM (#9646680)
One of my favorite bits for saving my own butt: commit more.

    "Function to commit.
    function! GitCommit ()
      execute 'write'
      let message = input('Enter commit message: ')
      execute '!git add ' . bufname('%') . ' && git commit -m ''' . message . ''';'
    endfunction
    
    imap <F7> <Esc>:call GitCommit()<CR>
    map <F7> <Esc>:call GitCommit()<CR>
Re:How to boost your Vim productivity by leephillips on Tuesday June 02, 2015 @12:37PM (#9647042)
Have you tried fugitive (a vim wrapper around git)?
Re:How to boost your Vim productivity by thekemkid on Tuesday June 02, 2015 @12:03PM (#9646752)
OMG, I need to add this to my .vimrc. Thanks :D
Re:How to boost your Vim productivity by mod on Tuesday June 02, 2015 @12:22PM (#9646931)
The only F-key I can hit reliably without looking down is F5, which comes from years of browser use & web development, and a slight gap there on my keyboard.

Perhaps it could be learned, but I haven't learned it yet in ~20 years of typing.

Re:How to boost your Vim productivity by iovar on Tuesday June 02, 2015 @12:04PM (#9646760)
I'd guess, for the same reason I use Ctrl-[ instead of the Esc key. F keys put you out of the home row (at least in full size keyboards).
Re:How to boost your Vim productivity by yawaramin on Wednesday June 03, 2015 @12:00AM (#9650506)
You can remap your Caps Lock key to Esc on pretty much everything: Windows using AutoHotKey, Mac OS using Seil, Unix using xmodmap.
Re:How to boost your Vim productivity by shmerl on Tuesday June 02, 2015 @12:01PM (#9646740)
I map a few of them:

    " Filesystem browser
    map <F2> :Explore<CR>

    " Show whitespace
    set listchars=eol:↵,tab:>·,trail:~,extends:>,precedes:<,space:␣
    map <F4> :set list!<CR>