Giter Club home page Giter Club logo

cmc.nvim's Introduction

๐Ÿš€ cmc.nvim: Compile My C

license

Welcome to cmc.nvim, a Neovim plugin that makes compiling C handy.

NOTE: As of now, main functionalty of this plugin can be solved with just 1 keybind. vim.api.nvim_set_keymap('n', '<F5>', [[:!gcc % -o main.out<CR>]], { noremap = true, silent = true }) I will be adding more features as needed. There is no roadmap defined for this project.

๐ŸŒŸ Features

  • ๐Ÿ”ง Compile C files right from Neovim - no terminal juggling required!
  • ๐ŸŽ›๏ธ Customize compiler flags on the fly
  • ๐Ÿ”ฅ Hot reload with compile-on-save
  • More coming soon...

Installation

{ 'AZarbade/cmc.nvim' }

โš™๏ธ Configuration

require('cmc').setup({
  output_name = "main.out",

  -- Sets the default name for compiled executables.
  -- Default: main.out

  ask_output_name = false,

  -- If true, prompts for output name before each compilation
  -- If false, uses output_name (defined above)
  -- Default: false

  default_flags = "",

  -- Compiler flags used in every compilation
  -- Default: ""

  compile_on_save = false,

  -- If true, compiles C files automatically on save
  -- Default: false
})

๐ŸŽฎ Usage

  • :CompileC [args] - Compile with optional arguments
  • <leader>cc - Prompt for compiler flags and compile
  • compile_on_save = true - Save your C file and watch the magic happen! โœจ

Known Issues

  • Compile progress is not shown.
    • It shows a simple 'compiling...' msg.
  • If compile fails it is silent.
    • It shows an error message, but not the error output itself.
  • Have not tested big projects w/ long compile times.

๐ŸŽญ Contributing

Feel free to create an issue/PR if you want to see anything else implemented. If you have some question or need help with configuration, start a discussion.

๐Ÿ“œ License

MIT License

Todo

  • Custom compilation flags: Let users specify additional compilation flags, either globally or per-project.
  • Auto-compilation on save: Option to automatically compile the file when it's saved.
  • Template generation: Provide commands to generate boilerplate code or common C structures.
  • Async compilation: Perform compilation asynchronously to avoid blocking the editor.
  • Include path management: Allow users to specify additional include paths for header files.
  • Multiple compiler support: Allow users to choose between different compilers (gcc, clang, etc.) and set compiler-specific flags.
    • GCC
    • Clang
  • Makefile integration: If a Makefile is present, use it for compilation instead of direct gcc commands.
  • Debugging integration: Integrate with debugging tools like gdb or lldb.
  • Static analysis: Integrate static analysis tools (like cppcheck or valgrind) and display results.
  • Header/source switching: Quick commands to switch between .c and .h files.

cmc.nvim's People

Contributors

adwaitzarbade avatar azarbade avatar

Stargazers

Yuta Katayama avatar

Watchers

Lucian avatar  avatar

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.