practicalli / neovim

Neovim, Conjure and LSP for Clojure development using Fennel configuration
https://practical.li/neovim/
Creative Commons Attribution Share Alike 4.0 International
21 stars 5 forks source link

Neovim - toggle between src and test files #3

Closed practicalli-johnny closed 5 months ago

practicalli-johnny commented 4 years ago

tpope/projectionist https://github.com/tpope/vim-projectionist

Suggested binding: SPC p a for project alternate

Swap between src and test with a simple binding Per project configuration config using projections.json file in root of project

{
  "src/*.clj": {
    "alternate": "test/{}_test.clj",
    "type": "source"
  },
  "test/*_test.clj": {
    "alternate": "src/{}.clj",
    "type": "test"
  }
}

Global configuration set it globally if a directory contains a file, using g:projectionist_heuristics

create a file $HOME/.vim/syntax/clojure.vim containing

"
" Projections
"
autocmd User ProjectionistDetect
  \ call projectionist#append(getcwd(),
  \ {
  \   'src/*.clj': {
  \     'alternate': 'test/{}_test.clj',
  \     'type': 'source'
  \   },
  \   'test/*_test.clj': {
  \     'alternate': 'src/{}.clj',
  \     'type': 'test'
  \   },
  \ })
practicalli-johnny commented 5 months ago

Looking for a lua based plugin or something with examples of configuring with lazy package manager.