How to autocomplete path in Vim insert mode

Updated post here: https://codeyarns.github.io/tech/2016-10-06-how-to-autocomplete-path-in-vim-insert-mode.html

How to get autocomplete in GoClipse

Problem

I installed the Go compiler and set the GOROOT and GOPATH environment variables correctly. To work with Go files, I installed the GoClipse plugin in Eclipse. When I tried to make Goclipse autocomplete my code, I got this error:

Cannot run program "gocode": error=2, No such file or directory

Solution

The Go compiler is not typically used for autocompletion. There is a separate gocode tool that is used for this purpose. So, to get autocompletion we need to install this by using this command:

$ go get -u github.com/nsf/gocode

I found that this installed the gocode binary in $GOPATH/bin. I opened Window -> Preferences -> Go -> Tools and set this path for gocode. Autocompletion started working immediately after this! 🙂

Tried with: GoClipse 0.14.1, Eclipse 4.5.2 and Go 1.6.2

How to get autocomplete for command options in Fish

Fish has support to autocomplete the options of any command at the shell. (This is sometimes called tab completions.) For example, when I type ls - and TAB, Fish shows me the options available for the ls command. This works even when you’ve typed out part of an option. Fish generates this information by parsing all the man pages installed on your system.

If you find that Fish autocomplete is not working for the options of a command, that can be fixed easily by asking Fish to reindex from man pages. The Fish function that you need to run for this is: fish_update_completions.

I recently installed Git. Since Git is infamous for its myriad command-line options I missed having autocomplete at the shell for Git command options. After running fish_update_completions, I could get autocomplete for options of all Git commands! The icing on top was to discover that Fish could autocomplete options even for my Git aliases!

Tried with: Fish 2.2.0