Skip to content

BalderHolst/matlab.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Open a matlab instance in the background, and send it commands from Neovim.

Setup

Install using your favorite package manager.

Packer

use 'BalderHolst/matlab.nvim'

Make sure to have Matlab installed.

Configuration

You can now configure and enable the plugin by calling the setup() function.

This is the default configuration:

require("matlab").setup({

    -- Path to the matlab executable. If `matlab` is already in your $PATH, just leave this.
    matlab_path = "matlab",

    -- How to open the matlab window. There are 4 options for now:
        -- split
        -- splitdown
        -- vsplit
        -- vsplitright
    open_window = require("matlab.openers").vsplit,

    -- Display the matlab splash screen on startup
    splash = true,

    -- A list of any other flags you want to add, when launching matlab
    matlab_flags = {},

})

Functions

Evaluate a string as a matlab command.

MatlabEval <expr>
require("matlab").evaluate("<matlab cmd>")

Evaluate currently opened matlab script.

MatlabEvalFile
require("matlab").evaluate_current_file()

Evaluate a matlab script file.

require("matlab").evaluate_file(path)

Evaluate the block under the cursor. Matlab blocks are separated by comments beginning with %%.

MatlabEvalBlock
require("matlab").evaluate_block()

Evaluate currently highlighted text.

MatlabEvalVisual
require("matlab").evaluate_visual()

Evaluate a table of strings as matlab commands.

require("matlab").evaluate_lines(lines)

Open documentation of the function under cursor.

require("matlab").open_documentation_at_cursor()

Open documentation of an arbitrary function.

MatlabDoc <matlab-function>

Close window and end matlab process.

MatlabClose
require("matlab").close()

Open the matlab "workspace" (variable explorer).

MatlabWorkspace
require("matlab").open_workspace()

TODO:

  • Matlab output inserted as comments under command

About

Run Matlab from within Neovim!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages