vimrc 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. " Some settings have to be done here
  2. set encoding=utf-8
  3. scriptencoding utf-8
  4. set secure
  5. set exrc
  6. " Detect which device we're using to apply device-specific settings.
  7. let g:vimdir = expand('<sfile>:p:h')
  8. if filereadable(g:vimdir . '/.iambiglaptop')
  9. let g:device = 'biglaptop'
  10. let g:mobile = 0
  11. elseif filereadable(g:vimdir . '/.iamsmalllaptop')
  12. let g:device = 'smalllaptop'
  13. let g:mobile = 0
  14. elseif filereadable(g:vimdir . '/.iamphone')
  15. let g:device = 'phone'
  16. let g:mobile = 1
  17. else
  18. let g:device = 'unknown'
  19. let g:mobile = 0
  20. endif
  21. " Plugins
  22. call plug#begin(g:vimdir.'/plug')
  23. Plug 'airblade/vim-gitgutter'
  24. Plug 'ap/vim-css-color'
  25. Plug 'aperezdc/vim-template'
  26. let g:templates_directory = [g:vimdir .. '/templates']
  27. let g:templates_global_name_prefix = 'template-'
  28. let g:templates_name_prefix = '.vim-template-'
  29. Plug 'bignimbus/pop-punk.vim'
  30. Plug 'easymotion/vim-easymotion'
  31. map <silent> ; <plug>(easymotion-prefix)
  32. Plug 'editorconfig/editorconfig-vim'
  33. Plug 'farmergreg/vim-lastplace'
  34. Plug 'junegunn/vim-easy-align'
  35. nmap ga <plug>(EasyAlign)
  36. xmap ga <plug>(EasyAlign)
  37. Plug 'lervag/vimtex'
  38. let g:vimtex_quickfix_mode = 0
  39. Plug 'lucasprag/simpleblack'
  40. Plug 'manicmaniac/coconut.vim'
  41. Plug 'markonm/traces.vim'
  42. " Plug 'mattn/vim-lsp-settings'
  43. " let g:lsp_settings = {
  44. " \ 'efm-langserver': {'disable': 1}
  45. " \}
  46. Plug 'matze/vim-move'
  47. let g:move_key_modifier = 'C'
  48. Plug 'pbrisbin/vim-mkdir'
  49. Plug 'prabirshrestha/async.vim'
  50. " Plug 'prabirshrestha/vim-lsp'
  51. " set omnifunc=lsp#complete
  52. " let g:lsp_diagnostics_echo_cursor = 1
  53. " let g:lsp_semantic_enabled = 1
  54. Plug 'Raimondi/delimitMate'
  55. let delimitMate_expand_cr = 2
  56. let delimitMate_expand_space = 1
  57. Plug 'rhysd/clever-f.vim'
  58. Plug 'sheerun/vim-polyglot'
  59. let g:polyglot_disabled = ['tex', 'latex', 'html', 'java']
  60. Plug 'svermeulen/vim-easyclip'
  61. let g:EasyClipAutoFormat = 1
  62. let g:EasyClipShareYanks = 1
  63. let g:EasyClipAlwaysMoveCursorToEndOfPaste = 1
  64. let g:EasyClipPreserveCursorPositionAfterYank = 1
  65. nmap M m$
  66. nmap <silent> gs <plug>SubstituteOverMotionMap
  67. nmap gss <plug>SubstituteLine
  68. xmap gs <plug>XEasyClipPaste
  69. Plug 'tommcdo/vim-exchange'
  70. Plug 'tpope/vim-commentary'
  71. Plug 'tpope/vim-endwise'
  72. Plug 'tpope/vim-fugitive'
  73. Plug 'tpope/vim-repeat'
  74. Plug 'tpope/vim-sensible'
  75. Plug 'tpope/vim-surround'
  76. Plug 'w0rp/ale'
  77. let g:ale_echo_msg_format = '(%linter%) [%severity%% code%] %s'
  78. let g:ale_list_window_size = 5
  79. let g:ale_lint_on_insert_leave = 0
  80. let g:ale_lint_on_text_changed = 0
  81. let g:ale_sign_error = 'EE'
  82. let g:ale_sign_info = 'ii'
  83. let g:ale_sign_style_error = 'se'
  84. let g:ale_sign_style_warning = 'sw'
  85. let g:ale_sign_warning = 'WW'
  86. let g:ale_linters = {
  87. \ 'cs': ['mcs'],
  88. \ 'dart': ['language_server'],
  89. \ 'haskell': ['ghc', 'hlint'],
  90. \ 'html': [],
  91. \}
  92. let g:ale_fixers = {
  93. \ 'dart': ['dartfmt'],
  94. \ 'haskell': ['hlint'],
  95. \ 'nim': ['nimpretty'],
  96. \ 'python': ['black', 'isort'],
  97. \ 'rust': ['cargo', 'rustc'],
  98. \}
  99. " let g:ale_javascript_prettier_options = ''
  100. " \ . ' --trailing-comma es5'
  101. " \ . ' --html-whitespace ignore'
  102. let g:ale_python_mypy_options = '--ignore-missing-imports'
  103. if g:mobile
  104. let g:ale_set_highlights = 0
  105. endif
  106. augroup CloseLoclistWindowGroup
  107. autocmd!
  108. autocmd QuitPre * if empty(&buftype) | lclose | endif
  109. augroup END
  110. Plug 'wellle/targets.vim'
  111. Plug 'wincent/terminus'
  112. Plug 'zyedidia/literate.vim'
  113. if !exists('g:started_by_firenvim')
  114. Plug 'vim-airline/vim-airline'
  115. let g:airline_powerline_fonts = 1
  116. let g:airline#extensions#tabline#enabled = 1
  117. endif
  118. if g:device ==# 'biglaptop'
  119. Plug '~/projects/hlas1/vim-hlas1'
  120. let g:hlas1_config_path = expand('~/code/projects/hlas1/vim-hlas1/config')
  121. Plug '~/projects/iprib/iprib0/vim-iprib'
  122. Plug '~/projects/jelly.vim'
  123. if has('nvim')
  124. Plug 'glacambre/firenvim', { 'do': { _ -> firenvim#install(0) } }
  125. endif
  126. endif
  127. if g:device ==# 'phone'
  128. Plug '~/hlas1/vim-hlas1'
  129. let g:hlas1_config_path = expand('~/hlas1/vim-hlas1/config')
  130. Plug '~/iprib/iprib0/vim-iprib'
  131. Plug '~/jelly.vim'
  132. endif
  133. call plug#end()