Set C-x C-o for mail completion

This commit is contained in:
Thomas Dehaeze 2021-10-25 14:26:02 +02:00
parent 2d668157d7
commit 137f160229

67
vim.org
View File

@ -532,7 +532,7 @@ tnoremap <C-w>l <C-\><C-n><C-w>l
Taken from: https://vi.stackexchange.com/questions/68/autocorrect-spelling-mistakes Taken from: https://vi.stackexchange.com/questions/68/autocorrect-spelling-mistakes
#+begin_src vimrc #+begin_src vimrc
" Go back to last misspelled word and pick first suggestion. " Go back to last misspelled word and pick first suggestion.
inoremap <C-L> <C-G>u<Esc>[s1z=`]a<C-G>u inoremap <C-L> <c-g>u<Esc>[s1z=`]a<c-g>u
" Select last misspelled word (typing will edit). " Select last misspelled word (typing will edit).
nnoremap <C-K> <Esc>[sve<C-G> nnoremap <C-K> <Esc>[sve<C-G>
@ -552,6 +552,35 @@ let g:which_key_map_local = {}
#+begin_src vimrc #+begin_src vimrc
autocmd FileType mail set spell spelllang=en_us,fr autocmd FileType mail set spell spelllang=en_us,fr
autocmd FileType mail set textwidth=0 autocmd FileType mail set textwidth=0
function! Mailcomplete(findstart, base)
if a:findstart == 1
let line = getline('.')
let idx = col('.')
while idx > 0
let idx -= 1
let c = line[idx]
if c == ':' || c == '>'
return idx + 2
else
continue
endif
endwhile
return idx
else
return split(system('~/.local/scripts/find-config.sh ' . a:base), '\n')
endif
endfunction
setl omnifunc=Mailcomplete
#+end_src
#+begin_src bash :shebang "#!/usr/bin/env bash" :tangle-mode (identity #o555) :tangle ~/.local/scripts/find-config.sh
search="$@"
contacts=`mu cfind "$search"`
emails=`echo "$contacts" | awk -F' ' '{print "<" $NF ">"}'`
names=`echo "$contacts" | awk -F' ' '{$NF=""; print $0}'`
paste -d "" <(printf %s "$names") <(printf %s "$emails")
#+end_src #+end_src
** MarkDown ** MarkDown
@ -680,7 +709,7 @@ call which_key#register('<Space>', "g:which_key_map")
#+end_src #+end_src
* Plugins Config * Plugins Config
** junegunn/fzf ** =junegunn/fzf=
#+begin_src vimrc #+begin_src vimrc
" This is the default extra key bindings " This is the default extra key bindings
let g:fzf_action = { let g:fzf_action = {
@ -715,7 +744,7 @@ endfunction
autocmd! User FzfStatusLine call <SID>fzf_statusline() autocmd! User FzfStatusLine call <SID>fzf_statusline()
#+end_src #+end_src
** autozimu/LanguageClient-neovim ** =autozimu/LanguageClient-neovim=
#+begin_src vimrc #+begin_src vimrc
let g:LanguageClient_serverCommands = { let g:LanguageClient_serverCommands = {
\ 'matlab': ['java', ' -Djava.library.path=$MATLABROOT/bin/glnxa64 -cp $MATLABROOT/extern/engines/java/jar/engine.jar:$MATLABROOT/java/jar/jmi.jar:/home/thomas/github/matlab-langserver/build/libs/lsp-matlab-0.1.jar org.tokor.lspmatlab.Application'], \ 'matlab': ['java', ' -Djava.library.path=$MATLABROOT/bin/glnxa64 -cp $MATLABROOT/extern/engines/java/jar/engine.jar:$MATLABROOT/java/jar/jmi.jar:/home/thomas/github/matlab-langserver/build/libs/lsp-matlab-0.1.jar org.tokor.lspmatlab.Application'],
@ -728,7 +757,7 @@ nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR> nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
#+end_src #+end_src
** JamshedVesuna/vim-markdown-preview ** =JamshedVesuna/vim-markdown-preview=
#+begin_src vimrc #+begin_src vimrc
let vim_markdown_preview_github=1 let vim_markdown_preview_github=1
let vim_markdown_preview_browser='Google Chrome' let vim_markdown_preview_browser='Google Chrome'
@ -736,14 +765,14 @@ let vim_markdown_preview_temp_file=1
" let vim_markdown_preview_pandoc=1 " let vim_markdown_preview_pandoc=1
#+end_src #+end_src
** mhinz/vim-signify ** =mhinz/vim-signify=
#+begin_src vimrc #+begin_src vimrc
let g:signify_vcs_list = ['git'] let g:signify_vcs_list = ['git']
let g:signify_disable_by_default = 1 let g:signify_disable_by_default = 1
#+end_src #+end_src
** Deoplete ** =Deoplete=
#+begin_src vimrc #+begin_src vimrc
let g:deoplete#enable_at_startup = 1 let g:deoplete#enable_at_startup = 1
@ -754,7 +783,7 @@ let g:deoplete#enable_at_startup = 1
" call deoplete#custom#set('ultisnips', 'matchers', ['matcher_fuzzy']) " call deoplete#custom#set('ultisnips', 'matchers', ['matcher_fuzzy'])
#+end_src #+end_src
** SirVer/ultisnips ** =SirVer/ultisnips=
#+begin_src vimrc #+begin_src vimrc
let g:UltiSnipsSnippetsDir = '~/.vim/UltiSnip' let g:UltiSnipsSnippetsDir = '~/.vim/UltiSnip'
@ -764,13 +793,13 @@ let g:UltiSnipsExpandTrigger="<C-j>"
" let g:UltiSnipsJumpBackwardTrigger="<s-tab>" " let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
#+end_src #+end_src
** honza/vim-snippets ** =honza/vim-snippets=
#+begin_src vimrc #+begin_src vimrc
let g:snipMate = {} let g:snipMate = {}
let g:snipMate.scope_aliases = {} let g:snipMate.scope_aliases = {}
#+end_src #+end_src
** itchyny/lightline.vim ** =itchyny/lightline.vim=
#+begin_src vimrc #+begin_src vimrc
function! LightlineObsession() function! LightlineObsession()
return '%{ObsessionStatus("")}' return '%{ObsessionStatus("")}'
@ -797,25 +826,25 @@ let g:lightline = {
\ } \ }
#+end_src #+end_src
** Autopairs ** =Autopairs=
#+begin_src vimrc #+begin_src vimrc
" Incompatibilité entre auto-pairs et clang-complete " Incompatibilité entre auto-pairs et clang-complete
let g:AutoPairsMapCR = 0 let g:AutoPairsMapCR = 0
imap <silent><CR> <CR><Plug>AutoPairsReturn imap <silent><CR> <CR><Plug>AutoPairsReturn
#+end_src #+end_src
** Yggdroot/indentLine ** =Yggdroot/indentLine=
#+begin_src vimrc #+begin_src vimrc
" :IndentLinesToggle toggles lines on and off. " :IndentLinesToggle toggles lines on and off.
let g:indentLine_color_term = 239 let g:indentLine_color_term = 239
#+end_src #+end_src
** ryanoasis/vim-devicons ** =ryanoasis/vim-devicons=
#+begin_src vimrc #+begin_src vimrc
let g:webdevicons_enable_ctrlp = 1 let g:webdevicons_enable_ctrlp = 1
#+end_src #+end_src
** junegunn/goyo.vim ** =junegunn/goyo.vim=
#+begin_src vimrc #+begin_src vimrc
let g:goyo_width=100 let g:goyo_width=100
let g:goyo_margin_top = 2 let g:goyo_margin_top = 2
@ -850,7 +879,7 @@ autocmd! User GoyoEnter call <SID>goyo_enter()
autocmd! User GoyoLeave call <SID>goyo_leave() autocmd! User GoyoLeave call <SID>goyo_leave()
#+end_src #+end_src
** tpope/vim-surround ** =tpope/vim-surround=
#+begin_src vimrc #+begin_src vimrc
vmap Si S(i_<esc>f) vmap Si S(i_<esc>f)
au FileType mako vmap Si S"i${ _(<esc>2f"a) }<esc> au FileType mako vmap Si S"i${ _(<esc>2f"a) }<esc>
@ -858,7 +887,7 @@ au FileType mako vmap Si S"i${ _(<esc>2f"a) }<esc>
let g:surround_{char2nr('b')} = "__\r__" let g:surround_{char2nr('b')} = "__\r__"
#+end_src #+end_src
** Vim-Markdown ** =Vim-Markdown=
#+begin_src vimrc #+begin_src vimrc
let g:vim_markdown_folding_disabled = 1 let g:vim_markdown_folding_disabled = 1
let g:vim_markdown_conceal = 0 let g:vim_markdown_conceal = 0
@ -868,7 +897,7 @@ let g:vim_markdown_toml_frontmatter = 1
let g:tex_conceal = "" let g:tex_conceal = ""
#+end_src #+end_src
** Neomake ** =Neomake=
#+begin_src vimrc #+begin_src vimrc
" Latex " Latex
autocmd! BufWritePost *.tex Neomake autocmd! BufWritePost *.tex Neomake
@ -897,14 +926,14 @@ let g:neomake_matlab_mlint_maker = {
let g:neomake_matlab_enabled_makers = ['mlint'] let g:neomake_matlab_enabled_makers = ['mlint']
#+end_src #+end_src
** lervag/vimtex ** =lervag/vimtex=
#+begin_src vimrc #+begin_src vimrc
" let g:tex_conceal="" " let g:tex_conceal=""
" autocmd FileType tex let b:vimtex_main = 'main.tex' " autocmd FileType tex let b:vimtex_main = 'main.tex'
" let g:vimtex_mappings_enabled=0 " let g:vimtex_mappings_enabled=0
#+end_src #+end_src
** jpalardy/vim-slime ** =jpalardy/vim-slime=
#+begin_src vimrc #+begin_src vimrc
if exists('$TMUX') if exists('$TMUX')
let g:slime_target = "tmux" let g:slime_target = "tmux"
@ -913,7 +942,7 @@ if exists('$TMUX')
endif endif
#+end_src #+end_src
** mhinz/vim-grepper ** =mhinz/vim-grepper=
#+begin_src vimrc #+begin_src vimrc
" nnoremap <leader>G :Grepper -tool ag<cr> " nnoremap <leader>G :Grepper -tool ag<cr>
" nmap gs <plug>(GrepperOperator) " nmap gs <plug>(GrepperOperator)