Linux 编译C++ 与 设置 Vim

1. Linux 下编译c++
vim test.cpp    // 创建文件
g++ test.cpp    // 编译文件
./a.out         // 执行文件
g++ test.cpp -o new_file.out   编译C++文件,生成new_file.out文件 ( -o 字母 o)


2 . 设置 vim 
vi ~/.vimrc


set nobackup
set nu
syntax on 

set showcmd 
set showmatch 
set ignorecase 
set smartcase 
set incsearch 
set autowrite 
set hidden 

set tabstop=8 
set softtabstop=4 
set shiftwidth=4 
set expandtab 
set autoindent 
set cindent


Esc ->  shift + q  ->    wq  

设置完后保存退出。

执行 source ~/.vimrc 使配置生效


VIM升级到最新版, sudo apt-get install vim



posted @ 2017-05-23 21:15  yangykaifa  阅读(495)  评论(0编辑  收藏  举报