Skip to content

CRAG666/crlvc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crlvc

Code Runner Like VsCode

Motivation

After hours and hours of searching for a vim add-on equal to code runner and none of the ones found satisfied my needs, I said to myself "Hey, it's time to create it!"

Quick Start

Open a terminal and run ./install

Setting

Before installing you can configure the languages you want to be supported, The configuration file is called crlvc.json.

The file should look like this:

{
    "java": "cd {dir} && javac {fileName} && java {fileNameWithoutExt}",
    "kt": "cd {dir} && kotlinc-native {fileName} -o {fileNameWithoutExt} && ./{fileNameWithoutExt}.kexe",
    "c": "cd {dir} && gcc {fileName} -o {fileNameWithoutExt} && {dir}{fileNameWithoutExt}",
    "cpp": "cd {dir} && g++ {fileName} -o {fileNameWithoutExt} && {dir}{fileNameWithoutExt}",
    "py": "python -u {file}",
    "cs": "alacritty -e sh -c 'cd {dir} && mcs {fileName} && mono *.exe'",
    "ts": "deno run {file}",
    "rs": "cd {dir} && rustc {fileName} && {dir}{fileNameWithoutExt}"
}

In the crlvc.json a series of commands associated with file extensions is specified, if you want to add some other language follow this structure "extension": "commans"

Variable

Variables are represented in python f string style the available variables are the following:

  • file //file path(~/anyrute/anyrute/myfile.cpp)
  • fileName //file name(myfile.cpp)
  • fileNameWithoutExt //file without extension(myfile)
  • dir //path(~/anyrute/anyrute/)

Example

add support to javascript and objective c:

{
....... more..........
     "js": "node {file}",
     "m": "cd {dir} && gcc -framework Cocoa {fileName} -o {fileNameWithoutExt} && {dir}{fileNameWithoutExt}"

}

Use

In Terminal:

crlvc ~/somedir/myfile

so simple.

Use in vim

The easiest way to use is by assigning it shortcuts

add this to your .vimrc or init.vim:

nmap <leader>B :belowright 7split term://crlvc %<CR>

Use the combination of keys you want

Screenshots

typescript

python

Important

If you have any ideas to improve this project, do not hesitate to make a request, if problems arise, try to solve them and publish them. Don't be so picky I did this in one afternoon.

About

Code Runner Like VsCode

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published