From a647d34ce197a451b2dac7ad2fa62533a790fa6e Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Wed, 7 Nov 2018 10:33:39 +0100 Subject: Vim Modules en vrac --- .gitmodules | 15 +++++++++++++ bundle/ack | 1 + bundle/supertab | 1 + colors/blue.vim | 1 + plugin/detectindent.vim | 2 +- skel/c | 18 +++++---------- skel/h | 18 +++++---------- vimrc | 60 ++++++++++++++++++++++++++++++++++++++----------- 8 files changed, 78 insertions(+), 38 deletions(-) create mode 160000 bundle/ack create mode 160000 bundle/supertab diff --git a/.gitmodules b/.gitmodules index 817ae3d..cfa1ded 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,3 +22,18 @@ [submodule "bundle/incsearch-easymotion.vim"] path = bundle/incsearch-easymotion.vim url = https://github.com/haya14busa/incsearch-easymotion.vim +[submodule "bundle/ack"] + path = bundle/ack + url = https://github.com/mileszs/ack.vim.git +[submodule "bundle/supertab"] + path = bundle/supertab + url = https://github.com/ervandew/supertab +[submodule "bundle/vimshell.vim"] + path = bundle/vimshell + url = https://github.com/Shougo/vimshell.vim +[submodule "bundle/vimproc"] + path = bundle/vimproc + url = http://github.com/Shougo/vimproc +[submodule "bundle/vim-plug"] + path = bundle/vim-plug + url = https://github.com/junegunn/vim-plug.git diff --git a/bundle/ack b/bundle/ack new file mode 160000 index 0000000..a16a9b6 --- /dev/null +++ b/bundle/ack @@ -0,0 +1 @@ +Subproject commit a16a9b63eb85cc0960a7f25c54647ac1f99f3360 diff --git a/bundle/supertab b/bundle/supertab new file mode 160000 index 0000000..22aac5c --- /dev/null +++ b/bundle/supertab @@ -0,0 +1 @@ +Subproject commit 22aac5c2cb6a8ebe906bf1495eb727717390e62e diff --git a/colors/blue.vim b/colors/blue.vim index 9376448..88e6357 100644 --- a/colors/blue.vim +++ b/colors/blue.vim @@ -666,6 +666,7 @@ if has("gui_running") || &t_Co >= 255 hi! Folded term=reverse ctermfg=00 ctermbg=none cterm=bold hi! link FoldColumn Folded hi! LineNR term=reverse,bold ctermbg=none ctermfg=236 cterm=bold + hi! CursorLineNR term=reverse,bold ctermbg=none ctermfg=24 cterm=none hi! TabLine term=underline cterm=none,underline ctermbg=none ctermfg=00 hi! link TabLineFill TabLine diff --git a/plugin/detectindent.vim b/plugin/detectindent.vim index d903948..b905e90 100644 --- a/plugin/detectindent.vim +++ b/plugin/detectindent.vim @@ -16,7 +16,7 @@ " " to set a preferred indent level when detection is " " impossible: " :let g:detectindent_preferred_indent = 4 -" +" " " To use preferred values instead of guessing: " :let g:detectindent_preferred_when_mixed = 1 " diff --git a/skel/c b/skel/c index 053e31a..516b445 100644 --- a/skel/c +++ b/skel/c @@ -1,15 +1,9 @@ /* - This file is a part of Qosmos ixEngine. - - Copyright Qosmos 2000-<+strftime("%Y")+> - All rights reserved - - This computer program and all its components are protected by - authors' rights and copyright law and by international treaties. - Any representation, reproduction, distribution or modification - of this program or any portion of it is forbidden without - Qosmos explicit and written agreement and may result in severe - civil and criminal penalties, and will be prosecuted - to the maximum extent possible under the law. -*/ + * (C) Copyright AdvisorSLA 2000-<+strftime("%Y")+> + * + * Unpublished + * All rights reserved + * + */ <=CURSOR=> diff --git a/skel/h b/skel/h index f536d56..b7fb51f 100644 --- a/skel/h +++ b/skel/h @@ -1,16 +1,10 @@ /* - This file is a part of Qosmos ixEngine. - - Copyright Qosmos 2000-<+strftime("%Y")+> - All rights reserved - - This computer program and all its components are protected by - authors' rights and copyright law and by international treaties. - Any representation, reproduction, distribution or modification - of this program or any portion of it is forbidden without - Qosmos explicit and written agreement and may result in severe - civil and criminal penalties, and will be prosecuted - to the maximum extent possible under the law. -*/ + * (C) Copyright AdvisorSLA 2000-<+strftime("%Y")+> + * + * Unpublished + * All rights reserved + * + */ #ifndef <+substitute(toupper(expand("%:t")), "[\\.-]", "_", "g")+>_ #define <+substitute(toupper(expand("%:t")), "[\\.-]", "_", "g")+>_ diff --git a/vimrc b/vimrc index 9f3b67e..964e2c4 100644 --- a/vimrc +++ b/vimrc @@ -1,6 +1,15 @@ execute pathogen#infect() +call plug#begin('~/.vim/plugged') +Plug 'junegunn/vim-easy-align' +call plug#end() + +" 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 + filetype plugin indent on " To ignore plugin indent changes, instead use: "filetype plugin on @@ -20,6 +29,7 @@ set ruler "Show line numbers set number set laststatus=2 +set rnu "use relative line numbers to cursor function! MyTabLine() let s = '' @@ -50,8 +60,18 @@ function! MyTabLabel(n) return bufname(buflist[winnr - 1]) endfunction +" Show current C function name +fun! ShowFuncName() + let lnum = line(".") + let col = col(".") + echohl ModeMsg + echo getline(search("^[^ \t#/]\\{2}.*[^:]\s*$", 'bWn')) + echohl None + call search("\\%" . lnum . "l" . "\\%" . col . "c") +endfun + "set statusline=%y─┤\ %*%1*%<%f%*\ %2*%M%3*%r%*├%=┤%4*%c%V%*├─┤%4*%l/%L%*├──┤%4*%P%*├─ -set statusline=┤%y\ %*%1*%<%f%*\ %2*%M%3*%r%*├%=┤%P%*├ +set statusline=┤%y\ %*%1*%<%f%*\ %2*%M%3*%r%*├%=┤%1*%v,%c%*├─┤%P%*├ set tabline=%!MyTabLine() @@ -128,7 +148,8 @@ noremap gj j noremap gk k "Macros -nmap :set invet +"nmap mc:%s/[\t ]\+$//'c +nmap :make " folding set foldmethod=indent set foldignore= @@ -151,7 +172,7 @@ augroup END " Quick search for merges nmap /^\(<\{7\}\\|>\{7\}\\|=\{7\}\) -nmap :windo set invnumber +nmap :windo set invrelativenumber "nmap :setlocal foldcolumn-=1:execute 'setlocal foldlevel='.(&foldcolumn - 2) "nmap :setlocal foldcolumn+=1:execute 'setlocal foldlevel='.(&foldcolumn - 2) @@ -165,7 +186,8 @@ nmap :windo set foldcolumn+=1 nmap ; za " open/close recursive under cursor "nmap zA -nmap :windo set invfoldenable +"nmap :windo set invfoldenable +nmap :set invet "buffer moving nmap h :tabN @@ -199,7 +221,7 @@ function! CscopeSearch(csearch) let @/=a:csearch set hls - let l:prompt = "Rechercher '".a:csearch."' avec cscope [cdefgist] : " + let l:prompt = "Rechercher '".a:csearch."' avec cscope [acdefgist] : " echo l:prompt let l:ctype=nr2char(getchar()) @@ -216,12 +238,14 @@ function! LoadTags() elseif filereadable( expand("$PWD/ctags.out") ) set tags=$pwd/ctags.out elseif has("cscope") + set cst if filereadable( expand("$PWD/cscope.out") ) - set cst + cscope add $PWD/cscope.out endif - - " Automagically done... - "cscope add $PWD/cscope.out + let l:git = system("dirname $(git rev-parse --git-dir) | tr -d '\n'") + if filereadable ( l:git . '/cscope.out' ) && l:git != expand("$PWD") + exe 'cscope add ' . l:git . ' ' . l:git + endif " cscope macros nmap C :!cscope -bqu:cs reset @@ -247,7 +271,7 @@ call LoadTags() augroup WhiteSpaces " F*cking whitespaces - autocmd BufRead * highlight ExtraWhitespace ctermbg=red ctermfg=black guibg=red + autocmd BufRead * highlight ExtraWhitespace ctermbg=160 ctermfg=black guibg=red autocmd BufRead * match ExtraWhitespace /\s\+$\| \+\ze\t\| \+/ augroup END @@ -258,7 +282,6 @@ nmap :set invlist set title set autoindent set diffopt=iwhite,filler,vertical -set guifont="Liberation Mono 10" " mouse " v -> enabled in visual mode @@ -274,6 +297,7 @@ set shiftwidth=4 set expandtab let g:detectindent_preferred_expandtab = 1 let g:detectindent_preferred_indent = 4 +let g:detectindent_preferred_when_mixed = 1 augroup DetectIndentation autocmd BufRead * DetectIndent augroup END @@ -287,9 +311,10 @@ set timeoutlen=250 " Code comment/uncomment noremap // m"I// g`"3l noremap /* m"I/* A */jg`"3l - xmap // /* +" xmap // /* +xnoremap // `>o#endif` xnoremap /* `>a */` - noremap \* m"e?/\* *:s:/\* *::/ *\*\/:s: *\*/::\|:nohljg`"3h + noremap \* m"e?/\* xxx/ \*\/xxx:nohljg`"3h noremap \\ m"0:s:// *::\|:nohlg`"3h @@ -312,6 +337,13 @@ noremap / incsearch#go(incsearch_config()) noremap ? incsearch#go(incsearch_config({'command': '?'})) noremap g/ incsearch#go(incsearch_config({'is_stay': 1})) +" FuzzyFinder +map ff :FufFile +map fd :FufDir +map fb :FufBuffer + +map ft :FufTagWithCursorWord! + let g:EasyMotion_do_mapping = 0 " Disable default mappings let mapleader=" " @@ -340,6 +372,7 @@ noremap u :noh runtime! ftplugin/man.vim noremap K :Man =expand("") +let g:ft_man_open_mode = 'vert' " Function @@ -488,3 +521,4 @@ augroup Todo au! autocmd FileType vimwiki set syn=todo augroup END + -- cgit v1.2.3