├── .editorconfig ├── .gitattributes ├── .github └── workflows │ └── build.yml ├── .gitignore ├── 404.html ├── CONTRIBUTING.md ├── Gemfile ├── Gemfile.lock ├── README.md ├── assets ├── img │ ├── editor.png │ ├── editor2.png │ ├── flags │ │ ├── de.svg │ │ └── us.svg │ └── logo.svg ├── javascript.js └── stylesheet.css ├── index.html ├── locales ├── de │ ├── 404.md │ ├── about │ │ ├── contributors.md │ │ ├── faq.md │ │ ├── features.md │ │ ├── index.md │ │ └── screenshots.md │ ├── documentation │ │ ├── build.md │ │ ├── index.md │ │ ├── keymap-macos.md │ │ ├── keymap.md │ │ └── usage.md │ ├── downloads.md │ ├── index.md │ ├── template.html │ └── tutorials │ │ ├── api-overview.md │ │ ├── index.md │ │ ├── overview │ │ ├── process.md │ │ ├── regex.md │ │ └── system.md │ │ ├── simple-plugin.md │ │ ├── syntax-highlighting.md │ │ └── system-fonts.md └── en │ ├── 404.md │ ├── about │ ├── contributors.md │ ├── faq.md │ ├── features.md │ ├── index.md │ └── screenshots.md │ ├── documentation │ ├── build.md │ ├── index.md │ ├── keymap-macos.md │ ├── keymap.md │ └── usage.md │ ├── downloads.md │ ├── index.md │ ├── template.html │ └── tutorials │ ├── api-overview.md │ ├── index.md │ ├── overview │ ├── process.md │ ├── regex.md │ └── system.md │ ├── simple-plugin.md │ ├── syntax-highlighting.md │ └── system-fonts.md └── site.rb /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 2 7 | indent_style = space 8 | insert_final_newline = false 9 | trim_trailing_whitespace = true 10 | 11 | [*.{html,xml,liquid}] 12 | indent_style = tab 13 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | *.png binary 5 | *.jpg binary 6 | *.pdf binary 7 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Deploy site 2 | 3 | on: 4 | push: { branches: [master] } 5 | workflow_dispatch: 6 | 7 | jobs: 8 | build: 9 | runs-on: ubuntu-latest 10 | # if: github.ref == 'refs/heads/master' 11 | steps: 12 | - name: Checkout 13 | uses: actions/checkout@v4 14 | 15 | - name: Restore file mtime 16 | run: | 17 | git ls-files -z | while read -d '' path; do 18 | if [[ -e "$path" ]]; then 19 | touch -d $(git log -1 --format="@%ct" "$path") "$path" 20 | fi 21 | done 22 | 23 | - name: Install ruby 24 | uses: ruby/setup-ruby@v1 25 | with: 26 | ruby-version: 2.7 27 | 28 | - name: Install gems 29 | run: gem install redcarpet rouge 30 | 31 | - name: Set environment variables 32 | run: echo "SITE_ROOT=deploy" >> $GITHUB_ENV 33 | 34 | - name: Build (for forks) 35 | if: ${{ github.repository_owner != 'lite-xl' }} 36 | run: ruby site.rb "/$(echo '${{ github.repository }}' | cut -d/ -f2)" 37 | 38 | - name: Build (for lite-xl org) 39 | if: ${{ github.repository_owner == 'lite-xl' }} 40 | run: ruby site.rb 41 | 42 | - name: Upload Artifact 43 | uses: actions/upload-artifact@v4 44 | with: 45 | name: website 46 | path: ./deploy 47 | compression-level: 9 48 | 49 | - name: Upload to GitHub pages (for lite-xl org) 50 | if: ${{ github.repository_owner == 'lite-xl' && github.ref_name == 'master' }} 51 | uses: peaceiris/actions-gh-pages@v3 52 | with: 53 | github_token: ${{ secrets.GITHUB_TOKEN }} 54 | publish_dir: ./deploy 55 | cname: lite-xl.com 56 | 57 | - name: Upload to GitHub pages (for forks) 58 | if: ${{ github.repository_owner != 'lite-xl' && github.ref_name == 'master' }} 59 | uses: peaceiris/actions-gh-pages@v3 60 | with: 61 | github_token: ${{ secrets.GITHUB_TOKEN }} 62 | publish_dir: ./deploy 63 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite-xl/website-archive/5ffffe72cb6c6a6d8c1f4a41706f11d0ddca2e60/.gitignore -------------------------------------------------------------------------------- /404.html: -------------------------------------------------------------------------------- 1 | 2 | Can't find the page you're looking for. 3 | 4 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Welcome to Lite XL website contributing guide 2 | 3 | We're grateful for your contribution. Your contribution will be reflected 4 | on https://lite-xl.com. 5 | 6 | This guide goes over several important notes you need to take account when 7 | contributing to the website. 8 | 9 | ## Issues 10 | 11 | #### Creating an issue 12 | 13 | You should search the issue tracker for a similar issue before creating one. 14 | When creating an issue, ensure that it has an appropriate title, description 15 | and an example to recreate the issue. 16 | 17 | #### Solving an issue 18 | 19 | We do not assign issues to anyone. 20 | You're welcome to submit PRs for an existing issue. 21 | 22 | ## Contributing code changes 23 | 24 | We accept PRs for website content. If you want to contribute, make sure 25 | that you've read the [site rules]. 26 | 27 | ## Localization 28 | 29 | We don't have full support for translations due to a lack of contributors. 30 | Localized files belong to the directory `locales/(language)`. 31 | 32 | ## Site Rules 33 | 34 | You must follow these rules when contributing to the website. 35 | Do note that this is not a complete list; we may advise on further 36 | improvements as we review your PRs. 37 | 38 | #### Don't 39 | 40 | Submit content that is badly-written or irrelevant to Lite XL. 41 | 42 | #### Do 43 | 44 | Submit content that is well-written and relevant to Lite XL. 45 | 46 | Proofread your work before submitting. 47 | 48 | #### Don't 49 | 50 | Omit the title/heading when creating a new page content. 51 | 52 | ```md 53 | This will generate the title "Lite XL" which conflicts with the home page. 54 | ``` 55 | 56 | #### Do 57 | 58 | Create a simple title/heading that is relevant to the page content. 59 | 60 | ```md 61 | # A title 62 | 63 | This will generate the title "Lite XL - A title" which is better. 64 | ``` 65 | 66 | #### Don't 67 | 68 | Use irregular indentation on the website code. 69 | 70 | ```js 71 | function updatePage() { 72 | if (this.length === 0) 73 | this.push(1); 74 | this.forEach(function(e) { return e + 1; }); 75 | } 76 | ``` 77 | 78 | #### Do 79 | 80 | Follow the EditorConfig (2 space as indentation). 81 | 82 | ```js 83 | function updatePage() { 84 | if (this.length === 0) 85 | this.push(1); 86 | this.forEach(function(e) { return e + 1; }); 87 | } 88 | ``` 89 | 90 | #### Don't 91 | 92 | Write incredibly long lines that cannot be broken down. 93 | 94 | > This does not apply to links as they cannot be broken down. 95 | 96 | ```md 97 | I love Lite XL because the editor provides many features out of the box such as syntax highlighting, filesystem tree and lua scripting which I use extensively to customize the editor to such an extent where it is so much better than the original jeez >//< i love lite-xl so muchhhhh!!!! 98 | ``` 99 | 100 | #### Do 101 | 102 | Ensure that each line does not exceed the 80-character limit. 103 | 104 | For long list items, break them down into multiple lines and indent 105 | the following lines with 2 spaces. 106 | 107 | ```md 108 | I love Lite XL because the editor provides many features: 109 | 110 | - syntax highlighting 111 | - filesystem tree 112 | - lua scripting 113 | - a killer feature that we probably don't have yet but we'll 114 | have in the future 115 | 116 | I use the lua scripting feature extensively to customize the editor so 117 | that it is better than the original jeez >//< i love lite-xl so 118 | muchhhhh!!!! 119 | ``` 120 | 121 | #### Don't 122 | 123 | Omit newlines between markdown elements. 124 | 125 | ````md 126 | # Installation 127 | You can install Lite XL by running: 128 | ```sh 129 | # sudo apt install lite-xl 130 | ``` 131 | or the following ways: 132 | - download a release 133 | - install it via lpm 134 | ```` 135 | 136 | #### Do 137 | 138 | Introduce a newline between Markdown elements. 139 | This helps with certain picky Markdown parsers. 140 | 141 | ````md 142 | # Installation 143 | 144 | You can install Lite XL by running: 145 | 146 | ```sh 147 | # sudo apt install lite-xl 148 | ``` 149 | 150 | or the following ways: 151 | 152 | - download a release 153 | - install it via lpm 154 | ```` 155 | 156 | #### Don't 157 | 158 | Use `<` and `>` without surrounding them in backticks. 159 | 160 | ```md 161 | Watch me! 162 | ``` 163 | 164 | #### Do 165 | 166 | Use `‹` and `›` or surround `<` and `>` in backticks. 167 | 168 | ```md 169 | Watch me! `` 170 | ``` 171 | 172 | #### Don't 173 | 174 | Link to insecure websites. 175 | 176 | ``` 177 | [1]: http://example.com 178 | ``` 179 | 180 | #### Do 181 | 182 | Link to secure websites. 183 | 184 | ``` 185 | [1]: https://example.com 186 | ``` 187 | 188 | #### Don't 189 | 190 | Use inline links. 191 | 192 | > This rule does not apply to autolinks or anchor links. 193 | 194 | ```md 195 | Follow [this link](https://someurl.com) and also [this interesting one](https://interesting-one.com). 196 | 197 | [We allow this](#this-will-be-allowed) 198 | 199 | # this will be allowed 200 | 201 | We allow this form of inline linking because it is short and useful. 202 | ``` 203 | 204 | #### Do 205 | 206 | Use reference-style links. 207 | 208 | ```md 209 | Follow [this link] and also [this interesting one]. 210 | 211 | 212 | [this link]: https://someurl.com 213 | [this interesting one]: https://interesting-one.com 214 | ``` 215 | 216 | Or 217 | 218 | ```md 219 | Follow [this link][1] and also [this interesting one][2]. 220 | 221 | 222 | [1]: https://someurl.com 223 | [2]: https://interesting-one.com 224 | ``` 225 | 226 | #### Don't 227 | 228 | Create messy Markdown tables (unless machine generated). 229 | 230 | ```md 231 | | name | Description 232 | |---:|---| 233 | | John | Doe 234 | | Jeanne | Doe 235 | ``` 236 | 237 | #### Do 238 | 239 | - Align the pipe character (`|`) to the left. 240 | - Ensure dashes (excluding the alignment colon character(`:`)) aligns with 241 | the table header. 242 | 243 | ```md 244 | | name | Description 245 | | ----: | ----------- 246 | | John | Doe 247 | | Jeanne | Doe 248 | ``` 249 | 250 | 251 | [site rules]: #site-rules -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gem 'redcarpet' 3 | gem 'rouge' 4 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | redcarpet (3.5.1) 5 | rouge (3.27.0) 6 | 7 | PLATFORMS 8 | x86_64-linux 9 | 10 | DEPENDENCIES 11 | redcarpet 12 | rouge 13 | 14 | BUNDLED WITH 15 | 2.2.33 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [Lite XL][1] website 2 | 3 | This website is built with markdown and a tiny ruby script 4 | as a static site generator. 5 | 6 | ## Local Build Quick-start Guide 7 | 8 | - Install ruby. 9 | - Install the `redcarpet` and `rouge` gems. 10 | You can install them with `gem install redcarpet rouge`. 11 | - Run `site.rb`. It should generate the website in-place. 12 | You'll need a HTTP server[₁][2][₂][3] to preview it. 13 | 14 | > If you use `python3`'s `http.server`, the links on the website 15 | > may not work correctly as `http.server` requires 16 | > the full filename (with the `.html` file extension) 17 | > while the website does not use that. 18 | > `http-server` does not have this limitation. 19 | 20 | ## Contributing 21 | 22 | Please read [CONTRIBUTING.md][4] for guidelines on how to contribute. 23 | 24 | ## Repo Structure 25 | 26 | - `assets/`: Asset files (images, js, css, etc.) 27 | - `assets/img`: Images used for the website 28 | - `assets/javascript.js`: Main JavaScript file used for the website 29 | - `assets/stylesheet.css`: Main CSS file used for the website 30 | - `locales/`: Localized website content 31 | - `locales/en`: English website content 32 | - `locales/en/template.html`: Template HTML for the english website 33 | - `locales/en/404.md`: The content shown to users when the page is not found 34 | - `.editorconfig`: EditorConfig for this website 35 | - `404.html`: The content shown to users when the page is not found 36 | - `index.html`: A symlink to index.html in the default locale 37 | - `site.rb`: Website generator 38 | 39 | ## Extra goodies 40 | 41 | #### Auto updates 42 | 43 | Get [watchexec][5] for watching directories. 44 | 45 | ```sh 46 | $ watchexec -e md,html -w locales -w assets ./site.rb 47 | ``` 48 | 49 | #### Configuring site.rb 50 | 51 | For normal usage you don't need to configure the script at all. 52 | However, some of the behavior can be changed via environment variables. 53 | 54 | | Environment Variable | Description 55 | | -------------------- | ----------- 56 | | `SITE_ROOT` | Change the output path of the script\*. 57 | | `SITE_DOMAIN` | Change the domain used in `sitemap.txt`. 58 | | `SITE_LOCALE` | Change the default locale of the website. 59 | | `VERBOSE` | Enable verbose logging. 60 | 61 | \* This does not change the URL in generated HTML files. 62 | 63 | # Credits 64 | 65 | [Material Design Icons][6] are used in the website. 66 | It is licensed under [Apache 2.0 License][7]. 67 | 68 | 69 | 70 | [1]: https://github.com/lite-xl/lite-xl 71 | [2]: https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server 72 | [3]: https://www.npmjs.com/package/http-server 73 | [4]: CONTRIBUTING.md 74 | [5]: https://github.com/watchexec/watchexec 75 | [6]: https://materialdesignicons.com/ 76 | [7]: https://github.com/Templarian/MaterialDesign/blob/1d1761974cabe0868441fac6069438e5243d3446/LICENSE -------------------------------------------------------------------------------- /assets/img/editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite-xl/website-archive/5ffffe72cb6c6a6d8c1f4a41706f11d0ddca2e60/assets/img/editor.png -------------------------------------------------------------------------------- /assets/img/editor2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lite-xl/website-archive/5ffffe72cb6c6a6d8c1f4a41706f11d0ddca2e60/assets/img/editor2.png -------------------------------------------------------------------------------- /assets/img/flags/de.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/img/flags/us.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/img/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /assets/javascript.js: -------------------------------------------------------------------------------- 1 | window.addEventListener('DOMContentLoaded', function() { 2 | function click(selector, callback) { document.querySelectorAll(selector).forEach(function(e) { e.addEventListener('click', function(ev) { callback(ev, e); }); }) } 3 | function hideMenus(except) { document.querySelectorAll('menu.active').forEach(function(e) { if (e != except) e.classList.remove('active'); }) } 4 | click('menu', function(ev, e) { hideMenus(e); ev.stopPropagation(); e.classList.toggle('active'); }); 5 | click('expander', function() { document.querySelectorAll('links').forEach(function(e) { e.classList.toggle('active'); }); }); 6 | click('body', hideMenus); 7 | document.querySelectorAll('menu h2 a').forEach(function(e) { e.parentNode.innerHTML = e.innerHTML; }) 8 | }); 9 | -------------------------------------------------------------------------------- /assets/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Global */ 2 | body { margin: 0; line-height: 24px; background: #252529; color: #e1e1e6; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans","Liberation Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"; } 3 | header, page { background: #2e2e32; margin: 0 auto; padding: 12px; box-sizing: border-box; } 4 | page { display: block; width: 100%; color: #999; } 5 | pre, code { background: #252529; border: 1px solid #e1e1e6; padding: 2px 4px; color: #bbb; } 6 | pre { overflow-x: auto; padding: 12px; } 7 | code { white-space: nowrap; } 8 | .active { display: block; } 9 | img { max-width: 100%; width: 100%; display: block; } 10 | body > * { width: 100%; max-width: 1200px; display: block; } 11 | 12 | /* Menu */ 13 | header, links, logo { margin: 0 auto 24px auto; display: flex; align-items: center; position: relative; } 14 | logo > *, header > *, links > *, menu > * { margin: 0; font-size: 16px !important; padding: 0 8px; } 15 | a, menu, svg { text-decoration: none; color: #c1c1c6; position: relative; cursor: pointer; fill: #c1c1c6; } 16 | links svg { vertical-align: middle; } 17 | menu h2::after { content: ""; width: 12px; display: inline-block; background-size: 12px; margin-left: 4px; background-position: 100% 200%; background-repeat: no-repeat; height: 16px; background-image: url("data:image/svg+xml;utf8,") } 18 | menu { padding: 0; } 19 | links h2 { padding: 0 16px; } 20 | a:hover, menu:hover, menu.active, menu.active svg, menu:hover svg, a:hover svg { color: #e1e1e6; fill: #e1e1e6; } 21 | menu.active items { display: block; } 22 | menu items { display: none; position: absolute; z-index: 1; top: 24px; background: #2e2e32; min-width: 168px; padding: 8px 16px; border: 1px solid rgba(0,0,0,0.15); } 23 | menu items > * { padding: 4px; display: block; } 24 | expander { display: none; width: 30px; height: 30px; cursor: pointer; background-size: contain; background-position: 50% 50%; background-image: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath d='M5,8 l20,0 z M5,15 l20,0 z M5,22 l20,0 z' stroke='%2397979c' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); } 25 | links:nth-last-child(2) { margin-left: auto; } 26 | menu img { display: inline; width: 24px; height: 18px; vertical-align: middle; } 27 | 28 | /* Content */ 29 | content { margin: 0 auto 48px auto; } 30 | sidebar { display: inline-block; width: 100%; padding: 0; width: 255px; vertical-align: top; box-sizing: border-box; } 31 | sidebar h2 { background: #2e2e32; margin: 0; padding: 8px; font-size: 18px; } 32 | sidebar a { display: block; padding: 8px; margin: 4px; } 33 | sidebar i { margin-right: 4px; } 34 | sidebar box { margin-bottom: 24px; border: 1px solid #343a40; display: block; } 35 | sidebar svg { fill: #bbb; position: relative; margin-right: 4px; vertical-align: middle; } 36 | page { display: inline-block; width: calc(100% - 286px); margin-right: 24px; } 37 | page h1 { text-align: center; margin-top: 12px; margin-bottom: 32px; } 38 | page h1, page h2, page h3, page h4, page h5 { color: rgba(255,255,255,.75); font-weight: 500; line-height: 36px; } 39 | page h4 { font-size: 24px; margin: 8px 0; } 40 | table { width: 100%; border-collapse: collapse; } 41 | th, td { border: 1px solid #fff; padding: 8px; } 42 | 43 | /* Specific Pages */ 44 | #page-about-screenshots p { display: grid; grid-template-columns: auto auto auto; column-gap: 24px; row-gap: 24px; } 45 | 46 | /* Mobile */ 47 | @media screen and (max-width: 767px) { 48 | header { display: block; margin-bottom: 0; } 49 | links { display: none; padding-left: 26px; } 50 | links:nth-last-child(2) { display: none; } 51 | content sidebar { display: none; } 52 | page { display: block; background: none; width: 100%; } 53 | content.index sidebar { display: block; margin: 0 auto; width: 100%; padding: 0 8px; } 54 | expander { display: block; border: 1px solid #47474c; padding: 4px 8px; position: absolute; right: 24px; top: 16px; } 55 | links > * { padding: 12px 0 12px 0 !important; } 56 | links h2 { padding-left: 0; } 57 | menu.active items { position: static; border: 0; } 58 | content { margin-bottom: 0; } 59 | } 60 | 61 | /* Syntax Higlighting */ 62 | pre table td { padding: 5px; } 63 | pre table pre { margin: 0; } 64 | pre .c, pre .ch, pre .cd, pre .cm, pre .cpf, pre .c1, pre .cs { 65 | color: #505050; 66 | } 67 | pre .k, pre .kn, pre .kp, pre .kr, pre .kv { 68 | color: #aa759f; 69 | } 70 | pre .s, pre .sb, pre .sc, pre .dl, pre .sd, pre .s2, pre .sh, pre .sx, pre .s1 { 71 | color: #90a959; 72 | } 73 | pre .m, pre .mb, pre .mf, pre .mh, pre .mi, pre .il, pre .mo, pre .mx { 74 | color: #90a959; 75 | } 76 | pre, pre .w { color: #d0d0d0; background-color: #151515; } 77 | pre .err { color: #151515; background-color: #ac4142; } 78 | pre .cp { color: #f4bf75; } 79 | pre .nt { color: #f4bf75; } 80 | pre .o, pre .ow { color: #d0d0d0; } 81 | pre .p, pre .pi { color: #d0d0d0; } 82 | pre .gi { color: #90a959; } 83 | pre .gd { color: #ac4142; } 84 | pre .gh { color: #6a9fb5; background-color: #151515; font-weight: bold; } 85 | pre .kc { color: #d28445; } 86 | pre .kt { color: #d28445; } 87 | pre .kd { color: #d28445; } 88 | pre .sa { color: #aa759f; } 89 | pre .sr { color: #75b5aa; } 90 | pre .si { color: #8f5536; } 91 | pre .se { color: #8f5536; } 92 | pre .nn { color: #f4bf75; } 93 | pre .nc { color: #f4bf75; } 94 | pre .no { color: #f4bf75; } 95 | pre .na { color: #6a9fb5; } 96 | pre .ss { color: #90a959; } 97 | 98 | /* Announcement header */ 99 | #outdated { display: block; text-align: center; background-color: #5865f2; color: white; } 100 | #outdated a { color: #edeae0; text-decoration: underline; } 101 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | en/index.html -------------------------------------------------------------------------------- /locales/de/404.md: -------------------------------------------------------------------------------- 1 | # Nicht Gefunden 2 | 3 | Diese Seite konnte nicht gefunden werden. Bitte beachte dass diese Webseite gerade getestet wird, also werden Seiten entweder bewegt oder gelöscht. 4 | -------------------------------------------------------------------------------- /locales/de/about/contributors.md: -------------------------------------------------------------------------------- 1 | # Mitwirkende 2 | 3 | | Name | Beiträge 4 | -------------------------------------------------------------|---------------------------------------------------------- 5 | | [rxi](https://github.com/rxi) | Ursprüngliche Entwicklung des Lite Editors. 6 | | [Francesco](https://github.com/franko) | Autor des lite-xl Forks von rxi/lite. 7 | | [Takase](https://github.com/takase1121) | NagView und X Window Datenbank Ressourcen für Xft.dpi Einstellung. 8 | | [Nils Kvist](https://github.com/budRich) | Popup Fenster Ersatz mit CommandView Dialog. 9 | | [liquidev](https://github.com/liquidev) | Tab Stil und Animationen Verbesserungen. 10 | | [Adam](https://github.com/adamharrison) | Mehrsprachige Syntaxhervorhebung und viele andere Verbesserungen. 11 | | [Cukmekerb](https://github.com/vincens2005) | Syntaxhervorhebung Verbesserungen. 12 | | [Janis-Leuenberger](https://github.com/Janis-Leuenberger) | Hilfedatei für Tastaturbelegungen und MacOS Testungen. 13 | | Mat Mariani | Hilfe mit MacOS Port. Paar Ressourcen von mathewmariani/lite-macos. 14 | | [daubaris](https://github.com/daubaris) | Anfängliche Implementation von Xft.dpi Query mit xrdb Befehl. 15 | | [Robert Štojs](https://github.com/netrobert) | Continuous Integration Konfiguration. 16 | -------------------------------------------------------------------------------- /locales/de/about/faq.md: -------------------------------------------------------------------------------- 1 | # FAQ 2 | 3 | #### Kann ich smart autocompletion (intellisense/LSP) bekommen? 4 | 5 | Schaue dir das [LSP] Plugin an. 6 | 7 | #### Wo ist das integrierte Terminal? 8 | 9 | Du kannst [lite-xl-terminal] ausprobieren. 10 | 11 | #### Tabs und Indent Größe? 12 | 13 | In deiner Benutzer Config (Das Zahnrad Symbol im File Tree): 14 | 15 | ```lua 16 | config.tab_type = "soft" -- soft für Leerzeichen, hard für echte Tabs (\t) 17 | config.indent_size = 4 -- 4 Leerzeichen 18 | ``` 19 | 20 | #### Wie binde ich Befehle an Tasten? 21 | 22 | ```lua 23 | local keymap = require "core.keymap" 24 | keymap.add { ["ctrl+escape"] = "core:quit" } 25 | ``` 26 | 27 | #### Wie entbinde ich Befehle für bestimmte Tasten? 28 | 29 | ```lua 30 | -- Das zweite Parameter lässt dir Befehle für bestimmte Tasten überschreiben 31 | -- in diesem Fall wird es auf nichts gebunden 32 | keymap.add({ ["ctrl+escape"] = {} }, true) 33 | ``` 34 | 35 | #### Wie bekomme ich die Befehle für diese Tastenkombinationen? 36 | 37 | Du kannst für Befehle im Command Palette suchen. 38 | 39 | Für jedem Befehl, ersetze die Leerzeichen auf der rechten Seite mit Striche. 40 | 41 | Zum Beispiel: `Core: Find Command` → `core:find-command` 42 | 43 | #### Welche Lua Version wird von Lite XL benutzt? 44 | 45 | Lua 5.4. 46 | 47 | #### Vim modus? 48 | 49 | Dafür brauchst du [vibe]. 50 | 51 | #### Plugin Empfehlungen 52 | 53 | Im fall dass du nicht unser [Plugin Repository][1] durchforsten möchtest, 54 | haben wir eine Liste von Plugins gemacht, die Lite XL viel mehr angenehmer machen. 55 | 56 | | Plugin | Verwendungszweck 57 | | --- | --- 58 | | [autoinsert] | Fügt automatisch schließende Klammern und Anführungszeichen ein 59 | | [bracketmatch] | Markiert übereinstimmende Klammern 60 | | [ephemeral_tabs] | Vorschau von Dateien ohne der Erstellung von mehrere Tabs (Ephemeral Tabs) 61 | | [gitdiff_highlight] | Git diff gutter 62 | | [lint+] | Linter Unterschützung 63 | | [minimap] | Minimap 64 | | [selectionhighlight] | Hebe Code hervor dass zur Auswahl passt 65 | | [lite-xl-discord] | Discord rich presence | 66 | 67 | #### Wo ist Funktion X? Wie wäre es mit Y? 68 | 69 | Du kannst mehr Informationen auf unserer [Funktionen Seite](/en/about/features) bekommen. 70 | 71 | 72 | [LSP]: https://github.com/lite-xl/lite-xl-lsp 73 | [lite-xl-terminal]: https://github.com/adamharrison/lite-xl-terminal 74 | [vibe]: https://github.com/eugenpt/lite-xl-vibe 75 | [autoinsert]: https://github.com/lite-xl/lite-xl-plugins/blob/master/plugins/autoinsert.lua?raw=1 76 | [bracketmatch]: https://github.com/lite-xl/lite-xl-plugins/blob/master/plugins/bracketmatch.lua?raw=1 77 | [ephemeral_tabs]: https://github.com/lite-xl/lite-xl-plugins/blob/master/plugins/ephemeral_tabs.lua?raw=1 78 | [gitdiff_highlight]: https://github.com/vincens2005/lite-xl-gitdiff-highlight 79 | [lint+]: https://github.com/liquid600pgm/lintplus 80 | [minimap]: https://github.com/lite-xl/lite-xl-plugins/blob/master/plugins/minimap.lua?raw=1 81 | [selectionhighlight]: https://github.com/lite-xl/lite-xl-plugins/blob/master/plugins/selectionhighlight.lua?raw=1 82 | [lite-xl-discord]: https://github.com/vincens2005/lite-xl-discord 83 | 84 | [1]: https://github.com/lite-xl/lite-xl-plugins 85 | -------------------------------------------------------------------------------- /locales/de/about/features.md: -------------------------------------------------------------------------------- 1 | # Funktionen 2 | 3 | Momentan bietet Lite XL viele eingebaute Funktionen. 4 | 5 | ## Cross-Platform 6 | Momentan unterstützen wir Windows, Linux und MacOS (Mit Unterschützung vom Retina-Display). 7 | 8 | ## Leicht 9 | Wir sind momentan bei ungefähr 3MB in Größe und es braucht ungefähr 10MB in RAM (kann niedriger sein). Kein Electron / WebView ist involviert. Der ganze Editor läuft in Lua auf einer Rendering Engine. 10 | 11 | ## Erweiterbar 12 | Der Editor is normalerweise minimal, es ist sehr erweiterbar mit Lua. Viele Funktionen werden von Plugins bereitgestellt. Zum Beispiel, [VSCode-ähnliche Intellisense](https://github.com/jgmdev/lite-xl-lsp). 13 | 14 | ## Betteres Schriftartenwiedergabe 15 | Der Editor sieht auf jeder Bildschirmgröße gut aus. Paar andere Optionen sind auch konfigurierbar, wie zum Beispiel Hinting und Antialiasing. 16 | 17 | ## Multi-cursor Bearbeitung 18 | Du kannst mehrere Cursor platzieren indem du `ctrl` + `lclick` oder `ctrl` + `shift` + `up` oder `ctrl` + `shift` + `down` drückst. 19 | 20 | --- 21 | 22 | 23 | Hier sind ein paar Funktionen dass _nicht_ aus entsprechenden Gründen implementiert wurden. 24 | Einige davon können durch Plugins implementiert werden. 25 | Wir ermutigen dir es einen Versuch zu geben. 26 | 27 | ## Hardwarebeschleunigtes Rendering 28 | ** tl;dr Franko (Entwickler) gab an dass er nicht OpenGL benutzen wird wegen seiner Fähigkeiten und der verbundenen Arbeit.** 29 | 30 | Hardwarebeschleunigen wurde in dieser [Diskussion](https://github.com/lite-xl/lite-xl/discussions/450) besprochen. 31 | Takase (Entwickler) versuchte es zwei mal - zuerst mit [NanoVG](https://github.com/inniyah/nanovg) und dann durchs erzwingen von SDL GPU Rendering zu benutzen. 32 | In beiden Versuchen war die Leistungsersteigerungen nicht bedeutend, im schlimmsten Fall war es komplet unverwendbar. 33 | Gerade haben wir uns entschieden dass wir uns auf die Optimierung des Software-Renderers und mehrere Teile des Lua Codes konzentieren. 34 | 35 | ## Systemschriftarten 36 | Dies ist schmerzhaft weil verschiedene Systeme ihren eigenen Mechanismus haben, wie sie Schriftarten verwalten. 37 | Zur Zeit können Nutzer das [Fontconfig Plugin](https://github.com/lite-xl/lite-xl-plugins/blob/master/plugins/fontconfig.lua) benutzen. 38 | Fontconfig ist auf Linux, [Windows](https://github.com/takase1121/mingw-w64-fontconfig) und [MacOS](https://formulae.brew.sh/formula/fontconfig) weit verbreitet. 39 | In der Zukunft werden wir vielleicht eine API hinzufügen um Font Metadaten zu lesen, dass uns erlaubt eine Fontconfig Alternative in Lua zu schreiben (Kein Versprechen). 40 | 41 | ## Das Öffnen von UNC Pfaden auf Windows (Netzwerklaufwerke, Zugriff auf Windows WSL2 Dateien) 42 | Unser Pfadumgangs Code kann nur mit POSIX- und Windowspfade umgehen. 43 | Wir sind also nicht sicher wie sich Lite XL in diesen Szenarien verhält. 44 | 45 | ## Kommunikation Zwischen Fenstern (Tabs zwischen Fenstern ziehen und andere Magie) 46 | Dies ist bei weitem am schwierigsten zu erreichen. 47 | Lite XL hat keine Absicht auf irgendwelche Widget-Toolkits (Qt und GTK) zu verlinken, die für diese Funktionen gebraucht werden. 48 | Eine Alterative wäre, unser Eigenes IPC Mechanismus zu erstellen, aber dass wäre [das](https://en.wikipedia.org/wiki/Inter-Client_Communication_Conventions_Manual) [Rad](https://github.com/swaywm/wlroots) [neu erfinden](https://en.wikipedia.org/wiki/D-Bus). 49 | 50 | ## Integriertes Terminal 51 | Ein Terminal kann sehr schwer zum implementieren sein. 52 | Es gibt Projekte dass man zu Lua porten kann, wie zum Beispiel [xterm.js](https://xtermjs.org/). 53 | Wenn jemand interessiert ist, könnte es jemand machen. 54 | -------------------------------------------------------------------------------- /locales/de/about/index.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | Diese Seiten beinhalten Informationen über Lite XLs Funktionen, Screenshots und Entwicklern. Es beinhaltet auch einen FAQ Abschnitt. 4 | 5 | - [Mitwirkende](/en/about/contributors) 6 | - [FAQ](/en/about/faq) 7 | - [Funktionen](/en/about/features) 8 | - [Screenshots](/en/about/screenshots) 9 | -------------------------------------------------------------------------------- /locales/de/about/screenshots.md: -------------------------------------------------------------------------------- 1 | # Screenshots 2 | 3 | [![Screenshot 1](/assets/img/editor.png)](/assets/img/editor.png) 4 | [![Screenshot 2](/assets/img/editor2.png)](/assets/img/editor2.png) 5 | -------------------------------------------------------------------------------- /locales/de/documentation/build.md: -------------------------------------------------------------------------------- 1 | # Bauen 2 | 3 | Wenn du dann den Quellcode hast, kannst du Lite XL mit Meson für dich selber bauen. 4 | Zusätzlich gibt es das `build-packages.sh` Script dass benutzt werden kann, um Lite XL zu kompilieren und 5 | ein Betriebsystemspezifisches Packet für Linux, Windows oder MacOS zu erstellen. 6 | 7 | Die folgenen Bibliotheken werden gebraucht: 8 | 9 | - freetype2 10 | - SDL2 11 | 12 | Die folgenden Bibliotheken sind **optional**: 13 | 14 | - libagg 15 | - Lua 5.2 16 | 17 | Wenn sie nicht gefunden werden können, werden sie von Meson heruntergeladen und kompiliert. 18 | Sonst wenn sie present sind, werden sie benutzt um Lite XL zu bauen. 19 | 20 | ## Bau Script 21 | 22 | Wenn du Lite XL selber kompilieren willst, 23 | ist es empfohlen, den `build-packages.sh` Script zu benutzen: 24 | 25 | ```bash 26 | bash build-packages.sh -h 27 | ``` 28 | 29 | Der Script wird Meson ausführen und erstellt ein tar komprimiertes Archiv mit der Anwendung, oder 30 | für Windows, eine zip Datei. Lite XL kann leicht installiert werden, indem man das Archiv auspackt. 31 | 32 | Unter Windows werden zwei Packete erstellt, eines heißt "portable" dass den Datenordner neben der Ausführbarendatei haben wird. 33 | Das andere Packet benutzt ein unix-ähnlichen Layout, es ist gemeint für die Leute, die ein unix-ähnliches Shell und Befehlszeile benutzen. 34 | 35 | Bitte bemerke dass es keine fest codierte Ordner in der Ausführenbarendatei gibt, also können Packete in allen Ordnern benutzt werden. 36 | 37 | ## Portable 38 | 39 | Wenn man `meson setup` ausführt, gibt es eine Option `-Dportable=true` die sagt, ob Dateien als tragbare Anwendung installiert werden soll. 40 | 41 | Wenn `portable` berechtigt wurde, wird Lite XL den Datenordner neben der Anwendung platzieren. 42 | Sonst wird Lite XL Unix-ähnliche Ordner benutzen. 43 | In diesen fall wird der Datenordner in `$prefix/share/lite-xl` sein und die Anwendung wird in `$prefix/bin` sein. 44 | `$prefix` wird bestimmt wenn die Anwendung in einem Ordner wie `$prefix/bin` gestartet wird. 45 | 46 | Der Benutzermodulordner hängt nicht von der `portable` Option ab und wird immer `$HOME/.config/lite-xl` sein. 47 | Auf Windows wird das Variable `$USERPROFILE` benutzt. 48 | 49 | ## Linux 50 | 51 | Auf Debianbasierten Systemen können die gebrauchten Bibliotheken und Meson mit den folgenden Befehlen installiert werden: 52 | 53 | ```bash 54 | # Um die gebrauchten Bibliotheken zu installieren: 55 | sudo apt install libfreetype6-dev libsdl2-dev 56 | 57 | # Um Meson zu installieren: 58 | sudo apt install meson 59 | # or pip3 install --user meson 60 | ``` 61 | 62 | Um Lite XL mit Meson zu bauen werden die folgenden Befehle benutzt: 63 | 64 | ```bash 65 | meson setup --buildtype=release --prefix build 66 | meson compile -C build 67 | DESTDIR="$(pwd)/lite-xl" meson install --skip-subprojects -C build 68 | ``` 69 | 70 | Wo `` ist, hängt von dein Betriebssystem ab: 71 | - Auf Linux ist es in `/usr` sein 72 | - Auf MacOS kann es in `"/Lite XL.app"` sein 73 | 74 | Wenn du eine Version von Meson benutzt die unter 0.54 ist, musst du andere Befehle benutzen: 75 | 76 | ```bash 77 | meson setup --buildtype=release build 78 | ninja -C build 79 | ninja -C build install 80 | ``` 81 | 82 | ## MacOS 83 | 84 | MacOS ist voll unterstützt und eine notarierte App-Disk-Image ist auf der [Veröffenlichungsseite][1] bereitgestellt. 85 | Die Anwendung kann mit den Schritten oben kompiliert werden. 86 | 87 | ## Windows MSYS2 88 | 89 | Die Bauumgebung für Lite XL auf Windows ist [MSYS2][2]. 90 | Folge die Installationsschritte im Link. 91 | 92 | - Öffne `MinGW 64-bit` oder `MinGW 32-bit` vom Startmenü 93 | - Aktualisiere die "MSYS" Installation mit `pacman -Syu` 94 | - Starte Shell neu 95 | - Installiere die Abhängigkeiten: 96 | 97 | ```sh 98 | pacman -S \ 99 | ${MINGW_PACKAGE_PREFIX}-freetype \ 100 | ${MINGW_PACKAGE_PREFIX}-gcc \ 101 | ${MINGW_PACKAGE_PREFIX}-ninja \ 102 | ${MINGW_PACKAGE_PREFIX}-pcre2 \ 103 | ${MINGW_PACKAGE_PREFIX}-pkg-config \ 104 | ${MINGW_PACKAGE_PREFIX}-python-pip \ 105 | ${MINGW_PACKAGE_PREFIX}-SDL2 106 | pip3 install meson 107 | ``` 108 | 109 | `${MINGW_PACKAGE_PREFIX}` ist entweder auf `mingw-w64-i686` oder `mingw-w64-x86_64` 110 | abhängig ob deine Shell 32- oder 64bit ist. 111 | 112 | [1]: https://github.com/lite-xl/lite-xl/releases/latest/ 113 | [2]: https://www.msys2.org/ 114 | -------------------------------------------------------------------------------- /locales/de/documentation/index.md: -------------------------------------------------------------------------------- 1 | # Documentation 2 | 3 | Diese Seiten beinhalten Dokumention um Lite XL zu bauen und zu benutzen. 4 | 5 | - [Bauen](/en/documentation/build) 6 | - [Keymap (MacOS)](/en/documentation/keymap-macos) 7 | - [Keymap](/en/documentation/keymap) 8 | - [Nutzen](/en/documentation/usage) 9 | -------------------------------------------------------------------------------- /locales/de/documentation/keymap-macos.md: -------------------------------------------------------------------------------- 1 | # MacOS Keymap 2 | 3 | Tastaturkürzeln haben die gleichen Funktionen auf jeden Betriebssystem, sie sind einfach nur anders gebunden 4 | um sich für normale Erwartungen für dem Betriebssystem anzupassen. 5 | 6 | Momentan gibt es nur two Betriebssystemlayouts. MacOS, und [alles andere](/en/documentation/keymap). 7 | ## Keymap 8 | 9 | |Tasten Kombination|Aktionen| 10 | |---------------|-------| 11 | |`cmd`+`/`|`doc:toggle-line-comments`| 12 | |`cmd`+`1`|`root:switch-to-tab-1`| 13 | |`cmd`+`2`|`root:switch-to-tab-2`| 14 | |`cmd`+`3`|`root:switch-to-tab-3`| 15 | |`cmd`+`4`|`root:switch-to-tab-4`| 16 | |`cmd`+`5`|`root:switch-to-tab-5`| 17 | |`cmd`+`6`|`root:switch-to-tab-6`| 18 | |`cmd`+`7`|`root:switch-to-tab-7`| 19 | |`cmd`+`8`|`root:switch-to-tab-8`| 20 | |`cmd`+`9`|`root:switch-to-tab-9`| 21 | |`cmd`+`[`|`doc:move-to-previous-block-start`| 22 | |`cmd`+`]`|`doc:move-to-next-block-end`| 23 | |`cmd`+`a`|`doc:select-all`| 24 | |`cmd`+`backspace`|`doc:delete-to-start-of-indentation`| 25 | |`cmd`+`c`|`doc:copy`| 26 | |`cmd`+`ctrl`+`i`|`root:switch-to-up`| 27 | |`cmd`+`ctrl`+`j`|`root:switch-to-left`| 28 | |`cmd`+`ctrl`+`k`|`root:switch-to-down`| 29 | |`cmd`+`ctrl`+`l`|`root:switch-to-right`| 30 | |`cmd`+`ctrl`+`return`|`core:toggle-fullscreen`| 31 | |`cmd`+`ctrl`+`shift`+`i`|`root:split-up`| 32 | |`cmd`+`ctrl`+`shift`+`j`|`root:split-left`| 33 | |`cmd`+`ctrl`+`shift`+`k`|`root:split-down`| 34 | |`cmd`+`ctrl`+`shift`+`l`|`root:split-right`| 35 | |`cmd`+`d`|` doc:select-word `| 36 | |`cmd`+`d`|`find-replace:select-add-next`| 37 | |`cmd`+`delete`|`doc:delete-to-end-of-line`| 38 | |`cmd`+`down`|`doc:move-to-end-of-doc`| 39 | |`cmd`+`f3`|`find-replace:select-next`| 40 | |`cmd`+`f`|`find-replace:find`| 41 | |`cmd`+`g`|`doc:go-to-line`| 42 | |`cmd`+`j`|`doc:join-lines`| 43 | |`cmd`+`l`|`doc:select-lines`| 44 | |`cmd`+`left`|`doc:move-to-start-of-indentation`| 45 | |`cmd`+`n`|`core:new-doc`| 46 | |`cmd`+`o`|`core:open-file`| 47 | |`cmd`+`option`+`down`|`doc:create-cursor-next-line`| 48 | |`cmd`+`option`+`up`|`doc:create-cursor-previous-line`| 49 | |`cmd`+`p`|`core:find-file`| 50 | |`cmd`+`pagedown`|`root:move-tab-right`| 51 | |`cmd`+`pageup`|`root:move-tab-left`| 52 | |`cmd`+`r`|`find-replace:replace`| 53 | |`cmd`+`return`|`doc:newline-below`| 54 | |`cmd`+`right`|`doc:move-to-end-of-line`| 55 | |`cmd`+`s`|`doc:save`| 56 | |`cmd`+`shift`+`[`|`doc:select-to-previous-block-start`| 57 | |`cmd`+`shift`+`]`|`doc:select-to-next-block-end`| 58 | |`cmd`+`shift`+`backspace`|`doc:delete-to-previous-word-start`| 59 | |`cmd`+`shift`+`c`|`core:change-project-folder`| 60 | |`cmd`+`shift`+`d`|`doc:duplicate-lines`| 61 | |`cmd`+`shift`+`delete`|`doc:delete-to-next-word-end`| 62 | |`cmd`+`shift`+`down`|`doc:select-to-end-of-doc`| 63 | |`cmd`+`shift`+`k`|`doc:delete-lines`| 64 | |`cmd`+`shift`+`l`|` doc:select-word `| 65 | |`cmd`+`shift`+`l`|`find-replace:select-add-all`| 66 | |`cmd`+`shift`+`left`|`doc:select-to-start-of-indentation`| 67 | |`cmd`+`shift`+`o`|`core:open-project-folder`| 68 | |`cmd`+`shift`+`p`|`core:find-command`| 69 | |`cmd`+`shift`+`return`|`doc:newline-above`| 70 | |`cmd`+`shift`+`right`|`doc:select-to-end-of-line`| 71 | |`cmd`+`shift`+`s`|`doc:save-as`| 72 | |`cmd`+`shift`+`up`|`doc:select-to-start-of-doc`| 73 | |`cmd`+`up`|`doc:move-to-start-of-doc`| 74 | |`cmd`+`v`|`doc:paste`| 75 | |`cmd`+`w`|`root:close-or-quit`| 76 | |`cmd`+`x`|`doc:cut`| 77 | |`cmd`+`y`|`doc:redo`| 78 | |`cmd`+`z`|`doc:undo`| 79 | |`ctrl`+`1lclick`|`doc:split-cursor`| 80 | |`ctrl`+`insert`|`doc:copy`| 81 | |`ctrl`+`shift`+`tab`|`root:switch-to-previous-tab`| 82 | |`ctrl`+`tab`|`root:switch-to-next-tab`| 83 | |`f3`|`find-replace:repeat-find`| 84 | |`option`+`backspace`|`doc:delete-to-previous-word-start`| 85 | |`option`+`delete`|`doc:delete-to-next-word-end`| 86 | |`option`+`down`|`doc:move-lines-down`| 87 | |`option`+`left`|`doc:move-to-previous-word-start`| 88 | |`option`+`right`|`doc:move-to-next-word-end`| 89 | |`option`+`shift`+`left`|`doc:select-to-previous-word-start`| 90 | |`option`+`shift`+`right`|`doc:select-to-next-word-end`| 91 | |`option`+`up`|`doc:move-lines-up`| 92 | |`shift`+`f3`|`find-replace:previous-find`| 93 | -------------------------------------------------------------------------------- /locales/de/documentation/keymap.md: -------------------------------------------------------------------------------- 1 | # Standard Keymap 2 | 3 | Tastaturkürzeln haben die gleichen Funktionen auf jeden Betriebssystem, sie sind einfach nur anders gebunden 4 | um sich für normale Erwartungen für dem Betriebssystem anzupassen. 5 | 6 | Momentan gibt es nur two Betriebssystemlayouts. [MacOS](/en/documentation/keymap-macos), und alles andere. 7 | 8 | ## Keymap 9 | 10 | |Tasten Kombination|Aktionen| 11 | |---------------|-------| 12 | |`alt`+`1`|`root:switch-to-tab-1`| 13 | |`alt`+`2`|`root:switch-to-tab-2`| 14 | |`alt`+`3`|`root:switch-to-tab-3`| 15 | |`alt`+`4`|`root:switch-to-tab-4`| 16 | |`alt`+`5`|`root:switch-to-tab-5`| 17 | |`alt`+`6`|`root:switch-to-tab-6`| 18 | |`alt`+`7`|`root:switch-to-tab-7`| 19 | |`alt`+`8`|`root:switch-to-tab-8`| 20 | |`alt`+`9`|`root:switch-to-tab-9`| 21 | |`alt`+`i`|`root:switch-to-up`| 22 | |`alt`+`j`|`root:switch-to-left`| 23 | |`alt`+`k`|`root:switch-to-down`| 24 | |`alt`+`l`|`root:switch-to-right`| 25 | |`alt`+`return`|`core:toggle-fullscreen`| 26 | |`alt`+`shift`+`i`|`root:split-up`| 27 | |`alt`+`shift`+`j`|`root:split-left`| 28 | |`alt`+`shift`+`k`|`root:split-down`| 29 | |`alt`+`shift`+`l`|`root:split-right`| 30 | |`ctrl`+`/`|`doc:toggle-line-comments`| 31 | |`ctrl`+`1lclick`|`doc:split-cursor`| 32 | |`ctrl`+`[`|`doc:move-to-previous-block-start`| 33 | |`ctrl`+`]`|`doc:move-to-next-block-end`| 34 | |`ctrl`+`a`|`doc:select-all`| 35 | |`ctrl`+`backspace`|`doc:delete-to-previous-word-start`| 36 | |`ctrl`+`c`|`doc:copy`| 37 | |`ctrl`+`d`|` doc:select-word `| 38 | |`ctrl`+`d`|`find-replace:select-add-next`| 39 | |`ctrl`+`delete`|`doc:delete-to-next-word-end`| 40 | |`ctrl`+`down`|`doc:move-lines-down`| 41 | |`ctrl`+`end`|`doc:move-to-end-of-doc`| 42 | |`ctrl`+`f3`|`find-replace:select-next`| 43 | |`ctrl`+`f`|`find-replace:find`| 44 | |`ctrl`+`g`|`doc:go-to-line`| 45 | |`ctrl`+`home`|`doc:move-to-start-of-doc`| 46 | |`ctrl`+`i`|`find-replace:toggle-sensitivity`| 47 | |`ctrl`+`insert`|`doc:copy`| 48 | |`ctrl`+`j`|`doc:join-lines`| 49 | |`ctrl`+`l`|`doc:select-lines`| 50 | |`ctrl`+`left`|`doc:move-to-previous-word-start`| 51 | |`ctrl`+`n`|`core:new-doc`| 52 | |`ctrl`+`o`|`core:open-file`| 53 | |`ctrl`+`p`|`core:find-file`| 54 | |`ctrl`+`pagedown`|`root:move-tab-right`| 55 | |`ctrl`+`pageup`|`root:move-tab-left`| 56 | |`ctrl`+`r`|`find-replace:replace`| 57 | |`ctrl`+`return`|`doc:newline-below`| 58 | |`ctrl`+`right`|`doc:move-to-next-word-end`| 59 | |`ctrl`+`s`|`doc:save`| 60 | |`ctrl`+`shift`+`[`|`doc:select-to-previous-block-start`| 61 | |`ctrl`+`shift`+`]`|`doc:select-to-next-block-end`| 62 | |`ctrl`+`shift`+`backspace`|`doc:delete-to-previous-word-start`| 63 | |`ctrl`+`shift`+`c`|`core:change-project-folder`| 64 | |`ctrl`+`shift`+`d`|`doc:duplicate-lines`| 65 | |`ctrl`+`shift`+`delete`|`doc:delete-to-next-word-end`| 66 | |`ctrl`+`shift`+`down`|`doc:create-cursor-next-line`| 67 | |`ctrl`+`shift`+`end`|`doc:select-to-end-of-doc`| 68 | |`ctrl`+`shift`+`f3`|`find-replace:select-previous`| 69 | |`ctrl`+`shift`+`home`|`doc:select-to-start-of-doc`| 70 | |`ctrl`+`shift`+`i`|`find-replace:toggle-regex`| 71 | |`ctrl`+`shift`+`k`|`doc:delete-lines`| 72 | |`ctrl`+`shift`+`l`|` doc:select-word `| 73 | |`ctrl`+`shift`+`l`|`find-replace:select-add-all`| 74 | |`ctrl`+`shift`+`left`|`doc:select-to-previous-word-start`| 75 | |`ctrl`+`shift`+`o`|`core:open-project-folder`| 76 | |`ctrl`+`shift`+`p`|`core:find-command`| 77 | |`ctrl`+`shift`+`return`|`doc:newline-above`| 78 | |`ctrl`+`shift`+`right`|`doc:select-to-next-word-end`| 79 | |`ctrl`+`shift`+`s`|`doc:save-as`| 80 | |`ctrl`+`shift`+`tab`|`root:switch-to-previous-tab`| 81 | |`ctrl`+`shift`+`up`|`doc:create-cursor-previous-line`| 82 | |`ctrl`+`tab`|`root:switch-to-next-tab`| 83 | |`ctrl`+`up`|`doc:move-lines-up`| 84 | |`ctrl`+`v`|`doc:paste`| 85 | |`ctrl`+`w`|`root:close`| 86 | |`ctrl`+`x`|`doc:cut`| 87 | |`ctrl`+`y`|`doc:redo`| 88 | |`ctrl`+`z`|`doc:undo`| 89 | |`f11`|`core:toggle-fullscreen`| 90 | |`f3`|`find-replace:repeat-find`| 91 | |`shift`+`f3`|`find-replace:previous-find`| 92 | -------------------------------------------------------------------------------- /locales/de/documentation/usage.md: -------------------------------------------------------------------------------- 1 | # Nutzen 2 | 3 | Lite XL ist ein leichter Texteditor dass größtensteils geschrieben in Lua - es zielt darauf ab etwas praktisches, schönes, *kleines* und schnelles zu bieten. 4 | So leicht wie möglich umgesetzt; leicht zur modifizieren und erweitern, oder zum Benutzen ohne beides zu machen. 5 | 6 | Lite XL ist auf dem Lite Editor basiert und bietet paar Verbesserungen an 7 | während es immernoch kompatible bleibt. 8 | 9 | ## Erste Schritte 10 | 11 | Lite XL funktioniert mit *Projektverzeichnissen* - dies sind Ordnern indem der Code 12 | deines Projektes und andere Daten beinhaltet sind. 13 | 14 | Um ein spezifisches Projektverzeichnis zu öffnen kann der Ordnername als Befehlzeilenargument angegeben werden. *(`.` kann angegeben werden um den jetzigen Ordner zu benutzen)* 15 | oder der Ordner kann ins Fenster gezogen werden. 16 | 17 | Einmal angefangen kann das Projektverzeichnis mit dem Befehl `core:change-project-folder` geändert werden. Der Befehl wird alle Dokumente schließen 18 | die zu Zeit offen sind und wechselt zum neuen Projektverzeichnis. 19 | 20 | Wenn du ein neues Projektverzeichnis in einem neuen Fenster öffnen willst kannst du den Befehl `core:open-project-folder` ausführen. 21 | Es wird ein neues Fenster mit dem ausgewählten Projektverzeichnis öffnen. 22 | 23 | Die Hauptmethode um Dateien in Lite XL zu öffnen ist der Befehl `core:find-file` - 24 | dies bietet eine fuzzy finder über alle Dateien des Projekts an 25 | und kann mit dem `ctrl`+`p` Abkürzung geöffnet werden. 26 | 27 | Befehle können durch Tastaturkürzel aktiviert werden, oder wenn man `core:find-command` benutzt. 28 | Das `core:find-command` Befehl ist normalerweise an `ctrl`+`shift`+`p` gebunden. Zum Beispiel, 29 | wenn man die Tastaturkürzel oben drückt und `newdoc` schreibt und dann `return` drückt, öffnet man ein neues Dokument. 30 | Die eingestellte Tastaturkürzel für jedes Befehl kann man auf der rechten Seite des Namens sehen. Also kann man mit `ctrl`+`shift`+`p` drücken, um Tastaturkürzel für Befehle zu finden. 31 | 32 | ## Benutzerdatenverzeichnisse 33 | 34 | Lite XL benutzt Standardsystembenutzerverzeichnisse; Die Nutzerdaten können in `$HOME/.config/lite-xl` auf Linux und MacOS gefunden werden. 35 | Auf Windows wird das Variable `$USERPROFILE` anstatt `$HOME` benutzt. 36 | 37 | ## Benutzermodule 38 | 39 | Lite XL wird durch Benutzermodule konfiguriert. Das Benutzermodul kann benutzt werden um neue Tastaturkürzel und 40 | neue Farbschemen hinzuzufügen, oder den Stil oder andere Teile des Editors zu ändern. 41 | 42 | Das Benutzermodul wird geladen nachdem die Anwendung gestartet wurde, nachdem Plugins geladen wurden. 43 | 44 | Das Benutzermodul kann modifiziert werden indem man das `core:open-user-module` Befehl ausführt 45 | sonst kann es auch modifiziert werden indem man die `$HOME/.config/lite-xl/init.lua` Datei öffnet. 46 | 47 | Auf Windows wird das Variable `$USERPROFILE` anstatt `$HOME` benutzt. 48 | 49 | **tl;dr:** 50 | 51 | - Windows: `C:\Users\(username)\.config\lite-xl\init.lua` 52 | - MacOS: `/Users/(usernmame)/.config/lite-xl/init.lua` 53 | - Linux: `/home/(username)/.config/lite-xl/init.lua` 54 | 55 | Dies sind nicht die genauen Orte, aber sie helfen dir sie zu finden. 56 | 57 | Bitte bemerke dass Lite XLs Benutzermodul ein ganz anderen Ort hat als Lite Editors. 58 | 59 | ## Projektmodul 60 | 61 | Das Projektmodul ist ein optionaler Modul der vom aktuellen Verzeichnis des Projekts geladen wird, wenn Lite XL startet. 62 | Projektmodule können nützlich sein wenn man eigene Befehle für projektspezifische Befehle für Buildsysteme oder das Laden von projektspezifische Plugins braucht. 63 | 64 | Nachdem die Plugins- und Benutzermodule geladen wurden, 65 | 66 | Das Projektmodul kann editiert werden indem man `core:open-project-module` ausführt - Wenn das Modul nicht existiert, wird das Befehl eines erstellen. 67 | 68 | ## Füge Ordner zum Projekt hinzu 69 | 70 | Es ist möglich andere Projektverzeichnisse hinzuzufügen indem man den `core:add-directory` Befehl ausführt. 71 | Es wird auf der rechten Seite angezeigt werden und du kannst die Dateien im Ordner mit den `ctrl`+`p` Befehl auswählen. 72 | 73 | Andere Projektverzeichnisse können mit dem `core:remove-directory` Befehl entfernt werden. 74 | 75 | Wenn du dann Lite XL wiederöffnest werden die gleichen Projektverzeichnisse bleiben. 76 | Die Anwendung merkt sich dein Arbeitsplatz und auch die hinzugefügten Projektverzeichnisse. 77 | 78 | Seit Version 1.15 braucht Lite XL kein Arbeitsplatz Plugin, es ist ein Teil des Editors. 79 | 80 | ## Erstelle einen leeren Ordner 81 | 82 | Mit dem `files:create-directory` Befehl oder control-click im Treeview kann man leere subordner erstellen. 83 | 84 | ## Befehle 85 | 86 | Befehle werden im Befehlfinder und im Tastaturkürzelsystem von Lite XL benutzt. 87 | Ein Befehl besteht aus diesen drei Komponenten: 88 | 89 | * **Name** - der Befehl name in Form von `Namensraum:aktion-name`, z.B `doc:select-all` 90 | * **Aussagen** - Eine Funktion die true zurückgibt wenn der Befehl ausgeführt werden kann, z.B für alle Dokumentenbefehle wird geschaut ob das ausgewählte View ein Dokument ist 91 | * **Funktion** - Die Funktion die das Befehl ausführt 92 | 93 | Befehle können hinzugefügt werden mit der `command.add` Funktion die vom `core.command` Modul bereitgestellt wird: 94 | 95 | ```lua 96 | local core = require "core" 97 | local command = require "core.command" 98 | 99 | command.add("core.docview", { 100 | ["doc:save"] = function() 101 | core.active_view.doc:save() 102 | core.log("Saved '%s'", core.active_view.doc.filename) 103 | end 104 | }) 105 | ``` 106 | 107 | Befehle können programmatisch ausgeführt werden, indem man die `command.perform` Funktion vom `core.command` Modul benutzt: 108 | 109 | ```lua 110 | local command = require "core.command" 111 | command.perform "core:quit" 112 | ``` 113 | 114 | ### Tastaturkürzel 115 | 116 | Alle Tastaturkürzel werden vom `core.keymap` Modul verarbeitet. 117 | Eine Tastaturkürzel verbindet ein "Kürzel" (z.B `ctrl`+`q`) mit ein oder mehreren Befehlen (z.B `core:quit`). 118 | Wenn eine Tastaturkürzel gedrückt wird, iteratiert Lite XL über jedes Befehl dass zu dieser Tastaturkürzel zugewiesen wurde 119 | und führt die *Aussage Funktion* für diesem Befehl aus - wenn eine Aussage erfolgreich ist, dann stoppt es die Iteration und führt den Befehl aus. 120 | 121 | Ein Beispiel ist die `tab` Taste: 122 | 123 | ``` lua 124 | ["tab"] = { "command:complete", "doc:indent" }, 125 | ``` 126 | 127 | Wenn Tab gedrückt wird, wird `command:complete` nur ausgeführt wenn die ausgewählte View das Befehleingang ist. Sonst 128 | wird das `doc:indent` ausgeführt wenn das ausgewählte View das Dokument ist. 129 | 130 | Ein neues Tastaturkürzel kann so in dein Benutzermodul hinzugefügt werden: 131 | 132 | ```lua 133 | local keymap = require "core.keymap" 134 | keymap.add { ["ctrl+q"] = "core:quit" } 135 | ``` 136 | 137 | Eine Liste der Standard Tastaturkürzel kann [hier][1] gefunden werden. 138 | 139 | ## Globale Variablen 140 | 141 | Es gibt ein paar globale Variablen die vom Editor gesetzt werden. 142 | Diese Variablen sind überall und sollten nicht überschrieben werden. 143 | 144 | - `ARGS`: Befehlszeilenargumente. `argv[1]` ist der Name der Anwendung, `argv[2]` ist das erste Parameter, ... 145 | - `PLATFORM`: Ausgabe von `SDL_GetPlatform()`. Kann `Windows`, `Mac OS X`, `Linux`, `iOS` und `Android` sein. 146 | - `SCALE`: Schriftartengröße. Normalerweise 1, Aber kann bei HiDPI Systemen höher sein. 147 | - `EXEFILE`: Absoluter Pfad zur ausführdatei. 148 | - `EXEDIR`: Der ausführpfad. **Schreibe nicht zu diesem Ordner** 149 | - `VERSION`: lite-xl Version. 150 | - `MOD_VERSION`: mod-version die in Plugins benutzt wird. Wird geändert wenn die API sich ändert. 151 | - `PATHSEP`: Pfad Trennzeichen. `\` (Windows) or `/` (Anderen Betriebssystemen) 152 | - `DATADIR`: Der Daten Ordner, wo der Lua Teil von lite-xl ist. **Schreibe nicht zu diesem Ordner.** 153 | - `USERDIR`: Benutzerkonfiguration Ordner. 154 | 155 | > `USERDIR` soll anstatt `DATADIR` benutzet werden wenn man den Editor konfiguriert 156 | > weil `DATADIR` vielleicht nicht schreibbar ist. 157 | > (Zum Beispiel, wenn der Editor in `/usr` installiert ist, dann ist `DATADIR` in `/usr/share/lite-xl`!) 158 | > `USERDIR` ist immer für den Nutzer schreibbar, es erlaubt mehrere Nutzer ihren Editor zu konfigurieren 159 | 160 | ## Plugins 161 | 162 | Plugins in Lite XL sind normale Lua Module und werden auch so behandelt - Kein komplizierter Pluginmanager wird bereitgestellt, und wenn einmal ein Plugin geladen ist, kann es sich nicht selber entladen. 163 | 164 | Um ein Plugins zu installieren kannst du es einfach im `plugins` Ordner im Benutzermodulordner reingeben. 165 | Wenn Lite XL startet, ladet es zuerst die Plugins im Datenordner, dann wird es die Plugins im Benutzermodulordner laden. 166 | 167 | Um ein Plugin zu deinstallieren, kann man einfach die Plugin Datei löschen - alle Plugins 168 | (Auch die was mit dem Editor installiert kommen) können gelöscht werden, um ihre Funktionen zu entfernen. 169 | 170 | Wenn du Plugins nur unter bestimmten Umstanden laden willst (z.B nur in einem bestimmen Project), 171 | dann kann der Plugin irgendwo außer im `plugins` Ordner gegeben werden. Der Plugin kann dann manuell geladen werden mit der 172 | `require` Funktion. 173 | 174 | Plugins können vom [Plugins Repository][2] heruntergeladen werden. 175 | 176 | ## Den Editor neustarten 177 | 178 | Wenn du eine Benutzerkonfiguration Datei oder eine Lua Implementation Datei modifizierst, 179 | dann kannst du mit `core:restart` Befehl den Editor neustarten. 180 | Die ganze Anwendung wird neugeladen indem es ein existierendes Fenster neustartet. 181 | 182 | ## Color Themes 183 | 184 | Farbthemen in Lite XL sind Lua Module die Farbfelder von Lite XLs `core.style` Modul überschreiben. 185 | Vordefinierte Farbenmethoden sind im `colors` Ordner im Datenordner. 186 | Neue Farbthemen können installiert werden im `colors` Ordner dass in dein Benutzermodulordner ist. 187 | 188 | Ein Farbthema kann benutzt werden indem man es in dein Benutzermodulordner erfordert: 189 | 190 | ```lua 191 | core.reload_module "colors.winter" 192 | ``` 193 | 194 | Im Lite Editor wird die `require` funktion benutzt anstatt `core.reload_module`. 195 | In Lite XL soll `core.reload_module` benutzt werden um sicher zu sein, dass ein Farbmodul echt neugeladen wird, 196 | wenn man die Benutzerkonfiguration speichert. 197 | 198 | Farbthemen können vom [Farbthemen Repository][3] heruntergeladen werden. 199 | Sie sind in Lite XL Veröffentlichungpacketen enthalten. 200 | 201 | 202 | [1]: /de/documentation/keymap 203 | [2]: https://github.com/lite-xl/lite-xl-plugins 204 | [3]: https://github.com/lite-xl/lite-xl-colors 205 | -------------------------------------------------------------------------------- /locales/de/downloads.md: -------------------------------------------------------------------------------- 1 | # Downloads 2 | 3 | ## Binary Packete 4 | 5 | Binär Packete sind verfügbar in der [GitHub Veröffentlichungensseite][1]. 6 | 7 | ## Installieren über Packetverwaltung 8 | 9 | Oder du kannst Lite-XL über den Paketmanager deiner Distribution installieren. 10 | **Diese Packete werden von der Community erhalten und sind vielleicht veraltet.** 11 | 12 | - [Windows][2] ([Chocolatey][3] / [Scoop][4]) 13 | - [Mac OS][5] (MacPorts) 14 | - [Arch Linux][6] (AUR) 15 | - [NixOS][7] (nixpkgs) 16 | - [Fedora][8] 17 | 18 | ```sh 19 | choco install lite-xl # chocolatey 20 | scoop bucket add extras && scoop install lite-xl # scoop 21 | sudo port install lite-xl # macports 22 | yay -S lite-xl # oder dein lieblings AUR helper 23 | nix-env -i lite-xl # nixos 24 | sudo dnf install lite-xl # fedora 25 | ``` 26 | 27 | ## Quellcode 28 | 29 | Das Quellcode ist verfügbar auf [GitHub][9], durch Herunterladen von Zip- oder Tar Archiven, 30 | oder direkt über Git: 31 | 32 | ```sh 33 | git clone https://github.com/lite-xl/lite-xl.git 34 | ``` 35 | 36 | 37 | [1]: https://github.com/lite-xl/lite-xl/releases/latest 38 | [2]: https://github.com/microsoft/winget-cli/discussions/223#discussion-15735 39 | [3]: https://community.chocolatey.org/packages/lite-xl 40 | [4]: https://github.com/ScoopInstaller/Extras/blob/master/bucket/lite-xl.json 41 | [5]: https://ports.macports.org/port/lite-xl/ 42 | [6]: https://aur.archlinux.org/packages/lite-xl/ 43 | [7]: https://github.com/NixOS/nixpkgs/blob/release-21.11/pkgs/applications/editors/lite-xl/default.nix 44 | [8]: https://src.fedoraproject.org/rpms/lite-xl 45 | [9]: https://github.com/lite-xl/lite-xl 46 | -------------------------------------------------------------------------------- /locales/de/index.md: -------------------------------------------------------------------------------- 1 | # Lite XL 2 | 3 | Ein leichter, *simpler*, schneller, funktionsreicher, und extrem erweiterbarerer Texteditor geschrieben in C, und Lua, angepasst von [lite](https://github.com/rxi/lite/). 4 | 5 | [![Lite XL Editor](/assets/img/editor.png)](/assets/img/editor.png) 6 | -------------------------------------------------------------------------------- /locales/de/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ title }} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 |

