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: Where ^M is entered by holding down Ctrl and … Read more

How to copy to clipboard in Vim?

The * register will do this. In Windows, + and * are equivalent. In unix there is a subtle difference between + and *: Under Windows, the * and + registers are equivalent. For X11 systems, though, they differ. For X11 systems, * is the selection, and + is the cut buffer (like clipboard). http://vim.wikia.com/wiki/Accessing_the_system_clipboard * is probably what you want most of the time, so … Read more

How to set default vim colorscheme

Your .vimrc file goes in your $HOME directory. In *nix, cd ~; vim .vimrc. The commands in the .vimrc are the same as you type in ex-mode in vim, only without the leading colon, so colo evening would suffice. Comments in the .vimrc are indicated with a leading double-quote. To see an example vimrc, open $VIMRUNTIME/vimrc_example.vim from within vim

How to make vim paste from (and copy to) system’s clipboard?

The “* and “+ registers are for the system’s clipboard (:help registers). Depending on your system, they may do different things. For instance, on systems that don’t use X11 like OSX or Windows, the “* register is used to read and write to the system clipboard. On X11 systems both registers can be used. See :help x11-selection for more details, but basically the “* is … Read more