<commit_before>" To activate, add the following to ~/.vimrc
" source $HOME/.vim/config.vim

" Add this before you include the config to enable light mode.
" let g:light_editor=1

" Add better UTF-8 support.
scriptencoding utf-8
set encoding=utf-8

" Make vim more useful. I think this drops vi compatibility.
" This allows vim to do a lot more and stray from it's roots.
set nocompatible

" Enable better indentation.
set autoindent smartindent
set smarttab
set tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab
let g:html_indent_inctags='html,body,head,tbody'

" More minimal sessions.
set sessionoptions=blank,curdir,folds,help,tabpages,winsize

" Persistent undo.
set undofile
set undodir=~/.vim/undo
set undolevels=1000
set undoreload=10000

" Quick session bindings.
nmap <F7> :mksession! .quicksave.vim<CR>
nmap <F8> :source .quicksave.vim<CR>

" Include all of the bundle configuration.
if !exists('g:light_editor')
	source $HOME/.vim/bundles.vim
endif

" Improve the colours.
syntax on

try
	colorscheme distinguished
	source $HOME/.vim/colorscheme-tweaks.vim
catch /^Vim\%((\a\+)\)\=:E185/
	" NO COLOUR FOR YOU
endtry

" Improve the backspace key.
set backspace=indent,eol,start

" Disable the swap files.
set noswapfile

" Enable the matchit plugin.
runtime macros/matchit.vim

" Enable virtualenv.
if has('python') && !empty($VIRTUAL_ENV)
python << EOF
import os
import sys
a = os.environ['VIRTUAL_ENV'] + '/bin/activate_this.py'
execfile(a, dict(__file__ = a))
if 'PYTHONPATH' not in os.environ:
	os.environ['PYTHONPATH'] = ''
	os.environ['PYTHONPATH'] += ':' + os.getcwd()
	os.environ['PYTHONPATH'] += ':'.join(sys.path)
EOF
endif

" Make <C-A> and <C-X> increment and decrement all numbers as decimals.
set nrformats=

" Disabled code folding. It can be weird sometimes.
set nofoldenable

" Enable the tab complete menu.
set wildmenu

" Increase the command line history length.
set history=1000

" Clears the search. (c)
nmap <silent> <leader>c/ :nohlsearch<CR>

" Corrects the spelling under the cursor with the first suggestion.
nmap <leader>z 1z=

" Shows the amount of matches for the previous search. (/)
nmap <leader>/ :%s///gn<CR>

" Strips the trailing white space from the file.
nmap <leader>w :%s/\s\+$//e<CR>

" Opens the split in a new tab. Kind like "distraction free" mode. (f)
nmap <leader>f :tab sp<CR>

" Rebuild the tags. (F5)
set tags+=.tags
command! GenerateTags call system('ctags -Rf ./.tags --python-kinds=-i --exclude=.git `cat .srclist`') | echo
nmap <F5> :GenerateTags<CR>

" Alternate escape binding.
noremap! jk <ESC>

" Show the file name in the window title bar.
set title

" Enable line numbers.
set number

" Show invisible characters.
set listchars=tab:▸\ ,trail:·
set list

" Improve screen clearing by using the background colour.
set t_ut=

" Enable mouse support.
set mouse=a

" Highlight searches.
set hlsearch

" Ignore case of searches.
set ignorecase

" If the search contains an upper-case character, become case sensitive.
set smartcase

" Highlight dynamically as pattern is typed.
set incsearch

" Set the default encoding to UTF-8.
set enc=utf-8

" Configure the spelling language and file.
set spelllang=en_gb
set spellfile=$HOME/.vim/spell/en.utf-8.add
set spell

" Disable error bells.
set noerrorbells visualbell t_vb=
augroup GUIBell
	autocmd!
	autocmd GUIEnter * set visualbell t_vb=
augroup END

" Improve the speed for updating the status line when leaving insert mode.
set ttimeoutlen=10
augroup FastEscape
	autocmd!
	au InsertEnter * set timeoutlen=0
	au InsertLeave * set timeoutlen=1000
augroup END

" Don't reset cursor to start of line when moving around.
set nostartofline

" Always show status line.
set laststatus=2

" Don't show the intro message when starting vim.
set shortmess=atI

" Disable the extra line at the end of files.
set binary
set noeol

" Start scrolling three lines before the horizontal window border.
set scrolloff=3<commit_msg>Set ttymouse to xterm2, much better.<commit_after>" To activate, add the following to ~/.vimrc
" source $HOME/.vim/config.vim

" Add this before you include the config to enable light mode.
" let g:light_editor=1

