linuxvimeditorcscope

Using VIM in read-only mode as the viewer in cscope


I tried setting the environment variables VIEWER/EDITOR to: '/usr/bin/vim -R', but, I got the error:
Cannot exec vim -R: No such file or directory

Is there a flag in cscope to open up files in read-only mode? Or, can the EDITOR/VIEWER be set to VIM in read-only mode? Thanks in advance!


Solution

  • this is just a problem with whitespace. The easiest solution is to use view which is usually installed with vim. It is the same as vim -R. Other solutions are just creating simple scripts in your path that simply call vim -R. Create a file view.sh with

    #!/bin/sh
    vim -R $@
    

    then chmod +x view.sh and after that you can use this also.

    The final option would be to try 'usr/bin/vim -R' without the quotes.