手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Vim之基础配置简述

[日期:2017-03-08] 来源:Linux社区  作者:Star_Sky [字体: ]

Vim之基础配置

安装方式

sudo apt-get install vim

无插件配置(简单配置)

.vimrc文件

""""""""""""""""""""""""""""""""
"Interface
""""""""""""""""""""""""""""""""
set nu      "show line number
syntax enable   "syntax highlight  
syntax on

""""""""""""""""""""""""""""""""
"Key command
""""""""""""""""""""""""""""""""    
set tabstop=4   "set Tab = 4
set softtabstop=4       "indent= 4
set shiftwidth=4 

""""""""""""""""""""""""""""""""
"Compile
""""""""""""""""""""""""""""""""
map <F5> :call CompileRunGcc()<CR>
func! CompileRunGcc()
    exec "w"
    if &filetype == 'c'
        exec "!g++ % -o %<"
    exec "! ./%<"
    elseif &filetype == 'cpp'
        exec "!g++ % -o %<"
        exec "! ./%<"
    elseif &filetype == 'java' 
        exec "!javac %" 
        exec "!java %<"
    elseif &filetype == 'sh'
        :!./%
    endif
endfunc

"""""""""""""""""""""""""""""""""
"Debug
"""""""""""""""""""""""""""""""""   
map <F8> :call Rungdb()<CR>
func! Rungdb()
    exec "w"
    exec "!g++ % -g -o %<"
    exec "!gdb ./%<"
endfunc

""""""""""""""""""""""""""""""""""
"Others
""""""""""""""""""""""""""""""""""
filetype plugin indent on
set autowrite               
set ruler           
set cursorline              
set magic                   
set guioptions-=T           
set guioptions-=m           
set autoindent
set cindent
set mouse=a  " always use mouse 

我的界面

Vim入门基础知识集锦  http://www.linuxidc.com/Linux/2017-02/140903.htm

Vim入门基础教程 http://www.linuxidc.com/Linux/2017-02/140279.htm

把Vim打造成优秀的C++ IDE  http://www.linuxidc.com/Linux/2016-06/132262.htm

Ubuntu 14.04升级Vim7.4到8.0  http://www.linuxidc.com/Linux/2016-11/136816.htm

Vim安装youcompleteme自动补全插件  http://www.linuxidc.com/Linux/2016-11/137665.htm

Linux Vim编辑器使用简单讲解  http://www.linuxidc.com/Linux/2016-12/138930.htm

Ubuntu 16.04 Vim YouCompleteMe自动补全的安装配置与使用  http://www.linuxidc.com/Linux/2017-02/141088.htm

本文永久更新链接地址http://www.linuxidc.com/Linux/2017-03/141527.htm

linux
相关资讯       Vim配置 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款