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 mapleader = "\<Space>"
let maplocalleader = "\\" let maplocalleader = "\\"
" Access colors present in 256 colorspace
let base16colorspace=256
" Set my colourscheme
colorscheme base16-gruvbox-dark-hard
" Config {{{1 " Config {{{1
" Set auto read so a file is updated if externally changed " Set auto read so a file is updated if externally changed
set autoread set autoread
@ -37,6 +31,26 @@ set spelllang=en_gb
set splitright set splitright
set splitbelow 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 " Tell vim it's a fast terminal
set ttyfast set ttyfast
@ -304,6 +318,28 @@ inoremap jj <Esc>
" Fix previous spelling mistake in insert mode " Fix previous spelling mistake in insert mode
inoremap <C-l> <c-g>u<Esc>[s1z=`]a<c-g>u 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) function! s:make_email_list(lines)
let l:emails = [] let l:emails = []
@ -383,6 +419,8 @@ augroup END
" Add latex maps, Currently only pandoc conversion {{{2 " Add latex maps, Currently only pandoc conversion {{{2
augroup latex augroup latex
autocmd! autocmd!
autocmd FileType tex,latex setlocal spell
autocmd FileType tex,latex setlocal textwidth=100
" Run current line through pandoc. " Run current line through pandoc.
" Convert from markdown to latex " Convert from markdown to latex
autocmd FileType tex,latex nnoremap <localleader>p :.!pandoc -t latex -f markdown-auto_identifiers --wrap=preserve<cr> 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 " Make md files use spellcheck{{{2
augroup file_md augroup file_md
autocmd! autocmd!
autocmd FileType markdown setlocal textwidth=100
autocmd FileType markdown setlocal spell autocmd FileType markdown setlocal spell
augroup END augroup END

Loading…
Cancel
Save