vim安装与配置
vim 8.0
安装
git clone https://github.com/vim/vim.git
sudo apt-get install libncurses5-dev # vim依赖一个ncurses的古老库
./configure --prefix=~/usr/vim-8.0/ --enable-pythoninterp --enable-multibyte --enable-rubyinterp
make
make install
查看当前vim环境
:scriptname 查看加载的配置文件
:verbose map [key_name] 查看key_name按键映射
:verbose set 查看所有set,如set paste
:verbose history 查看历史命令
:function [fun-name] 列出函数
F5运行当前脚本
map <F5> :call CompileRunGcc()<CR>
func! CompileRunGcc()
exec "w"
if &filetype == 'c'
:!if gcc % -o %<; then time ./%<; fi
elseif &filetype == 'cpp'
:!if g++ % -o %<; then time ./%<; fi
elseif &filetype == 'sh'
:!time bash %
elseif &filetype == 'python'
:!time python %
endif
endfunc
Vundle插件管理器
1 下载vundle
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
2 配置.vimrc
set nocompatible " be iMproved, required
filetype off " required " set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim' " Keep Plugin commands between vundle#begin/end.
call vundle#end() " required
filetype plugin indent on " required
vim基本配置
从vim的default.vim中修改的
set nocompatible
set backspace=indent,eol,start "Allow backspacing over everything in insert mode.
set history= " keep 200 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set wildmenu " display completion matches in a status line
set hlsearch " hightlight searched phase
set ttimeout " time out for key codes
set ttimeoutlen= " wait up to 100ms after Esc for special key
set display=truncate " Show @@@ in the last line if it is truncated.
set scrolloff= "Show a few lines of context around the cursor
set incsearch " Do incremental searching when it's possible to timeout.
set mouse=a
set number
set expandtab
set tabstop=
set shiftwidth=
set softtabstop= syntax on " Don't use Ex mode, use Q for formatting. Revert with ":unmap Q".
map Q gq " Only do this part when compiled with support for autocommands.
if has("autocmd") " Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
" Revert with ":filetype off".
filetype plugin indent on " Put these in an autocmd group, so that you can revert them with:
" ":augroup vimStartup | au! | augroup END"
augroup vimStartup
au! " When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") >= && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif augroup END endif " has("autocmd") " Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
" Revert with: ":delcommand DiffOrig".
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
\ | wincmd p | diffthis
endif if has('langmap') && exists('+langremap')
" Prevent that the langmap option applies to characters that result from a
" mapping. If set (default), this may break plugins (but it's backward
" compatible).
set nolangremap
endif
YouCompleteMe
- vundlle管理YCM,在.vimrc相应位置加上Plugin 'Valloric/YouCompleteMe'
- 打开vim,运行:PluginInstall,安装插件
- 进入~/.vim/bundle/YouCompleteMe/,运行./install.py(--clang-completer支持C系列语言补全,需要安装llvm+clang)
可能需要注意:
- vim python support
- git用来下载YCM的问题
- cmake默认编译器的问题(export CC和CXX到高版本的编译器)
vim安装与配置的更多相关文章
- Vim 安装、配置及复制粘贴操作
1.安装:sudo apt-get install vim 2.配置:cd ~ #进入用户主目录 touch .vimrc #.后缀文件不可见 vi .vimrc #打开文件 输入: set cind ...
- Vim 安装和配置、优化
Vim 介绍 Vim 官网:http://www.vim.org/ Vim 安装 CentOS:sudo yum install -y vim Ubuntu:sudo apt-get install ...
- Ubuntu 16.04 Vim安装及配置【转】
转自:http://www.cnblogs.com/ace-wu/p/6273031.html 安装VIM 默认已经安装了VIM-tiny acewu@acewu-computer:~$ locate ...
- Ubuntu 16.04 Vim安装及配置
安装VIM 默认已经安装了VIM-tiny acewu@acewu-computer:~$ locate vi | grep 'vi$' |xargs ls -al lrwxrwxrwx 1 root ...
- CentOS6 下Vim安装和配置
1.系统只安装了vim-minimal,执行以下命令安装另外两个组件 yum install vim-common yum install vim-enhanced 2.安装ctags yum ins ...
- vim 安装
Ubuntu 16.04 下 Vim安装及配置 默认已经安装了VIM-tiny linuxidc@linuxidc:~$ locate vi | grep 'vi$' |xargs ls -al lr ...
- Ubuntu下VIM的安装及其配置——Linux篇
一.Ubuntu系统默认内置: 实际上ubuntu默认没有安装老版本的vi,只装了vim.vi是vim.tiny(vim的最小化版本,不含 GUI,并且仅含有一小部分功能,并且默认与vi兼容.此软件包 ...
- CentOS 7下的Vim自动补齐插件YouCompleteMe安装及配置
备注:现在对于 YouCompleteMe 的安装应采用更为简单的方法,即利用 Vundle 来安装这个插件.具体方法可见: Vundle 主页 YouCompleteMe 主页 而 .vimrc 的 ...
- Vim安装使用和配置
卸载vim sudo apt-get remove --purge vim (--purge 是完全删除,会连配置文件一起删除) 也可以使用yum等其它方式安装 ,如果提示apt-get命令不存在可以 ...
随机推荐
- Demo—cookie电商购物车
说明:cookie的操作须有域名,简单点说就是需要用发布的方式去访问,查看cookie信息请用开发者模式进入application栏 1.页面布局(结构)(根目录) 商品列表 <!doctype ...
- 公众号js-sdk简
后台代码 jssdk.PHP——因sae的不可写环境,故需要将accesstoken和JsApiTicket存入数据库. 数据库字段:id(int 3),accesstoken(string 255) ...
- 白话浅说TCP/UDP面向连接,面向无连接的区别
TCP是面向连接的UDP是面向无连接的就是这种关系了 TCP(Transmission Control Protocol,传输控制协议) UDP(User Datagram Protocol,用户数据 ...
- tomcat 无法clean 的bug
如果你打开类似这种的文件夹了,那恭喜你,你无法正常clean E:\e\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0 请关 ...
- soapUI的bug切换版本解决
目录 文章背景 目录 运行环境及出现的问题 问题解决 说明 参考文章 版本记录 文章背景 为公司编写了一个webservice,本地测试时候是没有问题的,发布到现场之后,访问出现异常,通过切换soap ...
- JavaScript语言精粹 笔记02 函数
函数函数对象函数字面量调用参数返回异常给类型增加方法递归作用域闭包回调模块级联套用记忆 函数 1 函数对象 在JS中函数就是对象.对象是“名/值”对的集合并拥有一个连接到原型对象的隐藏连接.对象字 ...
- [转载]Java集合系列大全总结
Java 集合系列目录(Category) 22:06:49 2019-02-27
- python 批量创建文件
# coding:utf8 import os path = "D:/Python_mkfile" os.chdir(path)#切换到该目录 ysyl = u"验收文件 ...
- 腾讯云/阿里云/微软云安装ISO镜像系统方法
如今云服务的盛行,我们的开发和应用中场景应用也层出不穷,有时我们需要安装自由的镜像却越来越难,甚至有些云出于安全原因自己用户安装自由镜像,那么今天将带给大家安装自有镜像的方法. 前提条件:你的现有服务 ...
- 使用SQL Delta.v5.1.1.98.破解版同步数据结构
概述 本篇文章主要介绍SQL DELTA的简单使用.为了能够更加明了的说明其功能,本文将通过实际项目中的案例加以介绍. 1. SQLDELTA简介 SQLDELTA是一款便捷实用的数据库管理工具.使用 ...