vim in tmux background color changes when paging

As explained here, disable Background Color Erase (BCE) by clearing the t_ut terminal option (run :set t_ut= in Vim and then press Control+L to refresh the terminal’s display) so that color schemes work properly when Vim is used inside tmux and GNU screen. Per the above link, BCE can be set in .vimrc by adding … Read more

How to write buffer content to stdout?

Since you use Linux/Unix, you might also be interested in trying out moreutils. It provides a command called vipe, which reads from stdin, lets you edit the text in $EDITOR, and then prints the modified text to stdout. So make sure you set your editor to Vim: export EDITOR=vim And then you can try these … Read more

Sort numerically in VI editor [duplicate]

Just use Vim’s own sort function. Visually highlight the text (or use a range) and type: :sort n Documentation is available here: http://vim.wikia.com/wiki/Sort_lines Or in Vim itself: :help sort (Edited to reflect an important point of clarification from dash-tom-bang and the reference to Vim’s own help file.)