How do I close a single buffer (out of many) in Vim?

A word of caution: “the w in bw does not stand for write but for wipeout!” More from manuals: :bd Unload buffer [N] (default: current buffer) and delete it from the buffer list. If the buffer was changed, this fails, unless when [!] is specified, in which case changes are lost. The file remains unaffected. If you … Read more

What does ^M character mean in Vim?

Unix uses 0xA for a newline character. Windows uses a combination of two characters: 0xD 0xA. 0xD is the carriage return character. ^M happens to be the way vim displays 0xD (0x0D = 13, M is the 13th letter in the English alphabet). You can remove all the ^M characters by running the following: :%s/^M//g … Read more

“Find next” in Vim

It is n for next and N for previous. And if you use reverse search with ? (for example, ?cake) instead of /, it is the other way round. If it is installed on your system, you should try to run vimtutor command from your terminal, which will start a tutorial of the basic Vim … Read more

To switch from vertical split to horizontal split fast in Vim

Vim mailing list says (re-formatted for better readability): To change two vertically split windows to horizonally split Ctrl–w t Ctrl–w K Horizontally to vertically: Ctrl–w t Ctrl–w H Explanations: Ctrl–w t makes the first (topleft) window current Ctrl–w K moves the current window to full-width at the very top Ctrl–w H moves the current window … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)