ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Nim​Plus

by vanyle ST4

Nim plugin for Sublime Text 4 with IDE like features

Details

Installs

  • Total 134
  • Win 51
  • Mac 33
  • Linux 50
Feb 6 Feb 5 Feb 4 Feb 3 Feb 2 Feb 1 Jan 31 Jan 30 Jan 29 Jan 28 Jan 27 Jan 26 Jan 25 Jan 24 Jan 23 Jan 22 Jan 21 Jan 20 Jan 19 Jan 18 Jan 17 Jan 16 Jan 15 Jan 14 Jan 13 Jan 12 Jan 11 Jan 10 Jan 9 Jan 8 Jan 7 Jan 6 Jan 5 Jan 4 Jan 3 Jan 2 Jan 1 Dec 31 Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23
Windows 0 1 1 1 1 2 0 2 0 2 4 1 0 0 2 1 4 0 0 1 0 0 1 0 1 2 0 0 0 1 1 1 1 0 2 0 2 0 2 1 1 0 2 1 0 2
Mac 0 0 0 1 0 0 0 0 1 0 1 1 1 1 1 1 1 0 1 0 0 0 0 2 1 1 0 0 0 2 4 3 0 1 2 1 1 0 1 0 1 1 0 0 0 0
Linux 1 4 0 2 1 0 1 0 0 2 1 1 0 1 3 1 0 0 0 1 0 1 1 0 1 2 1 2 0 3 2 0 1 1 1 0 2 1 1 4 0 1 1 0 0 0

Readme

Source
raw.​githubusercontent.​com

NimPlus

(Formerly named SublimeNim)

Nim Programming Language plugin for Sublime Text 4

Requires version 4073 or higher.

  • Q: Why not use NimLime ?
  • A: NimLime dropped support for NimSuggest and Nimble. It now focuses on providing language highlighting support. The goal of NimPlus is to have IDE like support for Nim including autocompletion, type information tooltips and more (see the Features section)

We currently support Window and Linux. Other OS might work but aren't tested.

Features

  • Syntax highlighting
  • Highlight errors (Using nim check)
  • Show tooltips with type informations
  • Goto Definition (link inside tooltip)
  • Autocompletion (based on nimsuggest)
  • Shows your documentation
  • Keyboard shortcuts for building and generating documentation
  • Prettify your code with nimpretty

demo

Installation

Package Control is required. Find how to install it here: https://packagecontrol.io/installation If you have other packages installed, you probably also have already installed Package Control.

  1. Ctrl+Shift+P
  2. Select Package Control: Add repository
  3. Enter URL: https://github.com/vanyle/NimPlus
  4. Install package
  5. NimPlus
  6. Enter

Settings, Usage and Tips

To see what NimPlus is capable of, open the Command Palette (Ctrl+Shift+P ), and type NimPlus. This will list most NimPlus features.

You can install the ANSIescape package to enjoy the syntax coloring of the terminal when building. This is optional.

Depending on how much you want Sublime to behave as an IDE or as a text editor, you can toggle the following features. You can see all the toggles inside your preference file.

Open it with: Preferences > Package Settings > NimPlus > Settings - Default

Error highlighting

Toggle with nimplus.savecheck

After saving, will check the current file for errors. See screenshot above.

Tooltips

Toggle with nimplus.hoverdescription

Will show the types and the docstring of the variable and procedure you hover over.

Auto completion

Toggle with nimplus.autocomplete

Will propose completion options based on nimsuggest's sug feature.

You need to enable autocompletion in Sublime Text settings

Build shortcuts

Ctrl+B : Compile and Run the current nimble project

Ctrl+Shift+B : Compile the current nimble project

You can change these with:
Preferences > Package Settings > NimPlus > Key Bindings - Default

Possible configuration:

[
    {
        "keys":["ctrl+b"],
        "command":"run_nim" // put run_nim or run_nimble depending on if you use nim more as a scripting tool or for big projects.
    },
    {
        "keys":["ctrl+shift+b"],
        "command":"compile_nim" // same here
    },

]

When building, the result will be shown inside the Sublime Text terminal. You might want to change this behavior. The first settings controls the regular builds and the second setting controls the nimble builds. The compilation will always occur inside the Sublime Text terminal, only the run command can be customized.

// possible values:
// `[]` => Use the Sublime Text terminal (readonly)
// `["wt"]` => Use Windows Terminal
// `["start","cmd","/k"]` => Please use something more modern ...
// `["start","powershell","-Command"]` => Use Powershell
{
    // other values ...
    "nimplus.nim.console":["wt"],
    "nimplus.nimble.console":["wt"]
}

By default, NimPlus does not use the Build System integrated into Sublime Text. Instead, NimPlus uses custom commands that perform the building. This allows us to control what terminal is used to run the command and other options.

If you prefer using Build System, comment the lines inside the Key Bindings - Default files to disable the Custom Sublime Nim building and check the option in:

Tools > Build System > Nim

Note that the Build System does not support nimble.

Usage with Terminus

Terminus is a package that adds a real terminal inside Sublime Text with colored output and interaction and evverything.

If it is installed, you can run your programs inside of it instead of the default output panel with the config switch “js "nimplus.use_terminus”: true

Contributing
------------

Pull requests are **not** welcome.
I might still merge them if I feel like it thou.
Open an issue if you have a problem.