Open maujim opened 3 years ago
projectile does it. might be a good replacement https://github.com/bbatsov/projectile/blob/master/projectile.el#L1942
Thanks for the suggestion but I'm on vim so that wouldn't work.
The closest thing I've found so far is a special register in vim, %<
, that contains the name of the current file without the extension. So for example, if I'm editing src/foo/Bar.cpp
, the command :e %<.hpp
will open up src/foo/Bar.hpp
.
If nothing comes up, I'll probably write up a small vim plugin to do this.
I use (https://github.com/ericcurtin/CurtineIncSw.vim), its very small and if you are ok with the assumptions its the way to go. You can also take a look at he wiki (https://vim.fandom.com/wiki/Easily_switch_between_source_and_header_file). None of these are code aware, they use patterns/regex but maybe that is ok for you.
There's also vim-projectionist where you can define alternate files, like source and header files (among many other things).
Any updates on this? I use CoC and there is this line in my vimrc
" switch between header and implementation file
nmap <leader>ch :<C-u>CocCommand clangd.switchSourceHeader<CR>
which of course doesn't work with ccls. It would be great if I could generalize this line to include ccls.
Thanks for using my plugin @GGCristo ! I wrote a new little one recently. Feel free to try and star if you like! :smile:
@MaskRay any update on this?
Any progress on this? Just wonder.
I don't believe that this is a feature in the official LSP spec but it is implemented by
clangd
so I thought it to be worth asking.Is there any plans to implement the ability to switch between source and header files?
If there is a better place to ask about features, I can move this to there.