Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wanting to develop some features #91

Open
nadr0 opened this issue Jan 19, 2019 · 5 comments
Open

Wanting to develop some features #91

nadr0 opened this issue Jan 19, 2019 · 5 comments

Comments

@nadr0
Copy link

nadr0 commented Jan 19, 2019

I have been using this package every day at work for awhile now and I want to contribute to this project and develop some features. I don't know where to begin. I haven't programmed in emacslisp before and I don't know much about emacs/packages and how it all works. If anyone has any resources to understand emacslisp and how to create packages for emacs that would be great. Also if these features aren't what this package is looking for I have no problem forking my own for others to use.

This isn't a feature request list. I am trying to develop these features for myself and others if they want it. So I am wondering if any of these are possible to develop. Note: I use the Vim mode in spacemacs.

Autocomplete for

  • Computed Names,
  • Method Names,
  • sass class names,
  • data variables
  • etc ..

Automatic marking
http://vim.wikia.com/wiki/Using_marks
maset mark a at current cursor location
'ajump to line of mark a (first non-blank character in line)

I want to automatically mark these

  • computed for 'c
  • methods for 'm
  • template for 't
  • style tag for 's
  • and etc ...

Automatic file template
So when I create a new file I can just run a command to generate a generic template.

<template>

</template>

<script>
  export default {
    name: '',
    data () {
      return {};
    },
    // etc...
  }
</script>
    

<style lang="scss" scoped>

<style>

also I have no idea how to build/run/test the vue-mode package in this repo. Could someone give me some pointers?

@AdamNiederer
Copy link
Owner

AdamNiederer commented Jan 20, 2019

Hi, thanks for your interest in vue-mode! I'm still maintaining this package and use it daily, although I've been preoccupied by other tasks lately so most new development is on hold.

  • You can download this package, open vue-mode.el, and type eval-buffer to load everything into your current emacs session. Then, you can type M-x vue-mode in a .vue file to test your changes.
  • You can run the unit tests with ert, or the command line tool cask with cask exec ert-runner.
  • To build vue-mode, type M-x byte-compile while editing vue-mode.el. This will produce a faster .elc file, although this is done automatically when the package is uploaded to MELPA and is largely unnecessary for development.

I'd recommend looking at company and lsp-vue for autocompletion - a few people have set it up in the past, but I haven't invested the time in setting it up. You can also look at yasnippet for templating.

One other note: vue-mode uses mmm-mode to make editing html, js, and css in the same buffer possible. mmm-mode is a little temperamental and behaves strangely sometimes. You may encounter issues because of it that would not crop up in other single-language major modes. Some users have also reported issues with vue-mode on spacemacs which I have been unable to reproduce in vanilla emacs.

Good luck - feel free to ping me if you'd like any more information about vue-mode or emacs development in general.

@nadr0
Copy link
Author

nadr0 commented Jan 21, 2019

Thanks for the response! I'll start playing around with the code.

@DougBeney
Copy link

DougBeney commented Jan 25, 2019

This is good info. I'd like to help too when I get a chance.

vue-mode uses mmm-mode to make editing html, js, and css in the same buffer possible. mmm-mode is a little temperamental and behaves strangely sometimes.

I'm curious if mmm-mode is the best option. Found this page with a variety of choices.

https://www.emacswiki.org/emacs/MultipleModes

From what I can see, web-mode does not use mmm-mode. Since .vue files are just HTML files with some special rules, I'm wondering if it would be easy to fork (Or instead of fork it, configure it in some way) web-mode and just make a few changes to get it working.

@AdamNiederer
Copy link
Owner

This is good info. I'd like to help too when I get a chance.

vue-mode uses mmm-mode to make editing html, js, and css in the same buffer possible. mmm-mode is a little temperamental and behaves strangely sometimes.

I'm curious if mmm-mode is the best option. Found this page with a variety of choices.

https://www.emacswiki.org/emacs/MultipleModes

From what I can see, web-mode does not use mmm-mode. Since .vue files are just HTML files with some special rules, I'm wondering if it would be easy to fork (Or instead of fork it, configure it in some way) web-mode and just make a few changes to get it working.

I agree - mmm-mode is definitely a weight around vue-mode which should be addressed at some point in the future. I'm not sure if web-mode is the correct way forward, as they have their own product which ships new breaking versions regularly. I didn't know about polymode until now, though, so I'll check it out in the future.

Back when this project started, many linters/autocompleters/etc didn't know how to handle vue files, so hacking around the single-language linters was the best solution. This has changed for the better as time has progressed, and packages like lsp-vue have emerged.

@DougBeney
Copy link

packages like lsp-vue have emerged.

Which has now been added natively to lsp-mode :)

Syntax highlighting is not defined by a language server though, right? So vue-mode is still a required package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants