Coder Social home page Coder Social logo

vim-bsv's Introduction

Vim plugin for Bluespec SystemVerilog (BSV)

  • Syntax highlighting

  • Autoindent

  • Autocomplete options:

    1. From dictionary of words: ctrl-x ctrl-k
    2. From imported files: ctrl-x ctrl-i
    3. Above options are simply settings for vim's builtin 'complete' feature. Make it more useful with plugins like supertab or autocomplpop.
  • Move between matching keywords (%) with vim's built-in matchit plugin. Enable the plugin in vimrc:

    if !exists('g:loaded_matchit')
        runtime! macros/matchit.vim
    endif
  • Open imported file: In normal mode, press gf (goto file) with cursor over file name.

  • Code snippets for snipmate, or new snipmate

  • Rules for endwise

Features involving imported files use vim's path option to look for the files. There are several ways to do this:

  1. Per project: set exrc secure, put a .vimrc in your project folder with set path=...
  2. Per file: set modeline, put a comment at the beginning of your code // vim:path=...
  3. Can export the per file setting globally with: autocmd BufWinEnter *.bsv if &l:path != '' | let &path = &l:path | endif
  4. roll your own file format that can be read by both vim and your build script

Do :help path, :help exrc, :help modeline for more info.

I prefer the last option. In my top-level source folder, I have a file called "bsvpath". In vimrc:

function! BSVSetPath(srcdir)
    let pathfile = a:srcdir . '/bsvpath'
    if filereadable(pathfile)
        set path=
        for line in readfile(pathfile)
            if line =~# '^[^$/]'
                let line = simplify(a:srcdir . '/' . line)
            endif
            execute "set path+=" . line
        endfor
    endif
endfunction

autocmd FileType bsv call BSVSetPath(expand('<afile>:p:h'))

vim-bsv's People

Contributors

ksy9164 avatar mtikekar 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.