Comments (12)
Doperino (This is why I use nano)
from macos-dotfiles.
In all note, C + Neovim is probably not my territory so
from macos-dotfiles.
Could I get a log file? or some sort of screenshot showcasing a error?
Please also reference this: https://stackoverflow.com/questions/2627886/how-do-i-run-a-c-program-from-vim
from macos-dotfiles.
The only error given is: E116: Invalid arguments for function ToggleRun
the function ToggleRun is shown below
function! ToggleRun(cmd)
if empty(bufname(a:cmd))
call CreateCenteredFloatingWindow()
call termopen(a:cmd)
else
bwipeout!
endif
endfunction
from macos-dotfiles.
Could you try running a basic C program to see if it's a problem with neovim or just syntax (or basically anything wrong with language)
#include <stdio.h>
int main(void) {
printf("Hello World\n");
return 0;
}
Just try to compile that and see how that works. We should figure out if this is a Neovim problem or a C syntax error (language-level) problem
from macos-dotfiles.
I have a Hello World program, and I can compile and run it manually
gcc hello.c -o hello && ./hello
but when I try to use the command outlined before, that's when it becomes an issue, I have isolated the problem to the following line:
autocmd filetype c nnoremap C :w :call ToggleRun('gcc '. @% . ' -o ' . @%< ' && ./' . @%<)
edit: it will be to do with the way I am concatenating and grabbing file names from neovim.
from macos-dotfiles.
Ill make a testing branch so you can try it for yourself, the bind is C >> leader = space.
from macos-dotfiles.
Nah I like vim because of all this stuff, but running gcc manually each time is kinda annoying while I am learning C
from macos-dotfiles.
from macos-dotfiles.
I have got it a lot closer, I can get it to compile correctly but for some reason I cant get it to run (produces this error)
"hello.c" 8L, 83C written
:!gcc hello.c -o hello | :call ToggleRun('./hello')
zsh:1: unknown file attribute: hshell returned 1
from macos-dotfiles.
Fixed it :)
from macos-dotfiles.
You should probably assign the right labels :)
from macos-dotfiles.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from macos-dotfiles.