[JAVA] Questions when Vimmer writes programming (brackets)

About this article

I wrote this for beginners who are new to vim for less than a month to ask questions about vim and share information with beginners and seniors like me.

at first

--Vim has normal mode and insert mode. --In normal mode, you can move the cursor with "hjkl". --You can enter characters in insert mode. You can move the cursor at this time with the cursor keys. (It is better not to use it if possible.)

Question

-What is the general procedure for writing parentheses such as {}, (), "", []?

Example

Suppose you want to write a function like function (10, value) ;. Suppose the cursor is at'@'.

  1. function(@
  2. function();@
  3. function(@);
  4. fucntion(10, value@);
  5. function(10, value);@

I'm sure there are people who say, "Why don't you write the return parentheses later!", But I personally want to avoid forgetting to put the parentheses, so I'd like to write in this way. (You can highlight parentheses and jump.)

Suggestion

As a result of research and thinking for myself, I found the following method. --Return to normal mode and move --Use the arrow keys in insert mode --Ctrl-o allows one-time normal mode --Write in .vimrc (Registration of move command in insert mode)

Now I am moving with the arrow keys.

Finally

It is selfish, but please provide information.

Recommended Posts

Questions when Vimmer writes programming (brackets)
What is object-oriented programming? ~ Beginners ~
Recommended learning method for programming beginners
Questions when Vimmer writes programming (brackets)