Lite XL

17 |
18 | 19 | 20 |

21 | 22 | DE 23 |

24 | 25 | 26 | 27 | English 28 | 29 | 30 | 31 | Deutsch 32 | 33 | 34 |
35 | 36 |

Über

37 | 38 | FAQ 39 | Funktionen 40 | Screenshots 41 | Mitwirkende 42 | 43 |
44 | 45 |

Dokumentation

46 | 47 | Nutzen 48 | Bauen 49 | Standard Keymap 50 | MacOS Keymap 51 | 52 |
53 | 54 |

Tutorials

55 | 56 | Einfaches Plugin 57 | Syntaxhervorhebung 58 | API Overview 59 | Systemschriftarten 60 | 61 |
62 |

63 | 64 | 65 | 66 | Plugins 67 |

68 |

69 | 70 | 71 | 72 | Downloads 73 |

74 |
75 | 76 |

77 | 78 | 79 | 80 | Suchen 81 |

82 |
83 | 84 |
85 | 86 | 87 |

88 | A newer version of this file is available in English. 89 |

90 | {{ page }} 91 |
92 | 93 | 94 |

Mache mit

95 | 96 | 97 | 98 | 99 | Github 100 | 101 | 102 | 103 | 104 | 105 | Discord 106 | 107 | 108 | 109 | 110 | 111 | 112 | Matrix 113 | 114 | 122 |
123 | 124 |

