You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learners/setup.md
+48-19Lines changed: 48 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,80 +44,108 @@ If you are not taking this course on archer2 we recommend installing the [GFortr
44
44
45
45
## Text Editors and Integrated Development Environments (IDEs)
46
46
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)
48
55
49
56
### Emacs
50
57
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:
52
68
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
54
69
```lisp
55
70
(setq auto-mode-alist
56
71
(append '(("\\.mf90" . f90-mode)
57
72
("\\.X90" . f90-mode)
58
73
) auto-mode-alist))
59
74
```
75
+
60
76
::::::::::::::::: tab
61
77
62
-
### Windows/MacOS
78
+
### Windows and macOS
63
79
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.
65
81
66
82
### Linux
67
83
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.
69
86
70
87
### Legacy (cross platform)
71
88
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.
73
91
74
92
:::::::::::::::::::::::::
75
93
76
94
### VS Code
77
95
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.
79
105
80
106
::::::::::::::::: tab
81
107
82
108
### PyPI
83
109
84
110
```bash
85
-
pip install fortls
111
+
$ pip install fortls
86
112
```
87
113
88
114
### Anaconda
89
115
90
116
```bash
91
-
conda install -c conda-forge fortls
117
+
$ conda install -c conda-forge fortls
92
118
```
93
119
94
120
### Brew
95
121
96
122
```bash
97
-
brew install fortls
123
+
$ brew install fortls
98
124
```
99
125
100
126
### Source
101
127
102
-
The development version of `fortls` can be installed from GitHub via
128
+
The development version of `fortls` can be installed from GitHub:
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].
111
137
112
138
#### Adding a ruler
113
139
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.
115
143
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:
117
145
118
146
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.
121
149
4. Add the `editor.rulers` property to the JSON file, e.g.
122
150
123
151
```json
@@ -127,4 +155,5 @@ To add a ruler at 80 characters to your VS Code editor window, in VS Code
127
155
}
128
156
```
129
157
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