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.2KB

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