discuss@lists.openscad.org

OpenSCAD general discussion

View all threads

Auto suggestions for custom functions

SP
Sanjeev Prabhakar
Sun, Jan 2, 2022 4:40 AM

Hi,
Is there a way, Auto completion or auto suggestion works for custom
functions in openscad.
I have made a library of various function, unfortunately I myself tend to
forget a lot of them and then need to search for the same.
Thanks and Regards
Sanjeev

Hi, Is there a way, Auto completion or auto suggestion works for custom functions in openscad. I have made a library of various function, unfortunately I myself tend to forget a lot of them and then need to search for the same. Thanks and Regards Sanjeev
MH
Matthieu Hendriks
Mon, Jan 3, 2022 7:01 AM

I'm also very interested if there is such a possibility. No one?

Groet Matthieu



Sanjeev Prabhakar schreef op 2022-01-02 05:40:

Hi,
Is there a way, Auto completion or auto suggestion works for custom
functions in openscad.
I have made a library of various function, unfortunately I myself tend
to forget a lot of them and then need to search for the same.
Thanks and Regards
Sanjeev


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I'm also very interested if there is such a possibility. No one? Groet Matthieu ------------------------- ------------------------- Sanjeev Prabhakar schreef op 2022-01-02 05:40: > Hi, > Is there a way, Auto completion or auto suggestion works for custom > functions in openscad. > I have made a library of various function, unfortunately I myself tend > to forget a lot of them and then need to search for the same. > Thanks and Regards > Sanjeev > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
VB
Victor Buciuc
Mon, Jan 3, 2022 8:42 AM

Hi,

The only option is to use an external editor that supports LSP (the
language server protocol) like Emacs, Vim, Visual Studio, and a
language server like https://github.com/dzhu/openscad-language-server.

I have yet to try this myself, so 'tis purely theoretical.

Regards,
Victor Buciuc

On Mon, Jan 3, 2022 at 9:01 AM Matthieu Hendriks mhendriks@digirent.nl
wrote:

I'm also very interested if there is such a possibility. No one?
Groet Matthieu


Sanjeev Prabhakar schreef op 2022-01-02 05:40:

Hi,
Is there a way, Auto completion or auto suggestion works for custom
functions in openscad.
I have made a library of various function, unfortunately I myself tend to
forget a lot of them and then need to search for the same.
Thanks and Regards
Sanjeev


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Hi, The only option is to use an external editor that supports LSP (the language server protocol) like Emacs, Vim, Visual Studio, and a language server like https://github.com/dzhu/openscad-language-server. I have yet to try this myself, so 'tis purely theoretical. Regards, Victor Buciuc On Mon, Jan 3, 2022 at 9:01 AM Matthieu Hendriks <mhendriks@digirent.nl> wrote: > I'm also very interested if there is such a possibility. No one? > Groet Matthieu > ------------------------------ > > ------------------------------ > > > Sanjeev Prabhakar schreef op 2022-01-02 05:40: > > Hi, > Is there a way, Auto completion or auto suggestion works for custom > functions in openscad. > I have made a library of various function, unfortunately I myself tend to > forget a lot of them and then need to search for the same. > Thanks and Regards > Sanjeev > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SP
Sanjeev Prabhakar
Mon, Jan 3, 2022 12:52 PM

Thanks Victor for your reply, although it is quite difficult for me to
understand as to how to apply this.

On Mon, 3 Jan 2022, 14:13 Victor Buciuc, victor.buciuc@gmail.com wrote:

Hi,

The only option is to use an external editor that supports LSP (the
language server protocol) like Emacs, Vim, Visual Studio, and a
language server like https://github.com/dzhu/openscad-language-server.

I have yet to try this myself, so 'tis purely theoretical.

Regards,
Victor Buciuc

On Mon, Jan 3, 2022 at 9:01 AM Matthieu Hendriks mhendriks@digirent.nl
wrote:

I'm also very interested if there is such a possibility. No one?
Groet Matthieu


Sanjeev Prabhakar schreef op 2022-01-02 05:40:

