nus-cs2030 / 2021-s2

2 stars 2 forks source link

How to access .vimrc file #24

Open ryo-wijaya opened 3 years ago

ryo-wijaya commented 3 years ago

Hi, running checkstyle spams me with tabbing errors and stuff and im trying to configure .vimrc to add these things:

image

Already download the file and placed it in home directory. How to access it? It doesn't show up. thanks

Yung-Jer commented 3 years ago

you can try typing this: vim ~/.vimrc to access the file.

ryo-wijaya commented 3 years ago

Hi, ive tried that but got "permission denied".

gableejh commented 3 years ago

Hi KingRyo, perhaps you can try adding a sudo in front, i.e. "sudo ~/.vimrc". After adding in the comments/stuff above that you would like to add into the file, just type "w!" to save the changes made.

JasonDeKhanh commented 3 years ago

Hi, "permission denied" happened because technically you didn't "create" that file by yourself through vim/terminal. What I did was to run the command "chmod 777 [filename]" which will let me use that file as if I created it (can read, write, execute). Not sure if this is the best way but it's what worked for me!

ryo-wijaya commented 3 years ago

Hi, "permission denied" happened because technically you didn't "create" that file by yourself through vim/terminal. What I did was to run the command "chmod 777 [filename]" which will let me use that file as if I created it (can read, write, execute). Not sure if this is the best way but it's what worked for me!

Thanks! This worked for me. After that I ran :e $HOME/.vimrc in the VIM terminal to access the file.

However, running checkstyle on my lab stuff still spams me with tabbing errors even after all the stuff prof put in the .vimrc file regarding tabbing and identation, so apparently my .vimrc isn't working. Does anyone know what might be wrong?

image

Yung-Jer commented 3 years ago

Did you modify your codes using other text editor? If you use vim consistently, there should be no problem. You can try going back to your file and use vim to re-indent the lines that have errors after the style-checking.

ryo-wijaya commented 3 years ago

Did you modify your codes using other text editor? If you use vim consistently, there should be no problem. You can try going back to your file and use vim to re-indent the lines that have errors after the style-checking.

Mb, I just had to reindent my code with gg=G in vim and yay no more spam during checkstyle. Didn't use other text editors but apparently just had to reindent code made before my .vimrc file was installed.

Thanks all for help.