Server IP : 127.0.0.2 / Your IP : 3.16.111.78 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/vim/vim74/indent/ |
Upload File : |
" Matlab indent file " Language: Matlab " Maintainer: Christophe Poucet <christophe.poucet@pandora.be> " Last Change: 6 January, 2001 " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif let b:did_indent = 1 " Some preliminary setting setlocal indentkeys=!,o,O=end,=case,=else,=elseif,=otherwise,=catch setlocal indentexpr=GetMatlabIndent(v:lnum) " Only define the function once. if exists("*GetMatlabIndent") finish endif function GetMatlabIndent(lnum) " Give up if this line is explicitly joined. if getline(a:lnum - 1) =~ '\\$' return -1 endif " Search backwards for the first non-empty line. let plnum = a:lnum - 1 while plnum > 0 && getline(plnum) =~ '^\s*$' let plnum = plnum - 1 endwhile if plnum == 0 " This is the first non-empty line, use zero indent. return 0 endif let curind = indent(plnum) " If the current line is a stop-block statement... if getline(v:lnum) =~ '^\s*\(end\|else\|elseif\|case\|otherwise\|catch\)\>' " See if this line does not follow the line right after an openblock if getline(plnum) =~ '^\s*\(for\|if\|else\|elseif\|case\|while\|switch\|try\|otherwise\|catch\)\>' " See if the user has already dedented elseif indent(v:lnum) > curind - &sw " If not, recommend one dedent let curind = curind - &sw else " Otherwise, trust the user return -1 endif " endif " If the previous line opened a block elseif getline(plnum) =~ '^\s*\(for\|if\|else\|elseif\|case\|while\|switch\|try\|otherwise\|catch\)\>' " See if the user has already indented if indent(v:lnum) < curind + &sw "If not, recommend indent let curind = curind + &sw else " Otherwise, trust the user return -1 endif endif " If we got to here, it means that the user takes the standardversion, so we return it return curind endfunction " vim:sw=2