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

  1. vundlle管理YCM,在.vimrc相应位置加上Plugin 'Valloric/YouCompleteMe'
  2. 打开vim,运行:PluginInstall,安装插件
  3. 进入~/.vim/bundle/YouCompleteMe/,运行./install.py(--clang-completer支持C系列语言补全,需要安装llvm+clang)

可能需要注意:

  1. vim python support
  2. git用来下载YCM的问题
  3. cmake默认编译器的问题(export CC和CXX到高版本的编译器)

最新文章

  1. tomcat用root权限也起不来
  2. jQuery滚动数字
  3. spring.net 配置文件需要注意换行问题
  4. redis缓存
  5. Java虚拟机详解04----GC算法和种类【重要】
  6. SQL Server数据库多种方式查找重复记录
  7. bnuoj 31796 键盘上的蚂蚁(搜索模拟)
  8. 关闭HTC手机充电时屏幕一直亮着绿色电池的办法
  9. PMBok项目管理
  10. 发布支持多线程的PowerShell模块 &mdash;&mdash; MultiThreadTaskRunner
  11. java 基础语法 1
  12. 使用Glide以及OkHttp集成
  13. Django mysql应用
  14. 通过Docker构建TensorFlow Serving
  15. GlusterFS分布式存储系统中更换故障Brick的操作记录1
  16. 创建SpringBoot项目pom.xml文件第一行报错:Non-parseable POM E:\maven\repository\org\springframework\securit
  17. asp相关知识整理
  18. LoRa---数据包结构、跳频
  19. HihoCoder - 1886 :中位数2(贪心)
  20. C# LINQ语句

热门文章

  1. 如何设置才能远程登录Mysql数据库
  2. Generated by NetworkManager、ubuntu DNS设置丢失(network-manager造成的情况)
  3. 20145233《网络对抗》Exp5 MSF基础应用
  4. Nutch2.2.1 爬虫问题列表
  5. ES6——数据结构Set
  6. Python【变量】
  7. system idle process
  8. 《Think in Java》17~18
  9. PHP内核研究 静态变量
  10. MySql数据库,对varchar类型字段str进行where str=0条件查询时,查询结果是什么