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命令不存在可以 ...
随机推荐
- RF和GBDT的区别
Random Forest 采用bagging思想,即利用bootstrap抽样,得到若干个数据集,每个数据集都训练一颗树. 构建决策树时,每次分类节点时,并不是考虑全部特征,而是从特征候选集中选取 ...
- C# JackLib系列之自定义鼠标风格的实现
在我们开发的过程中,有时需要我们来自定义鼠标的形状和大小,刚巧前一阵子正好用到了这个技术,找了好多资料,基本上都是黑白色的鼠标风格实现,而我要的则是自定义大小和彩色风格的光标样式.百度上的资源又太少, ...
- requestAnimationFrame 定时器
这个方法是通过递归调用同一方法来不断更新画面以达到动起来的效果,但它优于setTimeout/setInterval的地方在于它是由浏览器专门为动画提供的API,在运行时浏览器会自动优化方法的调用,并 ...
- 使用shell脚本build并创建ipa文件(转)
前言 由于项目引入了敏捷开发,需要每天build出一个ipa供QA测试.此前是使用Xcode先achive出一个文件,再在 organizer->achives里发布ipa,一直感觉也没啥不方便 ...
- opencv——pcb上寻找mark点(拟合椭圆的方法)
#include "stdafx.h" // FitCircle.cpp : 定义控制台应用程序的入口 #include "cv.h" #include &qu ...
- Win7 家庭普通版开启超级管理员
将以下内容copy保存为admin.reg文件 Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ ...
- ASP.NET MVC 使用过滤器需要注意
想往下继续执行就return~
- nginx uwsgi flask相关配置
一.安装Nginx 在 /home/download下下载压缩包 wget https://nginx.org/download/nginx-1.12.2.tar.gz 解压缩 tar zxvf ng ...
- django drf viewsets和routers
1.定义VIew from django.shortcuts import render from rest_framework.views import APIView from rest_fram ...
- PXE-cobbler 无人值守装机
Cobbler PXE 自动安装系统(CentOS-7.2) 第一步:系统环境准备 1.查看系统版本与内核 2.关闭防火墙 3.关闭selinux 第二步:安装cobbler 与环境相关组件 1.下 ...