Status

125 | 126 | 127 |
128 |
129 |
130 | 131 | 132 | -------------------------------------------------------------------------------- /locales/de/tutorials/api-overview.md: -------------------------------------------------------------------------------- 1 | # API Overview 2 | 3 | ### This is a work in progress. 4 | 5 | Here we provide some resources and explanation to some API and aspects of Lite XL. 6 | For API docs, it's available in [the repo][1] 7 | Thus, we'll not explain _everything_, only the more important and frequently used features. 8 | 9 | Built-in APIs: 10 | 11 | - [Process API][2] 12 | - [System API][3] 13 | - [Regex API][4] 14 | 15 | [1]: https://github.com/lite-xl/lite-xl/tree/master/docs 16 | [2]: /en/tutorials/overview/process 17 | [3]: /en/tutorials/overview/system 18 | [4]: /en/tutorials/overview/regex 19 | -------------------------------------------------------------------------------- /locales/de/tutorials/index.md: -------------------------------------------------------------------------------- 1 | # Tutorials 2 | 3 | Diese Seiten enthalten Tutorials und Dokumentationen zum Erstellen von Plugins in Lite XL. 4 | 5 | - [API Overview](/en/tutorials/api-overview) 6 | - [Einfaches Plugin](/en/tutorials/simple-plugin) 7 | - [Syntaxhervorhebung](/en/tutorials/syntax-highlighting) 8 | - [System Schriftarten](/en/tutorials/system-fonts) 9 | -------------------------------------------------------------------------------- /locales/de/tutorials/overview/process.md: -------------------------------------------------------------------------------- 1 | # Process API 2 | 3 | Lite XL provides a process API to launch external applications. This API is meant to replace 4 | lua's `io.popen` and lite's [pipe-to-a-file][1] approach. 5 | 6 | Advantages of this API includes: 7 | 8 | - Proper argument escaping (arguments are supplied via a table) 9 | - Nonblocking IO 10 | - Able to detach processes from Lite XL [(in progress)][2] 11 | - Does not create temporary files 12 | - Mostly cross-platform (does not require special code for each shell) 13 | 14 | ## Using the Process API 15 | 16 | ### Error handling 17 | - `process.start()` may throw errors if it cannot run the program. 18 | - `process.read*` and `process.write` functions may throw errors if 19 | - the process ended 20 | - the process closed the stream 21 | - you closed the stream 22 | - there might be other errors to look forward to too 23 | 24 | ### Starting a process 25 | To start a process, use `process.start(args, options)`. 26 | 27 | Here are some of the more useful arguments. 28 | 29 | - `args`: The executable and any arguments, eg: `{ "sh", "-c", "echo hello world" }` 30 | - `options`: Options for `process.start()` 31 | - `env`: A key-value table containing the env. **Note that if this is provided, 32 | environment variables will not be inherited.** 33 | - `stdin`: Specify where to redirect stdin 34 | - `stdout`: Specify where to redirect stdout 35 | - `stderr`: Specify where to redirect stderr 36 | 37 | for `options.std{in,out,err}`, valid values are: 38 | 39 | - `process.REDIRECT_PIPE` (Make it available to subprocess API for reading / writing) 40 | - `process.REDIRECT_DISCARD` (Discard the output. Use this to prevent buffering) 41 | - `process.REDIRECT_STDOUT` (`stderr` only, for redirecting `stderr` to `stdout`) 42 | 43 | ### Reading from process 44 | To read from `stdout` or `stderr` of a process, use `process:read_stdout()` and 45 | `process:read_stderr()` respectively. 46 | 47 | You can specify a numeric argument to them, which will change the size of internal buffer used 48 | to read the output. 49 | 50 | Alternatively, you could use `process:read()` with `process.STREAM_STDERR` and `process.STREAM_STDOUT`. 51 | 52 | **Example:** 53 | 54 | ```lua 55 | local proc = process.start { "sh", "-c", "echo hello world!" } 56 | 57 | -- do not use `while proc:running()` if you care about output. 58 | -- The process could die and leave data in the buffer 59 | -- You should just read until `proc:read_stdout()` returns nil 60 | while true do 61 | local rdbuf = proc:read_stdout() 62 | if not rdbuf then break end 63 | -- yay, output 64 | end 65 | ``` 66 | 67 | ### Writing to process 68 | You can use `process:write(data)` to write a string to `stdin`. 69 | 70 | ### Checking completion 71 | - `process:running()` returns a boolean to indicate whether if the process is running. 72 | - `process:wait(time)` also does the same thing, but you specify how long it should wait (or 0 to return immediately). 73 | 74 | ### Terminating process 75 | - `process:terminate()` sends SIGTERM (or Windows equivalent) to the process. 76 | - `process:kill()` sends SIGKILL (or Windows equivalent) to the progress. 77 | **Use this only if `process:terminate()` cannot kill the process, [as it can cause issues][3].** 78 | 79 | ### Misc 80 | - `process:pid()` returns the PID of the process. 81 | **There are no guarantees for this PID to be correct if the process terminated early.** 82 | - `process:returncode()` returns the exit code of the process, if any 83 | - `process:close_stream()` closes `stdin`, `stdout` or `stderr` stream of the process. 84 | 85 | 86 | [1]: https://github.com/rxi/console/blob/fb3d414d085d4110364314d6cd8380dc1d386249/init.lua#L100 87 | [2]: https://github.com/lite-xl/lite-xl/pull/535 88 | [3]: http://turnoff.us/geek/dont-sigkill/ 89 | -------------------------------------------------------------------------------- /locales/de/tutorials/overview/regex.md: -------------------------------------------------------------------------------- 1 | # Regex API 2 | 3 | This API provides PCRE regular expressions for those who needs more power in matching text. 4 | This API written in C and Lua. 5 | 6 | ## Creating a regex 7 | Use `regex.compile(pattern, options)` to compile a regex. 8 | 9 | - `pattern`: The regex pattern 10 | - `options`: regex modifiers as a string, eg `"im"` 11 | - `"i"`: Case-insensitive search 12 | - `"m"`: Multiline search 13 | - `"s"`: Match all characters with dot (`.`), **including newlines.** 14 | 15 | ## Matching 16 | 17 | ### Low level functions 18 | - `regex:cmatch(str, offset, options)` low-level matching function 19 | - `str`: The string to match against 20 | - `offset`: Where to start matching 21 | - `options`: A bit field of options 22 | - `regex.ANCHORED`: Only match from the start of the string 23 | - `regex.ENDANCHORED`: Only match from the end of the string 24 | - `regex.NOTBOL`: String is not beginning of line 25 | - `regex.NOTEOL`: String is not the end of line 26 | - `regex.NOTEMPTY`: Do not match an empty string 27 | - `regex.NOTEMPTY_ATSTART`: Do not match empty string at the start 28 | 29 | **Note: `regex:cmatch()` returns wrong indexes (currently at version 2.0.2). 30 | The end index returned by `regex:cmatch()` is always off by 1 (-1 to get the actual end index).** 31 | 32 | ### High level functions 33 | All the functions below can be in 2 forms: 34 | - `regex:fn(...)` where `regex` is the compiled regex instance 35 | - `regex.fn(pattern, ...)` where `pattern` is a pattern string to be compiled and used directly. 36 | 37 | We will only document the first form. 38 | 39 | - `regex:match(str, offset, options)` high level matching function. This function accepts 40 | the same arguments as `regex:cmatch()` 41 | - `regex:gsub(str, replacement)` replaces matches in `str` with `replacement`. 42 | Capture groups are identified with `\\0` to `\\9`, this might change in the future. 43 | -------------------------------------------------------------------------------- /locales/de/tutorials/overview/system.md: -------------------------------------------------------------------------------- 1 | # System API 2 | 3 | This is where Lite XL's lua code interact with its underlying C engine. 4 | Some of the functions here will be omitted because they're not useful for 5 | plugins. 6 | 7 | ## Clipboard 8 | - `system.set_clipboard(text)` sets the clipboard content. 9 | - `system.get_clipboard()` retrieves the content of the clipboard. 10 | 11 | ## File / Directory manipulation 12 | - `system.list_dir(dir)` returns a list of filenames in a directory. 13 | - `system.rmdir(dir)` removes a directory. Use this instead of `os.remove()`. 14 | **The directory must be empty.** 15 | - `system.chdir(dir)` changes the current working directory (like `cd`). 16 | - `system.mkdir(dir)` creates a new directory. 17 | **It does not recursively create directories.** 18 | - `system.absolute_path(path)` resolves the path components (`.. and .`) to an absolute path. 19 | - `system.get_file_info(path)` returns info about a path. 20 | - `modified`: last modification time of the file in seconds since UNIX epoch. 21 | - `size`: file size in bytes. 22 | - `type`: Path type (`"file"` or `"dir"`). 23 | 24 | ## Timing 25 | - `system.get_time()` returns time in seconds (as floating point number) since Lite XL started. 26 | Use this instead of `os.time()` for higher precision timers. 27 | - `system.sleep(time)` sleeps for `time` in milliseconds. 28 | **Do not use this. Write asynchronous code.** 29 | 30 | ## Window manipulation 31 | - `system.set_window_opacity(o)` sets the window opacity from 0 to 1. 32 | - `system.set_window_title(title)` sets the window title. 33 | - `system.set_window_mode(mode)` sets window mode: 34 | - `"normal"`: also known as "restored" on Windows. 35 | - `"maximized"`: Maximize the window. 36 | - `"minimized"`: Minimize the window. 37 | - `"fullscreen"`: Fullscreen 38 | - `system.set_window_bordered(bordered)` enables or disable window border (decoration). 39 | - `system.set_window_hit_test(height, control_width, resize_border)` sets window hit test (used for 40 | `config.borderless` to make custom drawn border interactable). 41 | - If no argument is supplied, reset the hit test values. 42 | - `height`: height of the title bar. 43 | - `controls_width`: Not too sure about this, but it should be the size of the title bar controls 44 | (Maximize, Minimize and Normal buttons on the right). 45 | It seems to be fixed at the right side of the title bar. 46 | - `resize_border`: Number of pixels reserved for resizing the window. 47 | (setting this to a large value means that you can resize the window way easier) 48 | - `system.get_window_size()` gets the window size. 49 | - `system.set_window_size(w, h, x, y)` sets the window size (and also position). 50 | - `system.window_has_focus()` checks whether the window is in focus. 51 | - `system.show_fatal_error(title, msg)` shows an system error message box. 52 | **Use nagview whenever possible.** 53 | 54 | ## Misc 55 | - `system.exec(command)` runs a command. Use the [Process API][1] instead of this. 56 | - `system.fuzzy_match(haystack, needle, file)` generates a score depends on how close the needle 57 | matches the haystack. 58 | - `file`: match backwards (more accurate for filename matching). 59 | 60 | [1]: /en/tutorials/overview/process 61 | -------------------------------------------------------------------------------- /locales/de/tutorials/simple-plugin.md: -------------------------------------------------------------------------------- 1 | # Einfache Plugins 2 | 3 | ### Was ist Simple? 4 | Simple ist ein einfaches Plugin dass geschrieben wurde mit der Absicht Entwickler 5 | die neu bei Lite XL sind, den Prozess des Schreibens von Plugins für den Editor zu zeigen. 6 | 7 | ### Was macht das Plugin? 8 | Das Plugin zeigt eine Nachricht (Das als Eingabe Des Benutzers übernommen wird) 9 | am oberen rechten Eck des Editorfensters. Es erlaubt auch den Benutzer das Umschalten der Sichtbarkeit 10 | der Nachricht. 11 | 12 | ### Ich kann nicht Lua schreiben! 13 | Wenn du von anderen Programmierungsprachen kommst, dann schau dir das [Lua cheatsheet][1] an. 14 | Wenn du neu bei programmieren bist, dann schau dir [das (English)][2] an. 15 | 16 | ### Das Format vom Tutorial 17 | Das Code enthält Kommentare die detailieren was das Meiste (wenn nicht alles) 18 | im Code macht. 19 | 20 | Die Kommentare sind gerade in Englisch, aber ich glaub das wirst du schon verstehen :) 21 | 22 | ### Das Code: 23 | ```lua 24 | -- mod-version:3 25 | 26 | -- you MUST put mod-version:x on the first line of your plugin 27 | -- mod-version usually maps to lite-xl releases (eg. mod-version: 2 == lite-xl 2.0) 28 | -- lite-xl won't load the plugin if the mod-version mismatches 29 | 30 | ----------------------------------------------------------------------- 31 | -- NAME : Simple 32 | -- DESCRIPTION: A simple guide on how to make your first Lite XL plugin 33 | -- AUTHOR : Ashwin Godbole (aelobdog) 34 | -- GOALS : To render some text inside the editor 35 | ----------------------------------------------------------------------- 36 | -- Disclaimer : 37 | -- I am not a lua developer, and my knowledge about writing plugins for 38 | -- Lite XL is very limited. This file serves the purpose of helping the 39 | -- reader get started with plugin development for Lite XL, and therefore 40 | -- demonstrates only some very basic features. For more complex plugin 41 | -- development, be sure to check out the source code of some other 42 | -- plugins after going through this file. 43 | ----------------------------------------------------------------------- 44 | -- Before we start writing any code for the plugin, we must import the 45 | -- required modules from the "core" package. 46 | 47 | -- the "core" module 48 | local core = require "core" 49 | 50 | -- the "command" module will help us register commands for our plugin. 51 | local command = require "core.command" 52 | 53 | -- the "style" module will allow us to use styling options 54 | local style = require "core.style" 55 | 56 | -- the "config" module will be used to store certain things like colors 57 | -- and functions 58 | local config = require "core.config" 59 | 60 | -- the "keymap" module will allow us to set keybindings for our commands 61 | local keymap = require "core.keymap" 62 | 63 | -- since we want to modify RootView, we'll need to require it first 64 | local RootView = require "core.rootview" 65 | 66 | ----------------------------------------------------------------------- 67 | -- per-plugin config must stay in config.plugins.(plugin name) 68 | config.plugins.simple = {} 69 | 70 | -- colors are just three or four comma separated values (RGBA) (range 0 - 255) 71 | -- put inside of '{ }'. We will add our color to the config module. 72 | config.plugins.simple.text_color = {200, 140, 220} -- or use `{ common.color "#C88CDC" }` 73 | ----------------------------------------------------------------------- 74 | -- Let's create a function to calculate the coordinates of our text. 75 | -- While we're at it, let's add our function to the `config` module. 76 | -- We'll take the message we want to display as the argument to the 77 | -- function to determine the x and y coordinates of the text. 78 | 79 | function config.plugins.simple.get_text_coordinates(message) 80 | -- For this plugin, we want to display the text on the top right 81 | -- corner of the screen. For this, we need to know the editor's width 82 | -- and height. 83 | 84 | -- The current font's size can be obtained from the "style" module. 85 | -- The editor's dimensions can be obtained by 86 | -- 1. WIDTH : core.root_view.size.x 87 | -- 2. HEIGHT : core.root_view.size.y 88 | 89 | local message_width = style.code_font:get_width(message.." ") 90 | local font_height = style.code_font:get_size() 91 | local x = core.root_view.size.x - message_width 92 | local y = font_height / 2 93 | 94 | return x, y 95 | end 96 | ----------------------------------------------------------------------- 97 | -- Let's now get to actually drawing the text inside the editor. 98 | -- In order to "inject" our own code to draw text, 99 | -- we'll need to save the original draw function 100 | -- We'll save `RootView.draw` to a variable we call `parent_draw` 101 | 102 | local parent_draw = RootView.draw 103 | 104 | -- Now let's overload the original definition of `draw` in RootView 105 | -- by redefining the function. 106 | 107 | function RootView:draw() 108 | -- We call the parent's function to keep the editor functional... 109 | -- obviously we must still draw all the other stuff ! 110 | -- So we call the `parent_draw` function before doing anything else. 111 | parent_draw(self) 112 | 113 | -- we'll add an option to toggle the message on and off. let's use a 114 | -- boolean variable to keep track of whether we want to display the 115 | -- message or not. 116 | if config.plugins.simple.show_my_message then 117 | -- We'll be getting the message to display as input from the user 118 | -- later. We'll store that user input in `config.plugins.simple.hw_message`. 119 | -- (NOTE: this variable does not come in-built in lite-xl; 120 | -- it is a variable that we will define later.) 121 | 122 | -- let's store the value of config.plugins.simple.hw_message in a local variable 123 | -- `message` in case config.plugins.simple.hw_message we set the message to 124 | -- "message not set yet!" 125 | local message 126 | 127 | if config.plugins.simple.hw_message then 128 | message = config.plugins.simple.hw_message 129 | else 130 | message = "Message not set yet !" 131 | end 132 | 133 | -- let's get the coordinates for our text 134 | local x, y = config.plugins.simple.get_text_coordinates(message) 135 | 136 | -- let's finally draw the text to the window ! 137 | -- the draw_text function from `renderer` is an important function 138 | -- as it is used to display any and all text inside of the editor 139 | -- window 140 | renderer.draw_text(style.code_font, message, x, y, config.plugins.simple.text_color) 141 | end 142 | end 143 | ----------------------------------------------------------------------- 144 | -- Let's allow the user to turn the message on and off 145 | -- we'll write a function to flip our "show" boolean variable. 146 | 147 | local function toggle_helloworld() 148 | config.plugins.simple.show_my_message = not config.plugins.simple.show_my_message 149 | end 150 | ----------------------------------------------------------------------- 151 | -- Finally, let's add the toggle function to the command list so that 152 | -- we can call it from the C-S-p command panel. Let's add one command 153 | -- to toggle the visibility of the message on and off and one to get 154 | -- the user's message and then display it. 155 | 156 | command.add(nil, { 157 | -- Toggle the visibility of the message 158 | ["simple:toggle"] = toggle_helloworld, 159 | 160 | -- Set and show the message 161 | -- This is the way to get user input through the command bar. 162 | -- `core.command_view:enter` takes 2 arguments: 163 | -- * the prompt to display before taking input 164 | -- * a function that takes the "input" as its argument 165 | -- (NOTE: here the variable we are reading input into is `text`) 166 | ["simple:setshow"] = function() 167 | core.command_view:enter("Test to display", { 168 | submit = function(text) 169 | config.plugins.simple.hw_message = text 170 | config.plugins.simple.show_my_message = true 171 | end 172 | }) 173 | end 174 | }) 175 | ----------------------------------------------------------------------- 176 | -- Just for fun, let's assign our commands their own keybindings. 177 | -- Here, we assign the keybinding the same string(its name) as the one 178 | -- that we set while creating the command 179 | keymap.add { 180 | ["alt+s"] = "simple:setshow", 181 | ["alt+t"] = "simple:toggle", 182 | } 183 | ``` 184 | 185 | ### Zusätzliches 186 | - [Lite: Eine Implementation Übersicht (English)][3], ein exzellentes Post von rxi dass meistens zu lite-xl relevant bleibt. 187 | - [API Übersicht (English)][4], wo mache APIs erklärt werden. 188 | 189 | 190 | [1]: https://devhints.io/lua 191 | [2]: https://www.lua.org/pil 192 | [3]: https://rxi.github.io/lite_an_implementation_overview.html 193 | [4]: /en/tutorials/api-overview 194 | -------------------------------------------------------------------------------- /locales/de/tutorials/syntax-highlighting.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Syntaxhervorhebung 4 | 5 | ## So erstellt man Syntaxhervorhebung für Lite XL 6 | Syntaxhervorhebung Plugins für Lite XL sind Lua Dateien. Diese Dateien definieren Muster oder Regex 7 | verschiedene teile einer gegebenen Sprache, man ordnet Token-Typen zu Übereinstimmung zu. 8 | Diese verschiedenen Token-Typen werden dann verschiedene farben von deinem ausgesuchten Color Scheme gegeben. 9 | 10 | Wie andere Plugins, Syntax Definitionen werden von den folgenden Ordnern empfangen, in der folgenden Reihenfolge: 11 | 12 | - `/usr/share/lite-xl/plugins/` 13 | - `$HOME/.config/lite-xl/plugins/` 14 | 15 | BEMERKE: Der genaue Ort von diesen Ordnern wird von dein Betriebssystem und Installationsmethode abhängen. Zum Beispiel, unter Windows wird das Variable `$USERPROFILE` benutzt werden anstatt `$HOME`. 16 | 17 | Der Benutzer Modul Ordner für Lite Xl kann in diesen Orten auf different Betriebssystemen gefunden werden: 18 | 19 | - Windows: `C:\Users\(nutzername)\.config\lite-xl` 20 | - MacOS: `/Users/(nutzername)/.config/lite-xl` 21 | - Linux: `/home/(nutzername)/.config/lite-xl` 22 | 23 | Also, um eine neue Syntax Definition auf Linux zu erstellen, musst du eine `.lua` Datei in dein `$HOME/.config/lite-xl/plugins/` Ordner machen. 24 | 25 | ## Welche Syntax-Token arten sind unterstützt? 26 | 27 | Die unterstützten Syntax_Token art, definiert von `lite-xl/core/style.lua`, sind: 28 | 29 | - normal 30 | - symbol 31 | - comment 32 | - keyword 33 | - keyword2 34 | - number 35 | - literal 36 | - string 37 | - operator 38 | - function 39 | 40 | In dein Syntaxhervorhebung Plugin, schreibst du Muster um Teile der Sprachen-Syntax zu entsprechen, und um Token-Typen zu übereinstimmen. Du musst nicht alle benutzen - benutze so viele die du brauchst für deine Sprache. 41 | 42 | Let's walk through an example syntax definition and see how this works. 43 | 44 | Gehen wir mal durch eine Beispiel Syntax Definition und wir werden sehen wie es funktioniert. 45 | 46 | ## Beispiel Syntax: ssh config Dateien 47 | 48 | Das ist ein kleines, simples Beispiel von einer Syntax Definition, Es soll eine SSH config Datei hervorheben und es sieht so aus: 49 | 50 | ```lua 51 | -- mod-version:2 -- lite-xl 2.0 52 | local syntax = require "core.syntax" 53 | 54 | syntax.add { 55 | files = { "sshd?/?_?config$" }, 56 | comment = '#', 57 | patterns = { 58 | { pattern = "#.*\n", type = "comment" }, 59 | { pattern = "%d+", type = "number" }, 60 | { pattern = "[%a_][%w_]*", type = "symbol" }, 61 | { pattern = "@", type = "operator" }, 62 | }, 63 | symbols = { 64 | -- ssh config 65 | ["Host"] = "function", 66 | ["ProxyCommand"] = "function", 67 | 68 | ["HostName"] = "keyword", 69 | ["IdentityFile"] = "keyword", 70 | ... 71 | 72 | -- sshd config 73 | ["Subsystem"] = "keyword2", 74 | 75 | -- Literals 76 | ["yes"] = "literal", 77 | ["no"] = "literal", 78 | ["any"] = "literal", 79 | ["ask"] = "literal", 80 | }, 81 | } 82 | ``` 83 | 84 | Schauen wir uns mal jeden Teil an und schauen wie es funktioniert. 85 | 86 | ### Header 87 | 88 | Die erste Zeile ist ein Lua kommentar und sagt Lite XL welche version dieses Plugin braucht. Die zweite Zeile importiert das `core.syntax` Modul 89 | dass wir nutzen können: 90 | 91 | ```lua 92 | -- mod-version:2 -- lite-xl 2.0 93 | local syntax = require "core.syntax" 94 | ``` 95 | 96 | Dann fügen wir eine Syntax Definition mit `syntax.add {...}` zu lite ein. 97 | 98 | #### Files 99 | 100 | Die `files` Eigenschaft sagt Lite XL welche Dateien these Syntax benutzt werden soll. Das ist ein Lua Muster, das mit dem vollständigen Pfad der geöffneten Datei übereinstimmt. Zum Beispiel, um gegen Markdown Dateien zu übereinstimmen - mit entweder eine `.md` oder eine `.markdown` Erweiterung, 101 | du könntest das machen: 102 | 103 | ```lua 104 | files = { "%.md$", "%.markdown$" }, 105 | ``` 106 | 107 | In unseren original Beispiel, gleichen wir mit dem Ende des Pfads und nicht mit der Erweiterung ab, weil SSH config Dateien keine Erweiterung hat - und wir nicht alle `config` Dateien abgleichen. Wir erwarten den Pfad für SSH config Dateien so auszusehen: 108 | 109 | - `~/.ssh/config` 110 | - `/etc/ssh/ssh_config` 111 | - `/etc/ssh/sshd_config` 112 | 113 | Dieses Muster gleicht Pfade ab die so aussehen: 114 | 115 | ```lua 116 | files = { "sshd?/?_?config$" }, 117 | ``` 118 | 119 | ### Kommentare 120 | 121 | Die Kommentar Eigenschaft definiert _nicht_ welche Teile der Syntax Kommentare sind - Schaue auf Muster für das unten. Diese Eigenschaft sagt Lite XL welche Charaktere beim Anfang der ausgewählten Zeilen hinzufügt werden sollen, wenn du `ctrl+/` drückst. 122 | Du kannst auch `block_comment` benutzen um Lite XL zu sagen, wie es multiline oder Block Kommentare machen soll. 123 | 124 | ### Muster 125 | 126 | Ein gegebener Textabschnitt kann nur ein Muster abgleicht werden. Wenn Lite XL einmal einschieden hat, dass es mit einem Muster übereinstimmt, dann wird es den Token-Typen zuweisen und es wird weitergehen. 127 | Muster werden getestet in der Reihenfolge wie es in der Syntax Definition geschrieben wurde, also wird das erste Übereinstimmen gewinnen. 128 | 129 | Jedes Muster nimmt einer dieser Formen an: 130 | 131 | #### Einfaches Muster 132 | 133 | ```lua 134 | { pattern = "#.*\n", type = "comment" }, 135 | ``` 136 | 137 | Diese Form gleicht die Zeile mit dem Muster ab und wenn es abstimmt, weist es in diesem Fall den passenden Text den gebenen Token `type` - `comment` zu. 138 | 139 | #### Start- & Endmuster 140 | 141 | ```lua 142 | { pattern = { "%[", "%]" }, type = "keyword" }, 143 | ``` 144 | 145 | Diese Form hat zwei Muster - eines das mit dem Anfang des Bereichs übereinstimmt und eines dass mit dem Ende übereinstimmt. Alles zwischen den Anfang und den Ende wird den Token `type` zugewiesen. 146 | 147 | #### Start- & Endmuster, mit Ausgang 148 | 149 | ```lua 150 | { pattern = { '"', '"', '\\' }, type = "string" }, 151 | ``` 152 | 153 | Dieses ist das Gleiche wie die letzte Form, aber mit einem dritten Parameter. 154 | Der dritte Teil, der `'\\'` Teil in diesem Beispiel, spezifiziert den Charakter dass entkommen vom Schlussübereinstimmung ermöglicht. 155 | 156 | Für mehr Information von Lua Muster, sehe [Lua Muster Referenz (English)](https://www.lua.org/manual/5.3/manual.html#6.4.1) 157 | 158 | Wenn du PCRE Regular Expressions anstatt Lua Muster benutzen musst, kannst du das Stichwort `regex` anstelle von `pattern` benutzen. 159 | 160 | ### Symbole 161 | 162 | > Dieser Teil ist **nicht mit dem `symbol` Token-Typ verwandt**. 163 | 164 | Dieser Symbol Teil erlaubt dir Token-Typen zu bestimmten Schlüsselwörtern zuzuordnen - normalerweise sind das Wörter in der Sprache dass du hervorhebst. 165 | Der Token-Typ in diesem Teil nimmt immer Vorrang über Token-Typen deklariert im Muster. 166 | 167 | Zum Beispiel, Dieses Code markiert `Host` als `function` Token-Typ, `HostName` als `keyword` und `yes`, `no`, `any` & `ask` als `literal`: 168 | 169 | ```lua 170 | ["Host"] = "function", 171 | ["HostName"] = "keyword", 172 | 173 | ["yes"] = "literal", 174 | ["no"] = "literal", 175 | ["any"] = "literal", 176 | ["ask"] = "literal", 177 | ``` 178 | 179 | #### Tips: Überprüfe deine Muster! 180 | 181 | Es gibt häufige Fehler die gemacht werden können wenn man das `symbols` Table in Verbindung mit Muster benutzt. 182 | 183 | ##### Fall 1: Leerzeichen zwischen zwei `symbols` Token: 184 | 185 | Nehmen wir mal ein Beispiel: 186 | 187 | ```lua 188 | { pattern = "[%a_][%w_]+%s+()[%a_][%w_]+", type = { "keyword2", "symbol" } } 189 | ``` 190 | 191 | Jetzt erklären wir mal das Muster ein bisschen (Lasse die Leeren Klammer weg): 192 | 193 | ``` 194 | [%a_] = alle Buchstaben und Unterstriche 195 | [%w_] = alle Buchstaben, Nummern und Unterstriche 196 | %s = alle Leerzeichen Charaktere 197 | 198 | WORD = 199 | [%a_] gefolgt von (1 oder mehr [%w_]) 200 | 201 | pattern = 202 | WORD, gefolgt von (einem oder mehreren %s), gefolgt von WORD 203 | ``` 204 | 205 | Nachher fügst du einen Eintrag `["my"] = "literal"` im `symbols` Table. 206 | Du kannst die Syntax testen mit `my function`, und findest heraus das `"my"` nicht als `literal` markiert wurde. Warum ist das passiert? 207 | 208 | **`symbols` table braucht eine genaue Übereinstimmung**. 209 | Wenn du sorgfältig schaust, siehst du dass leere Klammern **nach dem Leerzeichen** platziert wurden! 210 | Dass sagt Lite XL dass `[%a_] gefolgt von (1 oder mehr [%w_])` ein Token ist, dass `my ` übereinstimmen soll (bemerke das Leerzeichen in der Übereinstimmung). 211 | 212 | Das Lösung steckt darin, ein `normal` Token für Leerzeichen zwischen zwei Tokens hinzuzufügen: 213 | 214 | ```lua 215 | { pattern = "[%a_][%w_]+()%s+()[%a_][%w_]+", type = { "keyword2", "normal", "symbol" } } 216 | ``` 217 | 218 | ##### Fall 2: Muster & `symbols` Token 219 | 220 | Man könnte annehmen dass Lite XL magisch Text mit den `symbols` Table vergleicht. Dies ist nicht der Fall. 221 | 222 | In manchen Sprachen fügen Leute generische Muster hinzu, um den Abgleich an die Tabelle `symbols` zu delegieren. 223 | 224 | ```lua 225 | { pattern = "[%a_][%w_]*", "symbol" } 226 | ``` 227 | 228 | Jedoch könnte das `symbols` Table so ausschauen: 229 | 230 | ```lua 231 | symbols = { 232 | ["my-symbol"] = "function", 233 | ["..something_else"] = "literal" 234 | } 235 | ``` 236 | 237 | `my-symbol` enthält ein Strich (`-`) und `"..something_else"` enthält zwei Punkte (`.`). 238 | Keinen von diesen Charakteren stimmt mit `[%a_][%w_]*` überein! 239 | 240 | **Vorsicht vor dem Text den du im `symbols` Table übereinstimmen willst.** 241 | **Wenn du es benutzen willst, musst du dir sicher sein, dass es mit einer dieser Muster übereinstimmt.** 242 | 243 | Die richtigen Muster sind: 244 | 245 | ```lua 246 | { pattern = "[%a_][%w%-_]*", "symbol" }, 247 | { pattern = "%.%.[%a_][%w_]*", "symbol" }, 248 | ``` 249 | 250 | ## Deine neue Syntax testen 251 | 252 | Um deine neue Syntaxhervorhebung zu testen musst du diesen zwei Dinge machen: 253 | 254 | - Lade den Lite XL Core neu 255 | - Lade eine Datei deiner ausgewählten Sprache und schaue an wie es ausschaut 256 | 257 | Um den Core neuzuladen kannst du entweder Lite XL neustarten, oder du ladest den Core über das Befehlspalette neu. 258 | Um dies zu machen, drücke `ctrl+shit+` Befehlspalette zu zeigen, dann wähle `Core: Restart` aus (oder schreibe `crr` oder ähnliches um es zu finden), dann drücke Enter. Du musst den Core immer neustarten wenn du änderungen zur Syntaxhervorhebung machst. 259 | 260 | 261 | ## Beispiel des fortschrittlichen Syntax: Markdown 262 | 263 | > **Bemerke: Dieses Beispiel hat Funktionen von 2.1. Es ist nicht kompatible mit älteren Versionen von lite-xl** 264 | 265 | Nicht alle Sprachen sind so leicht wie SSH config Dateien. Markup Sprache wie HTML und Markdown sind sehr schwer richtig zu analysieren. Hier ist die Markdown Syntaxhervorhebung Datei in seiner vollen Pracht: 266 | 267 | ```lua 268 | -- mod-version:3 269 | local syntax = require "core.syntax" 270 | local style = require "core.style" 271 | local core = require "core" 272 | 273 | local initial_color = style.syntax["keyword2"] 274 | 275 | -- Add 3 type of font styles for use on markdown files 276 | for _, attr in pairs({"bold", "italic", "bold_italic"}) do 277 | local attributes = {} 278 | if attr ~= "bold_italic" then 279 | attributes[attr] = true 280 | else 281 | attributes["bold"] = true 282 | attributes["italic"] = true 283 | end 284 | -- no way to copy user custom font with additional attributes :( 285 | style.syntax_fonts["markdown_"..attr] = renderer.font.load( 286 | DATADIR .. "/fonts/JetBrainsMono-Regular.ttf", 287 | style.code_font:get_size(), 288 | attributes 289 | ) 290 | -- also add a color for it 291 | style.syntax["markdown_"..attr] = style.syntax["keyword2"] 292 | end 293 | 294 | local in_squares_match = "^%[%]" 295 | local in_parenthesis_match = "^%(%)" 296 | 297 | syntax.add { 298 | name = "Markdown", 299 | files = { "%.md$", "%.markdown$" }, 300 | block_comment = { "" }, 301 | space_handling = false, -- turn off this feature to handle it our selfs 302 | patterns = { 303 | ---- Place patterns that require spaces at start to optimize matching speed 304 | ---- and apply the %s+ optimization immediately afterwards 305 | -- bullets 306 | { pattern = "^%s*%*%s", type = "number" }, 307 | { pattern = "^%s*%-%s", type = "number" }, 308 | { pattern = "^%s*%+%s", type = "number" }, 309 | -- numbered bullet 310 | { pattern = "^%s*[0-9]+[%.%)]%s", type = "number" }, 311 | -- blockquote 312 | { pattern = "^%s*>+%s", type = "string" }, 313 | -- alternative bold italic formats 314 | { pattern = { "%s___", "___%f[%s]" }, type = "markdown_bold_italic" }, 315 | { pattern = { "%s__", "__%f[%s]" }, type = "markdown_bold" }, 316 | { pattern = { "%s_[%S]", "_%f[%s]" }, type = "markdown_italic" }, 317 | -- reference links 318 | { 319 | pattern = "^%s*%[%^()["..in_squares_match.."]+()%]: ", 320 | type = { "function", "number", "function" } 321 | }, 322 | { 323 | pattern = "^%s*%[%^?()["..in_squares_match.."]+()%]:%s+.+\n", 324 | type = { "function", "number", "function" } 325 | }, 326 | -- optimization 327 | { pattern = "%s+", type = "normal" }, 328 | 329 | ---- HTML rules imported and adapted from language_html 330 | ---- to not conflict with markdown rules 331 | -- Inline JS and CSS 332 | { 333 | pattern = { 334 | "<%s*[sS][cC][rR][iI][pP][tT]%s+[tT][yY][pP][eE]%s*=%s*" .. 335 | "['\"]%a+/[jJ][aA][vV][aA][sS][cC][rR][iI][pP][tT]['\"]%s*>", 336 | "<%s*/[sS][cC][rR][iI][pP][tT]>" 337 | }, 338 | syntax = ".js", 339 | type = "function" 340 | }, 341 | { 342 | pattern = { 343 | "<%s*[sS][cC][rR][iI][pP][tT]%s*>", 344 | "<%s*/%s*[sS][cC][rR][iI][pP][tT]>" 345 | }, 346 | syntax = ".js", 347 | type = "function" 348 | }, 349 | { 350 | pattern = { 351 | "<%s*[sS][tT][yY][lL][eE][^>]*>", 352 | "<%s*/%s*[sS][tT][yY][lL][eE]%s*>" 353 | }, 354 | syntax = ".css", 355 | type = "function" 356 | }, 357 | -- Comments 358 | { pattern = { "" }, type = "comment" }, 359 | -- Tags 360 | { pattern = "%f[^<]![%a_][%w_]*", type = "keyword2" }, 361 | { pattern = "%f[^<][%a_][%w_]*", type = "function" }, 362 | { pattern = "%f[^<]/[%a_][%w_]*", type = "function" }, 363 | -- Attributes 364 | { 365 | pattern = "[a-z%-]+%s*()=%s*()\".-\"", 366 | type = { "keyword", "operator", "string" } 367 | }, 368 | { 369 | pattern = "[a-z%-]+%s*()=%s*()'.-'", 370 | type = { "keyword", "operator", "string" } 371 | }, 372 | { 373 | pattern = "[a-z%-]+%s*()=%s*()%-?%d[%d%.]*", 374 | type = { "keyword", "operator", "number" } 375 | }, 376 | -- Entities 377 | { pattern = "&#?[a-zA-Z0-9]+;", type = "keyword2" }, 378 | 379 | ---- Markdown rules 380 | -- math 381 | { pattern = { "%$%$", "%$%$", "\\" }, type = "string", syntax = ".tex"}, 382 | { pattern = { "%$", "%$", "\\" }, type = "string", syntax = ".tex"}, 383 | -- code blocks 384 | { pattern = { "```c++", "```" }, type = "string", syntax = ".cpp" }, 385 | -- ... there's some other patterns here, but I removed them for brevity 386 | { pattern = { "```lobster", "```" }, type = "string", syntax = ".lobster" }, 387 | { pattern = { "```", "```" }, type = "string" }, 388 | { pattern = { "``", "``" }, type = "string" }, 389 | { pattern = { "%f[\\`]%`[%S]", "`" }, type = "string" }, 390 | -- strike 391 | { pattern = { "~~", "~~" }, type = "keyword2" }, 392 | -- highlight 393 | { pattern = { "==", "==" }, type = "literal" }, 394 | -- lines 395 | { pattern = "^%-%-%-+\n", type = "comment" }, 396 | { pattern = "^%*%*%*+\n", type = "comment" }, 397 | { pattern = "^___+\n", type = "comment" }, 398 | -- bold and italic 399 | { pattern = { "%*%*%*%S", "%*%*%*" }, type = "markdown_bold_italic" }, 400 | { pattern = { "%*%*%S", "%*%*" }, type = "markdown_bold" }, 401 | -- handle edge case where asterisk can be at end of line and not close 402 | { 403 | pattern = { "%f[\\%*]%*[%S]", "%*%f[^%*]" }, 404 | type = "markdown_italic" 405 | }, 406 | -- alternative bold italic formats 407 | { pattern = "^___[%s%p%w]+___%s" , type = "markdown_bold_italic" }, 408 | { pattern = "^__[%s%p%w]+__%s" , type = "markdown_bold" }, 409 | { pattern = "^_[%s%p%w]+_%s" , type = "markdown_italic" }, 410 | -- heading with custom id 411 | { 412 | pattern = "^#+%s[%w%s%p]+(){()#[%w%-]+()}", 413 | type = { "keyword", "function", "string", "function" } 414 | }, 415 | -- headings 416 | { pattern = "^#+%s.+\n", type = "keyword" }, 417 | -- superscript and subscript 418 | { 419 | pattern = "%^()%d+()%^", 420 | type = { "function", "number", "function" } 421 | }, 422 | { 423 | pattern = "%~()%d+()%~", 424 | type = { "function", "number", "function" } 425 | }, 426 | -- definitions 427 | { pattern = "^:%s.+", type = "function" }, 428 | -- emoji 429 | { pattern = ":[a-zA-Z0-9_%-]+:", type = "literal" }, 430 | -- images and link 431 | { 432 | pattern = "!?%[!?%[()["..in_squares_match.."]+()%]%(()["..in_parenthesis_match.."]+()%)%]%(()["..in_parenthesis_match.."]+()%)", 433 | type = { "function", "string", "function", "number", "function", "number", "function" } 434 | }, 435 | { 436 | pattern = "!?%[!?%[?()["..in_squares_match.."]+()%]?%]%(()["..in_parenthesis_match.."]+()%)", 437 | type = { "function", "string", "function", "number", "function" } 438 | }, 439 | -- reference links 440 | { 441 | pattern = "%[()["..in_squares_match.."]+()%] *()%[()["..in_squares_match.."]+()%]", 442 | type = { "function", "string", "function", "function", "number", "function" } 443 | }, 444 | { 445 | pattern = "!?%[%^?()["..in_squares_match.."]+()%]", 446 | type = { "function", "number", "function" } 447 | }, 448 | -- url's and email 449 | { 450 | pattern = "<[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+%.[a-zA-Z0-9-.]+>", 451 | type = "function" 452 | }, 453 | { pattern = "", type = "function" }, 454 | { pattern = "https?://%S+", type = "function" }, 455 | -- optimize consecutive dashes used in tables 456 | { pattern = "%-+", type = "normal" }, 457 | }, 458 | symbols = { }, 459 | } 460 | 461 | -- Adjust the color on theme changes 462 | core.add_thread(function() 463 | while true do 464 | if initial_color ~= style.syntax["keyword2"] then 465 | for _, attr in pairs({"bold", "italic", "bold_italic"}) do 466 | style.syntax["markdown_"..attr] = style.syntax["keyword2"] 467 | end 468 | initial_color = style.syntax["keyword2"] 469 | end 470 | coroutine.yield(1) 471 | end 472 | end) 473 | ``` 474 | 475 | ### Syntaxschriftarten (Seit 1.16.10) 476 | 477 | Die Syntax erlaubt Benutzer verschiedene Schriftarten Stile (Bold, Italic, usw.) für verschiedene Muster zu setzen. 478 | Um ein Schriftarten Stil von ein Token zu ändern, füge eine Schriftarten bei `style.syntax_fonts[token_type]` hinzu. 479 | Zum Beispiel: 480 | ``` 481 | -- Wird sorgen, dass jedes "fancysyntax_fancy_token" Italic sein wird. 482 | style.syntax_fonts["fancysyntax_fancy_token"] = renderer.font.load("myfont.ttf", 14 * SCALE, { italic = true }) 483 | ``` 484 | 485 | Das Markdown Beispiele automatisiert dies mit einem for loop. 486 | 487 | Die Limitationen hier sind dass Schriftarten nicht von anderen Attributen kopiert werden können, also müssen Schriftartenpfade fest codiert werden. 488 | Der Missbrauch von `style.syntax_fonts` kann zur **langsame Leistung** und einen **hohen Speicherverbrauch** führen. 489 | Dies ist bemerkbar wenn ein Benutzer versucht die Größe des Editors mit `ctrl-scroll` or `ctrl+` and `ctrl-` zu ändern. 490 | Bitte benutze es in Moderation. 491 | 492 | ### Leerzeichen Umgang (v2.1 (Bevorstehend) / `master`) 493 | 494 | Normalerweise stellt Lite XL das Muster `{ pattern = "%s+", type = "normal" }` zu der Syntaxhervorhebung. 495 | Dies verbessert die Leistung drastisch bei Zeilen die mit Leerzeichen (z.B schwer-eingerücke Zeilen) 496 | Durchs anpassen des Leerzeichens bevor andere Muster muss Lite XL nicht durch die ganze Syntax durchgehen. 497 | Jedoch gibt es Syntaxen die Leerzeichen anpassen müssen (z.B Markdown mit einrückten Codeblocken) 498 | Also kann dies deaktiviert werden indem man `space_handling` to `false.` stellt. 499 | 500 | > Um die Leerzeichen Umgang Optimisierung zu behalten, oder um ältere Versionen von Lite XL zu unterstützen kann 501 | > `{ pattern = "%s+", type = "normal" }` nach Muster, die Leerzeichen brauchen hinzugefügt werden. 502 | 503 | ### Einfache Muster mit mehrere Tokens (1.16.10) 504 | 505 | Dies ist ein Ausschnitt dass von der Markdown Syntaxhervorhebung genommen wurde: 506 | 507 | ```lua 508 | local in_squares_match = "^%[%]" 509 | -- reference links 510 | { 511 | pattern = "^%s*%[%^()["..in_squares_match.."]+()%]: ", 512 | type = { "function", "number", "function" } 513 | }, 514 | ``` 515 | 516 | Manchmal macht es Sinn verschiedene Teile eines Musters anderst zu hervorheben. 517 | Leere Klammer (`()`) in Lua Muster werden die Position vom Text in den Klammern zurückgeben. 518 | Dies wird Lite XL sagen, wenn es den Typ des Tokens ändern muss. 519 | Zum Beispiel, `^%s*%[%^` ist `"function"`, `["..in_squares_match.."]+` ist `"number"` und `%]: ` ist `"function"`. 520 | 521 | ### Subsyntaxen (Seit 1.16.10) 522 | 523 | Lite XL unterschützt Einbettung von anderen Syntaxen in einer existierenden Syntax. 524 | Dies kann benutzt werden, um Codeblöcke im Markdown Syntax zu Unterstützen. 525 | 526 | Zum Beispiel: 527 | ```lua 528 | { pattern = { "```cpp", "```" }, type = "string", syntax = ".cpp" }, 529 | ``` 530 | 531 | Dies würde `` ```cpp `` und `` ``` `` mit `"string"` markieren während alles innerhalb mit der Syntax dass mit `".cpp"` übereinstimmt markiert wird. 532 | -------------------------------------------------------------------------------- /locales/de/tutorials/system-fonts.md: -------------------------------------------------------------------------------- 1 | # Systemschriftarten Benutzen 2 | 3 | Lite XL bietet keinen Weg um Schriftarten vom System zu benutzen. 4 | Weil _jede Platform die wir unterstützen (Windows, Linux und Mac)_ es anders macht. 5 | Hier kommt [fontconfig][1] zur Rettung. fontconfig kann man auf verschiedene Betriebssysteme installieren. 6 | 7 | lite-xl hat ein [fontconfig Plugin][2] dass wir benutzen können um Systemschriftarten zu finden. 8 | 9 | ## fontconfig Installieren 10 | #### Windows 11 | [mingw-w64-fontconfig][3] bietet einen Build, der direkt auf Windows benutzt werden kann. 12 | Lade die Datei herunter, extrahiere es irgendwo und (optional) füge es zu den [PATH][4] hinzu. 13 | 14 | #### Linux 15 | Überprüfe distro-spezifische Anweisungen. 16 | 17 | ```sh 18 | # ubuntu / debian 19 | apt install fontconfig 20 | # arch 21 | pacman -Su fontconfig 22 | # fedora 23 | dnf install fontconfig 24 | ... 25 | ``` 26 | 27 | #### MacOS 28 | 29 | ```sh 30 | brew install fontconfig 31 | ``` 32 | 33 | ### Einstellen 34 | 35 | 1. Installiere das Plugin 36 | 2. Gebe es in dein Benutzer Modul: 37 | 38 | ```lua 39 | local fontconfig = require "plugins.fontconfig" 40 | fontconfig.use { 41 | font = { name = "sans", size = 13 * SCALE }, 42 | code_font = { name = "monospace", size = 13 * SCALE } 43 | } 44 | ``` 45 | 46 | `"sans"` und `"monospace"` kann eine beliebige [fontconfig Syntax][4] sein. (sehe "Font Names") 47 | 48 | 49 | Beachte: Die Schriftart könnte nicht sofort laden (Weil wir auf `fc-match` warten müssen). 50 | Wenn du es so haben willst, dann ersetze `fontconfig.use` mit `fontconfig.use_blocking`. Wenn du dass machst dann 51 | muss lite-xl auf `fc-match` warten, was viel langsamer sein kann. 52 | 53 | 54 | [1]: https://www.freedesktop.org/wiki/Software/fontconfig/ 55 | [2]: https://github.com/lite-xl/lite-xl-plugins/blob/master/plugins/fontconfig.lua 56 | [3]: https://github.com/takase1121/mingw-w64-fontconfig 57 | [4]: https://michster.de/wie-setze-ich-die-path-umgebungsvariablen-unter-windows-10/ 58 | [5]: https://www.freedesktop.org/software/fontconfig/fontconfig-user.html 59 | -------------------------------------------------------------------------------- /locales/en/404.md: -------------------------------------------------------------------------------- 1 | # Not Found 2 | 3 | This page couldn't be found. Please note, that the site is undergoing testing at present, so pages may be missing/moved. 4 | 5 | 6 | -------------------------------------------------------------------------------- /locales/en/about/contributors.md: -------------------------------------------------------------------------------- 1 | # Contributors 2 | 3 | | Name | Contributions 4 | ------------------------------------------------------------|---------------------------------------------------------- 5 | | [rxi](https://github.com/rxi) | Original development of lite editor. 6 | | [Francesco](https://github.com/franko) | Creator of lite-xl fork from rxi/lite. 7 | | [Takase](https://github.com/takase1121) | NagView and X Window database resource query for Xft.dpi setting. 8 | | [Nils Kvist](https://github.com/budRich) | Popup window replacement with CommandView dialog. 9 | | [liquidev](https://github.com/liquidev) | Tab style and animations improvements. 10 | | [Adam](https://github.com/adamharrison) | Multi-language syntax highlighting and many other improvements. 11 | | [Cukmekerb](https://github.com/vincens2005) | Syntax highlighting improvements. 12 | | [Janis-Leuenberger](https://github.com/Janis-Leuenberger) | Add keymap bindings help file and macOS testing. 13 | | Mat Mariani | Help for macOS port. Some resources taken from mathewmariani/lite-macos. 14 | | [daubaris](https://github.com/daubaris) | Initial implementation of Xft.dpi query using xrdb command. 15 | | [Robert Štojs](https://github.com/netrobert) | Continuos integration configuration. 16 | -------------------------------------------------------------------------------- /locales/en/about/faq.md: -------------------------------------------------------------------------------- 1 | # FAQ 2 | 3 | #### Can I get smart autocompletion (intellisense/LSP)? 4 | 5 | Check out the [LSP] plugin. 6 | 7 | #### Where is the integrated terminal? 8 | 9 | You can try [lite-xl-terminal]. 10 | 11 | #### Tabs and indent size? 12 | 13 | In your user config (the cog icon in the file tree): 14 | 15 | ```lua 16 | config.tab_type = "soft" -- soft for spaces, hard for real tabs (\t) 17 | config.indent_size = 4 -- 4 spaces 18 | ``` 19 | 20 | #### How to bind commands to keys? 21 | 22 | ```lua 23 | local keymap = require "core.keymap" 24 | keymap.add { ["ctrl+escape"] = "core:quit" } 25 | ``` 26 | 27 | #### How to unbind commands for certain keys? 28 | 29 | ```lua 30 | -- the second parameter lets you override commands for certain keys 31 | -- in this case it maps it to nothing 32 | keymap.add({ ["ctrl+escape"] = {} }, true) 33 | ``` 34 | 35 | #### How to get commands for those keybinds? 36 | 37 | You can search for commands in the command palette. 38 | 39 | For each command, replace the spaces in the right side with dashes. 40 | 41 | For example: `Core: Find Command` → `core:find-command` 42 | 43 | #### What version of Lua does Lite XL use? 44 | 45 | Lua 5.4. 46 | 47 | #### Vim mode? 48 | 49 | You need to [vibe]. 50 | 51 | #### Plugin recommendations 52 | 53 | Just in case you don't want to comb through our [plugin repository][1], 54 | these are a list of plugins that just makes Lite XL a lot more pleasant. 55 | 56 | | Plugin | Use case 57 | | --- | --- 58 | | [autoinsert] | Automatically insert closing brackets and quotes 59 | | [bracketmatch] | Highlight matching brackets 60 | | [ephemeral_tabs] | Ephemeral tabs (previewing files without creating multiple tabs) 61 | | [gitdiff_highlight] | Git diff gutter 62 | | [lint+] | Linter support 63 | | [minimap] | Minimap 64 | | [selectionhighlight] | Highlight code that matches the selection 65 | | [lite-xl-discord] | Discord rich presence | 66 | 67 | #### Where's feature X? How about Y? 68 | 69 | You can get more info in the [Features page](/en/about/features). 70 | 71 | 72 | [LSP]: https://github.com/lite-xl/lite-xl-lsp 73 | [lite-xl-terminal]: https://github.com/adamharrison/lite-xl-terminal 74 | [vibe]: https://github.com/eugenpt/lite-xl-vibe 75 | [autoinsert]: https://github.com/lite-xl/lite-xl-plugins/blob/master/plugins/autoinsert.lua?raw=1 76 | [bracketmatch]: https://github.com/lite-xl/lite-xl-plugins/blob/master/plugins/bracketmatch.lua?raw=1 77 | [ephemeral_tabs]: https://github.com/lite-xl/lite-xl-plugins/blob/master/plugins/ephemeral_tabs.lua?raw=1 78 | [gitdiff_highlight]: https://github.com/vincens2005/lite-xl-gitdiff-highlight 79 | [lint+]: https://github.com/liquid600pgm/lintplus 80 | [minimap]: https://github.com/lite-xl/lite-xl-plugins/blob/master/plugins/minimap.lua?raw=1 81 | [selectionhighlight]: https://github.com/lite-xl/lite-xl-plugins/blob/master/plugins/selectionhighlight.lua?raw=1 82 | [lite-xl-discord]: https://github.com/vincens2005/lite-xl-discord 83 | 84 | [1]: https://github.com/lite-xl/lite-xl-plugins 85 | -------------------------------------------------------------------------------- /locales/en/about/features.md: -------------------------------------------------------------------------------- 1 | # Features 2 | 3 | Currently, Lite XL offers a lot of features out of the box. 4 | 5 | ## Cross-Platform 6 | We currently support Windows, Linux and MacOS (with Retina display support). 7 | 8 | ## Lightweight 9 | We are currently around 3MB in size and takes about 10MB in RAM (can be lower). No Electron / WebView involved. The whole thing is just Lua running on a rendering engine. 10 | 11 | ## Extensible 12 | While the editor is minimal by default, it is very extensible using Lua. In fact, a lot of features are provided by plugins. For example, [VSC-like intellisense](https://github.com/jgmdev/lite-xl-lsp) 13 | 14 | ## Better font rendering 15 | The editor looks good in screen of any sizes. Some other options are also configurable, such as hinting and antialiasing. 16 | 17 | ## Multi-cursor editing 18 | You can now place multiple cursors by `ctrl` + `lclick` on lines or `ctrl` + `shift` + `up` or `ctrl` + `shift` + `down`. 19 | 20 | 21 | --- 22 | 23 | 24 | Here are some features that aren't implemented with the rationales behind it. 25 | Some of these may be implemented via plugins. 26 | We encourage you to give it a shot. 27 | 28 | ## Hardware accelerated rendering 29 | **tl;dr - franko stated that he isn't considering using OpenGL due to the skills and work involved.** 30 | 31 | Hardware acceleration was brought up in this [discussion](https://github.com/lite-xl/lite-xl/discussions/450). 32 | Takase had made 2 attempts at this - at first using [NanoVG](https://github.com/inniyah/nanovg) and then forcing SDL to use GPU rendering. 33 | In both attempts, the performance gains at best is negligible, while at worst its completely unusable. 34 | Right now, we decided to focus on optimizing the software renderer and various part of Lua code. 35 | 36 | ## System fonts 37 | This is painful because various systems has their own mechanism of managing fonts. 38 | For now, users can use the [fontconfig plugin](https://github.com/lite-xl/lite-xl-plugins/blob/master/plugins/fontconfig.lua). 39 | Fontconfig is widely available on Linux and [installable on MacOS](https://formulae.brew.sh/formula/fontconfig), while [Windows builds](https://github.com/takase1121/mingw-w64-fontconfig) are available. 40 | In the future, we might consider adding API to read font metadata, allowing us to write a fontconfig alternative in Lua. (no promises here) 41 | 42 | ## Opening UNC paths on Windows (network drives, accessing WSL2 files from Windows) 43 | Our path handling code can only handle POSIX and Windows paths. 44 | We also aren't sure how Lite XL will behave in these scenarios. 45 | 46 | ## Inter-window communication (dragging tabs between windows and other magic) 47 | This is by far the hardest to achieve. 48 | Lite XL has no intention to link to any widget toolkits (Qt and GTK) which are required for these features. 49 | An alternative approach is to create our own IPC mechanism, but that's [reinventing](https://en.wikipedia.org/wiki/D-Bus) [the](https://en.wikipedia.org/wiki/Inter-Client_Communication_Conventions_Manual) [wheel](https://github.com/swaywm/wlroots). 50 | 51 | ## Integrated terminal 52 | A terminal is complex to implement. 53 | There are projects that _can_ be ported to Lua, such as [xterm.js](https://xtermjs.org/). 54 | If someone is interested, they can do so. 55 | -------------------------------------------------------------------------------- /locales/en/about/index.md: -------------------------------------------------------------------------------- 1 | # About 2 | 3 | These pages contain information about Lite XL's features, screenshots and developers. It also contains a FAQ section. 4 | 5 | - [Contributors](/en/about/contributors) 6 | - [FAQ](/en/about/faq) 7 | - [Features](/en/about/features) 8 | - [Screenshots](/en/about/screenshots) 9 | -------------------------------------------------------------------------------- /locales/en/about/screenshots.md: -------------------------------------------------------------------------------- 1 | # Screenshots 2 | 3 | [![Screenshot 1](/assets/img/editor.png)](/assets/img/editor.png) 4 | [![Screenshot 2](/assets/img/editor2.png)](/assets/img/editor2.png) 5 | -------------------------------------------------------------------------------- /locales/en/documentation/build.md: -------------------------------------------------------------------------------- 1 | # Build 2 | 3 | Once you have downloaded the source code, you can build Lite XL yourself using Meson. 4 | In addition, the `build.sh` script can be used to compile Lite XL with some 5 | level of customization. 6 | 7 | The following dependencies are required: 8 | 9 | - Meson (>=0.63) 10 | - Ninja 11 | - GCC / Clang / MSVC 12 | - Bash (installed from brew on macOS) 13 | 14 | The following libraries are **optional**: 15 | 16 | - FreeType2 17 | - SDL2 18 | - PCRE2 19 | - Lua 5.4 20 | 21 | If they are not found, they will be downloaded and compiled by Meson. 22 | Otherwise, if they are present, they will be used to compile Lite XL. 23 | 24 | On Linux, you may need to install other dependencies to compile 25 | the SDL2 X11 / Wayland backend: 26 | 27 | - `libX11-devel` 28 | - `libXi-devel` 29 | - `libXcursor-devel` 30 | - `libxkbcommon-devel` 31 | - `libXrandr-devel` 32 | - `wayland-devel` 33 | - `wayland-protocols-devel` 34 | - `dbus-devel` 35 | - `ibus-devel` 36 | 37 | These dependencies can also be installed as `libsdl2-dev` on Debian-based 38 | distros and `SDL2-devel` on CentOS / RHEL-based distros and Fedora. 39 | 40 | We recommend using [lite-xl-build-box][1] as it provides a containerized Linux 41 | environment specifically for compiling Lite XL. 42 | 43 | ## Build Script 44 | 45 | You can use `scripts/build.sh` to compile Lite XL yourself. 46 | 47 | ```sh 48 | $ bash build.sh --help 49 | # Usage: scripts/build.sh 50 | # 51 | # Available options: 52 | # 53 | # -b --builddir DIRNAME Sets the name of the build directory (not path). 54 | # Default: 'build-x86_64-linux'. 55 | # --debug Debug this script. 56 | # -f --forcefallback Force to build dependencies statically. 57 | # -h --help Show this help and exit. 58 | # -d --debug-build Builds a debug build. 59 | # -p --prefix PREFIX Install directory prefix. Default: '/'. 60 | # -B --bundle Create an App bundle (macOS only) 61 | # -A --addons Add in addons 62 | # -P --portable Create a portable binary package. 63 | # -r --reconfigure Tries to reuse the meson build directory, if possible. 64 | # Default: Deletes the build directory and recreates it. 65 | # -O --pgo Use profile guided optimizations (pgo). 66 | # macOS: disabled when used with --bundle, 67 | # Windows: Implicit being the only option. 68 | # --cross-platform PLATFORM Cross compile for this platform. 69 | # The script will find the appropriate 70 | # cross file in 'resources/cross'. 71 | # --cross-arch ARCH Cross compile for this architecture. 72 | # The script will find the appropriate 73 | # cross file in 'resources/cross'. 74 | # --cross-file CROSS_FILE Cross compile with the given cross file. 75 | ``` 76 | 77 | The script will run Meson and compile Lite XL. 78 | 79 | To create platform-dependent packages that can be installed on your machine, 80 | you should check out the various `scripts/package-*.sh` scripts. 81 | 82 | ## Portable 83 | 84 | When performing the `meson setup` command you may enable the `-Dportable=true` 85 | option to specify whether files should be installed as in a portable application. 86 | 87 | If `portable` is enabled, Lite XL is built to use a `data` directory placed next 88 | to the executable. 89 | Otherwise, Lite XL will use unix-like directory locations. 90 | In this case, the `data` directory will be `$prefix/share/lite-xl` 91 | and the executable will be located in `$prefix/bin`. 92 | `$prefix` is determined when the application starts as a directory such that 93 | `$prefix/bin` corresponds to the location of the executable. 94 | 95 | The `user` directory does not depend on the `portable` option and will always be 96 | `$HOME/.config/lite-xl`. 97 | `$HOME` is determined from the corresponding environment variable. 98 | As a special case on Windows the variable `$USERPROFILE` will be used instead. 99 | 100 | ## Linux 101 | 102 | On Debian-based systems the required libraries and Meson can be installed 103 | using the following commands: 104 | 105 | ```bash 106 | # To install the required libraries: 107 | sudo apt install libsdl2-dev 108 | 109 | # To install Meson: 110 | sudo apt install meson 111 | # or pip3 install --user meson 112 | ``` 113 | 114 | To build Lite XL with Meson the commands below can be used: 115 | 116 | ```bash 117 | meson setup --buildtype=release --prefix build 118 | meson compile -C build 119 | DESTDIR="$(pwd)/lite-xl" meson install --skip-subprojects -C build 120 | ``` 121 | 122 | where `` depends on the OS you are using: 123 | - on Linux is `/usr` 124 | - on macOS application bundle can be `"/Lite XL.app"` 125 | 126 | If you are using a version of Meson below 0.54 127 | you need to use diffent commands to compile and install: 128 | 129 | ```bash 130 | meson setup --buildtype=release build 131 | ninja -C build 132 | ninja -C build install 133 | ``` 134 | 135 | ## macOS 136 | 137 | macOS is fully supported and a notarized app disk image is provided in the 138 | [release page][2]. 139 | In addition the application can be compiled using the generic instructions given above. 140 | 141 | ## Windows MSYS2 142 | 143 | The build environment chosen for Lite XL on Windows is [MSYS2][3]. 144 | Follow the install instructions in the link. 145 | 146 | - Open `MinGW 64-bit` or `MinGW 32-bit` shell from the start menu. 147 | - Update the MSYS2 installation with `pacman -Syu` 148 | - Restart the shell 149 | - Install the dependencies: 150 | 151 | ```sh 152 | pacman -S \ 153 | git \ 154 | zip \ 155 | patch \ 156 | ${MINGW_PACKAGE_PREFIX}-gcc \ 157 | ${MINGW_PACKAGE_PREFIX}-ninja \ 158 | ${MINGW_PACKAGE_PREFIX}-meson \ 159 | ${MINGW_PACKAGE_PREFIX}-ca-certificates \ 160 | ${MINGW_PACKAGE_PREFIX}-pkg-config 161 | ``` 162 | 163 | `${MINGW_PACKAGE_PREFIX}` expands either to `mingw-w64-i686` or `mingw-w64-x86_64` 164 | depending if the current shell is 32 or 64 bit. 165 | 166 | [1]: https://github.com/lite-xl/lite-xl-build-box 167 | [2]: https://github.com/lite-xl/lite-xl/releases/latest/ 168 | [3]: https://www.msys2.org/ -------------------------------------------------------------------------------- /locales/en/documentation/index.md: -------------------------------------------------------------------------------- 1 | # Documentation 2 | 3 | These pages contain documentation to build, run and use Lite XL. 4 | 5 | - [Build](/en/documentation/build) 6 | - [Keymap (MacOS)](/en/documentation/keymap-macos) 7 | - [Keymap](/en/documentation/keymap) 8 | - [Usage](/en/documentation/usage) -------------------------------------------------------------------------------- /locales/en/documentation/keymap-macos.md: -------------------------------------------------------------------------------- 1 | # MacOS Keymap 2 | 3 | Keymaps on different operating systems have the same functionality, just bound slightly differently 4 | in order to conform to normal expectations for that operating system. 5 | 6 | Currently, there are only two operating system layouts. MacOS, and [everything else](/en/documentation/keymap). 7 | 8 | ## Keymap 9 | 10 | |Key Combination|Actions| 11 | |---------------|-------| 12 | |`cmd`+`/`|`doc:toggle-line-comments`| 13 | |`cmd`+`1`|`root:switch-to-tab-1`| 14 | |`cmd`+`2`|`root:switch-to-tab-2`| 15 | |`cmd`+`3`|`root:switch-to-tab-3`| 16 | |`cmd`+`4`|`root:switch-to-tab-4`| 17 | |`cmd`+`5`|`root:switch-to-tab-5`| 18 | |`cmd`+`6`|`root:switch-to-tab-6`| 19 | |`cmd`+`7`|`root:switch-to-tab-7`| 20 | |`cmd`+`8`|`root:switch-to-tab-8`| 21 | |`cmd`+`9`|`root:switch-to-tab-9`| 22 | |`cmd`+`[`|`doc:move-to-previous-block-start`| 23 | |`cmd`+`]`|`doc:move-to-next-block-end`| 24 | |`cmd`+`a`|`doc:select-all`| 25 | |`cmd`+`backspace`|`doc:delete-to-start-of-indentation`| 26 | |`cmd`+`c`|`doc:copy`| 27 | |`cmd`+`ctrl`+`i`|`root:switch-to-up`| 28 | |`cmd`+`ctrl`+`j`|`root:switch-to-left`| 29 | |`cmd`+`ctrl`+`k`|`root:switch-to-down`| 30 | |`cmd`+`ctrl`+`l`|`root:switch-to-right`| 31 | |`cmd`+`ctrl`+`return`|`core:toggle-fullscreen`| 32 | |`cmd`+`ctrl`+`shift`+`i`|`root:split-up`| 33 | |`cmd`+`ctrl`+`shift`+`j`|`root:split-left`| 34 | |`cmd`+`ctrl`+`shift`+`k`|`root:split-down`| 35 | |`cmd`+`ctrl`+`shift`+`l`|`root:split-right`| 36 | |`cmd`+`d`|` doc:select-word `| 37 | |`cmd`+`d`|`find-replace:select-add-next`| 38 | |`cmd`+`delete`|`doc:delete-to-end-of-line`| 39 | |`cmd`+`down`|`doc:move-to-end-of-doc`| 40 | |`cmd`+`f3`|`find-replace:select-next`| 41 | |`cmd`+`f`|`find-replace:find`| 42 | |`cmd`+`g`|`doc:go-to-line`| 43 | |`cmd`+`j`|`doc:join-lines`| 44 | |`cmd`+`l`|`doc:select-lines`| 45 | |`cmd`+`left`|`doc:move-to-start-of-indentation`| 46 | |`cmd`+`n`|`core:new-doc`| 47 | |`cmd`+`o`|`core:open-file`| 48 | |`cmd`+`option`+`down`|`doc:create-cursor-next-line`| 49 | |`cmd`+`option`+`up`|`doc:create-cursor-previous-line`| 50 | |`cmd`+`p`|`core:find-file`| 51 | |`cmd`+`pagedown`|`root:move-tab-right`| 52 | |`cmd`+`pageup`|`root:move-tab-left`| 53 | |`cmd`+`r`|`find-replace:replace`| 54 | |`cmd`+`return`|`doc:newline-below`| 55 | |`cmd`+`right`|`doc:move-to-end-of-line`| 56 | |`cmd`+`s`|`doc:save`| 57 | |`cmd`+`shift`+`[`|`doc:select-to-previous-block-start`| 58 | |`cmd`+`shift`+`]`|`doc:select-to-next-block-end`| 59 | |`cmd`+`shift`+`backspace`|`doc:delete-to-previous-word-start`| 60 | |`cmd`+`shift`+`c`|`core:change-project-folder`| 61 | |`cmd`+`shift`+`d`|`doc:duplicate-lines`| 62 | |`cmd`+`shift`+`delete`|`doc:delete-to-next-word-end`| 63 | |`cmd`+`shift`+`down`|`doc:select-to-end-of-doc`| 64 | |`cmd`+`shift`+`k`|`doc:delete-lines`| 65 | |`cmd`+`shift`+`l`|` doc:select-word `| 66 | |`cmd`+`shift`+`l`|`find-replace:select-add-all`| 67 | |`cmd`+`shift`+`left`|`doc:select-to-start-of-indentation`| 68 | |`cmd`+`shift`+`o`|`core:open-project-folder`| 69 | |`cmd`+`shift`+`p`|`core:find-command`| 70 | |`cmd`+`shift`+`return`|`doc:newline-above`| 71 | |`cmd`+`shift`+`right`|`doc:select-to-end-of-line`| 72 | |`cmd`+`shift`+`s`|`doc:save-as`| 73 | |`cmd`+`shift`+`up`|`doc:select-to-start-of-doc`| 74 | |`cmd`+`up`|`doc:move-to-start-of-doc`| 75 | |`cmd`+`v`|`doc:paste`| 76 | |`cmd`+`w`|`root:close-or-quit`| 77 | |`cmd`+`x`|`doc:cut`| 78 | |`cmd`+`y`|`doc:redo`| 79 | |`cmd`+`z`|`doc:undo`| 80 | |`ctrl`+`1lclick`|`doc:split-cursor`| 81 | |`ctrl`+`insert`|`doc:copy`| 82 | |`ctrl`+`shift`+`tab`|`root:switch-to-previous-tab`| 83 | |`ctrl`+`tab`|`root:switch-to-next-tab`| 84 | |`f3`|`find-replace:repeat-find`| 85 | |`option`+`backspace`|`doc:delete-to-previous-word-start`| 86 | |`option`+`delete`|`doc:delete-to-next-word-end`| 87 | |`option`+`down`|`doc:move-lines-down`| 88 | |`option`+`left`|`doc:move-to-previous-word-start`| 89 | |`option`+`right`|`doc:move-to-next-word-end`| 90 | |`option`+`shift`+`left`|`doc:select-to-previous-word-start`| 91 | |`option`+`shift`+`right`|`doc:select-to-next-word-end`| 92 | |`option`+`up`|`doc:move-lines-up`| 93 | |`shift`+`f3`|`find-replace:previous-find`| 94 | -------------------------------------------------------------------------------- /locales/en/documentation/keymap.md: -------------------------------------------------------------------------------- 1 | # Default Keymap 2 | 3 | Keymaps on different operating systems have the same functionality, just bound slightly differently 4 | in order to conform to normal expectations for that operating system. 5 | 6 | Currently, there are only two operating system layouts. [MacOS](/en/documentation/keymap-macos), and everything else. 7 | 8 | ## Keymap 9 | 10 | |Key Combination|Actions| 11 | |---------------|-------| 12 | |`alt`+`1`|`root:switch-to-tab-1`| 13 | |`alt`+`2`|`root:switch-to-tab-2`| 14 | |`alt`+`3`|`root:switch-to-tab-3`| 15 | |`alt`+`4`|`root:switch-to-tab-4`| 16 | |`alt`+`5`|`root:switch-to-tab-5`| 17 | |`alt`+`6`|`root:switch-to-tab-6`| 18 | |`alt`+`7`|`root:switch-to-tab-7`| 19 | |`alt`+`8`|`root:switch-to-tab-8`| 20 | |`alt`+`9`|`root:switch-to-tab-9`| 21 | |`alt`+`i`|`root:switch-to-up`| 22 | |`alt`+`j`|`root:switch-to-left`| 23 | |`alt`+`k`|`root:switch-to-down`| 24 | |`alt`+`l`|`root:switch-to-right`| 25 | |`alt`+`return`|`core:toggle-fullscreen`| 26 | |`alt`+`shift`+`i`|`root:split-up`| 27 | |`alt`+`shift`+`j`|`root:split-left`| 28 | |`alt`+`shift`+`k`|`root:split-down`| 29 | |`alt`+`shift`+`l`|`root:split-right`| 30 | |`ctrl`+`/`|`doc:toggle-line-comments`| 31 | |`ctrl`+`1lclick`|`doc:split-cursor`| 32 | |`ctrl`+`[`|`doc:move-to-previous-block-start`| 33 | |`ctrl`+`]`|`doc:move-to-next-block-end`| 34 | |`ctrl`+`a`|`doc:select-all`| 35 | |`ctrl`+`backspace`|`doc:delete-to-previous-word-start`| 36 | |`ctrl`+`c`|`doc:copy`| 37 | |`ctrl`+`d`|` doc:select-word `| 38 | |`ctrl`+`d`|`find-replace:select-add-next`| 39 | |`ctrl`+`delete`|`doc:delete-to-next-word-end`| 40 | |`ctrl`+`down`|`doc:move-lines-down`| 41 | |`ctrl`+`end`|`doc:move-to-end-of-doc`| 42 | |`ctrl`+`f3`|`find-replace:select-next`| 43 | |`ctrl`+`f`|`find-replace:find`| 44 | |`ctrl`+`g`|`doc:go-to-line`| 45 | |`ctrl`+`home`|`doc:move-to-start-of-doc`| 46 | |`ctrl`+`i`|`find-replace:toggle-sensitivity`| 47 | |`ctrl`+`insert`|`doc:copy`| 48 | |`ctrl`+`j`|`doc:join-lines`| 49 | |`ctrl`+`l`|`doc:select-lines`| 50 | |`ctrl`+`left`|`doc:move-to-previous-word-start`| 51 | |`ctrl`+`n`|`core:new-doc`| 52 | |`ctrl`+`o`|`core:open-file`| 53 | |`ctrl`+`p`|`core:find-file`| 54 | |`ctrl`+`pagedown`|`root:move-tab-right`| 55 | |`ctrl`+`pageup`|`root:move-tab-left`| 56 | |`ctrl`+`r`|`find-replace:replace`| 57 | |`ctrl`+`return`|`doc:newline-below`| 58 | |`ctrl`+`right`|`doc:move-to-next-word-end`| 59 | |`ctrl`+`s`|`doc:save`| 60 | |`ctrl`+`shift`+`[`|`doc:select-to-previous-block-start`| 61 | |`ctrl`+`shift`+`]`|`doc:select-to-next-block-end`| 62 | |`ctrl`+`shift`+`backspace`|`doc:delete-to-previous-word-start`| 63 | |`ctrl`+`shift`+`c`|`core:change-project-folder`| 64 | |`ctrl`+`shift`+`d`|`doc:duplicate-lines`| 65 | |`ctrl`+`shift`+`delete`|`doc:delete-to-next-word-end`| 66 | |`ctrl`+`shift`+`down`|`doc:create-cursor-next-line`| 67 | |`ctrl`+`shift`+`end`|`doc:select-to-end-of-doc`| 68 | |`ctrl`+`shift`+`f3`|`find-replace:select-previous`| 69 | |`ctrl`+`shift`+`home`|`doc:select-to-start-of-doc`| 70 | |`ctrl`+`shift`+`i`|`find-replace:toggle-regex`| 71 | |`ctrl`+`shift`+`k`|`doc:delete-lines`| 72 | |`ctrl`+`shift`+`l`|` doc:select-word `| 73 | |`ctrl`+`shift`+`l`|`find-replace:select-add-all`| 74 | |`ctrl`+`shift`+`left`|`doc:select-to-previous-word-start`| 75 | |`ctrl`+`shift`+`o`|`core:open-project-folder`| 76 | |`ctrl`+`shift`+`p`|`core:find-command`| 77 | |`ctrl`+`shift`+`return`|`doc:newline-above`| 78 | |`ctrl`+`shift`+`right`|`doc:select-to-next-word-end`| 79 | |`ctrl`+`shift`+`s`|`doc:save-as`| 80 | |`ctrl`+`shift`+`tab`|`root:switch-to-previous-tab`| 81 | |`ctrl`+`shift`+`up`|`doc:create-cursor-previous-line`| 82 | |`ctrl`+`tab`|`root:switch-to-next-tab`| 83 | |`ctrl`+`up`|`doc:move-lines-up`| 84 | |`ctrl`+`v`|`doc:paste`| 85 | |`ctrl`+`w`|`root:close`| 86 | |`ctrl`+`x`|`doc:cut`| 87 | |`ctrl`+`y`|`doc:redo`| 88 | |`ctrl`+`z`|`doc:undo`| 89 | |`f11`|`core:toggle-fullscreen`| 90 | |`f3`|`find-replace:repeat-find`| 91 | |`shift`+`f3`|`find-replace:previous-find`| 92 | -------------------------------------------------------------------------------- /locales/en/documentation/usage.md: -------------------------------------------------------------------------------- 1 | # Usage 2 | 3 | Lite XL is a lightweight text editor written mostly in Lua — it aims to provide 4 | something practical, pretty, *small* and fast, implemented as simply as 5 | possible; easy to modify and extend, or to use without doing either. 6 | 7 | Lite XL is based on the Lite editor and provide some enhancements 8 | while remaining generally compatible with it. 9 | 10 | ## Getting Started 11 | 12 | Lite XL works using a *project directory* — this is the directory where your 13 | project's code and other data resides. 14 | 15 | To open a specific project directory the directory name can be passed 16 | as a command-line argument *(`.` can be passed to use the current directory)* 17 | or the directory can be dragged onto either the executable or a running instance. 18 | 19 | Once started the project directory can be changed using the command 20 | `core:change-project-folder`. The command will close all the documents 21 | currently opened and switch to the new project directory. 22 | 23 | If you want to open a project directory in a new window the command 24 | `core:open-project-folder` will open a new editor window with the selected 25 | project directory. 26 | 27 | The main way of opening files in Lite XL is through the `core:find-file` command 28 | — this provides a fuzzy finder over all of the project's files and can be 29 | opened using the `ctrl`+`p` shortcut by default. 30 | 31 | Commands can be run using keyboard shortcuts, or by using the `core:find-command` 32 | command bound to `ctrl`+`shift`+`p` by default. For example, pressing 33 | the above combination and typing `newdoc` then pressing `return` 34 | would open a new document. The current keyboard shortcut for a command 35 | can be seen to the right of the command name on the command finder, thus to find 36 | the shortcut for a command `ctrl`+`shift`+`p` can be pressed 37 | and the command name typed. 38 | 39 | ## User Data Directories 40 | 41 | Lite XL uses standard systems user directories; the user data can be found in 42 | `$HOME/.config/lite-xl` on Linux and macOS. 43 | On Windows, the variable `$USERPROFILE` will be used instead of 44 | `$HOME`. 45 | 46 | ## User Module 47 | 48 | Lite XL can be configured through use of the user module. The user module can be 49 | used for changing options in the config module, adding additional key bindings, 50 | loading custom color themes, modifying the style or changing any other part of 51 | the editor to your personal preference. 52 | 53 | The user module is loaded when the application starts, 54 | after the plugins have been loaded. 55 | 56 | The user module can be modified by running the `core:open-user-module` command 57 | or otherwise directly opening the `$HOME/.config/lite-xl/init.lua` file. 58 | 59 | On Windows, the variable `$USERPROFILE` will be used instead of 60 | `$HOME`. 61 | 62 | **tl;dr:** 63 | 64 | - Windows: `C:\Users\(username)\.config\lite-xl\init.lua` 65 | - MacOS: `/Users/(usernmame)/.config/lite-xl/init.lua` 66 | - Linux: `/home/(username)/.config/lite-xl/init.lua` 67 | 68 | These aren't the exact location, but it gives you an idea where to find. 69 | 70 | Please note that Lite XL differs from the standard Lite editor for the location 71 | of the user's module. 72 | 73 | ## Project Module 74 | 75 | The project module is an optional module which is loaded from the current 76 | project's directory when Lite XL is started. Project modules can be useful for 77 | things like adding custom commands for project-specific build systems, or 78 | loading project-specific plugins. 79 | 80 | The project module is loaded when the application starts, 81 | after both the plugins and user module have been loaded. 82 | 83 | The project module can be edited by running the `core:open-project-module` 84 | command — if the module does not exist for the current project when the 85 | command is run it will be created. 86 | 87 | ## Add directories to a project 88 | 89 | In addition to the project directories it is possible to add other directories 90 | using the command `core:add-directory`. 91 | Once added a directory it will be shown in the tree-view on the left side and 92 | the additional files will be reachable using the `ctrl`+`p` command (find file). 93 | The additonal files will be also visible when searching across the project. 94 | 95 | The additional directories can be removed using the command `core:remove-directory`. 96 | 97 | When you will open again Lite XL on the same project folder the application will 98 | remember your workspace including the additonal project directories. 99 | 100 | Since version 1.15 Lite XL does not need a workspace plugin as it is now 101 | bundled with the editor. 102 | 103 | ## Create new empty directory 104 | 105 | Using the command `files:create-directory` or control-click in a directory in the 106 | tree-view to create a new empty subdirectory. 107 | 108 | ## Commands 109 | 110 | Commands are used both through the command finder (`ctrl`+`shift`+`p`) and 111 | by Lite XL's keyboard shortcut system. Commands consist of 3 components: 112 | 113 | * **Name** — The command name in the form of `namespace:action-name`, for 114 | example: `doc:select-all` 115 | * **Predicate** — A function that returns true if the command can be ran, for 116 | example, for any document commands the predicate checks whether the active 117 | view is a document 118 | * **Function** — The function which performs the command itself 119 | 120 | Commands can be added using the `command.add` function provided by the 121 | `core.command` module: 122 | 123 | ```lua 124 | local core = require "core" 125 | local command = require "core.command" 126 | 127 | command.add("core.docview", { 128 | ["doc:save"] = function() 129 | core.active_view.doc:save() 130 | core.log("Saved '%s'", core.active_view.doc.filename) 131 | end 132 | }) 133 | ``` 134 | 135 | Commands can be performed programatically (eg. from another command or by your 136 | user module) by calling the `command.perform` function after requiring the 137 | `command` module: 138 | 139 | ```lua 140 | local command = require "core.command" 141 | command.perform "core:quit" 142 | ``` 143 | 144 | ### Keymap 145 | 146 | All keyboard shortcuts are handled by the `core.keymap` module. 147 | A key binding maps a "stroke" (eg. `ctrl`+`q`) to one or more commands 148 | (eg. `core:quit`). When the shortcut is pressed Lite XL will iterate each command 149 | assigned to that key and run the *predicate function* for that command — if the 150 | predicate passes it stops iterating and runs the command. 151 | 152 | An example of where this used is the default binding of the `tab` key: 153 | 154 | ``` lua 155 | ["tab"] = { "command:complete", "doc:indent" }, 156 | ``` 157 | 158 | When tab is pressed the `command:complete` command is attempted which will only 159 | succeed if the command-input at the bottom of the window is active. Otherwise 160 | the `doc:indent` command is attempted which will only succeed if we have a 161 | document as our active view. 162 | 163 | A new mapping can be added by your user module as follows: 164 | 165 | ```lua 166 | local keymap = require "core.keymap" 167 | keymap.add { ["ctrl+q"] = "core:quit" } 168 | ``` 169 | 170 | A list of default mappings can be viewed [here][1]. 171 | 172 | ### Global variables 173 | 174 | There are a few global variables set by the editor. 175 | These variables are available everywhere and shouldn't be overwritten. 176 | 177 | - `ARGS`: command-line arguments. `argv[1]` is the program name, `argv[2]` is the 1st parameter, ... 178 | - `PLATFORM`: Output from `SDL_GetPlatform()`. Can be `Windows`, `Mac OS X`, `Linux`, `iOS` and `Android`. 179 | - `SCALE`: Font scale. Usually 1, but can be higher on HiDPI systems. 180 | - `EXEFILE`: An absolute path to the executable. 181 | - `EXEDIR`: The executable directory. **DO NOT WRITE TO THIS DIRECTORY.** 182 | - `VERSION`: lite-xl version. 183 | - `MOD_VERSION`: mod-version used in plugins. This is usually incremented when there are API changes. 184 | - `PATHSEP`: Path seperator. `\` (Windows) or `/` (Other OSes) 185 | - `DATADIR`: The data directory, where the Lua part of lite-xl resides. **DO NOT WRITE TO THIS DIRECTORY.** 186 | - `USERDIR`: User configuration directory. 187 | 188 | > `USERDIR` should be used instead of `DATADIR` when configuring the editor 189 | > because `DATADIR` might not be writable. 190 | > (for example, if the editor is installed in `/usr`, `DATADIR` will be `/usr/share/lite-xl`!) 191 | > `USERDIR` on the other hand should always be writable for the user, and allows multiple users to customize 192 | > their own editor. 193 | 194 | ## Plugins 195 | 196 | Plugins in Lite XL are normal lua modules and are treated as such — no 197 | complicated plugin manager is provided, and, once a plugin is loaded, it is never 198 | expected be to have to unload itself. 199 | 200 | To install a plugin simply drop it in the `plugins` directory in the user 201 | module directory. 202 | When Lite XL starts it will first load the plugins included in the data directory 203 | and will then loads the plugins located in the user module directory. 204 | 205 | To uninstall a plugin the plugin file can be deleted — any plugin 206 | (including those included with the default installation) 207 | can be deleted to remove its functionality. 208 | 209 | If you want to load a plugin only under a certain circumstance (for example, 210 | only on a given project) the plugin can be placed somewhere other than the 211 | `plugins` directory so that it is not automatically loaded. The plugin can 212 | then be loaded manually as needed by using the `require` function. 213 | 214 | Plugins can be downloaded from the [plugins repository][2]. 215 | 216 | ## Restarting the editor 217 | 218 | If you modify the user configuration file or some of the Lua implementation files 219 | you may restart the editor using the command `core:restart`. 220 | The entire application will be restarting by keeping the window that is already in use. 221 | 222 | ## Color Themes 223 | 224 | Colors themes in Lite XL are lua modules which overwrite the color fields of 225 | Lite XL's `core.style` module. 226 | Pre-defined color methods are located in the `colors` folder in the data directory. 227 | Additional color themes can be installed in the user's directory in a folder named 228 | `colors`. 229 | 230 | A color theme can be set by requiring it in your user module: 231 | 232 | ```lua 233 | core.reload_module "colors.winter" 234 | ``` 235 | 236 | In the Lite editor the function `require` is used instead of `core.reload_module`. 237 | In Lite XL `core.reload_module` should be used to ensure that the color module 238 | is actually reloaded when saving the user's configuration file. 239 | 240 | Color themes can be downloaded from the [color themes repository][3]. 241 | They are included with Lite XL release packages. 242 | 243 | 244 | [1]: /en/documentation/keymap 245 | [2]: https://github.com/lite-xl/lite-xl-plugins 246 | [3]: https://github.com/lite-xl/lite-xl-colors 247 | -------------------------------------------------------------------------------- /locales/en/downloads.md: -------------------------------------------------------------------------------- 1 | # Downloads 2 | 3 | ## Binary packages 4 | 5 | Binary packages are available on the [GitHub releases page][1]. 6 | 7 | ## Install via package management 8 | 9 | Alternatively, you can install lite-xl from your distribution's package manager. 10 | **These packages are maintained by the community and may be outdated.** 11 | 12 | - [Windows][2] ([Chocolatey][3] / [Scoop][4]) 13 | - [Mac OS][5] (MacPorts) 14 | - [Arch Linux][6] (AUR) 15 | - [NixOS][7] (nixpkgs) 16 | - [Fedora][8] 17 | 18 | ```sh 19 | choco install lite-xl # chocolatey 20 | scoop bucket add extras && scoop install lite-xl # scoop 21 | sudo port install lite-xl # macports 22 | yay -S lite-xl # or your favorite AUR helper 23 | nix-env -i lite-xl # nixos 24 | sudo dnf install lite-xl # fedora 25 | ``` 26 | 27 | ## Source Code 28 | 29 | Source code is available on [GitHub][9], by downloading zip or tar archives, 30 | or directly via git: 31 | 32 | ```sh 33 | git clone https://github.com/lite-xl/lite-xl.git 34 | ``` 35 | 36 | 37 | [1]: https://github.com/lite-xl/lite-xl/releases/latest 38 | [2]: https://github.com/microsoft/winget-cli/discussions/223#discussion-15735 39 | [3]: https://community.chocolatey.org/packages/lite-xl 40 | [4]: https://github.com/ScoopInstaller/Extras/blob/master/bucket/lite-xl.json 41 | [5]: https://ports.macports.org/port/lite-xl/ 42 | [6]: https://aur.archlinux.org/packages/lite-xl/ 43 | [7]: https://github.com/NixOS/nixpkgs/blob/release-21.11/pkgs/applications/editors/lite-xl/default.nix 44 | [8]: https://src.fedoraproject.org/rpms/lite-xl 45 | [9]: https://github.com/lite-xl/lite-xl 46 | -------------------------------------------------------------------------------- /locales/en/index.md: -------------------------------------------------------------------------------- 1 | # Lite XL 2 | 3 | A lightweight, *simple*, fast, feature-filled, and extremely extensible text editor written in C, and Lua, adapted from [lite](https://github.com/rxi/lite/). 4 | 5 | [![Lite XL Editor](/assets/img/editor.png)](/assets/img/editor.png) 6 | -------------------------------------------------------------------------------- /locales/en/template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{ title }} 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 |

