Personal vim configuration

"/*************************************************************************
"    > File Name: .vimrc
"    > Author: LyuCheng
"    > Created Time: 2018-01-14 14:39
"    > Description: 
" ************************************************************************/

syntax on
" Detect 
filetype filetype on
 " Use different indentation formats for different file types 
filetype indent on
 " Allow plugin 
filetype plugin on
 " Enable autocompletion 
filetype plugin indent on

" theme 
set background= light
let g:solarized_termcolors=256
colorscheme solarized

" powerline status bar

set rtp+=/home/lyucheng/.local/lib/python2.7/site-packages/powerline/bindings/vim/
set laststatus=2
set t_Co=256

set nu
set history=1024

set tabstop=4
set shiftwidth=4
set smarttab

set cindent
set nobackup

set noswapfile

set mouse=a

" Plugin {

set rtp + = / home / lyucheng / .vim / bundle / Vundle.vim
call vundle # begin ()

Plugin ' VundleVim / Vundle.vim ' 
Plugin ' scrooloose / nerdtree '

call vundle # end ()
filetype plugin indent on

" }

"NERDTree

map <F4> :NERDTreeMirror<CR>
map <F4> :NERDTreeToggle<CR>

map <F6> :call CR()<CR>

func! CR()

exec "w"
exec "!g++ -std=c++11 % -o %<"
exec "!./%<"
endfunc

" File header 
map <F5> :call AddTitle()<CR>
function AddTitle()
    call setline(1, "/*************************************************************************")
    call append(line("."), "    > File Name: ".expand("%"))
    call append(line(".")+1, "    > Author: LyuCheng")
    call append(line(".")+2, "    > Created Time: ".strftime("%Y-%m-%d %H:%M"))
    call append(line(".")+3, "    > Description: ")
    call append(line(".")+4, " ************************************************************************/")
    call append(line(".")+5, "")
    call append(line(".")+6, "#include <iostream>")
    call append(line(".")+7, "#include <string>")
    call append(line(".")+8, "#include <fstream>")
    call append(line(".")+9, "#include <vector>")
    call append(line(".")+10, "#include <set>")
    call append(line(".")+11, "#include <map>")
    call append(line(".")+12, "#include <algorithm>")
    call append(line(".")+13, "#include <memory>")
    call append(line(".")+14, "")
    call append(line(".")+15, "using namespace std;")
    call append(line(".")+16, "")
    call append(line(".")+17,"int main(int argc, char**argv) {")
    call append(line(".")+18, "")
    call append(line(".")+19, "    return 0;")
    call append(line(".")+20, "}")
    echohl WarningMsg | echo "Successful in adding the copyright." | echohl None
endf
""""""""""""""""""""""""""""""

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324906042&siteId=291194637