Hi,
Is there a way, Auto completion or auto suggestion works for custom
functions in openscad.
I have made a library of various function, unfortunately I myself tend to
forget a lot of them and then need to search for the same.
Thanks and Regards
Sanjeev


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Thanks Victor for your reply, although it is quite difficult for me to understand as to how to apply this. On Mon, 3 Jan 2022, 14:13 Victor Buciuc, <victor.buciuc@gmail.com> wrote: > Hi, > > The only option is to use an external editor that supports LSP (the > language server protocol) like Emacs, Vim, Visual Studio, and a > language server like https://github.com/dzhu/openscad-language-server. > > I have yet to try this myself, so 'tis purely theoretical. > > Regards, > Victor Buciuc > > > On Mon, Jan 3, 2022 at 9:01 AM Matthieu Hendriks <mhendriks@digirent.nl> > wrote: > >> I'm also very interested if there is such a possibility. No one? >> Groet Matthieu >> ------------------------------ >> >> ------------------------------ >> >> >> Sanjeev Prabhakar schreef op 2022-01-02 05:40: >> >> Hi, >> Is there a way, Auto completion or auto suggestion works for custom >> functions in openscad. >> I have made a library of various function, unfortunately I myself tend to >> forget a lot of them and then need to search for the same. >> Thanks and Regards >> Sanjeev >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
VB
Victor Buciuc
Mon, Jan 3, 2022 1:16 PM

Hi,

Indeed, experience using a text editor for programming would help a lot
here, but it's not impossible to get it working if you don't have it.

The basics steps would be:

  1. Choose an editor with LSP support that's known to work with OpenSCAD -
    out of
    https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_an_external_Editor_with_OpenSCAD
    probably Visual Studio or Sublime could be easier to start with.
  2. Install said editor.
  3. Follow the installation instructions to install the lsp server:
    https://github.com/dzhu/openscad-language-server
  4. Configure your chosen editor to use said lsp server (check the editor
    docs).
  5. Profit

Regards,
Victor Buciuc

On Mon, Jan 3, 2022, 2:52 PM Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

Thanks Victor for your reply, although it is quite difficult for me to
understand as to how to apply this.

On Mon, 3 Jan 2022, 14:13 Victor Buciuc, victor.buciuc@gmail.com wrote:

Hi,

The only option is to use an external editor that supports LSP (the
language server protocol) like Emacs, Vim, Visual Studio, and a
language server like https://github.com/dzhu/openscad-language-server.

I have yet to try this myself, so 'tis purely theoretical.

Regards,
Victor Buciuc

On Mon, Jan 3, 2022 at 9:01 AM Matthieu Hendriks mhendriks@digirent.nl
wrote:

I'm also very interested if there is such a possibility. No one?
Groet Matthieu


Sanjeev Prabhakar schreef op 2022-01-02 05:40:

Hi,
Is there a way, Auto completion or auto suggestion works for custom
functions in openscad.
I have made a library of various function, unfortunately I myself tend
to forget a lot of them and then need to search for the same.
Thanks and Regards
Sanjeev


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Hi, Indeed, experience using a text editor for programming would help a lot here, but it's not impossible to get it working if you don't have it. The basics steps would be: 1. Choose an editor with LSP support that's known to work with OpenSCAD - out of https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_an_external_Editor_with_OpenSCAD probably Visual Studio or Sublime could be easier to start with. 2. Install said editor. 3. Follow the installation instructions to install the lsp server: https://github.com/dzhu/openscad-language-server 4. Configure your chosen editor to use said lsp server (check the editor docs). 5. Profit Regards, Victor Buciuc On Mon, Jan 3, 2022, 2:52 PM Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > Thanks Victor for your reply, although it is quite difficult for me to > understand as to how to apply this. > > > > On Mon, 3 Jan 2022, 14:13 Victor Buciuc, <victor.buciuc@gmail.com> wrote: > >> Hi, >> >> The only option is to use an external editor that supports LSP (the >> language server protocol) like Emacs, Vim, Visual Studio, and a >> language server like https://github.com/dzhu/openscad-language-server. >> >> I have yet to try this myself, so 'tis purely theoretical. >> >> Regards, >> Victor Buciuc >> >> >> On Mon, Jan 3, 2022 at 9:01 AM Matthieu Hendriks <mhendriks@digirent.nl> >> wrote: >> >>> I'm also very interested if there is such a possibility. No one? >>> Groet Matthieu >>> ------------------------------ >>> >>> ------------------------------ >>> >>> >>> Sanjeev Prabhakar schreef op 2022-01-02 05:40: >>> >>> Hi, >>> Is there a way, Auto completion or auto suggestion works for custom >>> functions in openscad. >>> I have made a library of various function, unfortunately I myself tend >>> to forget a lot of them and then need to search for the same. >>> Thanks and Regards >>> Sanjeev >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
SP
Sanjeev Prabhakar
Mon, Jan 3, 2022 1:28 PM

