au FileType vimshell imap (neosnippet_expand_or_jump) au FileType text nnoremap w :w! let s:creg = has('unix') ? "+" : "*" function! s:copyall() let @+ = join(getbufline(bufnr('%'), 1, '$'), "\n") endfunction nnoremap c :call copyall() exe 'nnoremap v ggVGs"' .. s:creg .. 'P:w!' nmap t ggVGstemp " f#{a} で :e #{a}.cpp for i in range(char2nr("a"), char2nr("z")) execute \"nnoremap f" .. nr2char(i) .. " " .. \":e " .. nr2char(i) .. ".cpp\" endfor function! s:cp_cpp() " " clipboard を "%:r" .. _in#{i} に F#{i} キーで保存 for i in range(1, 9) let l:file_expand = '" .. expand("%:r") .. "_in' .. i execute \"nnoremap ":e ' .. l:file_expand .. '' .. \'ggVG\"' .. s:creg .. 'P:w!2' .. \':bd ' .. l:file_expand .. '' . \':echo \"ready, ' .. l:file_expand .. '\""' endfor " e " "%:r" .. _in#{i} を開く for i in range(1, 9) let l:file_expand = '" .. expand("%:r") .. "_in' .. i execute \"nnoremap e" .. i .. \' ":e ' .. l:file_expand .. '"' endfor " #{i} で "%:r" .. _in#{i} を input として % を実行 for i in range(1, 9) execute \'nnoremap ' .. i .. \' ":ccl\|QuickRun -input " .. expand("%:r") .. "_in' .. i .. \'\"' endfor endfunction augroup my_cpp au! autocmd Filetype cpp call cp_cpp() augroup END