jimenezrick / vimerl Goto Github PK
View Code? Open in Web Editor NEWThis project forked from ktt/vimerl
DEPRECATED - Please have a look at vim-erlang project
Home Page: https://github.com/vim-erlang
License: Other
This project forked from ktt/vimerl
DEPRECATED - Please have a look at vim-erlang project
Home Page: https://github.com/vim-erlang
License: Other
_ ___ __ | | / (_)___ ___ ___ _____/ / | | / / / __ `__ \/ _ \/ ___/ / | |/ / / / / / / / __/ / / / |___/_/_/ /_/ /_/\___/_/ /_/ ==================================== The Erlang plugin for Vim. Features ---------- - Syntax highlighting - Code indenting - Code folding - Code omni completion - Syntax checking with quickfix support - Code skeletons for the OTP behaviours - Uses configuration from Rebar - Pathogen compatible (http://github.com/tpope/vim-pathogen) How to install it ------------------- Copy the content of the tarball to your `.vim'. Don't forget to run `:helptags' if you are not using Pathogen. Vimerl requires to have a recent version of Erlang installed in your system with `escript' in your $PATH. With a Vim version older than 7.3 syntax checking will be disabled as some required features won't be available. How to use it --------------- Start with `:help vimerl'. How to contribute or report bugs ---------------------------------- Send it to me: Ricardo Catalinas Jiménez <[email protected]> Or use GitHub: http://github.com/jimenezrick/vimerl
When I -include_lib(x.hrl) and x.hrl is a pretty massive hrl file all warnings and errors disappear from the .erl file I'm writing. Is there a way to show what happens in the compile cycle so I can troubleshoot?
Thanks for the awesome branch by the way!
because it doesn't take in compilation rebar's deps path.
My modules includes files from deps, compilation with rebar works OK, but vimerl reports include errors....
The problem is made visible by this commit: 24babdcc4c792bbe422bfd8b18bfdfc28c91c141
Without this commit the incorrect errors are shown for a small moment, but then they are removed and only the real errors are visible.
Spent many time to turn off auto indentation. It would be good to have documented option to tun it off
This seems to have broken since the addition of erlang_indent.erl. Here's examples of typing the same function body in 56219e8 and 458da49:
% In 56219e8:
correct_indentation_on_begin_end() ->
Foo = begin
example_func(),
another_example_func()
end,
lists:reverse(Foo).
% In 458da49:
broken_indentation_on_begin_end() ->
Foo = begin
example_func(),
another_example_func()
end,
lists:reverse(Foo).
"hello.erl" [New File]
Error detected while processing function 65_SetErlangOptions:
line 17:
E518: Unknown option: not
:version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled May 29 2014 22:41:19)
Included patches: 1-316
Compiled by root@fm
Huge version without GUI. Features included (+) or not (-):
+acl +cscope +folding +menu +netbeans_intg -sniff +virtualedit
+arabic +cursorbind -footer +mksession +path_extra +startuptime +visual
+autocmd +cursorshape +fork() +modify_fname -perl +statusline +visualextra
-balloon_eval +dialog_con -gettext +mouse +persistent_undo -sun_workshop +viminfo
-browse +diff -hangul_input -mouseshape +postscript +syntax +vreplace
++builtin_terms +digraphs +iconv +mouse_dec +printer +tag_binary +wildignore
+byte_offset -dnd +insert_expand -mouse_gpm +profile +tag_old_static +wildmenu
+cindent -ebcdic +jumplist -mouse_jsbterm -python -tag_any_white +windows
-clientserver +emacs_tags +keymap +mouse_netterm -python3 -tcl +writebackup
-clipboard +eval +langmap +mouse_sgr +quickfix +terminfo -X11
+cmdline_compl +ex_extra +libcall -mouse_sysmouse +reltime +termresponse -xfontset
+cmdline_hist +extra_search +linebreak +mouse_urxvt +rightleft +textobjects -xim
+cmdline_info +farsi +lispindent +mouse_xterm -ruby +title -xsmp
+comments +file_in_path +listcmds +multi_byte +scrollbind -toolbar -xterm_clipboard
+conceal +find_in_path +localmap +multi_lang +signs +user_commands -xterm_save
+cryptv +float +lua -mzscheme +smartindent +vertsplit -xpm
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/local/share/vim"
Compilation:
/usr/bin/clang -c -I. -Iproto -DHAVE_CONFIG_H -march=core2 -O3 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking:
/usr/bin/clang -L/usr/local/lib -Wl,--as-needed -o vim -lm -ltinfo -lnsl -ldl -L/usr/local/lib -llua
After commit 4178cd1 vim highlights all include_lib
directives in red when I edit files that are located inside deps directory.
I see a massive family of erlang plugins for vim at https://github.com/vim-erlang
Most of them seem to be unmaintained forks of people's repos. But some, notably, the runtime files, omnicomplete, and the compiler seem to be maintained. Are you aware of any differences those plugins have compared to vimerl?
I really like writing erlang code with vimerl, but I need code formatting function to make all my code with same style, just like Ctrl+Shift+F with Eclipse for Java code.
I want to know whether there is any plan for this? or any ideas for how to implement this in vim? thanks.
The erlang-manpages
package on Ubuntu 11.10 installs the Erlang man pages with filenames like that:
/usr/share/man/man3/gen_server.3erl.gz
However, the globbing in erlang_complete.vim
is too restrictive to pick that up (the erl suffix of the extension). Replacing the ?
with the *
wildcard fixes the problem:
@@ -132,7 +132,7 @@
let function_name = matchstr(element, a:base . '\w*')
let number_of_args = matchstr(element, '\d\+', len(function_name))
let number_of_comma = max([number_of_args - 1, 0])
- let file_path = g:erlang_man_path . '/man?/' . a:module . '.?' . g:erlang_man_extension
+ let file_path = g:erlang_man_path . '/man?/' . a:module . '.*' . g:erlang_man_extension
let description = ''
" Don't look man pages if the module is present in the current directory
Cheers, Ludwig
Write some Mod:Fun
which that when omni completed only has one suggestion:
file:advise
.Ctrl+x+o
, then advise
will be erased and replaced by (
. The (
should be append to the tail.Hi!
I tried out Vimerl HEAD 4c4d1f0 and found out that indent is unusable.
When opening an erlang source file for edit as soon as any edit action
or closing the file is perfomed vim hangs. It seems to hang when
performing the erlang_indent.erl and its FIFO magic.
The last part of an strace with the vimerl indent on when I opened
the file and just exited (:q)
select(1, [0], NULL, [0], {0, 0}) = 0 (Timeout)
open("/home/avtobiff/.vim/indent/out_fifo.29410", O_WRONLY|O_CREAT|O_TRUNC|O_LARGEFILE, 0666) = ERESTARTSYS (To be restarted)
--- SIGHUP (Hangup) @ 0 (0) ---
--- SIGCONT (Continued) @ 0 (0) ---
sigreturn() = ? (mask now [])
write(1, "\33[?25l\33[1m\33[37m\33[41mError detect"..., 82) = -1 EIO (Input/output error)
write(1, "\33[m\r\r\n\33[33mline 1:", 21) = -1 EIO (Input/output error)
write(1, "\33[m\r\r\n\33[1m\33[37m\33[41mE482: Can't "..., 85) = -1 EIO (Input/output error)
write(1, "\r", 1) = -1 EIO (Input/output error)
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfa3de94) = -1 EIO (Input/output error)
ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = -1 EIO (Input/output error)
write(1, "\r\n\33[m\33[?1l\33>", 12) = -1 EIO (Input/output error)
write(1, "\33[?25h\33[2J\33[?47l\0338", 18) = -1 EIO (Input/output error)
close(4) = 0
unlink("/home/avtobiff/.vim/swp/socket_server.erl.swp") = 0
exit_group(0) = ?
Here is the relevant part of the strace for the same action when I run
vim -u NONE -U NONE
select(1, [0], NULL, [0], {0, 0}) = 0 (Timeout)
write(1, "\r", 1) = 1
write(1, "\33[?25l", 6) = 6
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost -isig -icanon -echo ...}) = 0
ioctl(0, SNDCTL_TMR_START or TCSETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(1, "\33[53;1H\33[K\33[53;1H\33[?1l\33>", 24) = 24
write(1, "\33[?25h\33[2J\33[?47l\0338", 18) = 18
close(4) = 0
unlink("/home/avtobiff/src/lab/erlang/.socket_server.erl.swp") = 0
brk(0x8c57000) = 0x8c57000
exit_group(0) = ?
Best,
Per
I use MacVim 7.3 and I installed vimerl via vundle. My .vimrc:
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'jimenezrick/vimerl'
filetype plugin indent on
syntax on
set autoindent
Executing ~/.vim/bundle/vimerl/indent/erlang_indent.erl -f foo.erl 1 (or 2 or 3)
gives no output for foo.erl:
foo() ->
z = 1 +
2,
ok.
When I open some .erl file in vim, it freezes when I try to quit vim or it freezes after a second or two when switching to INSERT
mode.
Such a simple tweak to compiler/erlang.vim that I'm not bothering forking and issuing a pull request.
On OSX 10.6, running vim from the CLI on a trivial .erl file results in the following:
Error detected while processing /Users/joant/.vim/bundle/jimenezrick-vimerl/compiler/erlang.vim:
line 34:
E319: Sorry, the command is not available in this version: sign define ErlangError text=>> texthl=Error
line 35:
E319: Sorry, the command is not available in this version: sign define ErlangWarning text=>> texthl=Todo
Wrap those two lines in:
if has('gui_running')
....
endif
and the error goes away.
README says that the plugin is compatible with pathogen, but doesn't specify how to install with it. This is confusing for novices. Should we git clone
whole repository or just the plugin
subdirectory?
About erlang indent, could we use the space to instead of tab in configuration file?
When following the loading of the vimerl into cygwin through pathogen I get an escript error saying that erlang_indent.erl wasn't able to be loaded. The location of the file exists.
The contents of my ./vimrc file is as follows;
call pathogen#infect()
call pathogen#helptags()
filetype plugin indent on
syntax on
autocmd BufEnter *.escript if &filetype == '' | setlocal filetype=erlang | endif
~/.vim/bundle/vimerl (master)$ ./autoload/erlang_complete.erl calendar
escript: exception error: no match of right hand side value {atom,358,
'?SECONDS_PER_DAY'}
Other modules like lists, file, ... works. Project's modules work too.
Erlang build from sources and put to /usr/local/...
vim 7.3
erlang R16B02
Reproduce with
% vim foo.erl
Then enter ':q'
ps shows
/usr/local/lib/erlang/erts-5.10.1/bin/beam.smp -B -- -root /usr/local/lib/erlang -progname erl -- -home /Users/molinaro -- -boot start_clean -noshell -noshell -noinput -run escript start -extra /Users/molinaro/projects/personal/dotfiles/vim/bundle/vimerl/indent/erlang_indent.erl /Users/molinaro/projects/personal/dotfiles/vim/bundle/vimerl/indent/vimerl_out_fifo.4108 /Users/molinaro/projects/personal/dotfiles/vim/bundle/vimerl/indent/vimerl_in_fifo.4108
and activity monitor shows beam.smp running at 100% CPU. Eventually the file closes after about 90 seconds.
Commenting out '-mode(compile)' in erlang_indent.erl seems to fix it though.
I found a fold bug when reading the source code of rebar
It appears on the function commands/0 in line 414 of rebar.erl.
I roughly read the erlang.vim, found it is because the line 454 of rebar.erl
_tests module.
matchs the regx
s:erlang_fun_end = '^[^%]*\.\s*\(%.*\)\?$'
It seems there is no method to fix this bug, because vim fold lines one by one and can not know it is a string.
Do you think so?
It seems Vimerl merges infomation from
edoc:get_doc(File)
and
Mod:module_info(exports)
so, if I write a new exported function in file1.erl but not compile this file. Vimerl will can not omni this new function.
Why not to make vimerl compile a erlang file when :w? So that vimerl can always omni the new functions.
Please close duplicate (messed up pull request)
I would like to know if the plugin is compatible with gVim on Windows.
When I try to load an .erl file, I got an error (tracked to the ftplugin/erlang.vim) in the line where there is a call to system('which erl').
Thanks
YCM allows me to show completions after :
, but the autocomplete menu closes when the first letter is typed. I have to explicitly press ctrl+space
or C-X, C-O
.
Is it possible to fix this? So that when semantically completing after a colon the user doesn't have to press ctrl+space
?
The help for vimerl says, a block can be indented using the |=| command. Where exactly do we give this command? Is it given using ESC := ?
Do we need to select a block in vim before that?
Sometimes the syntax checking doesn't distinguish correctly the warnings and present them as errors with red signs. The errorformat seems to be correct:
CompilerSet errorformat=%f:%l:\ %tarning:\ %m,%f:%l:\ %m
I have an Erlang file that looks like this:
-module(some_mod).
-export([some_fun/2
When I go to complete the export attribute it hangs when I type )
. Vim stays frozen until I kill it.
Erlang R16B03 (erts-5.10.4)
exists on my path. I am on vim 7.3.
Here is my vimrc: https://github.com/Stratus3D/dotfiles/blob/master/vimrc
I removed all plugins except vimerl and still had the same problem. I have been using vimerl for over a year and haven't had any trouble with it. I looked at all my recent changes to my vimrc and couldn't find anything that would affect vimerl. Removing vimrerl fixes the issue.
Copy tag to ~/.vim but nothing happened. On Lion I use this and all work without problems
Actually I am not familar with vimsrcipt, but seems that moving lines
setlocal shellpipe&
setlocal makeprg=make
from end of the s:ShowErrors function
to the point just after the silent make!
resolves the problem.
Maybe it's because getqflist()
waiting for make's output in any case. But I'm not sure if the suggested solution is safe in a case of long make's output.
Thanks much for vimerl.
A problem -- When I exit Vim while editing an Erlang (.erl) file, it
takes a long time to exit back to the command line (several
minutes).
I'm using vimerl from Github: http://github.com/jimenezrick/vimerl.
I did a "git pull" just this morning.
I'm on Ubuntu GNU/Linux 12.10.
When I type erl at the command line, I see:
$ erl
Erlang R16B (erts-5.10.1) [source] [64-bit] [smp:3:3]
[async-threads:10] [hipe] [kernel-poll:false]
Eshell V5.10.1 (abort with ^G)
I've compiled Erlang from otp_src_R16B.tar.gz. Possibly the problem
is with the new version of Erlang/otp?
Another possible clue -- Using "top", which is a processor monitor
that runs on Linux, I see that while vim is editing an erlang file, there is
a process beam.smp that is taking up lots of CPU time (almost 100%
on one core). That can't be good.
I tried "falling back" to vimerl-1.4.1 from
http://www.vim.org/scripts/script.php?script_id=3743, but the
problem is still there. So, I'd definitely say that one thing to
suspect is the R16B version of Erlang.
Note that when I remove vimerl and merely use the erlang support
that comes with Vim, the problem is not there.
I'm running Vim compiled from the Mercurial repository at
https://vim.googlecode.com/hg/.
Thanks for any help.
Dave
when using the plugin in a cygwin environment i came across two major issues:
escript expects windows-style paths (backslashes instead of slashes etc.), so erlang_check_file, erlang_complete_file, etc. should be set accordingly.
the erlang shell on windows does not support the "-man" command, so when code completion calls it, vim crashes.
Hi,
I just added the module, and when I open a .erl file, I'm getting this:
".\my.erl" 7L, 105C
Error detected while processing function <SNR>70_SetErlangOptions:
line 24:
E518: Unknown option: not
E492: Not an editor command: operable program or batch file.^@
Press ENTER or type command to continue
This is on a Windows 7 machine, running Erlang OTP 17.5.
Vim: vim-7.4.417-python-2.7-python-3.4-ruby-2.0.0-lua-5.2-perl-5.18-windows-x64
Erlang bin is in PATH, and escript is accessible from the command line. The following vim plugins are also present:
Would appreciate any pointers on resolving this.
See @sedrik 's issue in the youcompleteme repo.
Do you have an idea how to fix this?
The case try[...of]...catch
works perfectly. But try[...of]...catch...after
and try[...of]...after
don't work as expected:
try
foo
catch
_ ->
bar
after
fubar
end, <=== Indent wrong by -1
The next case is completely broken:
try
foo
after
bar
end,
Error detected while processing function 143_SetErlangOptions:
line 17:
E518: Unknown option: not
Press ENTER or type command to continue
I am on Ubuntu 14.04 and using zsh as my shell
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.