Thanks Victor for your detailed explanation.
Will give it a try

On Mon, 3 Jan 2022, 18:46 Victor Buciuc, victor.buciuc@gmail.com wrote:

Hi,

Indeed, experience using a text editor for programming would help a lot
here, but it's not impossible to get it working if you don't have it.

The basics steps would be:

  1. Choose an editor with LSP support that's known to work with OpenSCAD -
    out of
    https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_an_external_Editor_with_OpenSCAD
    probably Visual Studio or Sublime could be easier to start with.
  2. Install said editor.
  3. Follow the installation instructions to install the lsp server:
    https://github.com/dzhu/openscad-language-server
  4. Configure your chosen editor to use said lsp server (check the editor
    docs).
  5. Profit

Regards,
Victor Buciuc

On Mon, Jan 3, 2022, 2:52 PM Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

Thanks Victor for your reply, although it is quite difficult for me to
understand as to how to apply this.

On Mon, 3 Jan 2022, 14:13 Victor Buciuc, victor.buciuc@gmail.com wrote:

Hi,

The only option is to use an external editor that supports LSP (the
language server protocol) like Emacs, Vim, Visual Studio, and a
language server like https://github.com/dzhu/openscad-language-server.

I have yet to try this myself, so 'tis purely theoretical.

Regards,
Victor Buciuc

On Mon, Jan 3, 2022 at 9:01 AM Matthieu Hendriks mhendriks@digirent.nl
wrote:

I'm also very interested if there is such a possibility. No one?
Groet Matthieu


Sanjeev Prabhakar schreef op 2022-01-02 05:40:

Hi,
Is there a way, Auto completion or auto suggestion works for custom
functions in openscad.
I have made a library of various function, unfortunately I myself tend
to forget a lot of them and then need to search for the same.
Thanks and Regards
Sanjeev


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Thanks Victor for your detailed explanation. Will give it a try On Mon, 3 Jan 2022, 18:46 Victor Buciuc, <victor.buciuc@gmail.com> wrote: > Hi, > > Indeed, experience using a text editor for programming would help a lot > here, but it's not impossible to get it working if you don't have it. > > The basics steps would be: > > 1. Choose an editor with LSP support that's known to work with OpenSCAD - > out of > https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_an_external_Editor_with_OpenSCAD > probably Visual Studio or Sublime could be easier to start with. > 2. Install said editor. > 3. Follow the installation instructions to install the lsp server: > https://github.com/dzhu/openscad-language-server > 4. Configure your chosen editor to use said lsp server (check the editor > docs). > 5. Profit > > Regards, > Victor Buciuc > > On Mon, Jan 3, 2022, 2:52 PM Sanjeev Prabhakar <sprabhakar2006@gmail.com> > wrote: > >> Thanks Victor for your reply, although it is quite difficult for me to >> understand as to how to apply this. >> >> >> >> On Mon, 3 Jan 2022, 14:13 Victor Buciuc, <victor.buciuc@gmail.com> wrote: >> >>> Hi, >>> >>> The only option is to use an external editor that supports LSP (the >>> language server protocol) like Emacs, Vim, Visual Studio, and a >>> language server like https://github.com/dzhu/openscad-language-server. >>> >>> I have yet to try this myself, so 'tis purely theoretical. >>> >>> Regards, >>> Victor Buciuc >>> >>> >>> On Mon, Jan 3, 2022 at 9:01 AM Matthieu Hendriks <mhendriks@digirent.nl> >>> wrote: >>> >>>> I'm also very interested if there is such a possibility. No one? >>>> Groet Matthieu >>>> ------------------------------ >>>> >>>> ------------------------------ >>>> >>>> >>>> Sanjeev Prabhakar schreef op 2022-01-02 05:40: >>>> >>>> Hi, >>>> Is there a way, Auto completion or auto suggestion works for custom >>>> functions in openscad. >>>> I have made a library of various function, unfortunately I myself tend >>>> to forget a lot of them and then need to search for the same. >>>> Thanks and Regards >>>> Sanjeev >>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
JW
Jim Witte
Tue, Jan 4, 2022 3:47 PM

