enthuguy
asked on
set paste on my session in Linux
Hi Linux Experts,
Currently, when I paste yaml or jason (or any text) in vi editor. It is not aligning well. So every time I have to ": set paste"
Is there a way I can set this on my session pls?
how to set to my current session
how to set this in bash_profile
please advice
Currently, when I paste yaml or jason (or any text) in vi editor. It is not aligning well. So every time I have to ": set paste"
Is there a way I can set this on my session pls?
how to set to my current session
how to set this in bash_profile
please advice
You can set the environment variable EXINIT to do this. Put the following line in your ~/.bashrc, ~/.bash_profile, ~/.profile or wherever
export EXINIT='set paste'
In my .bashrc I have export EXINIT='se showmode number ai' - you might like to include some of these also
No I meant EXINIT. I tried unsetting EXINIT and line numbers in vim stopped.
And when I tried export EXINIT='se showmode number ai paste' I see -- INSERT (paste) -- in the status line. (and ai starts turned off as per vim help)
@noci please post how you came to the conclusion that "EXINIT doesn't work for 'set paste'"
(I tested with the o command)
@noci please post how you came to the conclusion that "EXINIT doesn't work for 'set paste'"
(I tested with the o command)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Interesting - thanks for getting to the bottom of that. Possibly a bug (that EXINIT only works w/out ~/.vimrc); but VIMINIT is clearly the better way to go.
So ... the OP could put
So ... the OP could put
export VIMINIT='set paste'
in ~/.bashrc, ~/.bash_profile, ~/.profile or wherever
ASKER
Thanks a lot noci and Duncan, that VIMINT did the trick for me.
vim --cmd 'set paste'
or
create a ~/.vimrc file containing
Open in new window
And other optional commands