You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.vimrc 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. behave mswin
  2. "let g:ale_completion_enabled = 1
  3. call plug#begin("$XDG_CONFIG_HOME/vim/plugged")
  4. Plug 'airblade/vim-gitgutter'
  5. Plug 'dense-analysis/ale'
  6. Plug 'itchyny/lightline.vim'
  7. Plug 'lifepillar/vim-solarized8'
  8. Plug 'mustache/vim-mustache-handlebars'
  9. Plug 'phpactor/phpactor', {'for': 'php', 'do': 'composer install --no-dev -o'}
  10. Plug 'rhysd/vim-gfm-syntax'
  11. Plug 'trusktr/seti.vim'
  12. Plug 'scrooloose/nerdtree'
  13. Plug 'xuyuanp/nerdtree-git-plugin'
  14. Plug 'yegappan/mru'
  15. Plug 'dikiaap/minimalist'
  16. "Plug 'vim-vdebug/vdebug'
  17. Plug 'uguu-org/vim-matrix-screensaver'
  18. "Plug 'neoclide/coc.nvim', {'branch': 'release'}
  19. Plug 'chriskempson/tomorrow-theme'
  20. Plug 'altercation/vim-colors-solarized'
  21. Plug 'romainl/flattened'
  22. Plug 'fneu/breezy'
  23. Plug 'chrisbra/vim-autosave'
  24. Plug 'junegunn/goyo.vim'
  25. Plug 'junegunn/limelight.vim'
  26. Plug 'bilalq/lite-dfm'
  27. Plug 'easymotion/vim-easymotion'
  28. call plug#end()
  29. set fileencoding=utf8
  30. set fileformat=unix
  31. set fileformats=unix,dos
  32. set termguicolors
  33. colorscheme flattened_dark
  34. set background=dark
  35. "set t_Co=256
  36. let g:lightline = { 'colorscheme': 'solarized', }
  37. let &showbreak='+-> '
  38. let &showbreak='⮑ '
  39. let g:markdown_fenced_languages = ['sh', 'bash=sh', 'shell=sh', 'php', 'sql']
  40. highlight MatchParen gui=bold guibg=NONE guifg=lightgrey cterm=bold ctermbg=NONE
  41. set matchtime=0 "prevent cursor from jumping around when highlighting braces ?
  42. set noshowmode "affiche le mode dans la ligne de statut
  43. set novisualbell "set vb t_vb=""
  44. set number "pas beau
  45. set title "affiche le titre du fichier dans le titlebar
  46. set titlestring=%F\ %r\ %m
  47. "set mouse=a "souris dans le terminal
  48. set mouse=r "sélectionner texte à la souris dans le terminal
  49. set autochdir "change le rep. courant de vim pour celui du fichier en cours d'édition
  50. set backup "effacer l'ancien back-up par le courant et active le backup :]
  51. set ignorecase "ignore la casse pour la recherche
  52. "autocmd FileType c set cindent "indentation c quand filetype c :)
  53. set expandtab "la touche TAB insère de vrais espaces
  54. set shiftwidth=4 "nombre d'espaces utilisés pour l'INDENTATION (après un if, l'appui sur enter insère une nouvelle indentation de deux espaces)
  55. set smartindent "modifie l'indentation si on est en fin de bloc (entre autre)
  56. set softtabstop=4 "la touche TAB insère deux espaces
  57. set tabstop=4 "le caractère TAB est interprété à l'écran comme deux espaces
  58. set linebreak "coupe les lignes trop longues (au mot près)
  59. set foldmethod=manual
  60. let MRU_File="$XDG_DATA_HOME/vim-data/mru_files"
  61. let MRU_Max_Entries=140
  62. set backupdir=$XDG_DATA_HOME/vim-data/backup
  63. set directory=$XDG_DATA_HOME/vim-data/swap
  64. set undodir=$XDG_DATA_HOME/vim-data/undo
  65. set undofile "undo même après avoir fermé le fichier
  66. inoremap <Tab> <C-R>=MyTabOrComplete()<CR>
  67. "inoremap <Tab> <C-X><C-O>
  68. cmap w!! %!sudo tee > /dev/null %
  69. imap jj <ESC>
  70. map <S-j> <S-C-W><S-C-W>
  71. map <S-k> <C-W>W
  72. map <C-h> <C-W><
  73. map <C-j> <C-W>-
  74. map <C-k> <C-W>+
  75. map <C-l> <C-W>>
  76. map tt :tabnew<CR>
  77. map f <Plug>(easymotion-overwin-f2)
  78. autocmd BufRead *.* set nohlsearch
  79. "autocmd BufRead *.c,*.h set ft=c "filetype c quand fichier c"
  80. "autocmd BufRead *.lua set ft=lua
  81. autocmd BufRead *.txt set ft=markdown
  82. autocmd BufRead *.md set ft=markdown
  83. autocmd BufRead *.markdown set ft=markdown
  84. "autocmd BufRead *.hackernews set ft=hackernews
  85. autocmd BufRead *.ejs set ft=html
  86. autocmd BufRead *.jade set ft=jade
  87. autocmd BufRead *.js set shiftwidth=2
  88. autocmd BufRead *.js set softtabstop=2
  89. autocmd BufRead *.js set tabstop=2
  90. autocmd BufRead *.yml set tabstop=2
  91. autocmd BufRead *.yml set shiftwidth=2
  92. autocmd BufRead *.yml set softtabstop=2
  93. autocmd BufRead *.html let g:ale_fix_on_save = 1
  94. autocmd BufRead *.css let g:ale_fix_on_save = 1
  95. autocmd BufRead *.js let g:ale_fix_on_save = 1
  96. autocmd BufRead *.php let g:ale_fix_on_save = 1
  97. autocmd BufRead *.yml,*.yaml let g:ale_fix_on_save = 1
  98. autocmd BufRead *.sh let g:ale_fix_on_save = 1
  99. "autocmd BufWritePost * NERDTreeFocus | execute 'normal R' | wincmd p
  100. autocmd BufWritePost * NERDTreeRefreshRoot
  101. """"""""""""""""""""""""""""""""
  102. " fonction complétion "
  103. """"""""""""""""""""""""""""""""
  104. function MyTabOrComplete()
  105. let col = col('.')-1
  106. if !col || getline('.')[col-1] !~ '\k'
  107. return "\<tab>"
  108. else
  109. return "\<C-N>"
  110. endif
  111. endfunction
  112. " *********************************************"
  113. " positionne le curseur au dernier emplacement "
  114. " connu à l'ouverture d'un fichier "
  115. " *********************************************"
  116. autocmd BufReadPost *
  117. \ if line("'\"") > 0 && line("'\"") <= line("$") |
  118. \ exe "normal! g`\"" |
  119. \ endif
  120. function! HighlightSearch()
  121. if &hls
  122. return 'H'
  123. else
  124. return ''
  125. endif
  126. endfunction
  127. let g:ale_sign_error = '✖'
  128. hi ALEErrorSign guifg=#DF8C8C
  129. "let g:ale_sign_warning = '⚠'
  130. "let g:ale_sign_warning = '❗'
  131. let g:ale_sign_warning = '!'
  132. "hi ALEWarningSign guifg=#F2C38F
  133. "let NERDTreeMinimalUI = 1
  134. let g:ale_php_phpcs_options = '--standard=/home/jeankri/.config/ruleset-psr12-custom.xml'
  135. " not doing anything ? let g:ale_php_phpcbf_options = '--standard=/xhome/jeankri/.config/ruleset-psr2-custom.xml'
  136. "
  137. " we need eslint for linting js and phpcs for linting php and tidy for html linting and prettier is used for every file format
  138. " tidy could use as fixer but I don't trust it enough yet
  139. "let g:ale_javascript_prettier_options = '--single-quote'
  140. let g:ale_fixers = {
  141. \ '*': ['remove_trailing_lines', 'trim_whitespace'],
  142. \ 'javascript': ['remove_trailing_lines', 'trim_whitespace', 'prettier'],
  143. \ 'json': ['remove_trailing_lines', 'trim_whitespace', 'prettier'],
  144. \ 'html': ['remove_trailing_lines', 'trim_whitespace','prettier'],
  145. \ 'css': ['remove_trailing_lines', 'trim_whitespace','prettier'],
  146. \ 'php': ['remove_trailing_lines', 'trim_whitespace', 'prettier'],
  147. \ 'sql': ['remove_trailing_lines', 'trim_whitespace', 'prettier'],
  148. \ 'shell': ['remove_trailing_lines', 'trim_whitespace', 'prettier'],
  149. \ 'bash': ['remove_trailing_lines', 'trim_whitespace', 'prettier'],
  150. \ 'yaml': ['remove_trailing_lines', 'trim_whitespace', 'prettier']
  151. \ }
  152. "let g:ale_fixers = {
  153. " \ '*': ['remove_trailing_lines', 'trim_whitespace'],
  154. " \ 'javascript': ['remove_trailing_lines', 'trim_whitespace', 'prettier'],
  155. " \ 'html': ['remove_trailing_lines', 'trim_whitespace','tidy'],
  156. " \ 'css': ['remove_trailing_lines', 'trim_whitespace','stylelint'],
  157. " \ 'php': ['remove_trailing_lines', 'trim_whitespace', 'phpcbf'],
  158. " \ 'yaml': ['remove_trailing_lines', 'trim_whitespace', 'prettier']
  159. " \ }
  160. set guicursor=
  161. let g:vdebug_options= {
  162. \ "port" : 9001,
  163. \ "server" : '',
  164. \ "timeout" : 20,
  165. \ "on_close" : 'detach',
  166. \ "break_on_open" : 0,
  167. \ "path_maps" : {},
  168. \ "debug_window_level" : 0,
  169. \ "debug_file_level" : 0,
  170. \ "debug_file" : "",
  171. \ "watch_window_style" : 'compact'
  172. \ }
  173. let g:autosave_backup = '~/.local/share/vim-data/backup-plugin'