Where is the autocomplete "list of strings" in the source code?

On Sat, Jan 1, 2022 at 11:41 PM Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

Hi,
Is there a way, Auto completion or auto suggestion works for custom
functions in openscad.
I have made a library of various function, unfortunately I myself tend to
forget a lot of them and then need to search for the same.
Thanks and Regards
Sanjeev


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Where is the autocomplete "list of strings" in the source code? On Sat, Jan 1, 2022 at 11:41 PM Sanjeev Prabhakar <sprabhakar2006@gmail.com> wrote: > Hi, > Is there a way, Auto completion or auto suggestion works for custom > functions in openscad. > I have made a library of various function, unfortunately I myself tend to > forget a lot of them and then need to search for the same. > Thanks and Regards > Sanjeev > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
TP
Torsten Paul
Tue, Jan 4, 2022 4:03 PM

On 04.01.22 16:47, Jim Witte wrote:

Where is the autocomplete "list of strings" in the source code?

It's collected from different places by registering in a class
called Builtins. The autocomplete part retrieving that list is

https://github.com/openscad/openscad/blob/master/src/ScadApi.cc#L52-L62

Some initial work for "Jump to Definition", which needs pretty
much the same data can be found in

https://github.com/openscad/openscad/pull/3283

ciao,
Torsten.

On 04.01.22 16:47, Jim Witte wrote: > Where is the autocomplete "list of strings" in the source code? It's collected from different places by registering in a class called Builtins. The autocomplete part retrieving that list is https://github.com/openscad/openscad/blob/master/src/ScadApi.cc#L52-L62 Some initial work for "Jump to Definition", which needs pretty much the same data can be found in https://github.com/openscad/openscad/pull/3283 ciao, Torsten.
MH
Matthieu Hendriks
Sun, Jan 9, 2022 3:48 PM

I've succesfully completed the steps, in ubuntu and vim for:

syntax highlighting and autocomplete for custom functions as follows:

  1. Unzip de included zip file in your ~/.vim directory

  2. Create an textfile with your lines for autocomplete. (I've included
    an examplem, the first lines are from my own library with custom
    functions, but you can fill in anything, followed by all openscad
    commands fromn the cheatsheet)

  3. adjust the location after readfile for this autocomplete.txt file in
    ./vim/ftplugin/openscad.vim

_ let l:data =
readfile("/home/matthieu/openscad_drawings/libraries/autocomplete.txt")_

When you are in vim in your file.scad in insertion mode

type the first letter(s) followed by ctrl-x ctrl-u and make your choice
from the popup list.

Groet Matthieu


Victor Buciuc schreef op 2022-01-03 14:16:

Hi,

Indeed, experience using a text editor for programming would help a lot
here, but it's not impossible to get it working if you don't have it.

The basics steps would be:

  1. Choose an editor with LSP support that's known to work with OpenSCAD
  1. Install said editor.
  2. Follow the installation instructions to install the lsp server:
    https://github.com/dzhu/openscad-language-server
  3. Configure your chosen editor to use said lsp server (check the
    editor docs).
  4. Profit

Regards,
Victor Buciuc

On Mon, Jan 3, 2022, 2:52 PM Sanjeev Prabhakar
sprabhakar2006@gmail.com wrote:
Thanks Victor for your reply, although it is quite difficult for me to
understand as to how to apply this.

On Mon, 3 Jan 2022, 14:13 Victor Buciuc, victor.buciuc@gmail.com
wrote:
Hi,

The only option is to use an external editor that supports LSP (the
language server protocol) like Emacs, Vim, Visual Studio, and a
language server like https://github.com/dzhu/openscad-language-server.

I have yet to try this myself, so 'tis purely theoretical.

Regards,

Victor Buciuc

On Mon, Jan 3, 2022 at 9:01 AM Matthieu Hendriks
mhendriks@digirent.nl wrote:

I'm also very interested if there is such a possibility. No one?

Groet Matthieu



Sanjeev Prabhakar schreef op 2022-01-02 05:40:

Hi,
Is there a way, Auto completion or auto suggestion works for custom
functions in openscad.
I have made a library of various function, unfortunately I myself tend
to forget a lot of them and then need to search for the same.
Thanks and Regards
Sanjeev


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

I've succesfully completed the steps, in ubuntu and vim for: syntax highlighting and autocomplete for custom functions as follows: 1. Unzip de included zip file in your ~/.vim directory 2. Create an textfile with your lines for autocomplete. (I've included an examplem, the first lines are from my own library with custom functions, but you can fill in anything, followed by all openscad commands fromn the cheatsheet) 3. adjust the location after readfile for this autocomplete.txt file in ./vim/ftplugin/openscad.vim _ let l:data = readfile("/home/matthieu/openscad_drawings/libraries/autocomplete.txt")_ When you are in vim in your file.scad in insertion mode type the first letter(s) followed by ctrl-x ctrl-u and make your choice from the popup list. Groet Matthieu ------------------------- Victor Buciuc schreef op 2022-01-03 14:16: > Hi, > > Indeed, experience using a text editor for programming would help a lot > here, but it's not impossible to get it working if you don't have it. > > The basics steps would be: > > 1. Choose an editor with LSP support that's known to work with OpenSCAD > - out of > https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_an_external_Editor_with_OpenSCAD > probably Visual Studio or Sublime could be easier to start with. > 2. Install said editor. > 3. Follow the installation instructions to install the lsp server: > https://github.com/dzhu/openscad-language-server > 4. Configure your chosen editor to use said lsp server (check the > editor docs). > 5. Profit > > Regards, > Victor Buciuc > > On Mon, Jan 3, 2022, 2:52 PM Sanjeev Prabhakar > <sprabhakar2006@gmail.com> wrote: > Thanks Victor for your reply, although it is quite difficult for me to > understand as to how to apply this. > > On Mon, 3 Jan 2022, 14:13 Victor Buciuc, <victor.buciuc@gmail.com> > wrote: > Hi, > > The only option is to use an external editor that supports LSP (the > language server protocol) like Emacs, Vim, Visual Studio, and a > language server like https://github.com/dzhu/openscad-language-server. > > I have yet to try this myself, so 'tis purely theoretical. > > Regards, > > Victor Buciuc > > On Mon, Jan 3, 2022 at 9:01 AM Matthieu Hendriks > <mhendriks@digirent.nl> wrote: > > I'm also very interested if there is such a possibility. No one? > > Groet Matthieu > > ------------------------- > > ------------------------- > > Sanjeev Prabhakar schreef op 2022-01-02 05:40: > > Hi, > Is there a way, Auto completion or auto suggestion works for custom > functions in openscad. > I have made a library of various function, unfortunately I myself tend > to forget a lot of them and then need to search for the same. > Thanks and Regards > Sanjeev > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org _______________________________________________ OpenSCAD mailing list To unsubscribe send an email to discuss-leave@lists.openscad.org
SP
Sanjeev Prabhakar
Sun, Jan 9, 2022 4:32 PM

Thanks Matthieu for sharing this.
I have no idea how vim works, will learn and give it a try.

On Sun, 9 Jan 2022 at 21:24, Matthieu Hendriks mhendriks@digirent.nl
wrote:

I've succesfully completed the steps, in ubuntu and vim for:

syntax highlighting and autocomplete for custom functions as follows:

  1. Unzip de included zip file in your ~/.vim directory

  2. Create an textfile with your lines for autocomplete. (I've included an
    examplem, the first lines are from my own library with custom functions,
    but you can fill in anything, followed by all openscad commands fromn the
    cheatsheet)

  3. adjust the location after readfile for this autocomplete.txt file in
    ./vim/ftplugin/openscad.vim

  • let l:data =
    readfile("/home/matthieu/openscad_drawings/libraries/autocomplete.txt")*

When you are in vim in your file.scad in insertion mode

type the first letter(s) followed by ctrl-x ctrl-u and make your choice
from the popup list.

Groet Matthieu


Victor Buciuc schreef op 2022-01-03 14:16:

Hi,

Indeed, experience using a text editor for programming would help a lot
here, but it's not impossible to get it working if you don't have it.

