Showing posts with label Vim. Show all posts
Showing posts with label Vim. Show all posts

Tuesday, August 11, 2015

Vim - How to remove the ^M Line break?

■ When a script file can not be executed, because of ^M
$ ./startBatchSample.sh 

-bash: ./startBatchSample.sh: /bin/sh^M: bad interpreter: No such file or directory

■■ This is the solution. ■■
■ Change mode into Unix.
:set fileformat=unix


■ Change mode into Dos.(This is extra information.)
:set fileformat=dos

Wednesday, June 3, 2015

Vim - How to turning off indent when pasting text into vim.

■ Sometime, I need to copy and paste text on Vim.
    But It doesn't work like this.
test
   test
      test

■■ This is the solution. ■■

■ Turning off indent
:set paste

■ Do copy

■ Turning on indent
:set nopaste