'Vim 'n' not working in command mode

I have the line:

public static void main(String args[])

with my cursor at the start. When I hit fc it correctly finds the first c at the end of public. When I press n, I expect it to jump to the second; instead I get the error E486: Pattern not found: alias rc

rc was an alias in my ~.bashrc that expaned to vim ~/.bashrc After experiencing this problem I removed the line (though I can't see why that should be the cause) and restarted bash and vim. But the problem still persists. I checked my vimrc and there is no mention of either alias or rc or any mapping for n.

In any case, here is the vimrc: http://codepaste.net/yz3b1r



Solution 1:[1]

The f command finds a single character. fc finds the next c.

To repeat an f search, type ; (or , to repeat the search in the opposite direction).

The / command finds a regular expression.

To repeat a / search, type n (or N to repeat the search in the opposite direction).

Solution 2:[2]

  1. I guess you have search for "rc" in another vim session.

    If you search for test (/test), and open another file without "test" using vim, you will properly get the following error when you try to search for "test":

    eE486: Pattern not found: test

  2. The fastest way I can think about to go to the second c is 2fc if you don't want to do searching.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Community