vim: how to create custom command to indent and then go to next line

StackOverflow https://stackoverflow.com/questions/18995381

  •  29-06-2022
  •  | 
  •  

سؤال

Okay so I want to create a custom command (and place it in my .vimrc file using the :command command, if possible) which basically indents the line which the cursor is on and then moves to the next line. Any idea on how to do this?

هل كانت مفيدة؟

المحلول

Do this:

 :nnoremap Q >>j

This will map Q to do what you want.

You can replace Q with anything.

You can make the above mapping permanent by putting it in your .vimrc (with no : character).

For more info check out :h map

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top