vim highlight whitespace at end of line and auto delete them

install Vundle.vim

  1. mkdir ~/.vim/bundle
  2. git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
  3. create .vimrc if it not exist. add the following setting into .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() " let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim' " All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required

install vim-better-whitespace git:https://github.com/ntpeters/vim-better-whitespace

add : Plugin 'ntpeters/vim-better-whitespace' to .vimrc between vundle#begin() and vundle#end()

Plugin 'ntpeters/vim-better-whitespace'

then rum vim : :PluginInstall

if you want to auto delete whitespace if can add the following cmd into your .vimrc

autocmd BufWritePre * StripWhitespace
上一篇:Elasticsearch教程(八) elasticsearch delete 删除数据(Java)


下一篇:sql server I/O硬盘交互