Fork me on GitHub

When I'm already using vim-projectionist, is there a way to create the alternate file if it doesn't exist?


:A command either switches to the alternative file or prompts to create one


if see the no alternate file it means that projectionist does know what should be alternate file for the current buffer


for clojure and java projects I've configured them manually

(set vim.g.projectionist_heuristics
     {"project.clj|deps.edn" {"src/*.clj"           {:alternate "test/{}_test.clj"}
                              "test/*_test.clj"     {:alternate "src/{}.clj"}}
      "pom.xml"              {"src/main/*.java"     {:alternate "src/test/{}"}
                              "src/test/*" {:alternate "src/main/{}.java"}}})


Is there a simple configuration (or lua / fennel code) for removing trailing whitespace on a file when saving that file? So it would remove additional spaces at the end of every line and optionally more than one line at the end of the file. (I am afraid I understand very little of what the neovim docs are saying, although they are very detailed)


I use this little plugin to do all whitespace highlighting and removal for me:


This is Lua auto-command that removes end of line whitespace on each save

{ pattern = "*", command = "%s/\\s\\+$//e" }


I use for my nvim 0.7+. Seems to work pretty well for my simple use cases 😄


@U11EL3P9U vim-better-whitespace looks interesting, although it may take me a while to translate that to my fennel config. Thanks


It seems there is no escape from adding those patterns in the config. I’ll just use a theme that hides the whitespace / indicators until I understand what those things mean Thanks


mine are essentially substitution patterns being executed as commands. like :%s/\s\+$//e. the patterns are taken from


when the buffer saves, it executes those commands in order


nnoremap <leader>tw :%s/\s\+$//e is what I use since the before-times


So not fully automagic 🙂


Help for debugging problem. Every once in a while, during a copy paste or opening a large file, nvim freezes. The CPU goes 100%, I wait a few minutes hoping for a time out, but normally I have to kill it. I just copy pasted a small json fragment into a markdown file. Should I look at the markdown plugin? Or perhaps is there a thread-dump facility I can see what nvim is doing?


Could it be clojure-lsp? I've noticed that running up my CPU at times


You could try nvim --clean to run with no plugins or configuration and see if it still happens. If it doesn't, disable half of your plugins and try again. Repeat until you find it. Or start with the ones you suspect first. I'm not aware of a detailed resource monitor for nvim.


I've used :h profile once, the profile output can help to figure out which plugin is slow. I've used this guide


Thanks all, will try a few options and report back