Giter Club home page Giter Club logo

julia-vim's Introduction

julia-textwrangler-bbedit

Julia language support for Textwrangler and BBEdit (Bare Bones Software)

Installation

Copy BBEditTextWrangler-julia.plist to

Textwrangler

~/Library/Application\ Support/TextWrangler/Language\ Modules/

BBEdit

~/Library/Application\ Support/BBEdit/Language\ Modules/

Credits

julia-vim's People

Contributors

ararslan avatar bkamins avatar carlobaldassi avatar chakravala avatar danielwe avatar dkearns avatar expandingman avatar fredrikekre avatar hcs42 avatar hydrotoast avatar iblislin avatar ikselven avatar jmert avatar jonas-schulze avatar jtravs avatar kose-y avatar machakann avatar mancellin avatar mcprentiss avatar ronisbr avatar sanga avatar stefankarpinski avatar swissr avatar tapichu avatar teekaay avatar thomasphyq avatar vpuri3 avatar vtjnash avatar wsliang avatar zhaiyusci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

julia-vim's Issues

LaTeX-to-Unicode triggers on all instances no just /unicode. Supertab conflict?

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?

Syntax folding trouble

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?

Wrong indent of macros

Currently, the plugin indents macros as follows:

@macro begin
do_stuff
end

I think the indentation should be:

@macro begin
    do_stuff
end

JuliaParBlock internals not being highlighted

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:
screenshot from 2016-06-22 22-12-29

Is there any way to get the individual tokens picked out by semantic-highlight?

Thanks!

Ritchie

LaTeX to Unicode autosub feature incompatible with auto-pairs plugin

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

"Function" cause indentation error

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.

Highlighting of keywords

More of a question than an issue necessarily, but why is "using" colored but keywords like require and println not?

E130: Unknown function: JuliaGetMatchWords

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 breaks my tab completion

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.

E117: Unknown function: LaTeXtoUnicode#Refresh

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.

LaTeX-to-Unicode with Python

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?

shiftwidth setting

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.

Tab and C-h interacting?

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…

matchit and julia-vim causes sporadic behaviour with mouse

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.

  • The behaviour goes away as soon as I disable matchit
  • matchit itself seems to work correctly. That is, browsing using commands such as [[ works as expected.
  • The mouse does not cause problems in other file types with matchit enabled, leading me to believe this is a julia-vim issue.

[Feature request] Hanging indent for long lines

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.

Not able to get Unicode support ("\alpha<TAB>") and "filetype plugin indent on" to work together

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/
let path='
/vimfiles/bundle'
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

Merge into julia repo

Is there a reason this isn't distributed with julia itself, like the emacs support is?

Matchit [% and ]% motions don't work reliably

It seems that these motions rarely work as expected. Likewise a% produces odd results.

E.g., with the cursor placed on the:

  • "s" of s = 1 [% doesn't jump to "function" and ]% doesn't jump to the function's "end"
  • "if" or "for" [% doesn't jump to "function" and ]% doesn't jump to the corresponding "end" (and takes a long time to decide not to jump)
  • "end" of either of the "if" or "for" blocks ]% doesn't jump to the function's "end"
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.

can't quit completion when a match can't be found

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"

- 20140730 - 204419
The Chinese characters in status bar means "omni-complete Searching..."

More colors

Hi,

in my terminal vim, julia code looks rather dull:
screen shot 2014-06-19 at 10 52 42

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.

Searching for unicode symbol

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!

Goto local Declaration

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.

Undo filetype=lisp not working on OS X MacVim

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_ftplugincommand 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?

E764: Option 'omnifunc' is not set

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

Auto-space between parentheses and preceding code.

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?

too much indent

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?

Line endings correction

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.

neovim Latex-to-Unicode Support

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.

When I type \alpha, I get:
screen shot 2015-11-22 at 20 41 17

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!

LaTeX to Unicode and YCM

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).
screen shot 2014-06-19 at 11 05 39

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?

Commenting

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?

Jumpt to matching block beginning

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

NERDTree and completion

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

Invalid character error when opening a file

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

<unique> mapping conflicts with existing mapping

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 ^[

vim version incompatibility

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

Spaces before brackets & parens; deprecated syntax

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 (.

Word boundary not working

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

Cannot defer loading with vim-plug

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.

filetype shows up as lisp with julia-vim flugin.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.