by joelthelion · 11y ago · 0 comments
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>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).
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.
"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>Perhaps it could be learned, but I haven't learned it yet in ~20 years of typing.
" Filesystem browser
map <F2> :Explore<CR>
" Show whitespace
set listchars=eol:↵,tab:>·,trail:~,extends:>,precedes:<,space:␣
map <F4> :set list!<CR>