]> code.delx.au - dotfiles/blob - .vim/commands.vim
Vim has latex report abbreviation
[dotfiles] / .vim / commands.vim
1 " Python Calculator
2 command! -nargs=+ Calc :r! python -c "from math import *; print <args>"
3
4 " Unhighlight search results
5 map <C-l> :nohlsearch<CR>:redraw!<CR>
6
7 " Map Y to be consistent with D, C, etc
8 noremap Y y$
9
10 " CTRL-n and CTRL-p to go forwards and backwards through files
11 nnoremap <C-n> :next<CR>
12 nnoremap <C-p> :prev<CR>
13
14 " Press CTRL-X after pasting something to fix up formatting
15 imap <C-z> <ESC>u:set paste<CR>.:set nopaste<CR>i
16
17 " Spell checking mode toggle
18 function s:spell()
19 if !exists("s:spell_check") || s:spell_check == 0
20 echo "Spell check on"
21 let s:spell_check = 1
22 setlocal spell spelllang=en_au
23 else
24 echo "Spell check off"
25 let s:spell_check = 0
26 setlocal spell spelllang=
27 endif
28 endfunction
29 map <F8> :call <SID>spell()<CR>
30 imap <F8> <C-o>:call <SID>spell()<CR>
31