diff --git a/vimrc b/vimrc index c79af7b..a725950 100644 --- a/vimrc +++ b/vimrc @@ -17,12 +17,6 @@ call pathogen#helptags() let mapleader = "\" let maplocalleader = "\\" -" Access colors present in 256 colorspace -let base16colorspace=256 - -" Set my colourscheme -colorscheme base16-gruvbox-dark-hard - " Config {{{1 " Set auto read so a file is updated if externally changed set autoread @@ -37,6 +31,26 @@ set spelllang=en_gb set splitright set splitbelow +" Generally, I want my text width to be 80 +set textwidth=80 + +" Set my colourscheme +" +" Access colors present in 256 colorspace +let base16colorspace=256 + +" Set my colourscheme +colorscheme base16-gruvbox-dark-hard + +if exists('+colorcolumn') + augroup colorcols + autocmd! + autocmd VimEnter,BufEnter,FocusGained,WinEnter * let &l:colorcolumn='+' . join(range(1,254),',+') + autocmd WinLeave,FocusLost * let &l:colorcolumn='' . join(range(0,254),',') + augroup END +endif + + " Tell vim it's a fast terminal set ttyfast @@ -304,6 +318,28 @@ inoremap jj " Fix previous spelling mistake in insert mode inoremap u[s1z=`]au +" Makes capital hjkl work as extream versions +nnoremap H ^ +vnoremap H ^ +nnoremap L $ +vnoremap L $ +nnoremap J 5j +vnoremap J 5j +nnoremap K 5k +vnoremap K 5k + +" Get back old functionality using leader +nnoremap H H +vnoremap H H +nnoremap l L +vnoremap l L +nnoremap j J +vnoremap j J + +" Since H and L are now h/l, also do the same for M +nnoremap m M +vnoremap m M + function! s:make_email_list(lines) let l:emails = [] @@ -383,6 +419,8 @@ augroup END " Add latex maps, Currently only pandoc conversion {{{2 augroup latex autocmd! + autocmd FileType tex,latex setlocal spell + autocmd FileType tex,latex setlocal textwidth=100 " Run current line through pandoc. " Convert from markdown to latex autocmd FileType tex,latex nnoremap p :.!pandoc -t latex -f markdown-auto_identifiers --wrap=preserve @@ -417,6 +455,7 @@ augroup END " Make md files use spellcheck{{{2 augroup file_md autocmd! + autocmd FileType markdown setlocal textwidth=100 autocmd FileType markdown setlocal spell augroup END