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

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