Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- syntax on
- set incsearch
- set number
- set nobackup
- set smartindent
- set nowrap
- set mouse=a
- set shiftwidth=4
- set ruler " bottom-left showing current row col position
- filetype indent on
- "set line number colors
- hi CursorLineNr cterm=bold ctermfg=Green ctermbg=NONE
- " underline cursor line and mark line color green
- hi LineNr cterm=bold ctermfg=DarkGrey ctermbg=NONE
- "mapping rules
- " when enter '{', vim will generate {\n}\n, 'k' curosr goes up, 'o' auto insert newline
- inoremap {<CR> {<CR>}<Esc>ko
- " 'i' means enter insert mode
- inoremap ( ()<Esc>i
- " "", '' and <> >mapping
- inoremap " ""<Esc>i
- inoremap ' ''<Esc>i
- inoremap < <><Esc>i
- " Color configuration
- set bg=dark
- color evening " Same as :colorscheme eveni:
- " ggVG to ctrl-a in vim, gg goes to the top of a file, V goes to visual mode, G goes to end of file
- " auto run python with f9
- autocmd FileType python map <buffer> <F9> :w<CR>:exec '!python3' shellescape(@%, 1)<CR>
- autocmd FileType python imap <buffer> <F9> <esc>:w<CR>:exec '!python3' shellescape(@%, 1)<CR>
- " auto gcc/g++ and execute f5 (not working)
- " autocmd FileType c map <buffer> <F5> :w<CR>:exec '!gcc' shellescape(@%, 1) '-o' shellescape(@%, 1:r) && './'.shellescape(@%, 1:r)<CR>
- " autocmd FileType c++ map <buffer> <F5> :w<CR>:exec '!g++' shellescape(@%, 1) '-o' shellescape(@%, 1:r) && './'.shellescape(@%, 1:r)<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement