Forcing gvim to open all files in one window (using gvim with cscope)

I was wondering if anyone knows how to make gvim, by default, open all files opened by gvim in the same gvim instance. I know there are options that can be sent to him on the command line to force this, but I was wondering if there was anything that could be added to the .gvimrc file, not the command line parameter.

The reason for this is because I use gvim with cscope. Therefore, I install cscope to use gvim as my editor. However, I don't know how or not (perhaps the first) to force cscope to allow me to send parameters to the editor.

A solution to any problem would be sufficient.

Thanks in advance.

+3
source share
2 answers

I don't think you can really do this from your .vimrc or .gvimrc. By the time the file is being read, you have already started a new instance.

If you can tell cscope to use gvim --remoteinstead just gvimas your editor, then you can get the behavior you need.

+7
source

Why don't you use vim cscope integration?

:cscope add /path/to/your/cscope.out
:cscope find s your_symbol

see :help :cscopeand: help quickfix for details.

Here are my mappings:

" F11 and F12 to go to previous/next entry
nnoremap <F11>          :silent! cc<CR>:silent! cp <CR>
nnoremap <F12>          :silent! cc<CR>:silent! cn <CR>

" Shifted: go to previous/next file in entries list
nnoremap <S-F11>        :silent! cc<CR>:silent! cpf<CR>
nnoremap <S-F12>        :silent! cc<CR>:silent! cnf<CR>

" Ctrl-F11/F12 : jump through quickfix lists history
nnoremap <C-F11>        :silent! col <CR>
nnoremap <C-F12>        :silent! cnew<CR>
+2
source

Source: https://habr.com/ru/post/1779483/


All Articles