How to copy and paste inside Vim using mouse

Sometimes copy and paste inside Vim using mouse over remote connection does not work as expected.

Categories
SysOps

How to integrate lightline status line plugin for Vim with Solarized theme

I am using the lightline status line with the Solarized color scheme inside Vim text editor.

Categories
Uncategorized

How to use sudo from within Vim to save file

It is very annoying to see message “E212: Can’t open file for writing” when trying to save file.

Hopefully there is a simple solution (a bit longer but without “W12 Warning“):

:execute ':w !sudo tee % > /dev/null' | :edit!

Look at commandlinefu.com for more solutions like :W command below:

:command W :execute ':silent w !sudo tee % > /dev/null' | :edit!