Kopieren und Einfügen mit vi-Duplikat-Kommentarzeilen

288
user1032531

Auf einem Windows-PC kopiere ich Folgendes in die QuickInfo.

var http = require("http");  http.createServer(function (request, response) {  // Send the HTTP header  // HTTP Status: 200 : OK // Content Type: text/plain response.writeHead(200, {'Content-Type': 'text/plain'});  // Send the response body as "Hello World" response.end('Hello World\n'); }).listen(8081);  // Console will print the message console.log('Server running at http://127.0.0.1:8081/'); 

Mit puTTY öffne ich vi auf einer Linux-Box, drücke "i" zum Einfügen und klicke mit der rechten Maustaste, wie immer. Aber dieses Mal bekomme ich:

var http = require("http");  http.createServer(function (request, response) {  // Send the HTTP header // // HTTP Status: 200 : OK // // Content Type: text/plain // response.writeHead(200, {'Content-Type': 'text/plain'}); // // // Send the response body as "Hello World" // response.end('Hello World\n'); // }).listen(8081); // // // Console will print the message // console.log('Server running at http://127.0.0.1:8081/'); // 

Wie Sie sehen, fügt vi automatisch zusätzliche ein //. Was verursacht das und wie verhindere ich es?

0

1 Antwort auf die Frage

3
jinhwanlazy

:set pastevor dem Einfügen Der automatische Einzug und der automatische Abschluss werden vorübergehend deaktiviert. Und Sie können die Einstellungen mit zurücksetzen:set nopaste

http://vim.wikia.com/wiki/Toggle_auto-indenting_for_code_paste nik vor 7 Jahren 0