Adds text width and capital movement mappings

master
Jonathan Hodgson 4 years ago
parent e83e46be9b
commit 3b3e0b2d16
  1. 51
      vimrc

51
vimrc

@ -17,12 +17,6 @@ call pathogen#helptags()
let mapleader = "\<Space>"
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 <Esc>
" Fix previous spelling mistake in insert mode
inoremap <C-l> <c-g>u<Esc>[s1z=`]a<c-g>u
" 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 <leader>H H
vnoremap <leader>H H
nnoremap <leader>l L
vnoremap <leader>l L
nnoremap <leader>j J
vnoremap <leader>j J
" Since H and L are now <leader> h/l, also do the same for M
nnoremap <leader>m M
vnoremap <leader>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 <localleader>p :.!pandoc -t latex -f markdown-auto_identifiers --wrap=preserve<cr>
@ -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

Loading…
Cancel
Save