Skip to content

Latest commit

 

History

History
84 lines (57 loc) · 1.69 KB

File metadata and controls

84 lines (57 loc) · 1.69 KB

matlab-mode and tlc-mode provides imenu support which lets you jump quickly to functions in the current *.m file you are visiting. Typing M-g i (or M-x imenu) will prompt you in the mini-buffer:

Index item:

You can type TAB to complete MATLAB function names and after selecting one, the point is moved to that function. For example, given test1.m

function test1
    a = test2(2);
    b = test3(a);
    test4(b);
end

function out = test2(in)
    out = in * 2;
end

function [out] = test3(in)
    out = in * 3;
end

function test4(in)
    disp(num2str(in))
end

Typing M-g i followed by a TAB at the prompt:

Index item: <TAB>

gives:

5 Possible completions:
*Rescan*
myFunc1
myFunc2
myFunc3
myFunc4

and you can select the one you’d like by clicking on it or by typing the name with tab completion.

Imenu Menu

  1. If you are using matlab-ts-mode

    In your ~/.emacs, add

    (add-hook 'matlab-ts-mode-hook (lambda () (imenu-add-to-menubar "Imenu")))
        
  2. If you are using matlab-mode
    M-x customize-variable RET matlab-mode-hook RET
        

    and add:

    (lambda () (imenu-add-to-menubar "Imenu"))
        
  3. If you are using tlc-mode
    M-x customize-variable RET tlc-mode-hook RET
        

    and add:

    (lambda () (imenu-add-to-menubar "Imenu"))