解决Cygwin中vim的backspace不能一般使用

解决Cygwin中vim的backspace不能正常使用

今天晚上遇到两个linux问题把我搞死了

1. cygwin vi 不好使了

 

解决方案:
 vim /home/yourhome/.vimrc  然后输入下面一段设置:
//start

set nocompatible
set backspace=indent,eol,start
set ruler
set showcmd
set wildmenu
set fo=cqrt
set laststatus=2
set textwidth=78
set ww=<,>,h,l
set autoindent
" set no error bells
set noeb visualbell
set expandtab
set tabstop=4
set shiftwidth=4
set expandtab
let mapleader = ","
syn on
filetype on
filetype plugin on
filetype indent on

//over
最后:wq

 

 

2. shell老是提示\r错误,原来是windows下面的换行符和Linux不一样,通过cat 文件 -v就可以看到差别。

解决方案:

sed 's/..$//g' srcfile > destfile