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

Add support for sh (bash) #19

Open
nkakouros opened this issue Mar 12, 2019 · 1 comment
Open

Add support for sh (bash) #19

nkakouros opened this issue Mar 12, 2019 · 1 comment

Comments

@nkakouros
Copy link

There are 3 ways to implement a function:

function name() {
  ....
}

name() {
  ...
}

function name {
  ...
}

I copied after/ftplugin/c to after/ftplugin/sh and everything works except the thrid case with iF, af, aF. if works.

I tried to look into the regex used in c.vim but I quickly got overwhelmed.

What would it take for sh support to work for the third case as well?

Also, since c style functions may be used in other languages as well and in general there might be overlap between languages, it would be nice to have mechanism to alias filetypes. Sth like:

let g:textobj_function_aliases = {'sh': 'c'}
@seb-mueller
Copy link

An alias or alike would be indeed nice. I would for example like to add R support, the function definition is identical to C, but it feels wasteful to duplicate the C files in a PR. Or is this the desired behaviour?

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

2 participants