I am currently new to neovim.
Something that has me a bit stuck is being able to easily run my code. The text editor I used before trying out vim was Sublime Text 3, and, in that text editor, all I had to do was press Cmd-B. It would use a build system that either came with the text editor or one that I made myself.
I haven't found a way to do this within vim. The closest I have gotten to doing something similar to this is by adding this to my init.vim command PYrun :!python3 %
, but this only works with python. It is no where near as good as the build systems in Sublime.
Is there some way that neovim can read the file's extension (eg., .py, .asm, .cs) and use a preconfigured build system to run the code?
Default Python Build System:
"cmd": ["/usr/local/bin/python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"quiet": true
My Customized Assembly Build System:
"shell": true,
"cmd": ["nasm -f macho64 ${file} && ld -macosx_version_min 10.12 -lSystem -o ${file_base_name} ${file_base_name}.o && ./${file_base_name}"],
"file_regex": "^(.+):([0-9]+)()?: error: (.*)$",
"working_dir": "${file_path}",
"selector": "source.assembly"