about summary refs log tree commit diff stats
path: root/js/baba-yaga/dev/vim/README.md
blob: fb1090e67343c4e44652757ffd3dc325cc44b7af (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Baba Yaga Vim/NeoVim Syntax

Syntax highlighting for the Baba Yaga programming language in Vim and NeoVim.

## Installation

### Method 1: Manual Installation
1. Copy the files to your Vim runtime directory:
   ```bash
   # For Vim
   cp syntax/baba.vim ~/.vim/syntax/
   cp ftdetect/baba.vim ~/.vim/ftdetect/
   
   # For NeoVim
   cp syntax/baba.vim ~/.config/nvim/syntax/
   cp ftdetect/baba.vim ~/.config/nvim/ftdetect/
   ```

2. Restart Vim/NeoVim

### Method 2: Using a Plugin Manager (Recommended)

#### Vim-Plug
Add to your `.vimrc` or `init.vim`:
```vim
Plug 'your-username/baba-yaga', { 'rtp': 'dev/vim' }
```

#### Vundle
Add to your `.vimrc`:
```vim
Plugin 'your-username/baba-yaga'
```

#### NeoVim with Packer
Add to your `init.lua`:
```lua
use {
  'your-username/baba-yaga',
  config = function()
    vim.cmd('set runtimepath+=dev/vim')
  end
}
```

### Method 3: Using Pathogen
```bash
cd ~/.vim/bundle
git clone https://github.com/your-username/baba-yaga.git
```

## Features
- Syntax highlighting for Baba Yaga language
- Automatic filetype detection for `.baba` files
- Highlighting for:
  - Keywords (when, then, is, with, etc.)
  - Types (Bool, Int, Float, String, etc.)
  - Operators (->, =>, +, -, etc.)
  - Functions and variables
  - Strings and numbers
  - Comments (// and /* */)
  - When expressions
  - Lists and tables
  - IO functions (io.out, io.in, etc.)

## Usage
Open any `.baba` file and Vim/NeoVim should automatically detect the language and apply syntax highlighting.

## Customization
You can customize the colors by modifying your color scheme or adding custom highlighting:

```vim
" Add to your .vimrc or init.vim
hi babaKeyword ctermfg=blue guifg=blue
hi babaType ctermfg=green guifg=green
hi babaOperator ctermfg=red guifg=red
```

## File Structure
```
dev/vim/
├── syntax/
│   └── baba.vim          # Syntax highlighting rules
├── ftdetect/
│   └── baba.vim          # Filetype detection
└── README.md             # This file
```

## Troubleshooting
If syntax highlighting doesn't work:

1. Check that the files are in the correct directories
2. Verify filetype detection: `:set filetype?`
3. Force syntax highlighting: `:set syntax=baba`
4. Check for syntax errors: `:syntax sync fromstart`