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.

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