I have two windows open in tmux
(version 2.3). In first tmux
window I have a SSH session to server1
and in second tmux
window I have a SSH session to server2
. In server1
I opened a shell script with vim script.sh
and selected a part of the script with mouse and paste it to vim
open in server2
with middle mouse button. This caused lot of trailing spaces for each line:
However, when I open script.sh
in server1
with vim -u NONE script.sh
(or with cat script.sh
or less script.sh
) and select the same text area and past it to vim
in server2
, then trailing spaces are not added:
This made me think that something in my .vimrc
causes this behavior. My .vimrc
is following:
set relativenumber
set number
syntax on
set hls
set background=dark
set hidden
set listchars=tab:▸\ ,eol:↲,trail:·
highlight NonText guifg=#054a59
highlight SpecialKey guifg=#4a4a59
set noexpandtab
set shiftwidth=4
set tabstop=4
set softtabstop=4
set colorcolumn=81
filetype on
filetype plugin on
filetype indent on
autocmd FileType cpp setlocal ts=8 sts=8 sw=8 noexpandtab
autocmd FileType * set formatoptions-=c formatoptions-=r formatoptions-=o
autocmd BufNewFile,BufReadPost *.bash set filetype=sh
endif
I tried to turn every possible option off(for example set syntax=
, set hidden!
, set colorcolumn=
, etc), but this did not help.
I know that copying and pasting from terminal screen is not reliable, but is there some clever workaround for this?
vim -u NONE
also takes out plugins. So if it's not in yourvimrc
there could be a plugin causing it.vim
inserver1
withvim --noplugin script.sh
(skips loading plugins, but settings in.vimrc
are loaded), execute:set relativenumber!
and:set number!
and copy tect tovim
inserver2
, then trailing spaces are added.