vim highlight whitespace at end of line and auto delete them

Posted hao.ma

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

 

以上是关于vim highlight whitespace at end of line and auto delete them的主要内容,如果未能解决你的问题,请参考以下文章

oeasy教您玩转vim - 89 - # 高亮细节Highlight

vim的conceal

sublime text 4 vim 插件配置

python中的whitespace

[单选题]php_strip_whitespace 函数返回什么?

xml空格WhiteSpace处理