Paste clipboard is bash or shell scripts with modification.

Today I had a issue where I wanted to paste the clipboard to a shell script after removing the spaces. So, I went hunting for a way to do this. Finally I came up with this:

sudo yum install xclip

Then you can paste the clipboard content using \”xclip -o\”. So now the problem is reduced to selecting the required info and doing :

xclip -o |sed \’s/ //g\’

or

xclip -o|tr -d \’ \’

stop indentation on current file in vim to keep the indentation from copied text.

I have been looking for this for quite some time. Finally found two easy ways to do it:

:setlocal noautoindent
:setlocal nocindent
:setlocal nosmartindent
:setlocal indentexpr=

Just use the above four commands when the file is already open to stop all the indentation/smart indentation/auto indentation in vim for the current file. If you want to map it then you can use shorthand notations and map it in the .vimrc file.

Example:

:map <F1> :setl noai nocin nosi inde=<CR>