Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

.vimrc 6.5KB

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