" Add better UTF-8 support.
scriptencoding utf-8
set encoding=utf-8

" Make vim more useful. I think this drops vi compatibility.
" This allows vim to do a lot more and stray from it's roots.
set nocompatible

" Enable better indentation.
set autoindent smartindent
set smarttab
set tabstop=4 softtabstop=4 shiftwidth=4 noexpandtab
let g:html_indent_inctags='html,body,head,tbody'

" More minimal sessions.
set sessionoptions=blank,curdir,folds,help,tabpages,winsize

" Persistent undo.
set undofile
set undodir=~/.vim/undo
set undolevels=1000
set undoreload=10000

" Quick session bindings.
nmap <F7> :mksession! .quicksave.vim<CR>
nmap <F8> :source .quicksave.vim<CR>

" Include all of the bundle configuration.
if !exists('g:light_editor')
	source $HOME/.vim/bundles.vim
endif

" Improve the colours.
syntax on

try
	colorscheme distinguished
	source $HOME/.vim/colorscheme-tweaks.vim
catch /^Vim\%((\a\+)\)\=:E185/
	" NO COLOUR FOR YOU
endtry

" Improve the backspace key.
set backspace=indent,eol,start

" Disable the swap files.
set noswapfile

" Enable the matchit plugin.
runtime macros/matchit.vim

" Enable virtualenv.
if has('python') && !empty($VIRTUAL_ENV)
python << EOF
import os
import sys
a = os.environ['VIRTUAL_ENV'] + '/bin/activate_this.py'
execfile(a, dict(__file__ = a))
if 'PYTHONPATH' not in os.environ:
	os.environ['PYTHONPATH'] = ''
	os.environ['PYTHONPATH'] += ':' + os.getcwd()
	os.environ['PYTHONPATH'] += ':'.join(sys.path)
EOF
endif

" Make <C-A> and <C-X> increment and decrement all numbers as decimals.
set nrformats=

" Disabled code folding. It can be weird sometimes.
set nofoldenable

" Enable the tab complete menu.
set wildmenu

" Increase the command line history length.
set history=1000

" Clears the search. (c)
nmap <silent> <leader>c/ :nohlsearch<CR>

" Corrects the spelling under the cursor with the first suggestion.
nmap <leader>z 1z=

" Shows the amount of matches for the previous search. (/)
nmap <leader>/ :%s///gn<CR>

" Strips the trailing white space from the file.
nmap <leader>w :%s/\s\+$//e<CR>

" Opens the split in a new tab. Kind like "distraction free" mode. (f)
nmap <leader>f :tab sp<CR>

" Rebuild the tags. (F5)
set tags+=.tags
command! GenerateTags call system('ctags -Rf ./.tags --python-kinds=-i --exclude=.git `cat .srclist`') | echo
nmap <F5> :GenerateTags<CR>

" Alternate escape binding.
noremap! jk <ESC>

" Show the file name in the window title bar.
set title

" Enable line numbers.
set number

" Show invisible characters.
set listchars=tab:▸\ ,trail:·
set list

" Improve screen clearing by using the background colour.
set t_ut=

" Enable mouse support.
set mouse=a
set ttymouse=xterm2

" Highlight searches.
set hlsearch

" Ignore case of searches.
set ignorecase

" If the search contains an upper-case character, become case sensitive.
set smartcase

" Highlight dynamically as pattern is typed.
set incsearch

" Set the default encoding to UTF-8.
set enc=utf-8

" Configure the spelling language and file.
set spelllang=en_gb
set spellfile=$HOME/.vim/spell/en.utf-8.add
set spell

" Disable error bells.
set noerrorbells visualbell t_vb=
augroup GUIBell
	autocmd!
	autocmd GUIEnter * set visualbell t_vb=
augroup END

" Improve the speed for updating the status line when leaving insert mode.
set ttimeoutlen=10
augroup FastEscape
	autocmd!
	au InsertEnter * set timeoutlen=0
	au InsertLeave * set timeoutlen=1000
augroup END

" Don't reset cursor to start of line when moving around.
set nostartofline

" Always show status line.
set laststatus=2

" Don't show the intro message when starting vim.
set shortmess=atI

" Disable the extra line at the end of files.
set binary
set noeol

" Start scrolling three lines before the horizontal window border.
set scrolloff=3
{'fraction_non_alphanumeric': 0.0986950462435069, 'fraction_numerical': 0.010388952236158622, 'mean_word_length': 4.403148528405202, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 41, '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': '2909122', 'n_tokens_mistral': 2774, 'n_tokens_neox': 2643, 'n_words': 970}