Compare commits
3 Commits
2d100c06fe
...
4b0f405e1e
Author | SHA1 | Date |
---|---|---|
Jake | 4b0f405e1e | |
Jake | 9ccf8d40ef | |
Jake | 5c97632908 |
|
@ -39,7 +39,8 @@ title: jakew
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr class="zig">
|
||||||
|
<hr class="zag">
|
||||||
|
|
||||||
{{ content | safe }}
|
{{ content | safe }}
|
||||||
</main>
|
</main>
|
||||||
|
|
5
index.md
5
index.md
|
@ -7,16 +7,11 @@ eleventyNavigation:
|
||||||
|
|
||||||
Welcome, I'm Jake! I'm from the UK and I love to tinker around with things.
|
Welcome, I'm Jake! I'm from the UK and I love to tinker around with things.
|
||||||
|
|
||||||
<hr class="zig">
|
|
||||||
<hr class="zag">
|
|
||||||
|
|
||||||
## sl projects
|
## sl projects
|
||||||
|
|
||||||
- [tips](/~jakew/tips)
|
- [tips](/~jakew/tips)
|
||||||
|
|
||||||
<hr class="zig">
|
|
||||||
<hr class="zag">
|
|
||||||
|
|
||||||
## where you can find me
|
## where you can find me
|
||||||
|
|
||||||
- IRC: jakew on [irc.tilde.chat](https://tilde.chat)
|
- IRC: jakew on [irc.tilde.chat](https://tilde.chat)
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
---
|
||||||
|
title: Micro Editor
|
||||||
|
date: 2021-04-06
|
||||||
|
description: Editing code in a shell without going insane with Micro.
|
||||||
|
---
|
||||||
|
|
||||||
|
There's a couple of options available when it comes to editing code on a tilde like South London. The first ones that come to mind are probably `nano`, `vim`/`vi`/`neovim` and `emacs`. I usually end up using `vim` or `nano` if I have something quick to edit like a config file, but editing whole scripts and things is where they start to be a bit frustrating. Micro is an excellent editor that you can install quickly and makes your life a lot easier with mouse support and sane keyboard shortcuts.
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
Firstly, we need somewhere to install Micro, so lets make a folder at `~/.local/bin`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir -p ~/.local/bin
|
||||||
|
cd ~/.local/bin
|
||||||
|
```
|
||||||
|
|
||||||
|
Now lets run the install script. You should inspect the contents before running by just leaving the `bash` command off the end.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl https://getmic.ro | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
The installer script should automatically detect your architecture and operating system and download the relavent version to the folder that you are in.
|
||||||
|
|
||||||
|
Finally, we need to tell our shell that we have programs installed in `~/.local/bin` that we want to use. We can do that by adding the following line to the **bottom** of the `~/.bashrc` file.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# other things...
|
||||||
|
|
||||||
|
export PATH="${PATH}:~/.local/bin"
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Now that we've got Micro installed, simply run `micro` with a filename to open a file.
|
||||||
|
|
||||||
|
```
|
||||||
|
micro ~/public_html/index.html
|
||||||
|
```
|
||||||
|
|
||||||
|
You have the regular keyboard shortcuts you'd expect like <kbd>CTRL</kbd> + <kbd>O</kbd> and <kbd>CTRL</kbd> + <kbd>S</kbd> for open and save respectively.
|
||||||
|
|
||||||
|
You can use <kbd>CTRL</kbd> + <kbd>E</kbd> to run editor commands like these useful ones:
|
||||||
|
|
||||||
|
- `help`: get help on how to use the editor
|
||||||
|
- `open /path/to/file`: open a file
|
||||||
|
- `save`: save the opened file
|
||||||
|
- `vsplit /path/to/file`: split the editor vertically, opening the given file in the new split (<kbd>CTRL</kbd> + <kbd>W</kbd> to switch between splits, <kbd>CTRL</kbd> + <kbd>Q</kbd> to close the split)
|
||||||
|
- `hsplit /path/to/file`: same as a vertical split, but you guessed it, horizontal instead
|
||||||
|
- `set <option> <value>`: configure the editor, see below for some useful options
|
||||||
|
|
||||||
|
### Useful options
|
||||||
|
|
||||||
|
- `set clipboard internal`: this either needs to be set to `terminal` or `internal` as we'll be using Micro over SSH, otherwise if you installed it on your local computer, you'd set this to `external`. `internal` just keeps the copy and paste buffer inside the editor rather than copying to your system clipboard which I found a bit janky with `terminal`
|
||||||
|
- `set colorscheme darcula`: this sets the theme that is used for syntax highlighting. Use the command `help colors` to see the other themes that are available
|
||||||
|
- `set diffgutter true`: this shows a little colour indicator on the line number gutter to whether you have added/updated/removed lines, useful for if you are working with git.
|
|
@ -29,11 +29,13 @@ chmod +x ./install.sh
|
||||||
./install.sh --bin-dir ~/.local/bin
|
./install.sh --bin-dir ~/.local/bin
|
||||||
```
|
```
|
||||||
|
|
||||||
Finally, we need to tell our shell to load this prompt, so we can do that by adding the following line to the **bottom** of your `~/.bashrc` file like so.
|
Finally, we need to tell our shell to load this prompt and where we have our local programs, so we can do that by adding the following lines to the **bottom** of your `~/.bashrc` file like so.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# other stuff...
|
# other stuff...
|
||||||
|
|
||||||
|
export PATH="${PATH}:~/.local/bin"
|
||||||
|
|
||||||
eval "$(starship init bash)"
|
eval "$(starship init bash)"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue