All of my important config files
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.

274 lines
9.1 KiB

8 years ago
8 years ago
7 years ago
7 years ago
8 years ago
6 years ago
6 years ago
6 years ago
8 years ago
8 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
6 years ago
7 years ago
8 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. set nocompatible " be iMproved, required
  2. filetype off " required
  3. " Section 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 'tpope/vim-dadbod' " Modern database interface for Vim
  15. Plug 'tpope/vim-dispatch' " Needed for dadbod
  16. Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } " file tree
  17. Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': 'NERDTreeToggle' }
  18. Plug 'scrooloose/nerdcommenter' " better commenting
  19. Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } " completion engine
  20. Plug 'Shougo/neosnippet.vim' " snippet engine
  21. Plug 'Shougo/neosnippet-snippets' " snippets
  22. Plug 'easymotion/vim-easymotion' " better motion with leader
  23. Plug 'bling/vim-airline' " statusline
  24. Plug 'w0rp/ale' " asynchronous linting engine
  25. Plug 'godlygeek/tabular' " Align text on symbols
  26. Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } " fuzzy file finder
  27. Plug 'junegunn/fzf.vim' " vim integration for fzf
  28. Plug 'airblade/vim-gitgutter' " git status in gutter column
  29. Plug 'radenling/vim-dispatch-neovim' " support for :Start command, needed in dadbod
  30. Plug 'lambdalisue/suda.vim' " As w!! did not work anymore in nvim
  31. " html / templates{{{
  32. Plug 'mattn/emmet-vim', { 'for': ['html', 'php', 'gohtmltmpl', 'vue', 'markdown'] } " emmet support for vim - easily create markdup wth CSS-like syntax
  33. Plug 'gregsexton/MatchTag', { 'for': ['html', 'php', 'gohtmltmpl', 'vue'] } " match tags in html, similar to paren support
  34. Plug 'othree/html5.vim', { 'for': ['html', 'php', 'gohtmltmpl', 'vue'] } " html5 support
  35. Plug 'lumiliet/vim-twig', { 'for': ['html'] } " twig syntax support
  36. "}}}
  37. " JavaScript{{{
  38. Plug 'gavocanov/vim-js-indent', { 'for': [ 'javascript' ]} " JavaScript indent support
  39. Plug 'moll/vim-node', { 'for': [ 'javascript', 'vue' ]} " node support
  40. "Plug 'othree/yajs.vim', { 'for': [ 'javascript', 'vue' ]} " JavaScript syntax plugin
  41. "Plug 'othree/es.next.syntax.vim', { 'for': [ 'javascript', 'vue' ]} " ES6 and beyond syntax
  42. Plug 'https://github.com/othree/jspc.vim', { 'for': [ 'javascript', 'vue' ]} " Function parameter completion
  43. Plug 'heavenshell/vim-jsdoc', { 'for': [ 'javascript', 'vue' ]} " Generate JSDoc comments
  44. Plug 'posva/vim-vue', { 'for': [ 'javascript', 'html', 'vue' ] } " vue.js integration
  45. Plug 'carlitux/deoplete-ternjs', { 'for': [ 'javascript', 'vue', 'html' ], 'do': 'npm install -g tern' } " deoplete completion via ternjs
  46. "}}}
  47. " Go {{{
  48. Plug 'fatih/vim-go', { 'for': [ 'go', 'html', 'gohtmltmpl' ], 'do': ':GoInstallBinaries' } " go support
  49. Plug 'zchee/deoplete-go', { 'for': 'go' }
  50. "}}}
  51. " LaTeX{{{
  52. Plug 'lervag/vimtex', { 'for': 'tex' }
  53. "}}}
  54. " Markdown{{{
  55. Plug 'suan/vim-instant-markdown', { 'for': 'markdown' }
  56. Plug 'tpope/vim-markdown', { 'for': 'markdown'}
  57. "}}}
  58. " Colorschemes{{{
  59. Plug 'altercation/vim-colors-solarized'
  60. "}}}
  61. " TOML{{{
  62. Plug 'cespare/vim-toml', { 'for': 'toml' }
  63. "}}}
  64. " Haskell{{{
  65. Plug 'bitc/vim-hdevtools', { 'for': 'haskell' }
  66. Plug 'nbouscal/vim-stylish-haskell', { 'for': 'haskell' }
  67. "}}}
  68. " C/C++{{{
  69. Plug 'Rip-Rip/clang_complete', { 'for': ['c', 'cpp'], 'do': 'make install' }
  70. let g:clang_library_path='/usr/lib/llvm-6.0/lib/libclang-6.0.so.1'
  71. Plug 'rhysd/vim-clang-format', { 'for' : ['c', 'cpp', 'java'] }
  72. "}}}
  73. " PHP{{{
  74. "Plug 'shawncplus/phpcomplete.vim', { 'for': 'php', 'do': 'curl -Ss http://vim-php.com/phpctags/install/phpctags.phar > ~/bin/phpctags && chmod +x ~/bin/phpctags' }
  75. "Plug 'lvht/phpcd.vim', { 'for': 'php', 'do': 'composer install' }
  76. Plug 'phpactor/phpactor', {'for': 'php', 'do': 'composer install'}
  77. Plug 'kristijanhusak/deoplete-phpactor', { 'for': 'php' }
  78. Plug 'captbaritone/better-indent-support-for-php-with-html', { 'for': 'php' }
  79. Plug 'lumiliet/vim-twig', { 'for': [ 'php', 'html' ] } " Twig templates
  80. Plug 'Rican7/php-doc-modded', { 'for': 'php' } " Automatic phpdoc comments
  81. "}}}
  82. " Python{{{
  83. Plug 'davidhalter/jedi-vim', { 'for': 'python', 'do': 'pip install jedi' }
  84. Plug 'zchee/deoplete-jedi', { 'for': 'python' }
  85. Plug 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' }
  86. "}}}
  87. " Java{{{
  88. Plug 'artur-shaik/vim-javacomplete2', { 'for': 'java' }
  89. "}}}
  90. " MIPS{{{
  91. Plug 'vim-scripts/mips.vim'
  92. "}}}
  93. " Rust {{{
  94. Plug 'sebastianmarkow/deoplete-rust', {'for': 'rust' }
  95. "}}}
  96. " All of your Plugins must be added before the following line
  97. call plug#end() " required
  98. filetype plugin indent on " required
  99. " }}}
  100. " THEME{{{
  101. colorscheme solarized
  102. set background=dark
  103. " Use light theme if whole shell is in light mode
  104. let themeenv=$THEME_SWITCHER
  105. if themeenv=='light'
  106. set background=light
  107. endif
  108. " }}}
  109. " SETTINGS{{{
  110. set number " line numbers
  111. set autoread " reload file automatically
  112. set colorcolumn=100 " highlight column 99
  113. set textwidth=100
  114. set history=1000
  115. set wildignore+=node_modules " ignore node_modules folder from file search
  116. set inccommand=split
  117. " make comments and HTML attributes italic
  118. highlight Comment cterm=italic
  119. highlight htmlArg cterm=italic
  120. set autoindent " automatically set indent of new line
  121. set smartindent
  122. set tabstop=4
  123. set shiftwidth=4
  124. set expandtab
  125. " toggle invisible characters
  126. set list
  127. set listchars=tab:→\ ,eol,trail:⋅,extends:❯,precedes:❮
  128. set showbreak=
  129. set ttyfast " faster redrawing
  130. set diffopt+=vertical
  131. set laststatus=2 " show the satus line all the time
  132. set so=7 " set 7 lines to the cursors - when moving vertical
  133. set wildmenu " enhanced command line completion
  134. set hidden " current buffer can be put into background
  135. set showcmd " show incomplete commands
  136. " set noshowmode " don't show which mode disabled for PowerLine
  137. set wildmode=list:longest " complete files like a shell
  138. set scrolloff=3 " lines of text around cursor
  139. set shell=$SHELL
  140. set cmdheight=1 " command bar height
  141. set title " set terminal title
  142. set foldmethod=marker" " folds are marked with {{{}}}
  143. " Uncomment the following to have Vim jump to the last position when
  144. " reopening a file
  145. if has("autocmd")
  146. au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
  147. \| exe "normal! g'\"" | endif
  148. endif
  149. " Setting for correct mips syntax highlighting
  150. au BufReadPost *.mips set syntax=mips
  151. " }}}
  152. " MAPPINGS{{{
  153. let mapleader = ","
  154. " CtrlP for Tags
  155. nnoremap <leader><C-p> :CtrlPTag<cr>
  156. " fzf bindings
  157. nmap <C-p> :Files<CR>
  158. nmap <leader><C-p> :Tags<CR>
  159. " Toggle NERDTree
  160. nmap <silent> <leader>k :NERDTreeToggle<cr>
  161. " expand to the path of the file in the current buffer
  162. nmap <silent> <leader>y :NERDTreeFind<cr>
  163. " Allow saving of files as sudo when I forgot to start vim using sudo.
  164. cmap w!! :w suda://%
  165. "Toggle set paste
  166. nmap <leader>tp :set paste!<cr>
  167. " scroll the viewport faster
  168. nnoremap <C-e> 3<C-e>
  169. nnoremap <C-y> 3<C-y>
  170. " ctrl-r in visual mode to replace selected text
  171. vnoremap <C-r> "hy:%s/<C-r>h//g<left><left>
  172. nmap <leader>an :ALENext<cr>
  173. nnoremap <leader>tn :tabnew<cr>
  174. "}}}
  175. " P L U G I N S{{{
  176. let NERDTreeShowHidden=1
  177. let g:airline_powerline_fonts = 1
  178. " ALE {{{
  179. let g:airline#extensions#ale#enabled = 1
  180. "}}}
  181. let vim_tags_ctags_binary='~/bin/phpctags'"
  182. " Java config
  183. autocmd FileType java setlocal omnifunc=javacomplete#Complete
  184. " Python-mode config
  185. let g:pymode_lint_on_write = 0
  186. " Vimtex{{{
  187. if !exists('g:neocomplete#sources#omni#input_patterns')
  188. let g:neocomplete#sources#omni#input_patterns = {}
  189. endif
  190. let g:neocomplete#sources#omni#input_patterns.tex =
  191. \ '\v\\%('
  192. \ . '\a*%(ref|cite)\a*%(\s*\[[^]]*\])?\s*\{[^{}]*'
  193. \ . '|includegraphics%(\s*\[[^]]*\])?\s*\{[^{}]*'
  194. \ . '|%(include|input)\s*\{[^{}]*'
  195. \ . ')'
  196. "}}}
  197. " C/C++
  198. autocmd FileType c,cpp,objc nnoremap <buffer><Leader>f :<C-u>ClangFormat<CR>
  199. autocmd FileType c,cpp,objc vnoremap <buffer><Leader>f :ClangFormat<CR>
  200. "}}}
  201. " Completion {{{
  202. " Use deoplete.
  203. let g:deoplete#enable_at_startup = 1
  204. " Use TAB to cycle between matches
  205. inoremap <silent><expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
  206. inoremap <silent><expr><s-tab> pumvisible() ? "\<c-p>" : "\<s-tab>"
  207. let g:deoplete#ignore_sources = get(g:, 'deoplete#ignore_sources', {})
  208. let g:deoplete#ignore_sources.php = ['omni']
  209. " Neosnippet Settings
  210. imap <C-k> <Plug>(neosnippet_expand_or_jump)
  211. smap <C-k> <Plug>(neosnippet_expand_or_jump)
  212. xmap <C-k> <Plug>(neosnippet_expand_target)
  213. " SuperTab like snippets behavior.
  214. "imap <expr><TAB>
  215. " \ pumvisible() ? "\<C-n>" :
  216. " \ neosnippet#expandable_or_jumpable() ?
  217. " \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
  218. smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
  219. \ "\<Plug>(neosnippet_expand_or_jump)" : "\<TAB>"
  220. " For conceal markers.
  221. if has('conceal')
  222. set conceallevel=2 concealcursor=niv
  223. endif
  224. let g:neosnippet#snippets_directory = '~/.dotfiles/vim/neosnippets'
  225. "}}}