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
 1 set nocompatible              " be iMproved, required
 2 filetype off                  " required
 3 
 4 " set the runtime path to include Vundle and initialize
 5 set rtp+=~/.vim/bundle/Vundle.vim
 6 call vundle#begin()
 7 
 8 " let Vundle manage Vundle, required
 9 Plugin 'gmarik/Vundle.vim'
10 
11 " All of your Plugins must be added before the following line
12 call vundle#end()            " required
13 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

 

转载于:https://www.cnblogs.com/allenhaozi/p/5526546.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值