Lite XL

17 |
18 | 19 | 20 |

21 | 22 | EN 23 |

24 | 25 | 26 | 27 | English 28 | 29 | 30 | 31 | Deutsch 32 | 33 | 34 |
35 | 36 |

About

37 | 38 | FAQ 39 | Features 40 | Screenshots 41 | Contributors 42 | 43 |
44 | 45 |

Documentation

46 | 47 | Usage 48 | Build 49 | Default Keymap 50 | MacOS Keymap 51 | 52 |
53 | 54 |

Tutorials

55 | 56 | Simple Plugin 57 | Syntax Highlighting 58 | API Overview 59 | System Fonts 60 | 61 |
62 |

63 | 64 | 65 | 66 | Plugins 67 |

68 |

69 | 70 | 71 | 72 | Downloads 73 |

74 |
75 | 76 |

77 | 78 | 79 | 80 | Search 81 |

82 |
83 | 84 |
85 | 86 | 87 |

88 | A newer version of this file is available in English. 89 |

90 | {{ page }} 91 |
92 | 93 | 94 |

Get Involved

95 | 96 | 97 | 98 | 99 | Github 100 | 101 | 102 | 103 | 104 | 105 | Discord 106 | 107 | 108 | 109 | 110 | 111 | 112 | Matrix 113 | 114 | 122 |
123 | 124 |

