vimrc additions and deadkeys

This commit is contained in:
Luke 2018-01-21 19:44:23 -07:00
parent a977b8b5f5
commit fe22a1e233
3 changed files with 456 additions and 72 deletions

136
.vim/luke/deadkeys.vim Normal file
View file

@ -0,0 +1,136 @@
let g:DeadKeysOn=0
function! ToggleDeadKeys()
if !g:DeadKeysOn
call DeadKeys()
else
call DeadKeysOff()
endif
endfunction
function! DeadKeys()
echo "Dead Keys: On"
let g:DeadKeysOn=1
" grave accents
imap `a à
imap `e è
imap `i ì
imap `o ò
imap `u ù
imap `A À
imap `E È
imap `I Ì
imap `O Ò
imap `U Ù
imap `<space> `
" umlaut
imap "a ä
imap "e ë
imap "i ï
imap "o ö
imap "u ü
imap "A Ä
imap "E Ë
imap "I Ï
imap "O Ö
imap "U Ü
imap "<space> "
" macrons
imap :a ā
imap :e ē
imap :i ī
imap :o ō
imap :u ū
imap :A Ā
imap :E Ē
imap :I Ī
imap :O Ō
imap :U Ū
" acute accents
imap 'a á
imap 'A Á
imap 'C Ć
imap 'c ć
imap 'e é
imap 'E É
imap 'i í
imap 'I Í
imap 'N Ń
imap 'n ń
imap 'o ó
imap 'R Ŕ
imap 'r ŕ
imap 'S Ś
imap 's ś
imap 'O Ó
imap 'u ú
imap 'U Ú
imap '<space> '
endfunction "deadkeys()
function! DeadKeysOff()
echo "Dead Keys: Off"
let g:DeadKeysOn=0
" unmapping graves
iunmap `a
iunmap `e
iunmap `i
iunmap `o
iunmap `u
iunmap `A
iunmap `E
iunmap `I
iunmap `O
iunmap `U
iunmap `<space>
" unmapping umlauts
iunmap "a
iunmap "e
iunmap "i
iunmap "o
iunmap "u
iunmap "A
iunmap "E
iunmap "I
iunmap "O
iunmap "U
iunmap "<space>
" unmapping macrons
iunmap :a
iunmap :e
iunmap :i
iunmap :o
iunmap :u
iunmap :A
iunmap :E
iunmap :I
iunmap :O
iunmap :U
" unmapping acutes
iunmap 'a
iunmap 'A
iunmap 'C
iunmap 'c
iunmap 'e
iunmap 'E
iunmap 'i
iunmap 'I
iunmap 'N
iunmap 'n
iunmap 'o
iunmap 'R
iunmap 'r
iunmap 'S
iunmap 's
iunmap 'O
iunmap 'u
iunmap 'U
iunmap '<space>
endfunction

257
.vim/luke/ipa.vim Normal file
View file

@ -0,0 +1,257 @@
"m̥
"n̼
"n̥
"ɳ̊
inoremap ;nn ɲ̊
inoremap ;gn ɲ
"ŋ̊
inoremap ;ng ŋ
"p̪
"b̪
"t̼
"d̼
"ɡ
inoremap ;' ʔ
inoremap ;sh ʃ
inoremap ;zh ʒ
inoremap ;xi ɕ
inoremap ;zi ʑ
inoremap ;ph ɸ
inoremap ;bh β
"θ̼
"ð̼
inoremap ;th θ
inoremap ;dh ð
"θ̠
"ð̠
"ɹ̠̊
"ɹ̠
inoremap ;cc ç
inoremap ;jj ʝ
inoremap ;gh ɣ
inoremap ;xx χ
inoremap ;fr ʁ
inoremap ;HH ħ
inoremap ;hh ɦ
"ʋ̥
inoremap ;vv ʋ
"ɹ̥
inoremap ;er ɹ
"ɻ̊
"j̊
"ɰ̊
"ʔ̞
"ⱱ̟
"ⱱ
"ɾ̼
"ɾ̥
inoremap ;fl ɾ
"ɽ̊
"ɢ̆
"ʡ̮
"ʙ̥
inoremap ;bb ʙ
"r̼
"r̥
"ɽ̊
"ʀ̥
"ɭ̊
"ʎ̥
"ʎ̝
"ʟ̝̊
"ʟ̝
"l̥
"ɭ̊
"ʎ̥
"ʟ̥
"ʟ̠
"ɺ̢
"ʎ̮
"ʟ̆
inoremap ;ih ɨ
"ɯ
inoremap ;ii ɪ
"ʏ
"ɪ̈
"ʊ̈
inoremap ;eu ɯ̽
inoremap ;uu ʊ
"e̞
"ø̞
inoremap ;uh ə
"ɵ̞
"ɤ̞
"o̞
inoremap ;eh ɛ
inoremap ;oe œ
inoremap ;au ɔ
inoremap ;ae æ
inoremap ;aa ɐ
"ɞ̞
inoremap ;OE ɶ
"ɒ̈
inoremap ;ah ɑ
inoremap ;ba ɒ

135
.vimrc
View file

@ -1,3 +1,9 @@
" _ _ ____ _ _ _ _ _
" | | _ _| | _____ / ___| _ __ ___ (_) |_| |__ ( )___ __ _(_)_ __ ___ _ __ ___
" | | | | | | |/ / _ \ \___ \| '_ ` _ \| | __| '_ \|// __| \ \ / / | '_ ` _ \| '__/ __|
" | |__| |_| | < __/ ___) | | | | | | | |_| | | | \__ \ \ V /| | | | | | | | | (__
" |_____\__,_|_|\_\___| |____/|_| |_| |_|_|\__|_| |_| |___/ \_/ |_|_| |_| |_|_| \___|
" Load Pathogen for plugins:
execute pathogen#infect()
execute pathogen#helptags()
@ -5,45 +11,49 @@
" Some basics:
set nocompatible
filetype plugin on
"colorscheme wal
syntax on
"colorscheme wal
set encoding=utf-8
set number
set relativenumber
"set relativenumber
"au BufWinLeave * mkview
"au BufWinEnter * silent loadview
let g:instant_markdown_autostart = 0
"For saving view folds:
"au BufWinLeave * mkview
"au BufWinEnter * silent loadview
let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markdown', '.markdown': 'markdown', '.mdown': 'markdown'} "Interpret .md files, etc. as .markdown
"Make calcurse notes markdown compatible:
" Make calcurse notes markdown compatible:
autocmd BufRead,BufNewFile /tmp/calcurse*,~/.calcurse/notes/* set filetype=markdown
"Spell-check set to F6:
" Spell-check set to F6:
map <F6> :setlocal spell! spelllang=en_us,es<CR>
"Toggle DeadKeys set to F7 (for accent marks):
" Toggle DeadKeys set to F7 (for accent marks):
so ~/.vim/luke/deadkeys.vim
nm <F7> :call ToggleDeadKeys()<CR>
"Goyo plugin makes text more readable when writing prose:
" Goyo plugin makes text more readable when writing prose:
map <F10> :Goyo<CR>
inoremap <F10> <esc>:Goyo<CR>a
"Enable Goyo by default for mutt writting
" Source my IPA shorcuts:
so ~/.vim/luke/ipa.vim
" Enable Goyo by default for mutt writting
autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=72
autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo
" Goyo's width will be the line limit in mutt.
"Enable autocompletion:
" Enable autocompletion:
set wildmode=longest,list,full
set wildmenu
"Automatically deletes all tralling whitespace on save.
" Automatically deletes all tralling whitespace on save.
autocmd BufWritePre * %s/\s\+$//e
"When shortcut files are updated, renew bash and ranger configs with new
"material:
" When shortcut files are updated, renew bash and ranger configs with new
" material:
autocmd BufWritePost ~/.config/Scripts/folders,~/.config/Scripts/configs !bash ~/.config/Scripts/shortcuts.sh
" Runs a script that cleans out tex build files whenever I close out of a .tex file.
@ -55,18 +65,22 @@ let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markd
"Copy selected text to system clipboard (requires gvim installed):
vnoremap <C-c> "+y
"C-T for new tab
" Disables automatic commenting on newline:
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
" C-T for new tab
nnoremap <C-t> :tabnew<cr>
"""BASIC TOOLS
"Navigating with guides
" Navigating with guides
inoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
vnoremap <Space><Tab> <Esc>/<++><Enter>"_c4l
map <Space><Tab> <Esc>/<++><Enter>"_c4l
inoremap ;gui <++>
"For normal mode when in terminals (in X I have caps mapped to esc, this replaces it when I don't have X)
" For normal mode when in terminals (in X I have caps mapped to esc, this replaces it when I don't have X)
inoremap jw <Esc>
inoremap wj <Esc>
"Shortcutting split navigation, saving a keypress:
map <C-h> <C-w>h
map <C-j> <C-w>j
@ -84,8 +98,8 @@ let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markd
autocmd FileType tex map <F3> :w !detex \| wc -w<CR>
autocmd FileType tex inoremap <F3> <Esc>:w !detex \| wc -w<CR>
" Compile document using xelatex:
autocmd FileType tex inoremap <F5> <Esc>:!xelatex<spacE><c-r>%<Enter>a
autocmd FileType tex nnoremap <F5> :!xelatex<spacE><c-r>%<Enter>
autocmd FileType tex inoremap <F5> <Esc>:!xelatex<space><c-r>%<Enter>a
autocmd FileType tex nnoremap <F5> :!xelatex<space><c-r>%<Enter>
" Code snippets
autocmd FileType tex inoremap ;fr \begin{frame}<Enter>\frametitle{}<Enter><Enter><++><Enter><Enter>\end{frame}<Enter><Enter><++><Esc>6kf}i
autocmd FileType tex inoremap ;fi \begin{fitch}<Enter><Enter>\end{fitch}<Enter><Enter><++><Esc>3kA
@ -93,9 +107,6 @@ let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markd
autocmd FileType tex inoremap ;em \emph{}<++><Esc>T{i
autocmd FileType tex inoremap ;bf \textbf{}<++><Esc>T{i
autocmd FileType tex vnoremap ; <ESC>`<i\{<ESC>`>2la}<ESC>?\\{<Enter>a
"autocmd FileType tex vnoremap : <ESC>`<i{\<ESC>`>2la}<ESC>?{\\<Enter>la
autocmd FileType tex inoremap {{ <Esc>F{i
autocmd FileType tex inoremap }} <Esc>f}a
autocmd FileType tex inoremap ;it \textit{}<++><Esc>T{i
autocmd FileType tex inoremap ;ct \textcite{}<++><Esc>T{i
autocmd FileType tex inoremap ;cp \parencite{}<++><Esc>T{i
@ -154,49 +165,36 @@ let g:vimwiki_ext2syntax = {'.Rmd': 'markdown', '.rmd': 'markdown','.md': 'markd
autocmd Filetype tex inoremap ;inst {\textsc{inst}}
autocmd FileType tex inoremap ;tipa \textipa{}<Space><++><Esc>T{i
"For Indo-European
"autocmd FileType tex inoremap ;dh d\textsuperscript{h}
"autocmd FileType tex inoremap ;bh b\textsuperscript{h}
"autocmd FileType tex inoremap ;gh g\textsuperscript{h}
"autocmd FileType tex inoremap ;gwh g\textsuperscript{hw}
"autocmd FileType tex inoremap ;kw k\textsuperscript{w}
"autocmd FileType tex inoremap ;gw g\textsuperscript{w}
"autocmd FileType tex inoremap ;h1 {h\textsubscript{1}}
"autocmd FileType tex inoremap ;h2 {h\textsubscript{2}}
"autocmd FileType tex inoremap ;h3 {h\textsubscript{3}}
"autocmd FileType tex inoremap ;h4 {h\textsubscript{4}}
"""PHP
autocmd FileType php,html inoremap ;b <b></b><Space><++><Esc>FbT>i
autocmd FileType php,html inoremap ;i <em></em><Space><++><Esc>FeT>i
autocmd FileType php,html inoremap ;h1 <h1></h1><Enter><Enter><++><Esc>2kf<i
autocmd FileType php,html inoremap ;h2 <h2></h2><Enter><Enter><++><Esc>2kf<i
autocmd FileType php,html inoremap ;h3 <h3></h3><Enter><Enter><++><Esc>2kf<i
autocmd FileType php,html inoremap ;p <p></p><Enter><Enter><++><Esc>02kf>a
autocmd FileType php,html inoremap ;a <a<Space>href=""><++></a><Space><++><Esc>14hi
autocmd FileType php,html inoremap ;e <a<Space>target="_blank"<Space>href=""><++></a><Space><++><Esc>14hi
autocmd FileType php,html inoremap ;ul <ul><Enter><li></li><Enter></ul><Enter><Enter><++><Esc>03kf<i
autocmd FileType php,html inoremap ;li <Esc>o<li></li><Esc>F>a
autocmd FileType php,html inoremap ;ol <ol><Enter><li></li><Enter></ol><Enter><Enter><++><Esc>03kf<i
autocmd FileType php,html inoremap ;im <table<Space>class="image"><Enter><caption align="bottom"></caption><Enter><tr><td><a<space>href="pix/<++>"><img<Space>src="pix/<++>"<Space>width="<++>"></a></td></tr><Enter></table><Enter><Enter><++><Esc>4kf>a
autocmd FileType php,html inoremap ;td <td></td><++><Esc>Fdcit
autocmd FileType php,html inoremap ;tr <tr></tr><Enter><++><Esc>kf<i
autocmd FileType php,html inoremap ;th <th></th><++><Esc>Fhcit
autocmd FileType php,html inoremap ;tab <table><Enter></table><Esc>O
autocmd FileType php,html inoremap ;gr <font color="green"></font><Esc>F>a
autocmd FileType php,html inoremap ;rd <font color="red"></font><Esc>F>a
autocmd FileType php,html inoremap ;yl <font color="yellow"></font><Esc>F>a
autocmd FileType php,html inoremap ;dt <dt></dt><Enter><dd><++></dd><Enter><++><esc>2kcit
autocmd FileType php,html inoremap ;dl <dl><Enter><Enter></dl><enter><enter><++><esc>3kcc
"autocmd FileType php,html inoremap -- &ndash;
"autocmd FileType php,html inoremap --- &mdash;
autocmd FileType php,html inoremap ;b <b></b><Space><++><Esc>FbT>i
autocmd FileType php,html inoremap ;i <em></em><Space><++><Esc>FeT>i
autocmd FileType php,html inoremap ;h1 <h1></h1><Enter><Enter><++><Esc>2kf<i
autocmd FileType php,html inoremap ;h2 <h2></h2><Enter><Enter><++><Esc>2kf<i
autocmd FileType php,html inoremap ;h3 <h3></h3><Enter><Enter><++><Esc>2kf<i
autocmd FileType php,html inoremap ;p <p></p><Enter><Enter><++><Esc>02kf>a
autocmd FileType php,html inoremap ;a <a<Space>href=""><++></a><Space><++><Esc>14hi
autocmd FileType php,html inoremap ;e <a<Space>target="_blank"<Space>href=""><++></a><Space><++><Esc>14hi
autocmd FileType php,html inoremap ;ul <ul><Enter><li></li><Enter></ul><Enter><Enter><++><Esc>03kf<i
autocmd FileType php,html inoremap ;li <Esc>o<li></li><Esc>F>a
autocmd FileType php,html inoremap ;ol <ol><Enter><li></li><Enter></ol><Enter><Enter><++><Esc>03kf<i
autocmd FileType php,html inoremap ;im <table<Space>class="image"><Enter><caption align="bottom"></caption><Enter><tr><td><a<space>href="pix/<++>"><img<Space>src="pix/<++>"<Space>width="<++>"></a></td></tr><Enter></table><Enter><Enter><++><Esc>4kf>a
autocmd FileType php,html inoremap ;td <td></td><++><Esc>Fdcit
autocmd FileType php,html inoremap ;tr <tr></tr><Enter><++><Esc>kf<i
autocmd FileType php,html inoremap ;th <th></th><++><Esc>Fhcit
autocmd FileType php,html inoremap ;tab <table><Enter></table><Esc>O
autocmd FileType php,html inoremap ;gr <font color="green"></font><Esc>F>a
autocmd FileType php,html inoremap ;rd <font color="red"></font><Esc>F>a
autocmd FileType php,html inoremap ;yl <font color="yellow"></font><Esc>F>a
autocmd FileType php,html inoremap ;dt <dt></dt><Enter><dd><++></dd><Enter><++><esc>2kcit
autocmd FileType php,html inoremap ;dl <dl><Enter><Enter></dl><enter><enter><++><esc>3kcc
"autocmd FileType php,html inoremap -- &ndash;
"autocmd FileType php,html inoremap --- &mdash;
""".bib
autocmd FileType bib inoremap ;a @article{<Enter>author<Space>=<Space>"<++>",<Enter>year<Space>=<Space>"<++>",<Enter>title<Space>=<Space>"<++>",<Enter>journal<Space>=<Space>"<++>",<Enter>volume<Space>=<Space>"<++>",<Enter>pages<Space>=<Space>"<++>",<Enter>}<Enter><++><Esc>8kA,<Esc>i
autocmd FileType bib inoremap ;b @book{<Enter>author<Space>=<Space>"<++>",<Enter>year<Space>=<Space>"<++>",<Enter>title<Space>=<Space>"<++>",<Enter>publisher<Space>=<Space>"<++>",<Enter>}<Enter><++><Esc>6kA,<Esc>i
autocmd FileType bib inoremap ;c @incollection{<Enter>author<Space>=<Space>"<++>",<Enter>title<Space>=<Space>"<++>",<Enter>booktitle<Space>=<Space>"<++>",<Enter>editor<Space>=<Space>"<++>",<Enter>year<Space>=<Space>"<++>",<Enter>publisher<Space>=<Space>"<++>",<Enter>}<Enter><++><Esc>8kA,<Esc>i
autocmd FileType bib inoremap ;a @article{<Enter>author<Space>=<Space>"<++>",<Enter>year<Space>=<Space>"<++>",<Enter>title<Space>=<Space>"<++>",<Enter>journal<Space>=<Space>"<++>",<Enter>volume<Space>=<Space>"<++>",<Enter>pages<Space>=<Space>"<++>",<Enter>}<Enter><++><Esc>8kA,<Esc>i
autocmd FileType bib inoremap ;b @book{<Enter>author<Space>=<Space>"<++>",<Enter>year<Space>=<Space>"<++>",<Enter>title<Space>=<Space>"<++>",<Enter>publisher<Space>=<Space>"<++>",<Enter>}<Enter><++><Esc>6kA,<Esc>i
autocmd FileType bib inoremap ;c @incollection{<Enter>author<Space>=<Space>"<++>",<Enter>title<Space>=<Space>"<++>",<Enter>booktitle<Space>=<Space>"<++>",<Enter>editor<Space>=<Space>"<++>",<Enter>year<Space>=<Space>"<++>",<Enter>publisher<Space>=<Space>"<++>",<Enter>}<Enter><++><Esc>8kA,<Esc>i
"MARKDOWN
autocmd Filetype markdown,rmd inoremap ;n ---<Enter><Enter>
@ -215,14 +213,9 @@ autocmd FileType bib inoremap ;c @incollection{<Enter>author<Space>=<Space>"<++>
autocmd Filetype rmd inoremap ;r ```{r,<space>echo=TRUE}<CR>```<CR><CR><esc>2kO
""".xml
"autocmd FileType xml inoremap ;e <item><Enter><title><++></title><Enter><pubDate><Esc>:put<Space>=strftime('%c')<Enter>A</pubDate><Enter><link><++></link><Enter><description><++></description><Enter></item>
autocmd FileType xml inoremap ;e <item><Enter><title><++></title><Enter><pubDate><Esc>:put<Space>=strftime('%c')<Enter>A</pubDate><Enter><link><++></link><Enter><description><![CDATA[<++>]]></description><Enter></item><Esc>5kcit
autocmd FileType xml inoremap ;a <a href="<++>"><++></a><++><Esc>F"ci"
"Insert the time:
noremap ;time :put<Space>=strftime('%c')<Enter>
inoremap ;time <esc>:put<Space>=strftime('%c')<Enter>
"autocmd FileType xml inoremap ;e <item><Enter><title><++></title><Enter><pubDate><Esc>:put<Space>=strftime('%c')<Enter>A</pubDate><Enter><link><++></link><Enter><description><++></description><Enter></item>
autocmd FileType xml inoremap ;e <item><Enter><title><++></title><Enter><pubDate><Esc>:put<Space>=strftime('%c')<Enter>A</pubDate><Enter><link><++></link><Enter><description><![CDATA[<++>]]></description><Enter></item><Esc>5kcit
autocmd FileType xml inoremap ;a <a href="<++>"><++></a><++><Esc>F"ci"
vmap <expr> ++ VMATH_YankAndAnalyse()
nmap ++ vip++
@ -231,5 +224,3 @@ vnoremap K xkP`[V`]
vnoremap J xp`[V`]
vnoremap L >gv
vnoremap H <gv
so ~/.vim/luke/ipa.vim