Giter Site home page Giter Site logo

gnuplot.vim's Introduction

Gnuplot syntax highlighting for Vim

PRs Welcome

I built this package from the ground up as a follow up to the work made by James Eberle and Andrew Rasmussen.

Notice

The aim of this package is to provide up-to-date support for gnuplot syntax. I'm basing the support for gnuplot 5.5 which is currently in development.

Installation

Using a plugin manager

This plugin follows the standard runtime path structure, and as such it can be installed with a variety of plugin managers:

Plugin Manager Install with...
Pathogen git clone https://github.com/dpezto/gnuplot.vim ~/.vim/bundle/gnuplot
Vundle Plugin 'dpezto/gnuplot.vim'
Plug Plug 'dpezto/gnuplot.vim'
minpac call minpac#add('dpezto/gnuplot.vim')
pack feature (native Vim 8 package feature) git clone https://github.com/dpezto/gnuplot.vim ~/.vim/pack/plugins/start/gnuplot

Manual installation

In order to have vim automatically detect gnuplot files, you need to have ftplugins enabled (e.g. by having this line in your .vimrc file:

:filetype plugin on

The plugin already sets up some logic to detect gnuplot files. In order that the gnuplot filetype plugin is loaded correctly, vim needs to be enabled to load filetype-plugins. This can be ensured by putting a line like this in your .vimrc:

:filetype plugin on

(see also :filetype-plugin-on).

In case this did not work, you need to setup vim like this:

To have Vim automatically detect gnuplot files, you need to do the following.

  1. Create your user runtime directory if you do not have one yet. This directory needs to be in your 'runtime' path. In Unix this would typically the ~/.vim directory, while in Windows this is usually your /vimfiles directory. Use :echo expand("") to find out, what Vim thinks your user directory is. To create this directory, you can do:

    :!mkdir ~/.vim

    for Unix and

    :!mkdir ~/vimfiles

    for Windows.

  2. In that directory you create a file that will detect gnuplot files.

if exists("did_load_filetypes")
  finish
endif
augroup filetypedetect
au! BufNewFile,BufRead *.plt,*.plot,*.gnuplot,*.gnu,*.gp setf gnuplot
augroup END

You save this file as "filetype.vim" in your user runtime diretory:

:w ~/.vim/filetype.vim
  1. To be able to use your new filetype.vim detection, you need to restart Vim. Vim will then load the gnuplot filetype plugin for all files whose names end with .plt, .plot, .gnuplot, .gnu, .gp.

Status

This began as a personal project since I prefer the results of the plots made with gnuplot, so most of the syntax currently in the file is for my use case. Despite this, the package can handle almost all use cases of gnuplot. I'm looking forward to refine the syntax highlighting.

gnuplot.vim's People

Contributors

dpezto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gnuplot.vim's Issues

Method for neovim-gnuplot highlight using your /syntax/gnuplot.vim file

In fact, your effect for highlight of gnuplot files in neovim is almost done. Here is what I do.

  1. grab your /syntax/gnuplot.vim file to .config/nvim/syntax, intact.

  2. create a file .config/nvim/filetype.vim, and the content should be like:

if exists("did_load_filetypes")
finish
endif
augroup filetypedetect
au! BufNewFile,BufRead .plt,.plot,.gnuplot,.gnu,*.gp setf gnuplot
augroup END

The method is the manual approach C of neovim document: new-filetype in https://neovim.io/doc/user/filetype.html#new-filetype

  1. try any .gp file. I works for me now

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.