From b9cdc703f21391ac9e2e08d3b7a3572cb3db3382 Mon Sep 17 00:00:00 2001 From: Patrick Cao Huu Thien Date: Tue, 24 Jun 2025 17:00:17 +0200 Subject: [PATCH] vim: ajout [[ ]] pour ft=sh --- .vimrc_vundle | 76 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 58 insertions(+), 18 deletions(-) diff --git a/.vimrc_vundle b/.vimrc_vundle index a6279c1..71b5ca4 100755 --- a/.vimrc_vundle +++ b/.vimrc_vundle @@ -311,10 +311,10 @@ let g:ollama_logfile = '/home/patrick/vim-ollama.log' " golang " require Vim 8.0.1453 Plugin 'fatih/vim-go' -au FileType go nmap m (go-test) -au FileType go nmap a :GoAlternate -au FileType go nmap gd (go-def) -au FileType go set foldmethod=syntax +autocmd FileType go nmap m (go-test) +autocmd FileType go nmap a :GoAlternate +autocmd FileType go nmap gd (go-def) +autocmd FileType go set foldmethod=syntax " :Refactor extract newfunc " Plugin 'godoctor/godoctor.vim' @@ -364,9 +364,22 @@ imap tm :TableModeTogglei " \m to launch Shellcheck " gb to see SCxxx in browser Plugin 'itspriddle/vim-shellcheck' -au FileType sh compiler shellcheck -au FileType sh nmap m :ShellCheck! -au FileType sh imap m :ShellCheck!i +autocmd FileType sh compiler shellcheck +autocmd FileType sh nmap m :ShellCheck! +autocmd FileType sh imap m :ShellCheck!i + + +" _\|/_ +" (o o) +" <~~~~~~oOO-{_}-OOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> +" | | +" | colorscheme papercolor | +" | | +" <~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~> +" (_) (_) +Plugin 'NLKNguyen/papercolor-theme' + + " All of your Plugins must be added before the following line call vundle#end() " required @@ -383,9 +396,15 @@ filetype plugin indent on " required " syntax syntax on +" COLORS +" use GUI colors for the terminal +set termguicolors " colorscheme default +set background=dark +" colorscheme PaperColor colorscheme pcht + " print code with :hardcopy using impression.lam.jussieu.fr " set printdevice=hp5550-509 " set printoptions=left:5pt,right:5pt,top:5pt,bottom:5pt,number:y,duplex:off,wrap:y,paper:A4,portrait:y @@ -566,7 +585,7 @@ map :tabnext setlocal spell spelllang=fr,en " setlocal spell spelllang=en_us,fr -set spell +" set nospell highlight SpellBad term=underline ctermfg=white ctermbg=red cterm=underline highlight SpellCap term=italic,underline ctermfg=yellow ctermbg=red cterm=underline highlight SpellRare term=bold,italic,underline ctermfg=cyan ctermbg=red cterm=underline @@ -621,15 +640,36 @@ autocmd BufRead * silent! call LoadTemplate('%:e','notall') " endif " CISCO ACL -augroup filetype - au! BufRead,BufNewFile *.crules set filetype=ciscoacl - au! BufRead,BufNewFile *.acl set filetype=ciscoacl +augroup ciscofiles + autocmd BufRead,BufNewFile *.crules setlocal filetype=ciscoacl + autocmd BufRead,BufNewFile *.acl setlocal filetype=ciscoacl augroup END " markdown syntax for gitit -augroup filetype - au! BufRead,BufNewFile *.page set filetype=markdown - au! BufRead,BufNewFile *.md set filetype=markdown +augroup markdownfiles + autocmd BufRead,BufNewFile *.page setlocal filetype=markdown + autocmd BufRead,BufNewFile *.md setlocal filetype=markdown +augroup END + +" HTML +augroup htmlfiles + autocmd BufRead,BufNewFile *.html setlocal filetype=html + " format all file with tidy + autocmd FileType html nmap tidy :%!tidy -config ~/.vim/ftplugin/tidyrc_html.txt +augroup END + +" shell +augroup shellfiles + autocmd BufRead,BufNewFile *.sh setlocal filetype=bash + + " FIXME ne fonctionne plus sous vim 9.1 + " autocmd FileType sh setlocal sections=^function,^\w\+\s*() + " FIXME \| ou ne fonctionne pas + " nnoremap ]] /^function\|^\w\+\s*() + nnoremap ]] /^function + nnoremap ] /\w\+\s*() + nnoremap [[ k?function + nnoremap [ k?\w\+\s*() augroup END @@ -718,10 +758,10 @@ nmap V :source ~/.vimrc imap s :!see %i nmap s :!see % " html + php -" nmap h :set ft=html -" imap h :set ft=htmli -" nmap p :set ft=php -" imap p :set ft=phpi +" nmap h :setlocal ft=html +" imap h :setlocal ft=htmli +" nmap p :setlocal ft=php +" imap p :setlocal ft=phpi " make nmap m :w:!clear:make imap m :w:!clear:make