Giter Club home page Giter Club logo

vim-solidity's Introduction

vim-solidity

Syntax files for Solidity, the contract-oriented programming language for Ethereum.

Installation

Pathogen

Run the following command:

git clone https://github.com/tomlion/vim-solidity.git ~/.vim/bundle/vim-solidity

Vundle

Add the following line to your ~/.vimrc:

Plugin 'tomlion/vim-solidity'

Plug

Add the following line to your ~/.vimrc:

Plug 'tomlion/vim-solidity'

No Plugin Manager

Copy all of the files manually into your ~/.vim.

vim-solidity's People

Contributors

amarandus avatar denton-l avatar dmdque avatar federicobond avatar tomlion 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

vim-solidity's Issues

Info

In your Readme section
Why you have put ?

No Plugin Manager

Copy all of the files manually into your ~/.vim.

What's the use of this.

constructor keyword not colored

A recent version of solidity added the constructor keyword.

contract OwnedToken {
    address owner;
    bytes32 name;

    constructor(bytes32 _name) public {
        owner = msg.sender;
        name = _name;
    }
}

Can't get to work at all

I am unsure what else to try. Here is my vimrc. Notably I have

filetype plugin indent on

and

set rtp+=~/.vim/bundle/vim-colorschemes/
set t_Co=256
" note: using Atom terminal color scheme for iTerm2
" (https://github.com/mbadolato/iTerm2-Color-Schemes/blob/master/schemes/Atom.itermcolors)
colorscheme herald
if has("syntax")
  syntax enable
endif

I have verified that the Vundle installation executed successfully

jamis@Jamiss-MBP:~/src/dotfiles$ tree ~/.vim/bundle/vim-solidity/
/Users/jamis/.vim/bundle/vim-solidity/
├── LICENSE
├── README.md
├── ftdetect
│   └── solidity.vim
├── ftplugin
│   └── solidity.vim
├── indent
│   └── solidity.vim
└── syntax
    └── solidity.vim

4 directories, 6 files](url)

Am I missing something major? Something conflicting in my vimrc? Maybe a conflicting Vundle plugin?

event indent mistake!

Before and After indent with gg=G

    event GameCreated(bytes32 indexed id, address indexed creator, string home,
        string away, uint16 indexed category, uint64 locktime);
    event BidPlaced(bytes32 indexed game_id, BookType book,
        address bidder, uint amount, bool home, int32 line);
    event GameCreated(bytes32 indexed id, address indexed creator, string home,
                      string away, uint16 indexed category, uint64 locktime);
                      event BidPlaced(bytes32 indexed game_id, BookType book,
                                      address bidder, uint amount, bool home, int32 line);

Any solution? Thank you!

highlight chained modifiers correctly

If you chain several modifiers (or keywords) together, some do not get colored correctly:

function example()
         modifier1()
         constant
         modifier2()
         internal
         returns (bool)

Don't override user settings without good reason

This plugin sets expandtab, tabstop=4 and softtabstop=4 for solidity files, overriding the value they are set to in vimrc.

A syntax plugin should only override such settings if there are good reasons to do so, such as tabs and spaces indent having a different meaning (like in e.g. python). That is not the case in solidity and you are just trying to force your coding style on everyone.
Please don't.

documentation request: basic installation

Sorry to ask, but it would be useful to include some really basic installation guidance, even if it's just a link to other relevant documentation. I copied the directories to ~/.vim/ but that's as far as I've gotten.

Some improvements possible

Hello,

After installing the plug, I compared it with the ethereum package provided for Atom:
screenshot from 2017-02-16 22-07-28

I ended up with this output in Vim:
screenshot from 2017-02-16 22-05-03

The newbie I am in Programming would like to know why there are such differences in the syntax highlighting.
Is there room for improving the actual Vim syntax highlighting ? It lacks items such as def | extern | self. | msg.sender | deposit | data, etc.... It does not recognize functions after 'def' for instance.
Otherwise, is there a way for me to change this by my own ?
Thanks.

Plugin Activation

The syntax highlighting only works, if vim is configured to use 256 colors. I think this should be reflected in the README.

Block comments unindent by one space each line

Seems like multiline comments might confuse vim-solidity. Having said that, I am using editorconfig, so if you can't reproduce, that might be where we diverge :)

contract SimpleStorage {
    uint storedData;

    /** 
    *
   *
  *
 *
    */
    function set(uint x) {
        storedData = x;
    }  

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.