![]() ![]() ![]() prefix to running executables in current directory, but windows doesn't. The absolute path name $(VIM_FILEDIR)/$(VIM_FILENOEXT) is used because linux needs a. The option -cwd=$(VIM_FILEDIR) means running the file in the file's directory. The double quotation mark is used to handle path names containing spaces. The macros in $(.) form will be expanded as the real file name or directory, and then we will have F5 to run the executable: noremap :AsyncRun -raw -cwd=$(VIM_FILEDIR) "$(VIM_FILEDIR)/$(VIM_FILENOEXT)" We can setup F9 for this: noremap :AsyncRun gcc -Wall -O2 "$(VIM_FILEPATH)" -o "$(VIM_FILEDIR)/$(VIM_FILENOEXT)" You will see the realtime command output in the open quickfix window.Ĭompiling a single file with AsyncRun is much simpler than Sublime Text’s build system. When you input “:AsyncRun echo hello ” in the command line: Nnoremap :call asyncrun#quickfix_toggle(6) ![]() " ring the bell to notify you job finished " set the quickfix window 6 lines height. " open quickfix window automatically when AsyncRun is executed You can navigate errors in the quickfix window or continue editing while compiling.Ĭopy & paste the lines below to your vimrc: Plug 'skywind3000/asyncrun.vim' Just like compiling programs in IDEs, the compilation errors will be matched by errorformat and be highlighted and become selectable. You can compile your C++/Java programs in vim as convenience as Sublime Text or NotePad++ with some dedicated plugins for Vim 8 or NeoVim.įor example, the AsyncRun plugin will allow you run shell commands in background and read output from quickfix window in realtime. But a lot of vim tutorials are still teaching people something ten years ago. It's 2018 now, vim 8 has released for 2 years and shipped with all the mean stream Linux distributions and Mac OS X. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |