nus-cs2030 / 2021-s1

28 stars 48 forks source link

Writing Java Code in Vim #10

Open SkyBlaise99 opened 4 years ago

SkyBlaise99 commented 4 years ago

Can anyone recommend something so that my vim will be like video 4 in LumiNUS? When I typed the code and the suggestion will jump out like when I use eclipse? When I type { and press enter for a new line I will get a } in the following line and my cursor is in between?

while (something) { // cursor is here and I press enter

while (something) {
    // cursor is here
}

Thanks a lot.

yonggqiii commented 4 years ago

Here ya go! https://youtu.be/gnupOrSEikQ

SkyBlaise99 commented 4 years ago

Thanks a lot, will take time to go through the vid

SkyBlaise99 commented 4 years ago

Erm the video don't really show how to install but showed me what to install. So I what I wanted should be coc. I tried to install by following the Quick Start part curl -sL install-node.now.sh/lts | bash. I enter y to install but it jumped out a bunch of errors. Mostly tar: include/node: Cannot mkdir: Permission denied errors. I tried add sudo but still the same error. Screenshot (11)

yonggqiii commented 4 years ago

@SkyBlaise99 just use vim-plug!

SkyBlaise99 commented 4 years ago

It says Install nodejs >= 10.12 before vim plug

SkyBlaise99 commented 4 years ago

Ok apparently it is install nodejs or use vim-plug, i guess its working fine now, installing in progress. Thx.

yonggqiii commented 4 years ago

@SkyBlaise99 Enjoy yourself, don't get too lost in the deep end... focus on the module 😂

SkyBlaise99 commented 4 years ago

Ok apparently it is install nodejs or use vim-plug, i guess its working fine now, installing in progress. Thx. Erm I'm wrong on this. You still need to install nodejs. It is something different from coc, which is installed via vim plug. I see this error telling me nodejs is missing whenever i run vim, and it provided me with a link to download nodejs. I did not do this but instead, run sudo apt install nodejs.

SkyBlaise99 commented 4 years ago

New issue when trying to install extensions. [coc.nvim] Can't find npm or yarn in your $PATH Does this mean I still have to download nodejs by the link and not using apt install nodejs? If so, which version should I download? Windows or Linux.

yonggqiii commented 4 years ago

Yup. If on WSL download Linux

SkyBlaise99 commented 4 years ago

Unsure how to use the link they provided. Instead found an alternative which is to install Node Version Manager and follow this guide. Probably works in WSL 1 although I can't really test.