set showcmd set backspace=indent,eol,start " Why the hell does Vim add \n add the end of a file ? set nofixendofline set clipboard=unnamedplus set ruler set t_Co=256 "map j j "map k k "map h h "map l l inoremap inoremap let mapleader = "!" " map leader to bang nnoremap f :call FoldColumnToggle() function! FoldColumnToggle() try if g:colors_name ==? "pink" colo badwolf hi CursorLine term=bold cterm=bold ctermbg=black hi CursorColumn ctermbg=54 elseif g:colors_name ==? "badwolf" colo jellybeans else colo pink hi CursorLine term=bold cterm=bold ctermbg=white hi CursorColumn ctermbg=Yellow endif catch /^Vim:E121/ colo pink hi CursorLine term=bold cterm=bold ctermbg=white hi CursorColumn ctermbg=Yellow endtry endfunction filetype plugin indent on " Color : autocmd ColorScheme * highlight ExtraWhitespace ctermbg=darkred guibg=darkred colo badwolf hi CursorLine term=bold cterm=bold ctermbg=black hi CursorColumn ctermbg=54 set cursorline match ExtraWhitespace /\s\+$/ " Completion related options " wildcard char = set wildmenu set wildmode=list:longest:full nnoremap :set pastem`o``:set nopaste nnoremap :set pastem`O``:set nopaste inoremap A inoremap 0i "Perso C définition" inoremap prt printf inoremap swf printf inoremap #in< #include <> inoremap #in" #include "" inoremap #def #define inoremap #un #undef inoremap #ifn #ifndef inoremap #ifd #ifdef inoremap #std #include inoremap #io #include inoremap #main int main(void) {}A inoremap ##main int main(int argc, char* argv[]) {}A " Personal shortcurts ca tn tabnew ca tc tabc map :setlocal spell! spelllang=fr map :setlocal spell! spelllang=en_us inoremap =strftime('%F') inoremap =strftime('%c') " Personal compil shortcurts noremap :make:cw:!./a.out map :make:cw noremap [q :copen noremap ]q :cclose noremap [Q :cfirst noremap ]Q :clast noremap [[ :cprev noremap ]] :cnext "Allow vim clipboad <-> host clipboard to share data set clipboard=unnamedplus " Quick Comment : autocmd FileType c,cpp,java,go,scala,js let b:comment_leader = '//' autocmd FileType sh,ruby,python let b:comment_leader = '#' autocmd FileType conf,fstab let b:comment_leader = '#' autocmd FileType tex let b:comment_leader = '%' autocmd FileType mail let b:comment_leader = '>' autocmd FileType vim let b:comment_leader = '"' autocmd FileType haskell let b:comment_leader = '--' autocmd FileType c,cpp,java,go,scala set foldmethod=syntax noremap ,cc :silent s/^/=escape(b:comment_leader,'\/')/:nohlsearch noremap ,cu :silent s/^\V=escape(b:comment_leader,'\/')//e:nohlsearch noremap :silent s/^/=escape(b:comment_leader,'\/')/:nohlsearch noremap c :silent s/^\V=escape(b:comment_leader,'\/')//e:nohlsearch nnoremap cd :cd %:p:h nnoremap // :nohls " Compil option autocmd Filetype c call SetCCompiler() function SetCCompiler() if !(filereadable("makefile") || filereadable("Makefile")) set makeprg=gcc\ % endif endfunction autocmd Filetype python call SetPythonCompiler() function SetPythonCompiler() if executable("flake8") set makeprg=flake8\ --ignore=E111,E303,E201,E231,E391,E225,E203,E226,W391\ % set textwidth=2000 endif endfunction noremap zv :!markdown % \| w3m -I utf-8 -T text/html set colorcolumn=80 set cursorcolumn set hls set incsearch let $VIMHOME=expand(':p:h:h') au BufNewFile *.c 0r $VIMHOME/template/skel.c " let g:deoplete#enable_at_startup = 1 " imap (neosnippet_expand_or_jump) " smap (neosnippet_expand_or_jump) " xmap (neosnippet_expand_target) " set completeopt-=preview " call deoplete#custom#option('auto_complete', v:false) " Plugin key-mappings. " Note: It must be "imap" and "smap". It uses mappings. " imap (neosnippet_expand_or_jump) " smap (neosnippet_expand_or_jump) " xmap (neosnippet_expand_target) " SuperTab like snippets behavior. " Note: It must be "imap" and "smap". It uses mappings. "imap " \ pumvisible() ? "\" : " \ neosnippet#expandable_or_jumpable() ? " \ "\(neosnippet_expand_or_jump)" : "\" "smap neosnippet#expandable_or_jumpable() ? "\ "\(neosnippet_expand_or_jump)" : "\" " For conceal markers. if has('conceal') set conceallevel=2 concealcursor=niv endif map :exec &conceallevel ? "set conceallevel=0" : "set conceallevel=2" " Start interactive EasyAlign in visual mode (e.g. vipga) xmap ga (EasyAlign) " Start interactive EasyAlign for a motion/text object (e.g. gaip) nmap ga (EasyAlign) noremap =g :GrammalecteCheck noremap =G :GrammalecteClear let b:ale_linters = { 'javascript': ['eslint', 'xo', 'jscs', 'jshint', 'standard'], 'typescript': ['eslint', 'tsserver', 'deno'] } let g:ale_disable_lsp = 1 " Ale message config : let g:ale_echo_msg_error_str = 'E' let g:ale_echo_msg_warning_str = 'W' let g:ale_echo_msg_format = '[%linter%] %s [%severity%]' " Ale only on save let g:ale_lint_on_text_changed = 'never' let g:ale_lint_on_enter = 0 autocmd BufNewFile,BufRead /tmp/mesms_* set noautoindent filetype=mail wm=0 tw=78 nonumber digraph nolist nopaste map at :ALEToggle set omnifunc=syntaxcomplete#Complete au BufReadPost,BufNewFile *.tmpl,*.tpm,*.svelte set filetype=html