<commit_before>#+TITLE: VIM

* Useful commands to remember

** Line numbering
Toggle line numbering with the following commands

#+BEGIN_SRC vim
:set number
:set nonumber
#+END_SRC

** Ex Commands

- @: :: repeat last command
- :{range}t{address} :: copy range of lines to line below specified address
- :{range}m{address} :: move range of lines to line below specified address

* HELP

** Generic help

Simply type ~:help~ or ~F1~ key to get into vims generic help.

This has lots of good information including how to jump in and out of files.

** Jump in and out of files

~CTRL - ]~ will jump into a topic that is tagged (between bars)
~CTRL - O~ or ~CTRL -T~ will jump back.

** Specific help

To get help on a specific topic

~:help topic~

* Vimrc and alternative configurations
All configutations are stored in a ~.vimrc~ file. This file is loaded
by default when you launch vim. Howerver vim can be launced with an
alternative configuration file using the ~-u~ switch.

This can be useful for things such as:
- playing vimgolf without amending your vim configuration
- for testing out new configurations
- for using a special configuration for a specialised task
- for vim / vimscript learning in a safe enviroment

To launch vim you a configuration file called ~my_vim_config~ in your
home directory you would enter the command:

#+BEGIN_SRC shell
vim -u ~/my_vim_config
#+END_SRC

** set nocp gotcha

When vim is launched and you have a ~/.vimrc file then ~set nocp~ is
enabled by default and you do not have to enable it explicitly.
If you don't enable it vim will be backward compatible with vi and
some vim features won't work.

When launching vim with a custom config file you need to either:

- ~set nocp~ in your custom config file
- launch ~-N~ swithch
  ~vim -Nu my_vim_config~
<commit_msg>fix typos and code highlighting issues<commit_after>#+TITLE: VIM

* Useful commands to remember

** Line numbering
Toggle line numbering with the following commands

#+BEGIN_SRC vim
:set number
:set nonumber
#+END_SRC

** Ex Commands

- @: :: repeat last command
- :{range}t{address} :: copy range of lines to line below specified address
- :{range}m{address} :: move range of lines to line below specified address

* HELP

** Generic help

Simply type ~:help~ or ~F1~ key to get into vims generic help.

This has lots of good information including how to jump in and out of files.

** Jump in and out of files

~CTRL - ]~ will jump into a topic that is tagged (between bars)
~CTRL - O~ or ~CTRL -T~ will jump back.

** Specific help

To get help on a specific topic

~:help topic~

* Vimrc and alternative configurations
All configutations are stored in a =~/.vimrc= file. This file is loaded
by default when you launch vim. Howerver vim can be launced with an
alternative configuration file using the ~-u~ switch.

This can be useful for things such as:
- playing vimgolf without amending your vim configuration
- for testing out new configurations
- for using a special configuration for a specialised task
- for vim / vimscript learning in a safe enviroment

To launch vim you a configuration file called ~my_vim_config~ in your
home directory you would enter the command:

#+BEGIN_SRC shell
vim -u ~/my_vim_config
#+END_SRC

** set nocp gotcha

When vim is launched and you have a =~/.vimrc= file then =set nocp= is
enabled by default and you do not have to enable it explicitly.
If you don't enable it vim will be backward compatible with vi and
some vim features won't work.

When launching vim with a custom config file you need to either:

- ~set nocp~ in your custom config file
- launch ~-N~ switch
  ~vim -Nu my_vim_config~

{'fraction_non_alphanumeric': 0.06476399560922064, 'fraction_numerical': 0.0005488474204171241, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6394654', 'n_tokens_mistral': 1111, 'n_tokens_neox': 1065, 'n_words': 569}