Skip to content
MarcusE1W edited this page Aug 25, 2018 · 16 revisions

Configuration

How do I change my theme?

Press alt_x to open the command line and type set theme= to see the list of available themes. Select one and press enter.

This theme setting directly corresponds to the variable howl.config.theme, which can be accessed programmatically in your init file. The same applies for every other setting available via the set command.

Where is my init file?

The init config file is located in ~/.howl/ and called either init.moon or init.lua, depending on which language you prefer. The init file is loaded and executed every time Howl is started.

How can I save the configuration modified by the set command?

Option 1: Run the save-config command. This saves all current global settings into ~/.howl/system/config.lua. Note that this is not your init file and not meant to be edited by hand. The config.lua file is automatically loaded on restarts and is overridden by any settings in your init file.

Option 2: Add code like the following to your init file:

howl.config.theme = 'Monokai'

The above example uses the Howl API to set the theme configuration.

What are all the configuration variables available?

To see a list of all variables, press alt_x to open the command line and type set (with trailing space). This shows a completion list of all variables with descriptions (screenshot).

Can I use custom fonts?

Yes, starting with 0.6 you can use custom fonts by putting them in a fonts directory within your Howl configuration directory (typically this would be ~/.howl/fonts).

Key bindings

How can I add a new key binding to an existing command?

Add code like the following to your init.lua file:

howl.bindings.push({'editor' : {'ctrl_e': 'howl-moon-eval'}})

Here the ctrl_e specifies the keystroke of pressing Ctrl and e together and binds it to the howl-moon-eval command.

If you use a init.moon file, a similar example in moonscript looks like this:

howl.bindings.push { ctrl_q: 'quit'
                     f1: -> howl.command.run howl.interact.select_command!
                   }
  • The first line binds Ctrl and q to quit the editor.
  • The second line opens the command line and enables the command search immediately and binds that to the key F1.

Additional key bindings can be added to the table between the brackets { }.

How do I find the keystroke name for a key combination?

Run the describe-key command. This opens a special buffer which shows the keystroke name for any key you press. Press escape to exit this mode.

Can I use Vim keybindings?

Yes. Run the command vi-on. To make this setting permanent, you can add one of the following stanzas to the init file you're using:

Lua (init.lua):

howl.signal.connect('app-ready', function() howl.command.vi_on() end)

Moonscript (init.moon):

howl.signal.connect 'app-ready', ->
  howl.command.vi_on!

Can I get a command palette similar to Atom or Sublime Text?

This function resembles the behavior of Ctrl-Shift-P in Atom or Sublime Text to open the command pallette and makes it easy to explore the available commands.

As the keystrokes are shown next to the command it is also helpful to memorize the keystrokes.

In your init.moon add this code:

-- open command select list together with the command line when F1 is pressed
howl.bindings.push f1: -> howl.command.run howl.interact.select_command!

When you press F1 the command select will open. You can replace f1 with any other key if you like. This code gives the same result as pressing Alt-x and then TAB.

Editing

How do I configure the tab width?

The indentation is specified by the indent configuration variable. To set it to any value, say 4, run set indent=4.

Can I disable auto-completion within comments?

Yes. Use the configuration variable completion_skip_auto_within which is a comma separated list of styles. To disable completion within comments use set completion_skip_auto_within@global=comment.

Extending

How can I add hooks to events, e.g., calling a function when saving a file or entering a mode?

Hooks are defined using the howl.signal module. Here is an example that prints a message every time a file is saved:

howl.signal.connect('buffer-saved', function(buffer) {print('saved a buffer')})

The list of all available signals can be seen by running the describe-signal command.