在一个项目中projectile-find-other-file不起作用,不能实现.cc和.h之间的切换。提示 projectile-find-other-file: No other file found 。哪位大神能帮忙看看
配置一下 projectile-other-file-alist
试试,默认配置是:
;;; Interactive commands
(defcustom projectile-other-file-alist
'(;; handle C/C++ extensions
("cpp" . ("h" "hpp" "ipp"))
("ipp" . ("h" "hpp" "cpp"))
("hpp" . ("h" "ipp" "cpp" "cc"))
("cxx" . ("h" "hxx" "ixx"))
("ixx" . ("h" "hxx" "cxx"))
("hxx" . ("h" "ixx" "cxx"))
("c" . ("h"))
("m" . ("h"))
("mm" . ("h"))
("h" . ("c" "cpp" "ipp" "hpp" "cxx" "ixx" "hxx" "m" "mm"))
("cc" . ("hh" "hpp"))
("hh" . ("cc"))
;; vertex shader and fragment shader extensions in glsl
("vert" . ("frag"))
("frag" . ("vert"))
;; handle files with no extension
(nil . ("lock" "gpg"))
("lock" . (""))
("gpg" . (""))
)
"Alist of extensions for switching to file with the same name, using other extensions based on the extension of current file.")
不知道,这个要在哪里配置
SPC :
然后输入 customize-variable
回车,然后输入 projectile-other-file-alist
,然后将
("h" "c" "cpp" "ipp" "hpp" "cxx" "ixx" "hxx" "m" "mm")
这行改成
("h" "c" "cc" "cpp" "ipp" "hpp" "cxx" "ixx" "hxx" "m" "mm")
将 ("cc" "hh" "hpp")
改成 ("cc" "hh" "h" "hpp")
最后按 Apply and Save
按钮
不保证有效,不过你可以这样试一下
谢谢大神帮忙解决,完全可以了!