Intellij IDEA with ideavim. Cannot copy text from another source

Vim’s yank command doesn’t yank to the system clipboard by default; it yanks to the unnamed register. You can use the * or + register to access the system clipboard; also see this wiki article for more information. Or just set this option in your ~/.ideavimrc: set clipboard+=unnamed This ~/.ideavimrc setting has been supported in … Read more

What exactly does “Stream” and “Buffer” mean in Java I/O?

Java has two kinds of classes for input and output (I/O): streams and readers/writers. Streams (InputStream, OutputStream and everything that extends these) are for reading and writing binary data from files, the network, or whatever other device. Readers and writers are for reading and writing text (characters). They are a layer on top of streams, … Read more

How to clear input buffer in C?

The program will not work properly because at Line 1, when the user presses Enter, it will leave in the input buffer 2 character: Enter key (ASCII code 13) and \n (ASCII code 10). Therefore, at Line 2, it will read the \n and will not wait for the user to enter a character. The … Read more

Replace word with contents of paste buffer?

I’m thinking by “paste” you mean the unnamed (yank/put/change/delete/substitute) register, right? (Since that’s the one that’d get overwritten by the change command.) Registers are generally specified by typing ” then the name (single character) of the register, like “ay then “ap to yank into register a, then put the contents of register a. Same goes … Read more

Diff two tabs in Vim

I suggest opening the second file in the same tab instead of a new one. Here’s what I usually do: :edit file1 :diffthis :vnew :edit file2 :diffthis The :vnew command splits the current view vertically so you can open the second file there. The :diffthis (or short: :difft) command is then applied to each view.

Refresh all files in buffer from disk in vim

The :checkt[ime] command is designed for this very purpose. It will prompt you to reload any buffers that have changed; if you wish to skip the prompt, you can do :set autoread beforehand (you’ll still get a prompt on buffers with local unsaved changes). It also avoids the syntax highlighting issue mentioned by Steven Lu … Read more