Giter Club home page Giter Club logo

vim-golang's Introduction

No Maintenance Intended

This project is my own fork of Go's Vim runtime files. I intended to add some additional features to it that won't make their way upstream, but which you may find useful.

Unfortunately, I don't write a whole of Go these days, so I stopped working on it and don't intend to continue. I'm leaving to code as potential inspiration for somebody else :).

Some notable changes:

  • :Godoc is smarter, and can now look for a particular symbol (function call) as well as packages.
  • Minimal syntax highlighting for the godoc buffer.
  • Function text objects
  • The gf family of mappings work for packages
  • The :A command opens the related test file
  • :Fmt can be given several arguments that change its behaviour

For the official runtime files, straight from the Golang project, go to golang.org/misc/vim/.

Usage

This plugin provides filetype detection, syntax highlighting and indentation for the Go programming language. It also includes some useful tools for working with Go code.

For the most basic usage, just install the plugin and edit Go code. You should get the basic benefits automatically.

If you want to use the other tools, please take a look at the documentation in doc/golang.txt, or within Vim itself with :help golang.

Installation

There are several ways to install the plugin. The recommended one is by using Tim Pope's pathogen. In that case, you can clone the plugin's git repository like so:

git clone git://github.com/AndrewRadev/vim-golang.git ~/.vim/bundle/golang

If your vim configuration is under git version control, you could also set up the repository as a submodule, which would allow you to update more easily. The command is (provided you're in ~/.vim):

git submodule add git://github.com/AndrewRadev/vim-golang.git bundle/golang

Another way is to simply copy all the essential directories inside the ~/.vim directory: autoload, doc, ftdetect, ftplugin, indent, plugin, syntax.

vim-golang's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vim-golang's Issues

Support for multiple "import" statements

The go#FindImports function only works with the multiline syntax, e.g.:

import (
    "fmt"
    "strings"
)

But it doesn't work with multiple imports:

import "fmt"
import "strings"

Surprisingly, gofmt doesn't reformat the second form into the first, so it should be supported.

Reorganize autoload directory

I'm currently a bit unhappy with the structure of autoload/. It feels like the functions can be categorized and/or renamed in a better way. A plus would be to remove the autoload/go.vim file and only use directories to reduce the possibility of conflicts with user-created files.

The first step would likely be getting a list of all autoload functions and figuring out what they do and what their level of abstraction is.

Consistent naming of settings

It would be a good idea to use consistent prefixes for global settings, like g:golang_ or g:go_. First step would be to grep the codebase for all of them and check which ones are used by the upstream repo.

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.