Giter Site home page Giter Site logo

juliatools-nvim's Introduction

juliatools-nvim

A simple plug-in for nvim support Julia.

Feature

  1. Julia REPLCompletion based completions.
  2. Eval code in current line or current block and get its result.
  3. Docstring generation. Support from AtsushiSakai/julia.vim
  4. Quick comment.

Require

  • Julia 1.0+
  • Python3
  • Neovim

Installation

1. Install VimCompletion.jl

2. Install pynvim

3. Install this plug-in

Installation with Vim-Plug

Plug 'wangl-cc/juliatools-nvim', { 'do' : ':UpdateRemotePlugins' }

Usage

1. Completion

Because the official julia-vim plug-in uses the omnifunc as its complete method, this plug-in uses completefunc as complete method wich is used for Insert mode completion with CTRL-X CTRL-U.

2. Eval code

Like Juno this plug-in can send code to term split (open default, if you exit, completion and eval code would be disable then you should call Reconnect()) and eval it then display its result (not inline but by echo). There are two functions: JLRunLine and JLRunBlock to eval code in current line and current block. Map your own shortcut to use this feature.

3. Docstring generation

There is a function juliadocstring#JuliaDocstring being used to generate docstring. Map your own shortcut as above.

4. Quick comment

There is a function comment#Comment(julia_comment_symbol) being used to comment and remove comment. Map your own shortcut as above.

Example config

There are some configurations for using this plugin, which should be append to file ~/.vim/ftplugin/julia.vim for vim or ~/.config/nvim/ftplugin/julia.vim for nvim:

if !exists("g:julia_comment_symbol")
    let julia_comment_symbol = '#'
endif

" key map
nnoremap <buffer> <leader>l :call JLRunLine()<cr>
nnoremap <buffer> <leader>b :call JLRunBlock()<cr>
nnoremap <buffer> <leader>/ :call comment#Comment(julia_comment_symbol)<cr>
nnoremap <buffer> <leader>d :call juliadocstring#JuliaDocstring()<cr>

" autoclose
augroup JuliaAutoClose
    autocmd!
    autocmd bufenter * if (winnr("$") == 1 && bufname("$") =~ "julia") | q | endif
augroup END

juliatools-nvim's People

Contributors

wangl-cc avatar

Watchers

 avatar

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.