Giter Site home page Giter Site logo

Comments (12)

WarpWing avatar WarpWing commented on August 16, 2024 1

Doperino (This is why I use nano)

from macos-dotfiles.

WarpWing avatar WarpWing commented on August 16, 2024 1

In all note, C + Neovim is probably not my territory so 😔 Good Luck finding a solution though

from macos-dotfiles.

WarpWing avatar WarpWing commented on August 16, 2024

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.

atidyshirt avatar atidyshirt commented on August 16, 2024

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.

WarpWing avatar WarpWing commented on August 16, 2024

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.

atidyshirt avatar atidyshirt commented on August 16, 2024

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.

atidyshirt avatar atidyshirt commented on August 16, 2024

Ill make a testing branch so you can try it for yourself, the bind is C >> leader = space.

from macos-dotfiles.

atidyshirt avatar atidyshirt commented on August 16, 2024

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.

WarpWing avatar WarpWing commented on August 16, 2024

from macos-dotfiles.

atidyshirt avatar atidyshirt commented on August 16, 2024

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: h

shell returned 1

from macos-dotfiles.

atidyshirt avatar atidyshirt commented on August 16, 2024

Fixed it :)

from macos-dotfiles.

WarpWing avatar WarpWing commented on August 16, 2024

You should probably assign the right labels :)

from macos-dotfiles.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.