Personally I made the transition to vim very early in my programming days, when I was only 14. Since than vim has improved and I eventually switched to neovim. I’m more than happy with it and love to use it.
My question to some fellow vim users is: what are you using in addition to vim that makes your life developing JUCE applications more easy? (plugins, external tools, etc.)
I kind of feel I’m not maxing out in this regard, so I just wanted to get some opinions in on that.
As a fellow neovim user: I like vim as a text editor. For development, using a full IDE made my life easier. CLion and Appcode have really good vim emulation, but they also provide good stuff like built-in static analysis and refactoring tools.
My vim config is quite minimal. I use vim-plug to manage add-ons, namely fzf.vim, vim-cpp-enhanced-highlight, and a colour scheme. I also use the clang-format.py integration script.
The best vim protip I know is to use a keyboard remapper, so that capslock behaves like escape when tapped, or like control when chorded.
Oh man finally someone who also remaps that stupid useless caps lock button to escape!
Yeah I’m also using an IDE if I have to do something I am not familiar with. But I do basic C++ code still in Neovim.
I’m using Visual Studio and android studio with a vim plugin.
Also I focused on learning the “native” vim as much as possible to be as portable and flexible as possible. Still didn’t prevent me from customizing the sh*t out of neovim. At least I have made a git repository out of it (github.com/dustvoice/nvim.git)
I mainly wanted to know if there is someone out there who uses some kind of plugin or external tool, to supply vim with basic code completion functionality (which would enable me using auto completion not only in the scope of my current file, but including JUCE headers, etc.), so I can use vim more.
Currently I find myself often doing major work in vim, switching to my IDE cleaning up some errors and done. But I somehow would love to have basic intellisense functionality in vim, so I don’t have to cope with the real intellisense as much.
Hope this somehow makes sense. It’s late again. Should probably sleep.
Sadly my capslock is remapped to control, but on the mac i just use Ctrl-[ for escape instead (it’s got one of those silly touch bars) and that’s just fine
I did try using VIM with the clang autocomplete stuff (VIM makes me horny), but it was rubbish compared to Appcode with the VIM emulation. It’s just a shame their Ctrl-N implementation is shite
The best experience si on the PC with VSVIM and resharper installed (and rewrap plugin for comments: gq is missing from all the vim emulations for some reason).
I’m using vsvim too. And ideavim when I REALLY gotta use android studio.
Although I was curious and installed You CompleteMe yesterday and will try it out today. I’ll see if it works for me. The thing is actually, I don’t need that much autocomplete as I’m pretty familiar with most of the stuff I’m working with but some autocomplete is nice to steer your mind in the right direction. Gonna report back if I find it useful.
+1 for AppCode / Android studio with the VIM plugin.
I prefer NeoVIM when possible, but my autocomplete / compilation error checking stuff seems to be broken and I haven’t made the time to fix it, as for most of my needs using IDEs works well enough. I miss some of the plugins though, especially with regard to file buffer management, allowing quick switching between recently used files.
I use Karabiner on the Mac to remap Caps-Lock to Escape.
Unfortunately I couldn’t get clang_complete running on Windows, which I tried first as I had problems setting up YouCompleteMe the first time. But as I researched YouCompleteMe seems to be the non plus ultra. If just Visual Studio or Jetbrains would enable NeoVim INTEGRATION instead of emulation. Would be a reason for me to switch from Visual Studio to something like CLion…
If you use cmake and you had setup lsp and installed clangd, all you need is to run cmake with - DCMAKE-EXPORT-COMPILE-COMANDS. copy the compile_commands.json to the root of your project. Now everything should be perfect. You can use autocomplete, see errors and warnings, go to definition/declaration and so forth.
The best experience, so far, I have with NVchad as config. The build in themes are c++ ready.
I’ve written a small bash script, that sets up a juce project for me. It basically clones JUCE, copies the CMake example from juce, renames some stuff in the CMakeLists.txt and creates and executes a build.sh and copies the `compile_commands.json’ to the project root. This is tested on Linux, it shoukld work for Mac, too, but I haven’t tested on Mac.
#!/bin/bash
# Ask for the project name
read -p "Enter the project name: " PROJECT_NAME
if [ -z "$PROJECT_NAME" ]; then
echo "Please provide a project name."
exit 1
fi
# Ask for the project type
echo "Do you want to create a GUI App or a Plugin? [GUI/Plugin]"
read PROJECT_TYPE
if [ "$PROJECT_TYPE" != "GUI" ] && [ "$PROJECT_TYPE" != "Plugin" ]; then
echo "Invalid project type. Please specify 'GUI' or 'Plugin'."
exit 1
fi
# Create a Project Folder
echo "Creating project folder..."
mkdir "$PROJECT_NAME"
cd "$PROJECT_NAME"
# Clone JUCE from GitHub
echo "Cloning JUCE from GitHub..."
git clone https://github.com/juce-framework/JUCE.git
# Create a Source Directory
echo "Creating source directory..."
mkdir source
# Copy the CMake Template based on the project type
echo "Copying CMake Template..."
if [ "$PROJECT_TYPE" == "GUI" ]; then
cp -r JUCE/examples/CMake/GuiApp/* ./source
elif [ "$PROJECT_TYPE" == "Plugin" ]; then
cp -r JUCE/examples/CMake/AudioPlugin/* ./source
fi
cd source
# Customize CMakeLists.txt
echo "Customizing CMakeLists.txt..."
if [ "$PROJECT_TYPE" == "GUI" ]; then
sed -i "s/project(GUI_APP_EXAMPLE VERSION 0.0.1)/project($PROJECT_NAME VERSION 0.0.1)/" CMakeLists.txt
sed -i "s/juce_add_gui_app(GuiAppExample/juce_add_gui_app($PROJECT_NAME/" CMakeLists.txt
sed -i "s/target_compile_definitions(GuiAppExample/target_compile_definitions($PROJECT_NAME/" CMakeLists.txt
sed -i "s/target_sources(GuiAppExample/target_sources($PROJECT_NAME/" CMakeLists.txt
sed -i "s/JUCE_APPLICATION_NAME_STRING=\"\$<TARGET_PROPERTY:GuiAppExample/JUCE_APPLICATION_NAME_STRING=\"\$<TARGET_PROPERTY:$PROJECT_NAME/" CMakeLists.txt
sed -i "s/JUCE_APPLICATION_VERSION_STRING=\"\$<TARGET_PROPERTY:GuiAppExample/JUCE_APPLICATION_VERSION_STRING=\"\$<TARGET_PROPERTY:$PROJECT_NAME/" CMakeLists.txt
sed -i "s/target_link_libraries(GuiAppExample/target_link_libraries($PROJECT_NAME/" CMakeLists.txt
sed -i "s/PRODUCT_NAME \"Gui App Example\")/PRODUCT_NAME \"$PROJECT_NAME\")/" CMakeLists.txt
elif [ "$PROJECT_TYPE" == "Plugin" ]; then
sed -i "s/juce_add_plugin(AudioPluginExample/juce_add_plugin($PROJECT_NAME/" CMakeLists.txt
sed -i "s/project(project(AUDIO_PLUGIN_EXAMPLE VERSION 0.0.1)/project($PROJECT_NAME VERSION 0.0.1)/" CMakeLists.txt
sed -i "s/target_compile_definitions(AudioPluginExample/target_compile_definitions($PROJECT_NAME/" CMakeLists.txt
sed -i "s/target_sources(AudioPluginExample/target_sources($PROJECT_NAME/" CMakeLists.txt
sed -i "s/target_link_libraries(AudioPluginExample/target_link_libraries($PROJECT_NAME/" CMakeLists.txt
sed -i "s/PRODUCT_NAME \"Audio Plugin Example\")/PRODUCT_NAME \"$PROJECT_NAME\")/" CMakeLists.txt
fi
cd ..
# Create a new CMakeLists.txt in the source subdirectory
echo "Creating new CMakeLists.txt in 'source' subdirectory..."
cat << EOF > CMakeLists.txt
cmake_minimum_required(VERSION 3.22)
project($PROJECT_NAME VERSION 0.01)
add_subdirectory(JUCE)
add_subdirectory(source)
EOF
cat << EOF > build.sh
# Create a Build Directory
echo "Creating build directory..."
mkdir -p build
cd build
rm CMakeCache.txt
# Generate the Build System
echo "Generating the build system..."
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
echo "Building the project..."
cmake --build .
echo "copy compile Instructiones for neovim to root..."
cp ./compile_commands.json ../
EOF
bash build.sh
echo "JUCE project setup for '$PROJECT_NAME' as a $PROJECT_TYPE complete!"
yeah i get your point. from my chronology and since i didn’t know where all the resources resided i might have cross posted a bit if I understand what you mean