The basics steps would be:

  1. Choose an editor with LSP support that's known to work with OpenSCAD -
    out of
    https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_an_external_Editor_with_OpenSCAD
    probably Visual Studio or Sublime could be easier to start with.
  2. Install said editor.
  3. Follow the installation instructions to install the lsp server:
    https://github.com/dzhu/openscad-language-server
  4. Configure your chosen editor to use said lsp server (check the editor
    docs).
  5. Profit

Regards,
Victor Buciuc

On Mon, Jan 3, 2022, 2:52 PM Sanjeev Prabhakar sprabhakar2006@gmail.com
wrote:

Thanks Victor for your reply, although it is quite difficult for me to
understand as to how to apply this.

On Mon, 3 Jan 2022, 14:13 Victor Buciuc, victor.buciuc@gmail.com wrote:

Hi,

The only option is to use an external editor that supports LSP (the
language server protocol) like Emacs, Vim, Visual Studio, and a
language server like https://github.com/dzhu/openscad-language-server.

I have yet to try this myself, so 'tis purely theoretical.

Regards,
Victor Buciuc

On Mon, Jan 3, 2022 at 9:01 AM Matthieu Hendriks mhendriks@digirent.nl
wrote:

I'm also very interested if there is such a possibility. No one?
Groet Matthieu


Sanjeev Prabhakar schreef op 2022-01-02 05:40:

Hi,
Is there a way, Auto completion or auto suggestion works for custom
functions in openscad.
I have made a library of various function, unfortunately I myself tend to
forget a lot of them and then need to search for the same.
Thanks and Regards
Sanjeev


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Thanks Matthieu for sharing this. I have no idea how vim works, will learn and give it a try. On Sun, 9 Jan 2022 at 21:24, Matthieu Hendriks <mhendriks@digirent.nl> wrote: > I've succesfully completed the steps, in ubuntu and vim for: > > syntax highlighting and autocomplete for custom functions as follows: > > 1. Unzip de included zip file in your ~/.vim directory > > 2. Create an textfile with your lines for autocomplete. (I've included an > examplem, the first lines are from my own library with custom functions, > but you can fill in anything, followed by all openscad commands fromn the > cheatsheet) > > 3. adjust the location after readfile for this autocomplete.txt file in > ./vim/ftplugin/openscad.vim > > * let l:data = > readfile("/home/matthieu/openscad_drawings/libraries/autocomplete.txt")* > > When you are in vim in your file.scad in insertion mode > > type the first letter(s) followed by ctrl-x ctrl-u and make your choice > from the popup list. > > > Groet Matthieu > > > ------------------------------ > > > Victor Buciuc schreef op 2022-01-03 14:16: > > Hi, > > Indeed, experience using a text editor for programming would help a lot > here, but it's not impossible to get it working if you don't have it. > > The basics steps would be: > > 1. Choose an editor with LSP support that's known to work with OpenSCAD - > out of > https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_an_external_Editor_with_OpenSCAD > probably Visual Studio or Sublime could be easier to start with. > 2. Install said editor. > 3. Follow the installation instructions to install the lsp server: > https://github.com/dzhu/openscad-language-server > 4. Configure your chosen editor to use said lsp server (check the editor > docs). > 5. Profit > > Regards, > Victor Buciuc > > On Mon, Jan 3, 2022, 2:52 PM Sanjeev Prabhakar <sprabhakar2006@gmail.com> > wrote: > > Thanks Victor for your reply, although it is quite difficult for me to > understand as to how to apply this. > > > > On Mon, 3 Jan 2022, 14:13 Victor Buciuc, <victor.buciuc@gmail.com> wrote: > > Hi, > > The only option is to use an external editor that supports LSP (the > language server protocol) like Emacs, Vim, Visual Studio, and a > language server like https://github.com/dzhu/openscad-language-server. > > I have yet to try this myself, so 'tis purely theoretical. > > Regards, > Victor Buciuc > > On Mon, Jan 3, 2022 at 9:01 AM Matthieu Hendriks <mhendriks@digirent.nl> > wrote: > > I'm also very interested if there is such a possibility. No one? > Groet Matthieu > ------------------------------ > > ------------------------------ > > > Sanjeev Prabhakar schreef op 2022-01-02 05:40: > > Hi, > Is there a way, Auto completion or auto suggestion works for custom > functions in openscad. > I have made a library of various function, unfortunately I myself tend to > forget a lot of them and then need to search for the same. > Thanks and Regards > Sanjeev > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >