A Vim mode to edit QB64 BASIC files, including commands to opens/compiles/run them with QB64 IDE.
See the commands section below for screenshots and features.
Quoting from QB64 on Wikipedia; QB64 is a self-hosting BASIC compiler for Microsoft Windows, Linux and Mac OS X, designed to be compatible with Microsoft QBasic and QuickBASIC. QB64 is a C++ emitter, which is integrated with a C++ compiler to provide compilation via C++ code and GCC optimization.
QB64 implements most QBasic statements, and can run many QBasic programs, including Microsoft's QBasic Gorillas and Nibbles games.
Furthermore, QB64 has been designed to contain an IDE resembling the QBASIC IDE.
See more on QB64 on Wikipedia.
- QB64 : Simply download and install QB64 to a directory of your choice. QB64 is available for Windows, Linux and Mac OS X.
For Vundle users:
Plugin 'caglartoklu/qb64dev.vim'
For all other users, simply drop the plugin/qb64dev.vim file to your plugin
directory.
The installation directory of QB64.
Default :
unavailable.
example:
g:qb64dev_qb64_directory = 'C:\bin\qb64'
If g:qb64dev_qb64_directory
is not defined, and g:qb64dev_autofind_qb64
is 1
, which is the default, then qb64dev.vim will check a few paths to locate QB64 directory.
Note that g:qb64dev_qb64_directory
will override this setting if defined.
Default:
let g:qb64dev_autofind_qb64 = 1
Compiles the .bas
file in Vim buffer with QB64.
The executable file will be in the same path as the .bas
file.
Runs the compiled executable file.
The executable file must be in the same path as the .bas
file.
Compiles the .bas
file in Vim buffer with QB64 and executes it.
The executable file must be in the same path as the .bas
file.
Opens the current buffer in QB64 IDE. This can be useful to squash a bug or use the inline help system in QB64 IDE.
au BufEnter,BufNew *.bas nnoremap <F5> : call qb64dev#QB64CompileAndRun()<cr>
au BufEnter,BufNew *.bas nnoremap <F11> : call qb64dev#QB64Compile()<cr>
Note that qb64dev.vim only provides the dictionary.
That dictionary can be used with Vim's standard dictionary completion keys (CTRL X CTRL K
) or any other compatible Vim completion plugin.
The following code sample is for VimCompletesMe.
au BufEnter,BufNew *.bas let b:vcm_tab_complete = 'dict'
In the following animated gif, TAB key makes the completion:
Technically no, but, without QB64 itself, this plugin would be pointless.
First of all, QB64 IDE is retro-classic, and nothing beats that :)
Moreover, QB64 IDE has its own advantages like code formatting, showing errors, and built-in help as in QuickBASIC.
But, if you use Vim for all your coding, you may want to use it for QuickBASIC as well. And, qb64dev.vim provides a way to use it.
In addition, qb64dev.vim provides a dictionary to use with Vim's dictionary completion.
It is qbcolor.vim and it can be found here here.
It is a separate plugin. It must be installed separately and used as follows:
Plugin 'caglartoklu/qbcolor.vim'
colorscheme qbcolor
That is FreeBASIC syntax file.
It is a separate plugin. It must be installed separately and used as follows:
Plugin 'vim-scripts/Freebasic-vim-syntax-file'
autocmd BufNewFile,BufRead *.bas set ft=freebasic
autocmd BufNewFile,BufRead *.bi set ft=freebasic
- Compile, Run features.
- Code completion.
- Test on Windows.
- Test on Linux.
- Test on macOS.
- Embedding help files.
- A script to automatically download keywords list from QB64 wiki.
- QB64 specific syntax file.
- QB64 specific snippets for vim-snipmate.
- Passing external arguments when running.
- Passing external complation options when compiling.
- vim-quickui integration (maybe?).
Licensed with 2-clause license ("Simplified BSD License" or "FreeBSD License"). See the LICENSE.txt file.