juliaeditorsupport / julia-vim Goto Github PK
View Code? Open in Web Editor NEWVim support for Julia.
Home Page: http://julialang.org/
License: Other
Vim support for Julia.
Home Page: http://julialang.org/
License: Other
I very much like the LaTeX-to-Unicode feature of julia-vim
, but how can I search my source code for a unicode symbol? I'm using terminal-vim on OSX. Hitting :/\alpha
and pressing the space bar doesn't complete the \alpha
in the search bar.
Thanks!
Hi,
I've recently started to face the following issue. When I press Enter in insert mode, julia-vim seems to put the following string in my code:
LaTeXtoUnicode#AutoSub("\n", "\
")
To me this looks like some vim script from the package itself. Any idea what's going on here? I have to disable LaTeX to Unicode entirely to get rid of this problem.
Here is my julia-vim config from my vimrc:
" Configure julia-vim {
let g:julia_latex_to_unicode=0
let g:julia_latex_suggestions_enabled=0
let g:julia_auto_latex_to_unicode=1
" }
Thanks,
Felix
Is there a reason this isn't distributed with julia itself, like the emacs support is?
vim-plug is a plugin manager like many others. One of its features on-demand loading of plugins:
Plug 'JuliaLang/julia-vim', { 'for': 'julia' }
This doesn't work well with julia-vim though, as it results in numerous "Unknown function: LaTeXtoUnicode#Init" messages when changing buffers, entering insert mode, etc.
My limited understanding is that this stems from the autocmd
hooks set in ftdetect/julia.vim
—the errors certainly go away if I comment them out. I am guessing that the deferred loading imposed by vim-plug makes the call LaTeXtoUnicode#Refresh()
etc. auto-commands useless.
I gather that julia-vim already uses Vim’s autoload feature, so there should be very little benefit from using vim-plug's feature here. Hence an easy fix would be to mention that in the docs.
Unicode superscripts and subscripts were recently added to the latex substitutions.
Maybe someone may tell me how to change this strange behavior. Up to now I am using set :setf julia, but this is not a longterm solution...
If I start with vim -u NONE
and immediately do :set wildchar=^I
I can attempt :e <Tab>
and get filename completion. Further <Tab>
presses cycle forward the list of files, while <Shift-Tab>
cycles in the other direction.
If I start Vim normally via just vim
(empty buffer, no filetype) with julia-vim present I can use <Tab>
to cycle forward, but <Shift-Tab>
instead stops auto-completion (leaving the last selected file in the command). The change in behaviour seems to happen between 5ea8ebc (tab completion works) and a809d86 (it doesn’t anymore).
I am on Ubuntu. I can provide more details on my system and config if necessary.
There are two computers using the same .vimrc file . One is normal, while the other one can't use tab only within a julia file. When I input tab, the error is : E764: Option 'omnifunc' is not set. It confuses me.
my .vimrc file is at [email protected]:zhmz90/myvimrc.git
Thanks,
Lanting
When I type in, e.g., a function definition, spaces are auto-added about which the Julia REPL complains.
For example, if I wish to type
Base.in(data, l::Leaf) = data == l.data
I instead get
Base.in (data, l::Leaf) = data == l.data
Note the space between in
and (
.
Hi,
I installed julia-vim using pathogen. However, on opening up .jl julia files, vim still doesn't detect the julia filetype.
:set filetype? " returns lisp
I noticed a comment in the ftdetect file that mentioned unsetting lisp filetypes due to a system-wide lisp plugin.
-Pulkit
Hi, I am having trouble with foldmethod=syntax
on the following (example) file:
function f()
a, b = {x for x in {1, 2}}
end
function g()
println("hello")
end
Hitting za
with the cursor on the first line folds the entire file, when it should only fold the top function.
Is there something wrong with my vim config or is this a bug?
I've been using julia-vim for quite a while with no problems, but recently enabled matchit so I could do some more efficient browsing.
runtime macros/matchit.vim
I have mouse support enabled in vim. After enabling matchit, my mouse causes all sorts of problems. After a few click-and-drags, the mouse starts randomly inserting characters and preforming commands. It seems like the mouse is inputting directly to the editor.
[[
works as expected.julia-vim
issue.Hi,
I found that 'w' and friends were not jumping over ":" characters to break up a word. For example:
name::String
is treated as one word. If I set the following then it works:
set iskeyword=48-57,64-90,95,97-122
Can you check to see if the vim plugin can set this automatically?
Note: I'm just a hack trying to get things working... Thanks for writing this!
Thanks,
Glen
Hi,
I am experiencing an odd problem: After opening files with NERDTree word completion does not work. If I don’t use NERDTree word completion works just fine.
Any ideas why this happens?
Thanks,
Robert
Hello,
I am trying to get semantic-highlight.vim to work properly with julia-vim. variables inside brackets () or [] or {} seem to be picked up as JuliaParBlock as a whole and so the individual variable names don't get parsed or highlighted. Please see screenshot here:
Is there any way to get the individual tokens picked out by semantic-highlight?
Thanks!
Ritchie
It seems that these motions rarely work as expected. Likewise a% produces odd results.
E.g., with the cursor placed on the:
function stride(a::AbstractArray, i::Integer)
if i > ndims(a)
return length(a)
end
s = 1
for n=1:(i-1)
s *= size(a, n)
end
return s
end
As an aside, would it be possible to send these to Bram Moolenaar for inclusion in the distributed runtime files? Having this work out of the box with Vim is a much nicer experience for the casual Julia user.
Illumination of syntax is when there is a gap
= 1
: 1
:: Int
Without gap isn't present
=1
:1
::Int
I don't know if this is currently possible (has some other keybinding I don't know), but it would be nice if % would jump from end
to the beginning of function/if/else/... statement.
Thanks,
Cássio
I love the LaTeX-to-Unicode feature in Julia, and would also like to use it in Python3. Following the Julia-vim documentation, I included the line
let g:latex_to_unicode_file_types = ".*"
in my .vimrc file. If I open a .txt file, the LaTeX-to-Unicode feature works fine. However, in a .py file when I hit tab I get the error message
-- Omni completion (^O^N^P) Pattern not found
If I call LaTeXtoUnicode#Enable(), nothing changes. But if I call LaTeXtoUnicode#Toggle() twice, then the LaTeX-to-Unicode feature turns off then back on and starts to work. I tried various ways of calling LaTeXtoUnicode#Toggle() twice in my vim initialization (I'm not really a vim expert though), and didn't have any luck. Is there a way to enable the LaTeX-to-Unicode feature in Python3 without having to manually call the toggle function twice after starting up vim?
By default I get 2 tabs indentation, for example when defining a function
function foo()
return
end
Is there a way to set this to a single tab?
This is an enhancement request to support vim's gd
(Goto local Declaration) command. The way it's implemented in vim-go is very nice: you move the cursor over a symbol and then enter gd
command to jump to the definition of that symbol.
I installed this plugin with pathogen, as instructed in the README.md file; however, when trying to edit a .jl
file, this message is displayed:
Error detected while processing /home/ryu/.vim/bundle/julia-vim/ftdetect/julia.vim:
line 1:
E15: Invalid expression: v:version < 704^M
line 20:
E171: Missing :endif
Press ENTER or type command to continue
I tried converting the line endings manually with dos2unix
(running in the .vim/bundle
directory):
for file in $(find .); do dos2unix $file; done
And now everything works fine in my Ubuntu 14.10.
As far as I know, this is only related to the line endings of the files; so, could you add this command to the installation instructions or correct the line endings?
Thanks in advance.
When I have a long line, julia-vim does not use a hanging indent for the second (and later) line(s). If I put them in manually, I then have to manually undo the extra indent for the next line of code. As it's not uncommon for me to have a long line (for example, complex mathematical expressions where the variables in the expression are more than a few characters long), I run into this regularly. If I have a block of code and there is a long line in the middle, it makes it difficult to read because it's not clear which lines are continuations of previous lines. Adding a hanging indent for long lines would be very helpful.
I am using the vim-r-plugin heavily.
Is there something like that for julia?
I am not able to get Unicode support ("\alpha") and "filetype plugin indent on" to work together. When I set "filetype plugin indent on" in my vimrc, typing "\alpha" does not insert anything (either tab or character). On the other hand, if I set "filetype plugin on", I am able to get the right Unicode character inserted when I type "\alpha" but then indentation does not work. My mimimal vimrc file that exhibits this problem is shown below. I am using Vim7.4/Windows/7/x64.
set nocompatible
filetype off
set rtp+=/vimfiles/bundle/Vundle.vim//vimfiles/bundle'
let path='
call vundle#begin(path)
Plugin 'gmarik/Vundle.vim'
Plugin 'cocopon/iceberg.vim'
Plugin 'JuliaLang/julia-vim'
Plugin 'ervandew/screen'
call vundle#end()
colorscheme iceberg
if has('gui_running')
set guifont=Dejavu\ Sans\ Mono:h12
endif
set encoding=utf-8
syntax on
filetype plugin on
\alpha = α<Tab symbol>
\ne = ≠
GVim 7.4, Windows, commit e35c248
The following snippet reproduces the inconsistency:
function foo()
Y = f(X')'
end
I have let g:latex_to_unicode_auto = 1
in my ~/.config/nvim/init.vim.
In a julia file, when I type \neq
, nothing happens.
So, it sort of worked. The unicode alpha symbol was inserted, but the alpha
characters remain and it looks like some unusual character (escape?) sequence <91>
was inserted.
Many thanks for this plugin!
The LaTeX-to-Unicode is a very useful feature in general text editing, so it would be nice to be able to use it for any file type. Is this possible?
Currently, the plugin indents macros as follows:
@macro begin
do_stuff
end
I think the indentation should be:
@macro begin
do_stuff
end
I get the above error when opening a Julia file.
Error detected while processing bundle\julia-vim\ftplugin\julia.vim. Line 37:
Vim version 7.4 and snipmate plugin is also installed. When I try to complete something not in the g:latex_symbols
Dict, e.g. "nono" and "\nono", vim will get trapped to call LaTeXtoUnicode_omnifunc()
again and again...
I noticed that when a completion can't be found when finding start, the return value is set to -2 not -3, but -2 means "To cancel silently and stay in completion mode" while -3 means "To cancel silently and leave completion mode". After replace -2 with -3, it works well when the string doesn't start with a slash, like "nono", but not for "\nono"
The Chinese characters in status bar means "omni-complete Searching..."
Line 252 in autoload/julia_blocks.vim
is causing an error in the startup of Neovim:
vnoremap <buffer><silent><unique> <Esc> <Esc>:call julia_blocks#select_reset()<CR>
This can be fixed by removing the <unique>
part of the mapping, but I am not sure if that is safe to do.
The error is:
Error detected while processing function julia_blocks#init_mappings:
line 22:
E225: global mapping already exists for ^[
Hello,
I get this error when I switch back to a Julia buffer:
Error detected while processing function <SNR>10_LoadFTPlugin:
line 2:
E130: Unknown function: JuliaGetMatchWords
To reproduce I open a Julia file, switch to another buffer (Julia or not), and switch back to the first one (with b #
or any other switching method).
I'm using the latest master cloned in ~/.vim/bundle
julia-vim/ftplugin/julia.vim
line 35
commit e35c248
Windows does not like the usage of forward slashes here. Changing them to escaped backwards slashes (\\
) fixes the problem on Windows, but probably isn't portable.
This is definitely not idiomatic is it? A space between something like the function name and parentheses? For example, "println (factors (a))" is how it is automatically formatted when it should be, "prinln(factors(a))" Is this another case of forcing code style onto the users?
Consider the following example
function foo(bar::Function)
bar(2);
end # indent error here
indentation will be wrong. I guess that might be because the Function
type is parsed as the keyword function
.
Even though I am using MacVim (Vim 7.4), there is still an issue with my .jl files always being detected as LISP. I tried removing the if v:version < 704
line to force the undo_ftplugin
command but it did not work. I do not have any other LISP plugins installed but I am using a quite involved configuration. However, none of my plugins define anything for .jl files, so I do not believe this is the source of this issue.
What extra info can I send you to help solve this issue?
On MacVim 7.4 when pressing <Tab>
for indenting (say at the beginning of a line), LaTeX-to-Unicode triggers and since there is nothing to match, it fallbacks to the vim-supertab mapping and lets me indent.
However pressing <Tab>
twice each time is not exactly ideal. Any idea how I can fix this conflict without deactivating LaTeX-to-Unicode?
Why is this set to 4 by the plugin? The Julia style guide does not mention 4 spaces as the "rule" and I've seen a lot of Julia code that uses 2 spaces.
Is <Tab>
somehow using <C-h>
? If I try to map <C-h>
to something (specifically with imap
), it works, but the tab key starts acting up in julia-vim
(but nowhere else). As an example, I'll start out with a .vimrc
with just the minimal Vundle setup for including julia-vim
, and no other mappings or code.
Then I add the following (before the Vundle block):
imap <C-h> Hello, world!
Starting vim with this .vimrc
, if I edit a non-Julia file, pressing <Tab>
(in insert mode) will insert a tab, and pressing <C-h>
will insert Hello, world!
.
If I edit a Julia file, <C-h>
also does its job, but pressing <Tab>
will now insert:
<91>Hello, world!
where there is a tab character after Hello, world!
. If I start the line with, say, \alph
and then press tab, I get the completion:
\alpha
I press it again, and get:
α<91>Hello, world!
This time without a tab at the end.
The <91>
is a Unicode "PRIVATE USE ONE".
It seems to me that this behavior is a bug, and that it is a bug in julia-vim
– but I may very well be mistaken…
I have been getting this error whenever I open a Julia file recently.
E59: invalid character after \@
E475: Invalid argument: juliaModuleBlock^I^Imatchgroup=juliaBlKeyword start="\%(\.\s*\)\@4<!\<\%(bare\)\?module\>" end="\<end\>" contains=@juliaExpressions fold
Hi,
in my terminal vim, julia code looks rather dull:
Variable names, function names, and operators are all grey. In addition only types included in Base appear to be recognised. For example, Array is highlighted as a type in yellow. DataArray, on the other hand, is not.
Are these things part of the julia-vim plugin? To me it looks like the plugin's syntax definitions need to be smarter about identifying meaningful bits of code and distinguishing them.
the new changes appear to not work on older versions of vim, such as the version shipping with OS X: VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 24 2013 18:58:47)
or Ubuntu 12.04: VIM - Vi IMproved 7.3 (2010 Aug 15, compiled May 4 2012 04:21:49)
"number.jl" 54L, 1648C
Error detected while processing function JuliaLaTeXtoUnicodeInit..<SNR>29_JuliaSetTab:
line 15:
E216: No such group or event: CompleteDone <buffer> call JuliaFallbackCallback()
Press ENTER or type command to continue
Hello,
The latest commit f68b890 introduced a bug whereby the following errors occur on all filetypes (instead of just the Julia filetype):
Error detected while processing BufEnter Auto commands for "*":
".xmodmaprc" 64L, 2328C
Error detected while processing FileType Auto commands for "*":
E117: Unknown function: LaTeXtoUnicode#Refresh
Error detected while processing BufEnter Auto commands for "*":
E117: Unknown function: LaTeXtoUnicode#Refresh
Error detected while processing VimEnter Auto commands for "*":
E117: Unknown function: LaTeXtoUnicode#Init
Thanks for your consideration.
The documentation states
Note that the YouCompleteMe and neocomplcache plug-ins do not work well with the suggestion of possible completions for partial matches, and therefore this feature is disabled if those plug-ins are detected.
However, I know that partial completion for snippets provided by UltiSnips works great! Below you see an example of various for loop snippets I wrote for julia (now included in vim-snippets).
When I type for
, YCM will give me suggestions for any snippet beginning with for
. Can't you do the same with possible LaTeX completions?
More of a question than an issue necessarily, but why is "using" colored but keywords like require and println not?
I use NERDcommenter in Julia. When to togelling comments using the [count]<leader>c<space>
command combination, NERDcommenter will use the multi line comment style, even for a single line. NERDcommenter uses the commentstring
variable to determine a file type's comment syntax.
Is there any way of supporting "proper" single-line comment?
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.