Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set ar fdm=manual nu ts=2 sw=2 ai rnu
- sy on
- function Run_cpp_from_clipboard()
- !xclip -selection clipboard -o > /home/kevin/Documents/Code/inputf.txt &&
- \clear &&
- \printf " input : \n" &&
- \cat /home/kevin/Documents/Code/inputf.txt &&
- \printf "\n\n output : \n" &&
- \~/run</home/kevin/Documents/Code/inputf.txt
- endfunction
- function Build_cpp()
- !g++ -DKEV -std=c++17 -fsanitize=undefined "%" -o ~/run
- endfunction
- function Init_cpp()
- noremap<leader>l :%d<bar>0r /home/kevin/Documents/Code/template.cpp<CR>:1,16fold<CR>
- set cin
- noremap <F7> :w<bar>call Build_cpp()<CR>
- noremap <F8> :wa<bar>call Run_cpp_from_clipboard()<CR>
- noremap <F9> :!~/run<CR>
- noremap <C-p> I//<ESC>
- endfunction
- function Init_python()
- map <F7> :w<bar>!python '%'<CR>
- map <F8> :w<bar>!python '%' <01.in<CR>
- map <C-p> I#<esc>
- endfunction
- function Init_latex()
- map<F7> :wa<bar>!xelatex main.tex<CR>
- map<F8> :!okular main.pdf & exit<CR>
- map<C-p> I%<ESC>
- endfunction
- function Init_c()
- map<F7> :w<bar>!gcc -std=c11 -fsanitize=undefined "%" -o ~/run<CR>
- endfunction
- au Bufenter *.cpp,*.c call Init_cpp()
- au BufNewFile *.cpp -r ~/Documents/Code/template.cpp
- au Bufenter *.tex call Init_latex()
- au Bufenter *.py call Init_python()
- au Bufenter *.c call Init_c()
- map <leader>p :%d<bar>0pu+<CR>
- map <leader>l :%d<bar>0r ~/t<CR>
- map <leader>b <F7>
- map <leader>r <F8>
- map <leader>i <F9>
- map <leader>c <C-p>
- map <leader>y :%y+<CR>
Add Comment
Please, Sign In to add comment