Skip to content

Instantly share code, notes, and snippets.

@JeanRibes
Last active August 16, 2023 14:55
Show Gist options
  • Save JeanRibes/5066e4a21bdf2222fd8ae21c4a913866 to your computer and use it in GitHub Desktop.
Save JeanRibes/5066e4a21bdf2222fd8ae21c4a913866 to your computer and use it in GitHub Desktop.
Fichier de conf pour VIM
set ts=4
set sw=4
augroup configgroup
autocmd VimEnter * highlight clear SignColumn
autocmd FileType python set sw=4
autocmd FileType python let python_highlight_all = 1
autocmd FileType python set ts=4
autocmd FileType python set sts=4
" " expand tabs into spaces
autocmd FileType python set expandtab
autocmd FileType python set autoindent
autocmd FileType python set fileformat=unix
" autocmd BufWritePre *.php,*.py,*.js,*.txt,*.hs,*.java,*.md :call <SID>StripTrailingWhitespaces()
autocmd FileType java setlocal noexpandtab
" autocmd FileType java setlocal list
" autocmd FileType java setlocal listchars=tab:+\ ,eol:-
autocmd FileType java setlocal formatprg=par\ -w80\ -T4
autocmd FileType php setlocal expandtab
autocmd FileType php setlocal list
autocmd FileType php setlocal listchars=tab:+\ ,eol:-
autocmd FileType php setlocal formatprg=par\ -w80\ -T4
autocmd FileType ruby setlocal tabstop=2
autocmd FileType ruby setlocal shiftwidth=2
autocmd FileType ruby setlocal softtabstop=2
autocmd FileType ruby setlocal commentstring=#\ %s
autocmd FileType python setlocal commentstring=#\ %s
autocmd BufEnter *.cls setlocal filetype=java
autocmd BufEnter *.zsh-theme setlocal filetype=zsh
autocmd BufEnter Makefile setlocal noexpandtab
autocmd BufNewFile,BufRead Vagrantfile set filetype=ruby
autocmd BufEnter *.sh setlocal tabstop=2
autocmd BufEnter *.sh setlocal shiftwidth=2
autocmd BufEnter *.sh setlocal softtabstop=2
augroup END
au BufNewFile,BufRead *.js
\ set tabstop=2 |
\ set softtabstop=2 |
\ set shiftwidth=2 |
" enable syntax highlighting
syntax enable
set wildmenu
set lazyredraw
" montre les matchs de recherche
set hlsearch
set encoding=utf-8
" " show line numbers
set number
" " set tabs to have 4 spaces
" " indent when moving to the next line while writing code
" " when using the >> or << commands, shift lines by 4 spaces
set shiftwidth=4
" " show a visual line under the cursor's current line
"set cursorline
" " show the matching part of the pair for [] {} and ()
set showmatch
" Enable folding
set foldmethod=indent
set foldlevel=10
" espace pour fold le code en mode normal
nnoremap <space> za
"PRO+ mode
inoremap jk <Esc>
" FORMATTERS , taper 'gggqG' pour fomatter tout ...
au FileType javascript setlocal formatprg=prettier
au FileType javascript.jsx setlocal formatprg=prettier
au FileType typescript setlocal formatprg=prettier\ --parser\ typescript
au FileType html setlocal formatprg=js-beautify\ --type\ html
au FileType scss setlocal formatprg=prettier\ --parser\ css
au FileType css setlocal formatprg=prettier\ --parser\ css
" raccourcis de formattage. mz définit la marque 'z', et `z y revient après le
" formatage
inoremap <C-S-l> <Esc>mzgggqG`zi
map <C-S-l> mzgggqG`z
"VUNDLE
"########################
set nocompatible " required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" add all your plugins here (note older versions of Vundle
" used Bundle instead of Plugin)
"###########################
Plugin 'tmhedberg/SimpylFold'
Plugin 'vim-scripts/indentpython.vim'
"Plugin 'jnurmine/Zenburn'
Plugin 'altercation/vim-colors-solarized'
"Plugin 'vim-syntastic/syntastic' "un Linter, il affiche les problèmes de code (marche pour le C normalemtn)
Plugin 'dense-analysis/ale' "linter asynchrone, askip il marche pour le JS
"Plugin 'nvie/vim-flake8'
"Plugin 'davidhalter/jedi-vim'
Plugin 'scrooloose/nerdtree'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'airblade/vim-gitgutter' "pour afficher les diffs
Plugin 'vimwiki/vimwiki'
Plugin 'davidhalter/jedi-vim'
"Plugin 'jiangmiao/auto-pairs' "insère automatiquement l'autre guillement/accolade/parenthèse/crochet...
"Plugin 'xavierd/clang_complete' "pour compléter le C
"Plugin 'tpope/vim-commentary' "press gcc to comment out a line or gc to comment a selection in visual mode
"Plugin 'yuezk/vim-js' "coloration syntaxique moderne du Js
"Plugin 'maxmellon/vim-jsx-pretty' "coloration syntaxique du JSX !
Plugin 'samoshkin/vim-mergetool'
Plugin 'hashivim/vim-terraform'
Plugin 'fatih/vim-go'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
syntax on "syntax recognition
set background=dark
"let g:solarized_termtrans = 1 "fond transparent
colorscheme solarized
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:clang_library_path='/usr/lib/llvm-9/lib/libclang-9.so.1'
" recherge les symboles qui montrent les diffs GIT
autocmd BufWritePost * GitGutterEnable
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
map <C-n> :NERDTreeToggle<CR>
"nnoremap <S-left> :tabprevious<CR>
"nnoremap <S-right> :tabnext<CR>
map <S-left> :tabprevious<CR>
map <S-right> :tabnext<CR>
inoremap <C-Space> <C-x>o
map <F9> :GoBuild<CR>
map <S-F9> :GoRun<CR>
"# Git Mergetool
let g:mergetool_layout = 'bmr'
@JeanRibes
Copy link
Author

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

vim
:PluginInstall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment