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.

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