From 641b8fb825dfe713a2e4dda2b64b4b775c10b28d Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Wed, 26 Mar 2025 14:07:27 +0100 Subject: [PATCH] update vim syntax --- vim/navigate.md | 47 ++++++++++++++++--------------------------- vim/vim-completion.md | 8 ++++---- vim/vim-search.md | 10 ++++----- vim/vim-windows.md | 16 +++++++-------- vim/vim_in_bash.md | 2 +- vim/vim_tricks.md | 3 ++- 6 files changed, 37 insertions(+), 49 deletions(-) diff --git a/vim/navigate.md b/vim/navigate.md index c40054e..4b8de50 100644 --- a/vim/navigate.md +++ b/vim/navigate.md @@ -1,34 +1,21 @@ --- title: "vim navigation" -tags: [ "vim" ] +tags: [ "vim", "navigation" ] --- -| Move | Command | -|:-----|:-------------| -|Down page | C-f | -| Down half page | C-d | -| Up page | C-b | -| Up half page | C-u | - -## Scroll - -> C-e - -> C-y - -## Jumps - -Go through your last jumps: - -> C-I - -> C-O - -Go to the last and previous places you've changed: - -> g; - -> g, +| Move | Command | +|:------------------------|:-------------| +| Down page | Ctl-f | +| Down half page | Ctl-d | +| Up page | Ctl-b | +| Up half page | Ctl-u | +| Scroll down | Ctl-e | +| Scroll up | Ctl-y | +| Jump to previous place | Ctl-i | +| Jump to back | Ctl-o | +| Jump to last change | g; | +| Jump to next change | g, | +| Go to current filename | gf | Go to a filename, and type `gf` (Go-to-File). For example, if you put your cursor over the `~/.vimrc` in this line, you can edit your vim configuration file. @@ -39,10 +26,10 @@ For example, if you put your cursor over the `~/.vimrc` in this line, you can ed Make a 20 character 'visual split' in the current working directory ('`.`'). -> :20vs . +`:20vs .` -Change the view for this: +Swap buffer positions: -> C-w x +`C-w x` diff --git a/vim/vim-completion.md b/vim/vim-completion.md index 1714288..524b8c7 100644 --- a/vim/vim-completion.md +++ b/vim/vim-completion.md @@ -1,16 +1,16 @@ --- title: "vim completion" -tags: [ "vim" ] +tags: [ "vim", "completion" ] --- Complete the word by searching for the *n*ext similar word: -> C-n +`C-n` Complete the word by searching for a *p*revious similar word: -> C-p +`C-p` Complete the full line: -> C-x C-l +`C-x C-l` diff --git a/vim/vim-search.md b/vim/vim-search.md index 7e952d4..3963639 100644 --- a/vim/vim-search.md +++ b/vim/vim-search.md @@ -1,22 +1,22 @@ --- title: "vim search" -tags: [ "vim" ] +tags: [ "vim", "search" ] --- Search for the next and or previous occurrence of the word under your cursor with `*` and `#`. Search and replace the first 'one' found with 'two': -> :%s/one/two/ +`:%s/one/two/` Same, but replace 'one' globally: -> :%s/one/two/g +`:%s/one/two/g` Put quotes around every occurrence of `$HOME`: -> :%s/$HOME/"&" +`:%s/$HOME/"&"` Same, but add curly brackets around `$HOSTNAME`: -> :%s/$HOSTNAME/{&} +`:%s/$HOSTNAME/{&}` diff --git a/vim/vim-windows.md b/vim/vim-windows.md index 987ac39..fdd8c97 100644 --- a/vim/vim-windows.md +++ b/vim/vim-windows.md @@ -3,12 +3,12 @@ title: "vim windows" tags: [ "vim" ] --- -| Command | Keys | -|:-----|:----:| -| split window | C-w s | -| split window vertically | C-w v | -| close window | C-q | -| change window | C-w w | -| rotate windows | C-w r | -| split open new file | :sf path/file | +| Command | Keys | +|:--------------------------|:-------------------:| +| split window | `C-w s` | +| split window vertically | `C-w v` | +| close window | `C-q` | +| change window | `C-w w` | +| rotate windows | `C-w r` | +| split open new file | `:sf $filepath` | diff --git a/vim/vim_in_bash.md b/vim/vim_in_bash.md index e045510..b0d28fe 100644 --- a/vim/vim_in_bash.md +++ b/vim/vim_in_bash.md @@ -7,7 +7,7 @@ Put bash in vim mode! Place the following in your `~/.inputrc`: -```bash +``` set editing-mode vi set show-mode-in-prompt on set vi-ins-mode-string \1\e[33;32m\2[>]=\1\e[0m\2 diff --git a/vim/vim_tricks.md b/vim/vim_tricks.md index e30b171..e873e11 100644 --- a/vim/vim_tricks.md +++ b/vim/vim_tricks.md @@ -1,9 +1,10 @@ --- title: "Vim Tricks" tags: [ "vim" ] +requiered: [ "ssh" ] --- ## Remote Editing -> vim scp://*user*@*myserver*[:*port*]//*path/to/file.txt* +`vim scp://*user*@*myserver*[:*port*]//*path/to/file.txt*`