Status

125 | 126 | 127 |
128 |
129 |
130 | 131 | 132 | -------------------------------------------------------------------------------- /locales/en/tutorials/api-overview.md: -------------------------------------------------------------------------------- 1 | # API Overview 2 | 3 | ### This is a work in progress. 4 | 5 | Here we provide some resources and explanation to some API and aspects of Lite XL. 6 | For API docs, it's available in [the repo][1] 7 | Thus, we'll not explain _everything_, only the more important and frequently used features. 8 | 9 | Built-in APIs: 10 | 11 | - [Process API][2] 12 | - [System API][3] 13 | - [Regex API][4] 14 | 15 | [1]: https://github.com/lite-xl/lite-xl/tree/master/docs 16 | [2]: /en/tutorials/overview/process 17 | [3]: /en/tutorials/overview/system 18 | [4]: /en/tutorials/overview/regex 19 | -------------------------------------------------------------------------------- /locales/en/tutorials/index.md: -------------------------------------------------------------------------------- 1 | # Tutorials 2 | 3 | These pages contain tutorials and documentations for building plugins in Lite XL. 4 | 5 | - [API Overview](/en/tutorials/api-overview) 6 | - [Simple Plugin](/en/tutorials/simple-plugin) 7 | - [Syntax Highlighting](/en/tutorials/syntax-highlighting) 8 | - [System Fonts](/en/tutorials/system-fonts) -------------------------------------------------------------------------------- /locales/en/tutorials/overview/process.md: -------------------------------------------------------------------------------- 1 | # Process API 2 | 3 | Lite XL provides a process API to launch external applications. This API is meant to replace 4 | lua's `io.popen` and lite's [pipe-to-a-file][1] approach. 5 | 6 | Advantages of this API includes: 7 | 8 | - Proper argument escaping (arguments are supplied via a table) 9 | - Nonblocking IO 10 | - Able to detach processes from Lite XL [(in progress)][2] 11 | - Does not create temporary files 12 | - Mostly cross-platform (does not require special code for each shell) 13 | 14 | ## Using the Process API 15 | 16 | ### Error handling 17 | - `process.start()` may throw errors if it cannot run the program. 18 | - `process.read*` and `process.write` functions may throw errors if 19 | - the process ended 20 | - the process closed the stream 21 | - you closed the stream 22 | - there might be other errors to look forward to too 23 | 24 | ### Starting a process 25 | To start a process, use `process.start(args, options)`. 26 | 27 | Here are some of the more useful arguments. 28 | 29 | - `args`: The executable and any arguments, eg: `{ "sh", "-c", "echo hello world" }` 30 | - `options`: Options for `process.start()` 31 | - `env`: A key-value table containing the env. **Note that if this is provided, 32 | environment variables will not be inherited.** 33 | - `stdin`: Specify where to redirect stdin 34 | - `stdout`: Specify where to redirect stdout 35 | - `stderr`: Specify where to redirect stderr 36 | 37 | for `options.std{in,out,err}`, valid values are: 38 | 39 | - `process.REDIRECT_PIPE` (Make it available to subprocess API for reading / writing) 40 | - `process.REDIRECT_DISCARD` (Discard the output. Use this to prevent buffering) 41 | - `process.REDIRECT_STDOUT` (`stderr` only, for redirecting `stderr` to `stdout`) 42 | 43 | ### Reading from process 44 | To read from `stdout` or `stderr` of a process, use `process:read_stdout()` and 45 | `process:read_stderr()` respectively. 46 | 47 | You can specify a numeric argument to them, which will change the size of internal buffer used 48 | to read the output. 49 | 50 | Alternatively, you could use `process:read()` with `process.STREAM_STDERR` and `process.STREAM_STDOUT`. 51 | 52 | **Example:** 53 | 54 | ```lua 55 | local proc = process.start { "sh", "-c", "echo hello world!" } 56 | 57 | -- do not use `while proc:running()` if you care about output. 58 | -- The process could die and leave data in the buffer 59 | -- You should just read until `proc:read_stdout()` returns nil 60 | while true do 61 | local rdbuf = proc:read_stdout() 62 | if not rdbuf then break end 63 | -- yay, output 64 | end 65 | ``` 66 | 67 | ### Writing to process 68 | You can use `process:write(data)` to write a string to `stdin`. 69 | 70 | ### Checking completion 71 | - `process:running()` returns a boolean to indicate whether if the process is running. 72 | - `process:wait(time)` also does the same thing, but you specify how long it should wait (or 0 to return immediately). 73 | 74 | ### Terminating process 75 | - `process:terminate()` sends SIGTERM (or Windows equivalent) to the process. 76 | - `process:kill()` sends SIGKILL (or Windows equivalent) to the progress. 77 | **Use this only if `process:terminate()` cannot kill the process, [as it can cause issues][3].** 78 | 79 | ### Misc 80 | - `process:pid()` returns the PID of the process. 81 | **There are no guarantees for this PID to be correct if the process terminated early.** 82 | - `process:returncode()` returns the exit code of the process, if any 83 | - `process:close_stream()` closes `stdin`, `stdout` or `stderr` stream of the process. 84 | 85 | 86 | [1]: https://github.com/rxi/console/blob/fb3d414d085d4110364314d6cd8380dc1d386249/init.lua#L100 87 | [2]: https://github.com/lite-xl/lite-xl/pull/535 88 | [3]: http://turnoff.us/geek/dont-sigkill/ 89 | -------------------------------------------------------------------------------- /locales/en/tutorials/overview/regex.md: -------------------------------------------------------------------------------- 1 | # Regex API 2 | 3 | This API provides PCRE regular expressions for those who needs more power in matching text. 4 | This API written in C and Lua. 5 | 6 | ## Creating a regex 7 | Use `regex.compile(pattern, options)` to compile a regex. 8 | 9 | - `pattern`: The regex pattern 10 | - `options`: regex modifiers as a string, eg `"im"` 11 | - `"i"`: Case-insensitive search 12 | - `"m"`: Multiline search 13 | - `"s"`: Match all characters with dot (`.`), **including newlines.** 14 | 15 | ## Matching 16 | 17 | ### Low level functions 18 | - `regex:cmatch(str, offset, options)` low-level matching function 19 | - `str`: The string to match against 20 | - `offset`: Where to start matching 21 | - `options`: A bit field of options 22 | - `regex.ANCHORED`: Only match from the start of the string 23 | - `regex.ENDANCHORED`: Only match from the end of the string 24 | - `regex.NOTBOL`: String is not beginning of line 25 | - `regex.NOTEOL`: String is not the end of line 26 | - `regex.NOTEMPTY`: Do not match an empty string 27 | - `regex.NOTEMPTY_ATSTART`: Do not match empty string at the start 28 | 29 | **Note: `regex:cmatch()` returns wrong indexes (currently at version 2.0.2). 30 | The end index returned by `regex:cmatch()` is always off by 1 (-1 to get the actual end index).** 31 | 32 | ### High level functions 33 | All the functions below can be in 2 forms: 34 | - `regex:fn(...)` where `regex` is the compiled regex instance 35 | - `regex.fn(pattern, ...)` where `pattern` is a pattern string to be compiled and used directly. 36 | 37 | We will only document the first form. 38 | 39 | - `regex:match(str, offset, options)` high level matching function. This function accepts 40 | the same arguments as `regex:cmatch()` 41 | - `regex:gsub(str, replacement)` replaces matches in `str` with `replacement`. 42 | Capture groups are identified with `\\0` to `\\9`, this might change in the future. 43 | -------------------------------------------------------------------------------- /locales/en/tutorials/overview/system.md: -------------------------------------------------------------------------------- 1 | # System API 2 | 3 | This is where Lite XL's lua code interact with its underlying C engine. 4 | Some of the functions here will be omitted because they're not useful for 5 | plugins. 6 | 7 | ## Clipboard 8 | - `system.set_clipboard(text)` sets the clipboard content. 9 | - `system.get_clipboard()` retrieves the content of the clipboard. 10 | 11 | ## File / Directory manipulation 12 | - `system.list_dir(dir)` returns a list of filenames in a directory. 13 | - `system.rmdir(dir)` removes a directory. Use this instead of `os.remove()`. 14 | **The directory must be empty.** 15 | - `system.chdir(dir)` changes the current working directory (like `cd`). 16 | - `system.mkdir(dir)` creates a new directory. 17 | **It does not recursively create directories.** 18 | - `system.absolute_path(path)` resolves the path components (`.. and .`) to an absolute path. 19 | - `system.get_file_info(path)` returns info about a path. 20 | - `modified`: last modification time of the file in seconds since UNIX epoch. 21 | - `size`: file size in bytes. 22 | - `type`: Path type (`"file"` or `"dir"`). 23 | 24 | ## Timing 25 | - `system.get_time()` returns time in seconds (as floating point number) since Lite XL started. 26 | Use this instead of `os.time()` for higher precision timers. 27 | - `system.sleep(time)` sleeps for `time` in milliseconds. 28 | **Do not use this. Write asynchronous code.** 29 | 30 | ## Window manipulation 31 | - `system.set_window_opacity(o)` sets the window opacity from 0 to 1. 32 | - `system.set_window_title(title)` sets the window title. 33 | - `system.set_window_mode(mode)` sets window mode: 34 | - `"normal"`: also known as "restored" on Windows. 35 | - `"maximized"`: Maximize the window. 36 | - `"minimized"`: Minimize the window. 37 | - `"fullscreen"`: Fullscreen 38 | - `system.set_window_bordered(bordered)` enables or disable window border (decoration). 39 | - `system.set_window_hit_test(height, control_width, resize_border)` sets window hit test (used for 40 | `config.borderless` to make custom drawn border interactable). 41 | - If no argument is supplied, reset the hit test values. 42 | - `height`: height of the title bar. 43 | - `controls_width`: Not too sure about this, but it should be the size of the title bar controls 44 | (Maximize, Minimize and Normal buttons on the right). 45 | It seems to be fixed at the right side of the title bar. 46 | - `resize_border`: Number of pixels reserved for resizing the window. 47 | (setting this to a large value means that you can resize the window way easier) 48 | - `system.get_window_size()` gets the window size. 49 | - `system.set_window_size(w, h, x, y)` sets the window size (and also position). 50 | - `system.window_has_focus()` checks whether the window is in focus. 51 | - `system.show_fatal_error(title, msg)` shows an system error message box. 52 | **Use nagview whenever possible.** 53 | 54 | ## Misc 55 | - `system.exec(command)` runs a command. Use the [Process API][1] instead of this. 56 | - `system.fuzzy_match(haystack, needle, file)` generates a score depends on how close the needle 57 | matches the haystack. 58 | - `file`: match backwards (more accurate for filename matching). 59 | 60 | [1]: /en/tutorials/overview/process 61 | -------------------------------------------------------------------------------- /locales/en/tutorials/simple-plugin.md: -------------------------------------------------------------------------------- 1 | # Simple Plugin 2 | 3 | ### What is Simple? 4 | Simple is a very basic plugin written with the intention of introducing developers 5 | who are new to Lite XL to the process of writing plugins for the editor. 6 | 7 | ### What does the plugin do? 8 | The plugin displays a message (that is taken as input from the user) at the top 9 | right corner of the editor window. It also allows the user to toggle 10 | the visibility of the message. 11 | 12 | ### I can't write Lua! 13 | If you come from other programming languages, take a look at [Lua cheatsheet][1]. 14 | If you're new to programming, you can read [this][2]. 15 | 16 | ### Format of the tutorial 17 | The code contains comments detailing what most (if not all) 18 | of the code in the file does. 19 | 20 | 21 | ### The code : 22 | ```lua 23 | -- mod-version:3 24 | 25 | -- you MUST put mod-version:x on the first line of your plugin 26 | -- mod-version usually maps to lite-xl releases (eg. mod-version: 2 == lite-xl 2.0) 27 | -- lite-xl won't load the plugin if the mod-version mismatches 28 | 29 | ----------------------------------------------------------------------- 30 | -- NAME : Simple 31 | -- DESCRIPTION: A simple guide on how to make your first Lite XL plugin 32 | -- AUTHOR : Ashwin Godbole (aelobdog) 33 | -- GOALS : To render some text inside the editor 34 | ----------------------------------------------------------------------- 35 | -- Disclaimer : 36 | -- I am not a lua developer, and my knowledge about writing plugins for 37 | -- Lite XL is very limited. This file serves the purpose of helping the 38 | -- reader get started with plugin development for Lite XL, and therefore 39 | -- demonstrates only some very basic features. For more complex plugin 40 | -- development, be sure to check out the source code of some other 41 | -- plugins after going through this file. 42 | ----------------------------------------------------------------------- 43 | -- Before we start writing any code for the plugin, we must import the 44 | -- required modules from the "core" package. 45 | 46 | -- the "core" module 47 | local core = require "core" 48 | 49 | -- the "command" module will help us register commands for our plugin. 50 | local command = require "core.command" 51 | 52 | -- the "style" module will allow us to use styling options 53 | local style = require "core.style" 54 | 55 | -- the "config" module will be used to store certain things like colors 56 | -- and functions 57 | local config = require "core.config" 58 | 59 | -- the "keymap" module will allow us to set keybindings for our commands 60 | local keymap = require "core.keymap" 61 | 62 | -- since we want to modify RootView, we'll need to require it first 63 | local RootView = require "core.rootview" 64 | 65 | ----------------------------------------------------------------------- 66 | -- per-plugin config must stay in config.plugins.(plugin name) 67 | config.plugins.simple = {} 68 | 69 | -- colors are just three or four comma separated values (RGBA) (range 0 - 255) 70 | -- put inside of '{ }'. We will add our color to the config module. 71 | config.plugins.simple.text_color = {200, 140, 220} -- or use `{ common.color "#C88CDC" }` 72 | ----------------------------------------------------------------------- 73 | -- Let's create a function to calculate the coordinates of our text. 74 | -- While we're at it, let's add our function to the `config` module. 75 | -- We'll take the message we want to display as the argument to the 76 | -- function to determine the x and y coordinates of the text. 77 | 78 | function config.plugins.simple.get_text_coordinates(message) 79 | -- For this plugin, we want to display the text on the top right 80 | -- corner of the screen. For this, we need to know the editor's width 81 | -- and height. 82 | 83 | -- The current font's size can be obtained from the "style" module. 84 | -- The editor's dimensions can be obtained by 85 | -- 1. WIDTH : core.root_view.size.x 86 | -- 2. HEIGHT : core.root_view.size.y 87 | 88 | local message_width = style.code_font:get_width(message.." ") 89 | local font_height = style.code_font:get_size() 90 | local x = core.root_view.size.x - message_width 91 | local y = font_height / 2 92 | 93 | return x, y 94 | end 95 | ----------------------------------------------------------------------- 96 | -- Let's now get to actually drawing the text inside the editor. 97 | -- In order to "inject" our own code to draw text, 98 | -- we'll need to save the original draw function 99 | -- We'll save `RootView.draw` to a variable we call `parent_draw` 100 | 101 | local parent_draw = RootView.draw 102 | 103 | -- Now let's overload the original definition of `draw` in RootView 104 | -- by redefining the function. 105 | 106 | function RootView:draw() 107 | -- We call the parent's function to keep the editor functional... 108 | -- obviously we must still draw all the other stuff ! 109 | -- So we call the `parent_draw` function before doing anything else. 110 | parent_draw(self) 111 | 112 | -- we'll add an option to toggle the message on and off. let's use a 113 | -- boolean variable to keep track of whether we want to display the 114 | -- message or not. 115 | if config.plugins.simple.show_my_message then 116 | -- We'll be getting the message to display as input from the user 117 | -- later. We'll store that user input in `config.plugins.simple.hw_message`. 118 | -- (NOTE: this variable does not come in-built in lite-xl; 119 | -- it is a variable that we will define later.) 120 | 121 | -- let's store the value of config.plugins.simple.hw_message in a local variable 122 | -- `message` in case config.plugins.simple.hw_message we set the message to 123 | -- "message not set yet!" 124 | local message 125 | 126 | if config.plugins.simple.hw_message then 127 | message = config.plugins.simple.hw_message 128 | else 129 | message = "Message not set yet !" 130 | end 131 | 132 | -- let's get the coordinates for our text 133 | local x, y = config.plugins.simple.get_text_coordinates(message) 134 | 135 | -- let's finally draw the text to the window ! 136 | -- the draw_text function from `renderer` is an important function 137 | -- as it is used to display any and all text inside of the editor 138 | -- window 139 | renderer.draw_text(style.code_font, message, x, y, config.plugins.simple.text_color) 140 | end 141 | end 142 | ----------------------------------------------------------------------- 143 | -- Let's allow the user to turn the message on and off 144 | -- we'll write a function to flip our "show" boolean variable. 145 | 146 | local function toggle_helloworld() 147 | config.plugins.simple.show_my_message = not config.plugins.simple.show_my_message 148 | end 149 | ----------------------------------------------------------------------- 150 | -- Finally, let's add the toggle function to the command list so that 151 | -- we can call it from the C-S-p command panel. Let's add one command 152 | -- to toggle the visibility of the message on and off and one to get 153 | -- the user's message and then display it. 154 | 155 | command.add(nil, { 156 | -- Toggle the visibility of the message 157 | ["simple:toggle"] = toggle_helloworld, 158 | 159 | -- Set and show the message 160 | -- This is the way to get user input through the command bar. 161 | -- `core.command_view:enter` takes 2 arguments: 162 | -- * the prompt to display before taking input 163 | -- * a function that takes the "input" as its argument 164 | -- (NOTE: here the variable we are reading input into is `text`) 165 | ["simple:setshow"] = function() 166 | core.command_view:enter("Test to display", { 167 | submit = function(text) 168 | config.plugins.simple.hw_message = text 169 | config.plugins.simple.show_my_message = true 170 | end 171 | }) 172 | end 173 | }) 174 | ----------------------------------------------------------------------- 175 | -- Just for fun, let's assign our commands their own keybindings. 176 | -- Here, we assign the keybinding the same string(its name) as the one 177 | -- that we set while creating the command 178 | keymap.add { 179 | ["alt+s"] = "simple:setshow", 180 | ["alt+t"] = "simple:toggle", 181 | } 182 | ``` 183 | 184 | ### Further reading 185 | - [Lite: An Implementation Overview][3], an excellent post by rxi that stays mostly relevant to lite-xl. 186 | - [API overview][4], where some of the APIs are explained. 187 | 188 | 189 | [1]: https://devhints.io/lua 190 | [2]: https://www.lua.org/pil 191 | [3]: https://rxi.github.io/lite_an_implementation_overview.html 192 | [4]: /en/tutorials/api-overview 193 | -------------------------------------------------------------------------------- /locales/en/tutorials/syntax-highlighting.md: -------------------------------------------------------------------------------- 1 | # Syntax Highlighting 2 | 3 | ## How to create syntax highlighting plugins for Lite XL 4 | 5 | Syntax highlighting plugins for Lite XL are Lua files. These define some patterns or regular expressions that 6 | match different parts of a given language, assigning token types to each match. 7 | These different token types are then given different colors by your chosen color scheme. 8 | 9 | Like other plugins, syntax definitions are sourced from the following folders, in order: 10 | 11 | - `/usr/share/lite-xl/plugins/` 12 | - `$HOME/.config/lite-xl/plugins/` 13 | 14 | NOTE: The exact location of these folders will depend on your OS and installation method. For example, on Windows, the variable `$USERPROFILE` will be used instead of `$HOME`. 15 | 16 | The user module folder for Lite XL can generally be found in these places on different OSes: 17 | 18 | - Windows: `C:\Users\(username)\.config\lite-xl` 19 | - MacOS: `/Users/(usernmame)/.config/lite-xl` 20 | - Linux: `/home/(username)/.config/lite-xl` 21 | 22 | So, to create a new syntax definition on Linux, you can just create a `.lua` file in your `$HOME/.config/lite-xl/plugins/` folder. 23 | 24 | ## What syntax token types are supported? 25 | 26 | The supported syntax token types, defined by `lite-xl/core/style.lua`, are: 27 | 28 | - normal 29 | - symbol 30 | - comment 31 | - keyword 32 | - keyword2 33 | - number 34 | - literal 35 | - string 36 | - operator 37 | - function 38 | 39 | In your syntax highlighting plugin, you write patterns to match parts of the language syntax, assigning these token types to matches. You don't have to use them all - just use as many as you need for your language. 40 | 41 | Let's walk through an example syntax definition and see how this works. 42 | 43 | ## Example syntax: ssh config files 44 | 45 | This is a small, simple example of a syntax definition. It's intended to highlight SSH Config files and looks like this: 46 | 47 | ```lua 48 | -- mod-version:2 -- lite-xl 2.0 49 | local syntax = require "core.syntax" 50 | 51 | syntax.add { 52 | files = { "sshd?/?_?config$" }, 53 | comment = '#', 54 | patterns = { 55 | { pattern = "#.*\n", type = "comment" }, 56 | { pattern = "%d+", type = "number" }, 57 | { pattern = "[%a_][%w_]*", type = "symbol" }, 58 | { pattern = "@", type = "operator" }, 59 | }, 60 | symbols = { 61 | -- ssh config 62 | ["Host"] = "function", 63 | ["ProxyCommand"] = "function", 64 | 65 | ["HostName"] = "keyword", 66 | ["IdentityFile"] = "keyword", 67 | ... 68 | 69 | -- sshd config 70 | ["Subsystem"] = "keyword2", 71 | 72 | -- Literals 73 | ["yes"] = "literal", 74 | ["no"] = "literal", 75 | ["any"] = "literal", 76 | ["ask"] = "literal", 77 | }, 78 | } 79 | ``` 80 | 81 | Let's take each section in turn and see how it works. 82 | 83 | ### Header 84 | 85 | The first line is a Lua comment & tells Lite XL which version this plugin requires. The second imports the `core.syntax` module 86 | for us to use: 87 | 88 | ```lua 89 | -- mod-version:2 -- lite-xl 2.0 90 | local syntax = require "core.syntax" 91 | ``` 92 | 93 | We then add a syntax definition to lite, using `syntax.add {...}`. The contents of this definition are covered next. 94 | 95 | #### Files 96 | 97 | The `files` property tells Lite XL which files this syntax should be used for. This is a Lua pattern that matches against the full path of the file being opened. For example, to match against Markdown files - with either a `.md` or a `.markdown` extension, 98 | you could do this: 99 | 100 | ```lua 101 | files = { "%.md$", "%.markdown$" }, 102 | ``` 103 | 104 | In our original example, we match against the end of the path rather than the extension, because SSH config files don't have extensions - and we don't want to match all `config` files. We expect the path for SSH config files to look something like one of these: 105 | 106 | - `~/.ssh/config` 107 | - `/etc/ssh/ssh_config` 108 | - `/etc/ssh/sshd_config` 109 | 110 | This pattern matches paths that look like that: 111 | 112 | ```lua 113 | files = { "sshd?/?_?config$" }, 114 | ``` 115 | 116 | ### Comment 117 | 118 | The comment property _doesn't_ define which parts of the syntax are comments - see Patterns for that, below. This property tells Lite XL which character to insert at the start of selected lines when you press `ctrl+/`. 119 | You can also use `block_comment` to tell Lite XL how to create multiline / block comments. 120 | 121 | ### Patterns 122 | 123 | A given piece of text can only match one pattern. Once Lite XL decides that a piece of text matches a pattern, it will assign that token type to that piece and move on. 124 | Patterns are tested in the order that they are written in the syntax definition, so the first match will win. 125 | 126 | Each pattern takes one of the following forms: 127 | 128 | #### Simple Pattern 129 | 130 | ```lua 131 | { pattern = "#.*\n", type = "comment" }, 132 | ``` 133 | 134 | This form matches the line against the pattern and if it matches, assigns the matching text to the given token `type` - `comment`, in this case. 135 | 136 | #### Start & End Pattern 137 | 138 | ```lua 139 | { pattern = { "%[", "%]" }, type = "keyword" }, 140 | ``` 141 | 142 | This form has two patterns - one that matches against the start of the range and one that matches against the end. Everything between the start and the end will be assigned the given token `type`. 143 | 144 | #### Start & End Pattern, with Escape 145 | 146 | ```lua 147 | { pattern = { '"', '"', '\\' }, type = "string" }, 148 | ``` 149 | 150 | This is the same as the previous form, but with an extra, third parameter. 151 | The 3rd part, the `'\\'` part in this example, specifies the character that allows escaping the closing match. 152 | 153 | For more on Lua Patterns, see: [Lua Pattern Reference](https://www.lua.org/manual/5.3/manual.html#6.4.1) 154 | 155 | If you need to use PCRE Regular Expressions, instead of Lua Patterns, you can use the `regex` keyword here, instead of `pattern`. 156 | 157 | ### Symbols 158 | 159 | > This is **not related to the `symbol` token type**. 160 | 161 | The symbols section allows you to assign token types to particular keywords or strings - usually reserved words in the language you are highlighting. 162 | The token type in this section **always take precedence** over token types declared in patterns. 163 | 164 | For example this highlights `Host` using the `function` token type, `HostName` as a `keyword` and `yes`, `no`, `any` & `ask` as a `literal`: 165 | 166 | ```lua 167 | ["Host"] = "function", 168 | ["HostName"] = "keyword", 169 | 170 | ["yes"] = "literal", 171 | ["no"] = "literal", 172 | ["any"] = "literal", 173 | ["ask"] = "literal", 174 | ``` 175 | 176 | #### Tips: double check your patterns! 177 | 178 | There are a few common mistakes that can be made when using the `symbols` table in conjunction with patterns. 179 | 180 | ##### Case 1: Spaces between two `symbols` tokens 181 | 182 | Let's have an example: 183 | 184 | ```lua 185 | { pattern = "[%a_][%w_]+%s+()[%a_][%w_]+", type = { "keyword2", "symbol" } } 186 | ``` 187 | 188 | Let's explain the pattern a bit (omitting the empty parentheses): 189 | 190 | ``` 191 | [%a_] = any alphabet and underscore 192 | [%w_] = any alphabet, numbers and underscore 193 | %s = any whitespace character 194 | 195 | WORD = 196 | [%a_] followed by (1 or more [%w_]) 197 | 198 | pattern = 199 | WORD followed by (one or more %s) followed by WORD 200 | ``` 201 | 202 | Afterwards, you add an entry `["my"] = "literal"` in the `symbols` table. 203 | You test the syntax with `my function` found that `"my"` isn't highlighted as `literal`. Why did that happen? 204 | 205 | **`symbols` table requires an exact match**. 206 | If you look carefully, the empty parentheses (`()`) is placed **after the space**! 207 | This tells Lite XL that `WORD followed by (one or more %s)` is a token, which will match `my ` (note the space in the match). 208 | 209 | The fix is to add a `normal` token for the whitespace between the two tokens: 210 | 211 | ```lua 212 | { pattern = "[%a_][%w_]+()%s+()[%a_][%w_]+", type = { "keyword2", "normal", "symbol" } } 213 | ``` 214 | 215 | ##### Case 2: Patterns & `symbols` tokens 216 | 217 | One might assume that Lite XL magically matches text against the `symbols` table. This is not the case. 218 | 219 | In some languages, people may add a generic pattern to delegate the matching to the `symbols` table. 220 | 221 | ```lua 222 | { pattern = "[%a_][%w_]*", "symbol" } 223 | ``` 224 | 225 | However, the `symbols` table may look like this: 226 | 227 | ```lua 228 | symbols = { 229 | ["my-symbol"] = "function", 230 | ["..something_else"] = "literal" 231 | } 232 | ``` 233 | 234 | `"my-symbol` contains a dash (`-`) and `"..something_else"` contains 2 dots (`.`). 235 | None of the characters are matched by `[%a_][%w_]*`! 236 | 237 | **Beware of the text you intend to match in the `symbols` table.** 238 | **If you want to use it, you need to ensure that it can matched by one of the patterns.** 239 | 240 | The correct patterns are: 241 | 242 | ```lua 243 | { pattern = "[%a_][%w%-_]*", "symbol" }, 244 | { pattern = "%.%.[%a_][%w_]*", "symbol" }, 245 | ``` 246 | 247 | ## Testing Your New Syntax 248 | 249 | To test your new syntax highlighting you need to do two things: 250 | 251 | - Reload the Lite XL core 252 | - Load a file in your chosen language and see how it looks 253 | 254 | To reload the core, you can either restart Lite XL, or reload the core from the command palette, without needing to restart. 255 | To do this, type `ctrl+shit+p` to show the command palette, then select `Core: Restart` (or type `crr` or something similar to match it), then press Enter. You will need to restart the core after any changes you make to the syntax highlighting definition. 256 | 257 | 258 | ## Example advanced syntax: Markdown 259 | 260 | > **Note: This example has features from 2.1. It is not compatible with older versions of lite-xl.** 261 | 262 | Not all languages are as simple as SSH config files. Markup languages like HTML and Markdown are especially hard to parse correctly. Here's the markdown syntax file in its full glory: 263 | 264 | ```lua 265 | -- mod-version:3 266 | local syntax = require "core.syntax" 267 | local style = require "core.style" 268 | local core = require "core" 269 | 270 | local initial_color = style.syntax["keyword2"] 271 | 272 | -- Add 3 type of font styles for use on markdown files 273 | for _, attr in pairs({"bold", "italic", "bold_italic"}) do 274 | local attributes = {} 275 | if attr ~= "bold_italic" then 276 | attributes[attr] = true 277 | else 278 | attributes["bold"] = true 279 | attributes["italic"] = true 280 | end 281 | -- no way to copy user custom font with additional attributes :( 282 | style.syntax_fonts["markdown_"..attr] = renderer.font.load( 283 | DATADIR .. "/fonts/JetBrainsMono-Regular.ttf", 284 | style.code_font:get_size(), 285 | attributes 286 | ) 287 | -- also add a color for it 288 | style.syntax["markdown_"..attr] = style.syntax["keyword2"] 289 | end 290 | 291 | local in_squares_match = "^%[%]" 292 | local in_parenthesis_match = "^%(%)" 293 | 294 | syntax.add { 295 | name = "Markdown", 296 | files = { "%.md$", "%.markdown$" }, 297 | block_comment = { "" }, 298 | space_handling = false, -- turn off this feature to handle it our selfs 299 | patterns = { 300 | ---- Place patterns that require spaces at start to optimize matching speed 301 | ---- and apply the %s+ optimization immediately afterwards 302 | -- bullets 303 | { pattern = "^%s*%*%s", type = "number" }, 304 | { pattern = "^%s*%-%s", type = "number" }, 305 | { pattern = "^%s*%+%s", type = "number" }, 306 | -- numbered bullet 307 | { pattern = "^%s*[0-9]+[%.%)]%s", type = "number" }, 308 | -- blockquote 309 | { pattern = "^%s*>+%s", type = "string" }, 310 | -- alternative bold italic formats 311 | { pattern = { "%s___", "___%f[%s]" }, type = "markdown_bold_italic" }, 312 | { pattern = { "%s__", "__%f[%s]" }, type = "markdown_bold" }, 313 | { pattern = { "%s_[%S]", "_%f[%s]" }, type = "markdown_italic" }, 314 | -- reference links 315 | { 316 | pattern = "^%s*%[%^()["..in_squares_match.."]+()%]: ", 317 | type = { "function", "number", "function" } 318 | }, 319 | { 320 | pattern = "^%s*%[%^?()["..in_squares_match.."]+()%]:%s+.+\n", 321 | type = { "function", "number", "function" } 322 | }, 323 | -- optimization 324 | { pattern = "%s+", type = "normal" }, 325 | 326 | ---- HTML rules imported and adapted from language_html 327 | ---- to not conflict with markdown rules 328 | -- Inline JS and CSS 329 | { 330 | pattern = { 331 | "<%s*[sS][cC][rR][iI][pP][tT]%s+[tT][yY][pP][eE]%s*=%s*" .. 332 | "['\"]%a+/[jJ][aA][vV][aA][sS][cC][rR][iI][pP][tT]['\"]%s*>", 333 | "<%s*/[sS][cC][rR][iI][pP][tT]>" 334 | }, 335 | syntax = ".js", 336 | type = "function" 337 | }, 338 | { 339 | pattern = { 340 | "<%s*[sS][cC][rR][iI][pP][tT]%s*>", 341 | "<%s*/%s*[sS][cC][rR][iI][pP][tT]>" 342 | }, 343 | syntax = ".js", 344 | type = "function" 345 | }, 346 | { 347 | pattern = { 348 | "<%s*[sS][tT][yY][lL][eE][^>]*>", 349 | "<%s*/%s*[sS][tT][yY][lL][eE]%s*>" 350 | }, 351 | syntax = ".css", 352 | type = "function" 353 | }, 354 | -- Comments 355 | { pattern = { "" }, type = "comment" }, 356 | -- Tags 357 | { pattern = "%f[^<]![%a_][%w_]*", type = "keyword2" }, 358 | { pattern = "%f[^<][%a_][%w_]*", type = "function" }, 359 | { pattern = "%f[^<]/[%a_][%w_]*", type = "function" }, 360 | -- Attributes 361 | { 362 | pattern = "[a-z%-]+%s*()=%s*()\".-\"", 363 | type = { "keyword", "operator", "string" } 364 | }, 365 | { 366 | pattern = "[a-z%-]+%s*()=%s*()'.-'", 367 | type = { "keyword", "operator", "string" } 368 | }, 369 | { 370 | pattern = "[a-z%-]+%s*()=%s*()%-?%d[%d%.]*", 371 | type = { "keyword", "operator", "number" } 372 | }, 373 | -- Entities 374 | { pattern = "&#?[a-zA-Z0-9]+;", type = "keyword2" }, 375 | 376 | ---- Markdown rules 377 | -- math 378 | { pattern = { "%$%$", "%$%$", "\\" }, type = "string", syntax = ".tex"}, 379 | { pattern = { "%$", "%$", "\\" }, type = "string", syntax = ".tex"}, 380 | -- code blocks 381 | { pattern = { "```c++", "```" }, type = "string", syntax = ".cpp" }, 382 | -- ... there's some other patterns here, but I removed them for brevity 383 | { pattern = { "```lobster", "```" }, type = "string", syntax = ".lobster" }, 384 | { pattern = { "```", "```" }, type = "string" }, 385 | { pattern = { "``", "``" }, type = "string" }, 386 | { pattern = { "%f[\\`]%`[%S]", "`" }, type = "string" }, 387 | -- strike 388 | { pattern = { "~~", "~~" }, type = "keyword2" }, 389 | -- highlight 390 | { pattern = { "==", "==" }, type = "literal" }, 391 | -- lines 392 | { pattern = "^%-%-%-+\n", type = "comment" }, 393 | { pattern = "^%*%*%*+\n", type = "comment" }, 394 | { pattern = "^___+\n", type = "comment" }, 395 | -- bold and italic 396 | { pattern = { "%*%*%*%S", "%*%*%*" }, type = "markdown_bold_italic" }, 397 | { pattern = { "%*%*%S", "%*%*" }, type = "markdown_bold" }, 398 | -- handle edge case where asterisk can be at end of line and not close 399 | { 400 | pattern = { "%f[\\%*]%*[%S]", "%*%f[^%*]" }, 401 | type = "markdown_italic" 402 | }, 403 | -- alternative bold italic formats 404 | { pattern = "^___[%s%p%w]+___%s" , type = "markdown_bold_italic" }, 405 | { pattern = "^__[%s%p%w]+__%s" , type = "markdown_bold" }, 406 | { pattern = "^_[%s%p%w]+_%s" , type = "markdown_italic" }, 407 | -- heading with custom id 408 | { 409 | pattern = "^#+%s[%w%s%p]+(){()#[%w%-]+()}", 410 | type = { "keyword", "function", "string", "function" } 411 | }, 412 | -- headings 413 | { pattern = "^#+%s.+\n", type = "keyword" }, 414 | -- superscript and subscript 415 | { 416 | pattern = "%^()%d+()%^", 417 | type = { "function", "number", "function" } 418 | }, 419 | { 420 | pattern = "%~()%d+()%~", 421 | type = { "function", "number", "function" } 422 | }, 423 | -- definitions 424 | { pattern = "^:%s.+", type = "function" }, 425 | -- emoji 426 | { pattern = ":[a-zA-Z0-9_%-]+:", type = "literal" }, 427 | -- images and link 428 | { 429 | pattern = "!?%[!?%[()["..in_squares_match.."]+()%]%(()["..in_parenthesis_match.."]+()%)%]%(()["..in_parenthesis_match.."]+()%)", 430 | type = { "function", "string", "function", "number", "function", "number", "function" } 431 | }, 432 | { 433 | pattern = "!?%[!?%[?()["..in_squares_match.."]+()%]?%]%(()["..in_parenthesis_match.."]+()%)", 434 | type = { "function", "string", "function", "number", "function" } 435 | }, 436 | -- reference links 437 | { 438 | pattern = "%[()["..in_squares_match.."]+()%] *()%[()["..in_squares_match.."]+()%]", 439 | type = { "function", "string", "function", "function", "number", "function" } 440 | }, 441 | { 442 | pattern = "!?%[%^?()["..in_squares_match.."]+()%]", 443 | type = { "function", "number", "function" } 444 | }, 445 | -- url's and email 446 | { 447 | pattern = "<[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+%.[a-zA-Z0-9-.]+>", 448 | type = "function" 449 | }, 450 | { pattern = "", type = "function" }, 451 | { pattern = "https?://%S+", type = "function" }, 452 | -- optimize consecutive dashes used in tables 453 | { pattern = "%-+", type = "normal" }, 454 | }, 455 | symbols = { }, 456 | } 457 | 458 | -- Adjust the color on theme changes 459 | core.add_thread(function() 460 | while true do 461 | if initial_color ~= style.syntax["keyword2"] then 462 | for _, attr in pairs({"bold", "italic", "bold_italic"}) do 463 | style.syntax["markdown_"..attr] = style.syntax["keyword2"] 464 | end 465 | initial_color = style.syntax["keyword2"] 466 | end 467 | coroutine.yield(1) 468 | end 469 | end) 470 | ``` 471 | 472 | ### Syntax fonts (Since 1.16.10) 473 | 474 | The syntax allows users to set different font styles (bold, italic, etc.) for different patterns. 475 | To change the font style of a token, add a Font to `style.syntax_fonts[token_type]`. 476 | For example: 477 | ``` 478 | -- will ensure every "fancysyntax_fancy_token" is italic 479 | style.syntax_fonts["fancysyntax_fancy_token"] = renderer.font.load("myfont.ttf", 14 * SCALE, { italic = true }) 480 | ``` 481 | 482 | The markdown example automates this with a for loop. 483 | 484 | The limitations here are that fonts cannot be copied with different attributes, thus the font path has to be hardcoded. 485 | Other than that, abusing `style.syntax_fonts` may lead to **slow performance** and **high memory consumption**. 486 | This is very obvious when the user tries to resize the editor with `ctrl-scroll` or `ctrl+` and `ctrl-`. 487 | Please use it in moderation. 488 | 489 | ### Space handling (v2.1 (upcoming) / `master`) 490 | 491 | By default, Lite XL prepends a pattern `{ pattern = "%s+", type = "normal" }` to the syntax. 492 | This improves the performance drastically on lines that starts with whitespaces (eg. heavily indented lines) 493 | by matching the whitespace before other patterns in order to prevent Lite XL from iterating the entire syntax. 494 | However, there may be syntaxes that require matching spaces (eg. Markdown with indented blocks) 495 | so this can be disabled by setting `space_handling` to `false.` 496 | 497 | > To keep the space handling optimization or to support older versions of Lite XL, 498 | > `{ pattern = "%s+", type = "normal" }` can be added after patterns that require space. 499 | 500 | ### Simple patterns with multiple tokens (v1.16.10) 501 | 502 | This is an excerpt taken from the markdown plugin: 503 | 504 | ```lua 505 | local in_squares_match = "^%[%]" 506 | -- reference links 507 | { 508 | pattern = "^%s*%[%^()["..in_squares_match.."]+()%]: ", 509 | type = { "function", "number", "function" } 510 | }, 511 | ``` 512 | 513 | Sometimes it makes sense to highlight different parts of a pattern differently. 514 | An empty parentheses (`()`) in Lua patterns will return the position of the text in the parentheses. 515 | This will tell Lite XL when to change the type of token. 516 | For instance, `^%s*%[%^` is `"function"`, `["..in_squares_match.."]+` is `"number"` and `%]: ` is `"function"`. 517 | 518 | ### Subsyntaxes (Since v1.16.10) 519 | 520 | Lite XL supports embedding another syntax into the existing syntax. 521 | This is used to support code blocks inside the markdown syntax. 522 | 523 | For example: 524 | ```lua 525 | { pattern = { "```cpp", "```" }, type = "string", syntax = ".cpp" }, 526 | ``` 527 | 528 | This would highlight `` ```cpp `` and `` ``` `` with `"string"` while everything inside them will be highlighted with a syntax that matches `".cpp"`. -------------------------------------------------------------------------------- /locales/en/tutorials/system-fonts.md: -------------------------------------------------------------------------------- 1 | # Using system fonts 2 | 3 | lite-xl does not provide a convenient way to use fonts on the system. 4 | There is literally _different APIs for the each platforms we support (Windows, Linux and Mac). 5 | This is where [fontconfig][1] comes to our rescue. fontconfig is 6 | installable on a lot of OSes. 7 | 8 | lite-xl has a [fontconfig plugin][2] that we can use to find system fonts. 9 | 10 | ## Installing fontconfig 11 | #### Windows 12 | [mingw-w64-fontconfig][3] provides a build that can be used directly on Windows. 13 | Download the file, extract it to somewhere and (optionally) add it to the PATH. 14 | 15 | #### Linux 16 | Check your distro-specific instructions. 17 | 18 | ```sh 19 | # ubuntu / debian 20 | apt install fontconfig 21 | # arch 22 | pacman -Su fontconfig 23 | # fedora 24 | dnf install fontconfig 25 | ... 26 | ``` 27 | 28 | #### MacOS 29 | 30 | ```sh 31 | brew install fontconfig 32 | ``` 33 | 34 | ### Setting up 35 | 36 | 1. Install the plugin 37 | 2. Put this in your user module: 38 | 39 | ```lua 40 | local fontconfig = require "plugins.fontconfig" 41 | fontconfig.use { 42 | font = { name = "sans", size = 13 * SCALE }, 43 | code_font = { name = "monospace", size = 13 * SCALE } 44 | } 45 | ``` 46 | 47 | `"sans"` and `"monospace"` can be any [fontconfig syntax. (check "Font Names")][4] 48 | 49 | 50 | Note that the font might not load immediately (because we need to wait for `fc-match` to return. 51 | If you want that, replace `fontconfig.use` with `fontconfig.use_blocking`. Doing this will force 52 | lite-xl to wait for `fc-match`, which can be much slower. 53 | 54 | 55 | [1]: https://www.freedesktop.org/wiki/Software/fontconfig/ 56 | [2]: https://github.com/lite-xl/lite-xl-plugins/blob/master/plugins/fontconfig.lua 57 | [3]: https://github.com/takase1121/mingw-w64-fontconfig 58 | [4]: https://www.freedesktop.org/software/fontconfig/fontconfig-user.html 59 | -------------------------------------------------------------------------------- /site.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'redcarpet' 3 | require 'redcarpet/render_strip' 4 | require 'rouge' 5 | require 'json' 6 | require 'fileutils' 7 | 8 | class RedRouge < Redcarpet::Render::HTML 9 | def block_code(code, language) 10 | "
" + Rouge.highlight(code, language || "bash", 'html') + "
" 11 | end 12 | 13 | def link(link, title, link_content) 14 | # make all external and asset links to open in new tab 15 | "#{link_content}" 16 | end 17 | end 18 | 19 | class StripMore < Redcarpet::Render::StripDown 20 | def link(link, title, content) content end 21 | end 22 | 23 | def slugify(name) 24 | name 25 | .downcase 26 | .gsub(/[^a-z0-9]+/, "-") # replace non-url friendly characters with dashes 27 | .gsub(/\-+/, "-") # remove duplicate dashes 28 | .gsub(/^\-|\-$/, "") # remove trailing dashes 29 | end 30 | 31 | 32 | 33 | # config options 34 | root = ENV.fetch("SITE_ROOT", "") 35 | domain = ENV.fetch("SITE_DOMAIN", "https://lite-xl.com") 36 | default_locale = ENV.fetch("SITE_LOCALE", "en") 37 | verbose = ENV.key?("VERBOSE") 38 | generateIndex = !ENV.key?("INDEX") 39 | 40 | 41 | 42 | indexFile = [] 43 | root = root.gsub(/\/\\$/, "") + "/" unless root == "" 44 | FileUtils.rm_rf(root) unless root == "" 45 | renderer = Redcarpet::Markdown.new(RedRouge.new(with_toc_data: true), { fenced_code_blocks: true, tables: true, footnotes: true }) 46 | stripRenderer = Redcarpet::Markdown.new(StripMore, { fenced_code_blocks: true, tables: true, footnotes: true }) 47 | files = Dir 48 | .glob("locales/*") 49 | .map { |x| x.gsub("locales/", "") } 50 | .map { |locale| 51 | template = File.read("locales/#{locale}/template.html") 52 | FileUtils.rm_rf(root + locale) 53 | 54 | # process markdown files 55 | files = Dir 56 | .glob("locales/#{locale}/**/*.md") 57 | .select { |x| File.file?(x) } 58 | .map { |path| 59 | basename = path.gsub("locales/#{locale}", "").gsub(/.\w+$/, "") 60 | basepath = path.gsub("locales/#{locale}", "") 61 | original_lang_path = File.expand_path("locales/#{default_locale}/#{basepath}") 62 | 63 | original_newer = begin locale != default_locale && File.mtime(original_lang_path) > File.mtime(path) ? "block" : "none" rescue "none" end 64 | puts("#{original_lang_path} is newer than #{original_lang_path}") if verbose && original_newer == "block" 65 | 66 | # the slugs produced by target and id is different, as target slugifies each component 67 | # while id slugifies everything. For instance, path "/locale/en/magic!I don't know" produces 68 | # target = /en/magic-i-don-t-know 69 | # id = magic-i-don-t-know 70 | target = File.join(Pathname(locale + basename).each_filename.map { |component| slugify(component) }) + ".html" 71 | 72 | FileUtils.mkdir_p(root + File.dirname(target)) unless Dir.exist?(root + File.dirname(target)) 73 | mdContent = File.read(path) 74 | contents = renderer.render(mdContent) 75 | title = (contents.scan(/<\s*h1.*?>(.*?)<\s*\/h1\s*>/).first || ["Lite XL"]).first 76 | title = "Lite XL - #{title}" unless title == "Lite XL" 77 | id = slugify(basename) 78 | 79 | contents = template 80 | .gsub("{{ page }}", contents) 81 | .gsub("{{ title }}", title) 82 | .gsub("{{ id }}", id) 83 | .gsub("{{ lang }}", locale) 84 | .gsub("{{ path }}", File.join(Pathname(basename).each_filename.map { |component| component == "index" ? "" : slugify(component) })) 85 | .gsub("{{ original_ver_is_newer }}", original_newer) 86 | File.write(root + target, contents) 87 | 88 | if generateIndex 89 | # this is inflexible; we need to rework this 90 | categories = Pathname(basename).each_filename.map { |component| slugify(component) } 91 | categories.pop 92 | stripContent = stripRenderer 93 | .render(mdContent) 94 | .gsub(/ {2,}/, '\t') # attempt to compact indentation 95 | .gsub(/([\r\n\t\v])+/, '\1') # remove duplicate space 96 | .strip 97 | indexFile.append({ 98 | "id" => target, 99 | "title" => title, 100 | "category" => categories, 101 | "content" => stripContent 102 | }) 103 | end 104 | 105 | 106 | # return target filename for sitemap 107 | target 108 | } 109 | 110 | # html file passthrough 111 | files + Dir 112 | .glob("locales/#{locale}/**/*.html") 113 | .select { |file| file != "locales/#{locale}/template.html" } 114 | .map { |file| [file, root + file.gsub("locales/", "")] } 115 | .each { |(src, dest)| FileUtils.copy_file(src, dest, true, true) } 116 | .map { |(_, dest)| dest } 117 | } 118 | .flatten 119 | .each { |path| puts("#{path} generated.") if verbose } 120 | .map { |path| "#{domain}/#{path == "index.html" ? '' : path}" } 121 | .unshift(domain) # prepend the domain 122 | 123 | # write sitemap 124 | File.write("#{root}sitemap.txt", files.join("\n") + "\n") 125 | 126 | # generate index file 127 | File.write("#{root}posts.json", JSON.generate(indexFile)) if generateIndex 128 | 129 | # copy index.html for default locale 130 | unless File.symlink?("#{root}index.html") 131 | FileUtils.copy_file("#{root}#{default_locale}/index.html", "#{root}index.html") 132 | end 133 | 134 | # copy other files 135 | unless root == "" 136 | FileUtils.cp_r("assets", "#{root}assets") 137 | FileUtils.copy_file("404.html", "#{root}404.html") 138 | end 139 | --------------------------------------------------------------------------------