Vimcraft Docs/Configuration

Configuration

Vimcraft is configured using JavaScript (or TypeScript) with full IntelliSense support. Build your perfect editor with type-safe configuration.

Zero Configuration Philosophy

Vimcraft is designed to work out of the box with sensible defaults. You don't need any configuration to start using it. The configuration system exists to customize the editor to your exact preferences, not to make it usable.

If you find yourself needing to configure something beyond personal preferences (like theme or keybindings), please open a discussion — it might be a candidate for better defaults.

Configuration Format

Vimcraft uses JavaScript or TypeScript for configuration, giving you the full power of a programming language with IntelliSense, type checking, and hot reload.

File Location

The configuration file, init.js (or init.ts), is loaded from these locations:

  • $XDG_CONFIG_HOME/vimcraft/init.js
  • ~/.config/vimcraft/init.js (if XDG_CONFIG_HOME is not defined)
  • On macOS, also supports ~/Library/Application Support/com.vimcraft/init.js

Basic Syntax

Vimcraft uses standard JavaScript/TypeScript syntax with a Neovim-compatible API:

// Set options
vim.opt.number = true;
vim.opt.cursorLine = true;
vim.opt.tabStop = 2;
vim.opt.shiftWidth = 2;

// Define keymaps
vim.keymap.set('n', '<leader>ff', () => {
  vim.lsp.buf.format();
});

vim.keymap.set('n', '<leader>fs', () => {
  vim.lsp.buf.save();
});

// Set highlighting
vim.highlight('Comment', {
  fg: '#6c6c6c',
  italic: true
});
TypeScript Support

TypeScript support is planned but not yet available. For now, you'll need to transpile TypeScript to JavaScript manually. Native TypeScript support with automatic compilation is coming soon.

Hot Reload

Any changes to init.js or other .js files under ~/.config/vimcraft/ are automatically reloaded when you save. No restart required — just save and see your changes instantly.

Configuration Examples

Theme and Appearance

// Set color scheme
vim.cmd('colorscheme tokyonight');

// Custom highlighting
vim.highlight('Normal', { bg: '#1a1b26' });
vim.highlight('CursorLine', { bg: '#24283b' });

// Configure UI options
vim.opt.termguicolors = true;
vim.opt.showMode = false;
vim.opt.signColumn = 'yes';

Next Steps