Can't use cscope correctly under emacs evil-mode

432 views Asked by At

I have the same issue with the guy, the link is below: http://comments.gmane.org/gmane.emacs.vim-emulation/1404

when I try to use xgtags/xcscope with evil I have the following question: xgtags/xcscope would open a new window with all search results and this window/buffer is in normal mode, but enter wouldn't work to go in to the source code file in the result list. I need to c-z to get to emacs mode to jump to the source file. Would it be possible to let evil go into emacs mode for result buffers of cscope and gtags? or what is your approach regarding to this issue?

But I didn't find any solution on Internet. Is there anyone know how to solve the issue?

Thanks! Jerry

3

There are 3 answers

1
user3090584 On

Ehvince, thanks very much.

But enter wouldn't work to go in to the source code file in the result list.

The following is my config:

4 ;;coscope

5 (require 'xcscope)

6 (setq cscope-do-not-update-database t)

92 ;;evil

93 (add-to-list 'load-path "~/.emacs.d/site-lisp/evil")

94 (require 'evil) 95 (evil-mode 1)

96 (add-hook 'dired-mode-hook (lambda () (evil-emacs-state)))

2
Ehvince On

This is what works to enter evil-emacs-state when entering dired-mode (just replace with the mode used by xgtags):

(add-hook 'dired-mode-hook (lambda () (evil-emacs-state)))

put it in you .emacs or try temporarily with M-x ielm.

0
user3090584 On

Sorry, the issue is solved. Thanks, guys. I forgot to set following: (define-key evil-normal-state-map (kbd "SPC") 'cscope-show-entry-other-window)