Some commands are not working in vim

I am new to Vim. I'm following these tutorials to help me learn to use it.

But some of my commands are not working, for example:

Capital W.
f followed by a character. (To move to next same char.)

Why is this happening and how can I get these commands to work?

2

3 Answers

this may be because by default Ubuntu has a cut down version of vim called vim-tiny and many commands don't work in vim-tiny. To get full functionality you need to install vim. You can install vim with following command

sudo apt-get install vim

Try these commands after installing vim and let me know if you still have problems.

Usually VIM runs in VI compatibility mode by default.

Try switching modes and see if the commands work. Use this to see which mode you are in:

:set compatible?

Then

:set compatible

or

:set nocompatible 

to switch to the other mode and give your commands a try.

Adding

set nocompatible

or

set compatible

to a file called ".vimrc" in your home directory will make the setting the default for vim.

I'm not sure of capital W. I dont know what it is supposed to do, it works just like small w, moving to the next word.

Regarding f followed by a character will move to the character only in the current line. If you want to move to a character else where use / and the character and press enter. ? for reverse. I too got confused with f first.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like