Repository für den Vim Workshop in der O-Phase 2019
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.

108 lines
3.8 KiB

  1. set nocompatible " be iMproved, required
  2. filetype off " required
  3. " Plugins
  4. " Load vim-plug
  5. if empty(glob("~/.config/nvim/autoload/plug.vim"))
  6. execute '!curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  7. endif
  8. call plug#begin()
  9. Plug 'VundleVim/Vundle.vim' " let Vundle manage Vundle, required
  10. Plug 'tpope/vim-fugitive' " Git integration
  11. Plug 'tpope/vim-sensible' " Defaults everyone can agree on
  12. Plug 'tpope/vim-surround' " better handling of surrounding markers
  13. Plug 'tpope/vim-ragtag' " Enhancement of surround for html
  14. Plug 'tpope/vim-repeat' " repeat last command with .
  15. Plug 'scrooloose/nerdcommenter' " better commenting
  16. Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } " completion engine
  17. Plug 'Shougo/neosnippet.vim' " snippet engine
  18. Plug 'Shougo/neosnippet-snippets' " snippets
  19. Plug 'easymotion/vim-easymotion' " better motion with leader
  20. Plug 'bling/vim-airline' " statusline
  21. Plug 'w0rp/ale' " asynchronous linting engine
  22. Plug 'godlygeek/tabular' " Align text on symbols
  23. Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } " fuzzy file finder
  24. Plug 'junegunn/fzf.vim' " vim integration for fzf
  25. Plug 'airblade/vim-gitgutter' " git status in gutter column
  26. " All of your Plugins must be added before the following line
  27. call plug#end() " required
  28. filetype plugin indent on " required
  29. " SETTINGS
  30. set number " line numbers
  31. set autoread " reload file automatically
  32. set history=1000
  33. set autoindent " automatically set indent of new line
  34. set smartindent
  35. set tabstop=4
  36. set shiftwidth=4
  37. set expandtab
  38. set ttyfast " faster redrawing
  39. set diffopt+=vertical
  40. set laststatus=2 " show the satus line all the time
  41. set so=7 " set 7 lines to the cursors - when moving vertical
  42. set wildmenu " enhanced command line completion
  43. set hidden " current buffer can be put into background
  44. set showcmd " show incomplete commands
  45. set wildmode=list:longest " complete files like a shell
  46. set scrolloff=3 " lines of text around cursor
  47. set shell=$SHELL
  48. set cmdheight=1 " command bar height
  49. set title " set terminal title
  50. set foldmethod=marker" " folds are marked with {{{}}}
  51. " Uncomment the following to have Vim jump to the last position when
  52. " reopening a file
  53. if has("autocmd")
  54. au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
  55. \| exe "normal! g'\"" | endif
  56. endif
  57. " SETTINGS
  58. let mapleader = ","
  59. " fzf bindings
  60. nmap <C-p> :Files<CR>
  61. nmap <leader><C-p> :Tags<CR>
  62. " Allow saving of files as sudo when I forgot to start vim using sudo.
  63. cmap w!! w !sudo tee > /dev/null %
  64. " Show Infos from ALE in Airline
  65. let g:airline#extensions#ale#enabled = 1
  66. " Completion settings
  67. let g:deoplete#enable_at_startup = 1
  68. " Use TAB to cycle between matches
  69. inoremap <silent><expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
  70. inoremap <silent><expr><s-tab> pumvisible() ? "\<c-p>" : "\<s-tab>"
  71. let g:deoplete#ignore_sources = get(g:, 'deoplete#ignore_sources', {})
  72. let g:deoplete#ignore_sources.php = ['omni']
  73. " Neosnippet Settings
  74. imap <C-k> <Plug>(neosnippet_expand_or_jump)
  75. smap <C-k> <Plug>(neosnippet_expand_or_jump)
  76. xmap <C-k> <Plug>(neosnippet_expand_target)
  77. " SuperTab like snippets behavior.
  78. "imap <expr><TAB>
  79. " \ pumvisible() ? "\<C-n>" :
  80. " \ neosnippet#expandable_or_jumpable() ?
  81. " \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
  82. smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
  83. \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
  84. " For conceal markers.
  85. if has('conceal')
  86. set conceallevel=2 concealcursor=niv
  87. endif
  88. let g:neosnippet#snippets_directory = '~/.dotfiles/vim/neosnippets'