7
1
Whenever I copy something from another application and then go to paste it into vim, it messes up the indentation.
For example, just now I tried to copy the manifest.json file from the hello-world tutorial for creating chrome extensions.
It looks like this:
{
"manifest_version": 2,
"name": "One-click Kittens",
"description": "This extension demonstrates a browser action with kittens.",
"version": "1.0",
"permissions": [
"https://secure.flickr.com/"
],
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
}
}
but, when I paste it into vim, it looks like this:
My vimrc is as follows:
"se t_Co=256
syntax enable
set nowrap
set mouse=a
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set number
set showcmd
set cursorline
set showmatch
execute pathogen#infect()
"filetype plugin indent on
"folding settings
set foldmethod=indent "fold based on indent
set foldnestmax=10 "deepest fold is 10 levels
set nofoldenable "dont fold by default
set foldlevel=1
set clipboard=unnamed "share one clipboard for everyhting
It has something to do with this line:
execute pathogen#infect() "filetype plugin indent on
If I comment it out, The problem is resolved. However, this is what I use to achieve auto-indent for when I am coding in python. Is there another way to get auto-indent?
How do you paste, with middle mouse button? Read
:help 'paste'
for an explanation and toggle that option before / after pasting, or paste from within Vim (via the register+
, e.g."+p
. – Ingo Karkat – 2015-01-10T17:40:42.477woah, so I have always pasted by right-clicking and choosing paste, but I just tried it with the middle mouse button and it worked as expected. – Luke – 2015-01-10T17:56:15.517
Ah, great! I've expanded my comment into a proper answer; please accept by clicking on the outlined checkmark next to it. – Ingo Karkat – 2015-01-10T19:07:33.437