Skip to content

Commit 4a05cb6

Browse files
#41 Simplifies the language in the Text Editor and IDE Setup Section
* Simplifies the language slightly and ensures the reading flows in a similar voice * Fixes vscode Fortran extension link and splits line
1 parent 9577bff commit 4a05cb6

File tree

1 file changed

+48
-19
lines changed

1 file changed

+48
-19
lines changed

learners/setup.md

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,80 +44,108 @@ If you are not taking this course on archer2 we recommend installing the [GFortr
4444

4545
## Text Editors and Integrated Development Environments (IDEs)
4646

47-
While Fortran files are plain text and can be edited with any plain text editor, it is recommened that you use an editor that is capable of _syntax highlighting_. Setup instructions for some editors are available below.
47+
Fortran files are plain text and can be edited with any plain text editor.
48+
We recommend you use an editor that is capable of ***syntax highlighting***.
49+
Setup instructions for some editors are available below.
50+
51+
Editor Setup Quick Links:
52+
53+
- [Emacs](#emacs)
54+
- [VS Code](#vs-code)
4855

4956
### Emacs
5057

51-
[Emacs][emacs-link] is a cross-platform text editor available for Linux, MacOS, and Windows. Emacs applies syntax highlighting for most Fortran files, but additional file extensions, such as `.X90` may be valid Fortran files but will not be picked up in Emacs _f90-mode_. This mode allows for tab-completion of Fortran statements and the addition of a drop-down menu that provides additional Fortran-related options.
58+
[Emacs][emacs-link] is a cross-platform text editor available for Linux, macOS, and Windows.
59+
Emacs applies syntax highlighting for most Fortran files.
60+
Emacs ***f90-mode*** mode lets you tab complete Fortran statements.
61+
It also adds a drop-down menu providing additional Fortran-related options.
62+
63+
Fortran files with different extensions, such as `.X90`, will not be picked up in this mode.
64+
Files can be manually set to ***f90-mode*** using `M-x f90-mode`.
65+
File extensions can be added to your [Emacs initialization file][emacs-init-link]
66+
so they are recognised as Fortran when opened.
67+
To add this to your initialisation file:
5268

53-
Files can be manually set to f90-mode using `M-x f90-mode`, but file extensions can be added to your [Emacs initialization file][emacs-init-link] to ensure that these are recognised when opened. The format for this is
5469
```lisp
5570
(setq auto-mode-alist
5671
(append '(("\\.mf90" . f90-mode)
5772
("\\.X90" . f90-mode)
5873
) auto-mode-alist))
5974
```
75+
6076
::::::::::::::::: tab
6177

62-
### Windows/MacOS
78+
### Windows and macOS
6379

64-
From your home directory, initialization settings can be placed within your `.emacs.d/init.el` file.
80+
From your home directory, initialization settings are placed in your `.emacs.d/init.el` file.
6581

6682
### Linux
6783

68-
Initialization settings can be placed within your `~/.config/emacs/init.el` file. This location follows the Linux desktop environment guidelines.
84+
Initialization settings are placed in your `~/.config/emacs/init.el` file.
85+
This location follows the Linux desktop environment guidelines.
6986

7087
### Legacy (cross platform)
7188

72-
The `.emacs` or `.emacs.el` file is an older method of configuring Emacs. This file is held in your home directory.
89+
The `.emacs` or `.emacs.el` file is an older method of configuring Emacs.
90+
This file is stored in your home directory.
7391

7492
:::::::::::::::::::::::::
7593

7694
### VS Code
7795

78-
[Visual Studio Code (VS Code)][vscode-link] is a powerful IDE available for Linux, macOS, and Windows. To bring the power of VS Code to bear on Fortran, two additions are required. The [Modern Fortran extension](vscode-modern-fortran) enhances Fortran support in VS Code, offering features such as syntax highlighting, IntelliSense for Fortran statements, and debugging capabilities, along with customization options to improve the coding experience for Fortran developers. The Modern Fortran extension depends on `fortls`: a language server that interfaces with the code editor.
96+
[Visual Studio Code (VS Code)][vscode-link] is another powerful cross-platform IDE.
97+
To use VS Code with Fortran we recommend two additions:
98+
99+
- The [Modern Fortran extension][vscode-modern-fortran] provides syntax highlighting,
100+
IntelliSense for Fortran statements, and debugging capabilities.
101+
It also adds customization options to improve the coding experience for Fortran developers.
102+
- The Modern Fortran extension depends on `fortls`: a language server that interfaces VS Code.
103+
104+
`fortls` must be installed before the Modern Fortran extension.
79105

80106
::::::::::::::::: tab
81107

82108
### PyPI
83109

84110
```bash
85-
pip install fortls
111+
$ pip install fortls
86112
```
87113

88114
### Anaconda
89115

90116
```bash
91-
conda install -c conda-forge fortls
117+
$ conda install -c conda-forge fortls
92118
```
93119

94120
### Brew
95121

96122
```bash
97-
brew install fortls
123+
$ brew install fortls
98124
```
99125

100126
### Source
101127

102-
The development version of `fortls` can be installed from GitHub via
128+
The development version of `fortls` can be installed from GitHub:
103129

104130
```bash
105-
pip install --user --upgrade git+git://github.com/fortran-lang/fortls
131+
$ pip install --user --upgrade git+git://github.com/fortran-lang/fortls
106132
```
107133

108134
:::::::::::::::::::::::::
109135

110-
Once `fortls` is installed, install the [Modern Fortran extension](vscode-modern-fortran), and it should work out of the box.
136+
Once `fortls` is installed, install the [Modern Fortran extension][vscode-modern-fortran].
111137

112138
#### Adding a ruler
113139

114-
We recommend adding a ruler: essentially a vertical line in the editor which gives you a visual guide as to the number of characters you should include on a single line of code.
140+
We recommend adding a ruler.
141+
This is a vertical line in the editor after a set number of characters.
142+
Rulers help avoid long lines that are hard to read.
115143

116-
To add a ruler at 80 characters to your VS Code editor window, in VS Code
144+
To add a ruler at 80 characters:
117145

118146
1. Open the Command Palette (Press `Cmd+Shift+P`, or `Ctrl+Shift+P`)
119-
2. Type 'settings' and then select the option which says "Preferences: Open User Settings (JSON)"
120-
3. This should open the `settings.json` file in your editor. It may already have code in it.
147+
2. Type 'settings'. Then select the option which says "Preferences: Open User Settings (JSON)"
148+
3. This will open the `settings.json` file in your editor.
121149
4. Add the `editor.rulers` property to the JSON file, e.g.
122150

123151
```json
@@ -127,4 +155,5 @@ To add a ruler at 80 characters to your VS Code editor window, in VS Code
127155
}
128156
```
129157

130-
If you save the file, you should immediately see a vertical line appear in your editor.
158+
Save the file.
159+
You should see a vertical line appear in your editor.

0 commit comments

Comments
 (0)