-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocs.html
192 lines (179 loc) · 11.2 KB
/
docs.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!DOCTYPE html>
<html>
<head>
<title>Focus Editor</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="images/favicon.ico">
<link rel="stylesheet" href="lib/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<header class="d-flex justify-content-center py-2">
<ul class="nav nav-pills">
<li class="nav-item"><a href="index.html" class="nav-link">Home</a></li>
<li class="nav-item"><a href="docs.html" class="nav-link">Documentation</a></li>
</ul>
</header>
<br />
<div class="container">
<div class="row">
<div class="col-xs-12 col-lg-2">
<div class="sticky-top" style="top: 2em">
<h6 class="side-title">Documentation</h6>
<nav class="side-nav">
<a class="side-nav-item" href="#installation">Installation</a>
<a class="side-nav-item" href="#global-config">Global Config</a>
<a class="side-nav-item" href="#projects">Projects</a>
<a class="side-nav-item" href="#faq">FAQ</a>
</nav>
<br />
<br />
</div>
</div>
<div class="col-xs-12 col-lg col-pop">
<!-- ======== INSTALLATION ======== -->
<h2 class="display-7" id="installation">Installation</h2>
<p>
<a href="https://github.com/focus-editor/focus/releases" target="_blank">Download the executable</a> for your target platform and put it in any directory you like.
<br /><br />
Launch the executable. Once launched, it will generate its config files.
<ul>
<li>On Windows, it will create a <code>global.focus-config</code> file and a <code>projects</code> and <code>temp</code> folders next to itself (therefore, the directory must be writable).</li>
<li>On macOS, these files will be found in <code>/Users/YOURNAME/Library/Application Support/dev.focus-editor/</code>.</li>
<li>On Linux, these files will be found in <code>${XDG_CONFIG_HOME}/focus-editor/</code> (which usually expands to <code>${HOME}/.config/focus-editor</code>).</li>
</ul>
</p>
<p>
After installing, you can edit the <a href="#global-config">global config</a> of the editor, or create one or more <a href="#projects">projects</a> to be able to quickly switch between them.
</p>
<br />
<!-- ======== EDITOR CONFIGURATION ======== -->
<h2 class="display-7" id="global-config">Global Config</h2>
<p>
The editor is configured using a simple text file called <code>global.focus-config</code>, which you can quickly open by opening the Command Palette
(<span class="key">Alt</span>-<span class="key">X</span> by default) and selecting <code>Open Global Config</code>.
</p>
<p>
The config file is a simple text file which should be easy to read and edit to your liking. We suggest that you read through it to familiarize yourself with what options are available.
</p>
<p>
<ul>
<li>
Config files have a built-in smart highlighting, so it's best to edit them using Focus itself. In this way it should tell you about any potential problems it detects,
such as invalid editor actions, duplicate key bindings or invalid file paths.
</li>
<li>
When an active config file is saved the changes should be automatically applied. If you have edited any workspace directories, the workspace will be reloaded.
</li>
<li>
You can see whether the config file you're editing is currently active by looking at the footer, which should have a label telling you it's active:<br />
<img style="width: 500px;" alt="" src="images/active-config.png" />
</li>
</ul>
</p>
<p class="text-secondary">
NOTE: The base editor is not designed to be extensible in the same way Vim or Emacs are. Plugin support is not planned.
Any customization that is not found in the config file must be done by modifying the source code.
This is the tradeoff we are making to keep the upstream project as simple as possible,
while offering a simple and approachable codebase for those who do want to extend it.
</p>
<br />
<!-- ======== PROJECTS ======== -->
<h2 class="display-7" id="projects">Projects</h2>
<!--div class="card">
<div class="card-body">
<pre class="code">
...
[[settings]]
maximize_on_start: false
open_on_the_biggest_monitor: false
cursor_as_block: true
cursor_blink_time_in_seconds: 0
highlight_selection_occurrences: true
disable_that_annoying_paste_effect: true
disable_file_open_close_animations: true
double_shift_to_search_in_workspace: false
tab_size: 4
insert_spaces_when_pressing_tab: true
strip_trailing_whitespace_on_save: true
smooth_scrolling: false
scroll_beyond_last_line: true
line_height_scale_percent: 100
max_editor_width: -1
can_cancel_go_to_line: true
copy_whole_line_without_selection: true
...
[[keymap]]
# - The first matching combination will be used, so order matters
[editors] # <- this means that the following key combos will apply only when editing text
# Key combination Action
Alt-F4 quit
Ctrl-D select_word_or_create_another_cursor
Ctrl-Shift-A select_all_occurrences
Ctrl-Shift-D duplicate_lines
...
</pre>
</div>
</div-->
<p>
In Focus, a "project" is a user defined config file that contains project-specific settings.
A project can override any settings that are present in the global config file.
Projects can specify one or more directories to add to the active workspace.
</p>
<p class="text-secondary">
NOTE: when overriding settings with you project config bear in mind that some of the settings, such as workspace dirs, build commands etc. will completely replace
the global settings, while other options (such as keymaps or the options in the <code>[[settings]]</code> block) will be merged with the global ones, allowing you
to only replace a few and leave the rest intact.
</p>
<p><h5>Creating a new project</h5></p>
<p>
To create a new project, enter the <code>projects/</code> directory by selecting the command <code>Open Directory With Project Files</code> in the command palette
and create a new file with the following naming scheme: <code>Your Project Name.focus-config</code>.
</p>
<p>
When you first launch Focus, there will be an <code>Example Project.focus-config</code> available for
reference in the <code>projects</code> directory.
</p>
<p><h5>Switching to project</h5></p>
<p>
In the editor, executing the <code>Switch To Project</code> command will display a menu of available projects to switch to.
When you switch to a project, Focus scans the configured workspace directories and loads all text files.
Commands such as <code>Search In Workspace</code> will operate over all loaded files.
</p>
<p class="text-secondary">
NOTE: when you switch to project or modify the list of workspace dirs in any way, the existing workspace will be removed and a new one will be scanned.
</p>
<p>
Alternatively, you can load projects at startup in one of the following ways:
<ul>
<li>By passing a project name as a parameter: <code>focus -project "Project Name"</code> or <code>focus -project path/to/project.focus-config</code>.</li>
<li>By passing in a directory path which contains a file named <code>.focus-config</code> (not <code>[project name].focus-config</code>!). This file will be loaded as a Focus project.</li>
<li>By launching Focus from a directory containing a file named <code>.focus-config</code>.</li>
</ul>
</p>
<p>
When a project is opened by any means it is remembered and can be then switched to using the Switch To Project command.
</p>
<p class="text-secondary">
Hint: if you want to load last project on startup, set <code>load_most_recent_project_on_start</code> to <code>true</code> in the config.
</p>
<br />
<!-- ======== FAQ ======== -->
<h2 class="display-7" id="faq">FAQ</h2>
<h5>How do I add syntax highlighting for language X?</h5>
<p>
Ask on our <a href="https://discord.gg/eSXquAzTmW">Discord server</a>. We might be able to add it or prioritize adding it.
In Focus syntax highlighting is done by writing a language lexer.
It is straightforward enough to add a lexer for a new language, but you have to have a Jai compiler.
</p>
<h5>Is there a VIM mode?</h5>
<p>
There isn't, and it's unlikely there ever will be in the base editor. Someone might fork the editor and add one someday.
</p>
<br />
<br />
</div>
</div>
</div>
</body>
</html>