Advertisement
Guest User

init.vim

a guest
Apr 11th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 5.50 KB | None | 0 0
  1. if &compatible
  2.     set nocompatible
  3. endif
  4. set runtimepath+=~/.config/nvim/repos/github.com/Shougo/dein.vim
  5.  
  6. if dein#load_state('~/.config/nvim/plugins')
  7.     call dein#begin('~/.config/nvim/plugins')
  8.  
  9.     call dein#add('~/.config/nvim/repos/github.com/Shougo/dein.vim')
  10.     call dein#add('Shougo/deoplete.nvim')
  11.     call dein#add('brooth/far.vim')
  12.     call dein#add('Shougo/unite.vim')
  13.     call dein#add('altercation/vim-colors-solarized')
  14.     call dein#add('Shougo/denite.nvim')
  15.     call dein#add('bfredl/nvim-ipy')
  16.     call dein#add('tpope/vim-fugitive')
  17.     call dein#add('ayu-theme/ayu-vim')
  18.     call dein#add('reedes/vim-colors-pencil')
  19.     call dein#add('vim-airline/vim-airline')
  20.     call dein#add('justmao945/vim-clang')
  21.     call dein#add('neovim/python-client')
  22.     call dein#add('zchee/deoplete-clang')
  23.     call dein#add('ekalinin/Dockerfile.vim')
  24.     call dein#add('junegunn/gv.vim')
  25.     call dein#end()
  26.     call dein#save_state()
  27. endif
  28.  
  29. filetype plugin indent on
  30. syntax enable
  31.  
  32. let g:deoplete#enable_at_startup = 1
  33.  
  34. set termguicolors
  35.  
  36. colorscheme pencil
  37. set background=light
  38. let g:airline_theme = 'pencil'
  39. let g:airline_section_z = '%l:%c'
  40.  
  41. " IndentLine {{
  42. let g:indentLine_char = ''
  43. let g:indentLine_first_char = ''
  44. let g:indentLine_showFirstIndentLevel = 1
  45. let g:indentLine_setColors = 0
  46. " }}
  47.  
  48. call denite#custom#map(
  49.             \ 'insert',
  50.             \ '<C-j>',
  51.             \ '<denite:move_to_next_line>',
  52.             \ 'noremap'
  53.             \)
  54. call denite#custom#map(
  55.             \ 'insert',
  56.             \ '<C-k>',
  57.             \ '<denite:move_to_previous_line>',
  58.             \ 'noremap'
  59.             \)
  60. let mapleader=","
  61.  
  62. " Scrolling options
  63. set scrolljump=5
  64. set scrolloff=3
  65.  
  66. " F*ck backups and swap files
  67. set nobackup
  68. set noswapfile
  69. set nowritebackup
  70.  
  71. set noshowmatch                 " Do not show matching brackets by flickering
  72. set cursorline
  73. set nocursorcolumn
  74. set lazyredraw                              " Wait to redraw "
  75. set incsearch                   " Shows the match while typing
  76. set hlsearch                    " Highlight found searches
  77. set ignorecase                  " Search case insensitive...
  78. set smartcase                   " ... but not when search pattern contains upper case characters
  79. set ttyfast
  80. set nowrap
  81.  
  82. " folding based on language
  83. set foldmethod=syntax
  84.  
  85. set noerrorbells                " No beeps
  86. set backspace=indent,eol,start  " Makes backspace key more powerful.
  87. set showcmd                     " Show me what I'm typing
  88. set showmode                    " Show current mode.
  89. set ruler
  90. set number
  91. set history=1000
  92. set mouse=a
  93.  
  94. set splitright                  " Split vertical windows right to the current windows
  95. set splitbelow                  " Split horizontal windows below to the current windows
  96. set encoding=utf-8              " Set default encoding to UTF-8
  97. set autowrite                   " Automatically save before :next, :make etc.
  98. set autoread                    " Automatically reread changed files without asking me anything
  99. set laststatus=2
  100.  
  101. set fileformats=unix,dos,mac    " Prefer Unix over Windows over OS 9 formats
  102.  
  103. let mapleader = ","
  104. let g:mapleader = ","
  105.  
  106. " Easy indents
  107. vnoremap < <gv
  108. vnoremap > >gv
  109. nmap < <<
  110. nmap > >>
  111.  
  112. " Remove search highlight
  113. nnoremap <leader><space> :nohlsearch<CR>
  114.  
  115. " Better split switching
  116. map <C-j> <C-W>j
  117. map <C-k> <C-W>k
  118. map <C-h> <C-W>h
  119. map <C-l> <C-W>l
  120. nmap <leader>) :tabn<CR>
  121. nmap <leader>( :tabp<CR>
  122. nmap ¬ :tabn<CR>
  123. nmap ˙ :tabp<CR>
  124. nnoremap <tab> <c-w>w
  125.  
  126.  
  127. au BufNewFile,BufRead *.vim setlocal noet ts=2 sw=2 sts=2
  128. au BufNewFile,BufRead *.txt setlocal noet ts=4 sw=4
  129. au BufNewFile,BufRead *.md setlocal noet ts=4 sw=4
  130.  
  131. augroup filetypedetect
  132.     au BufNewFile,BufRead .tmux.conf*,tmux.conf* setf tmux
  133.     au BufNewFile,BufRead .nginx.conf*,nginx.conf* setf nginx
  134. augroup END
  135.  
  136. au FileType nginx setlocal noet ts=4 sw=4 sts=4
  137.  
  138. " Go settings
  139. au BufNewFile,BufRead *.go setlocal noet ts=4 sw=4 sts=4
  140.  
  141.  
  142. " Dockerfile
  143. au BufNewFile,BufRead *.yml setlocal noet shiftwidth=2 expandtab
  144.  
  145. " c/c++ settings
  146. au BufNewFile,BufRead *.c,*.cpp,*.h,*.hcc setl noet ts=4 sw=4 sts=4
  147.  
  148. " coffeescript settings
  149. autocmd BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab
  150.  
  151. " js settings
  152. autocmd BufNewFile,BufReadPost *.js,*.json,*.html,*.css,*.scss setl shiftwidth=2 expandtab
  153.  
  154. " scala settings
  155. autocmd BufNewFile,BufReadPost *.scala setl shiftwidth=2 expandtab
  156.  
  157. " lua settings
  158. autocmd BufNewFile,BufRead *.lua setlocal noet ts=4 sw=4 sts=4
  159.  
  160.  
  161. " Wildmenu completion {{{
  162. set wildmenu
  163. " set wildmode=list:longest
  164. set wildmode=list:full
  165.  
  166. set wildignore+=.hg,.git,.svn                    " Version control
  167. set wildignore+=*.aux,*.out,*.toc                " LaTeX intermediate files
  168. set wildignore+=*.jpg,*.bmp,*.gif,*.png,*.jpeg   " binary images
  169. set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest " compiled object files
  170. set wildignore+=*.spl                            " compiled spelling word lists
  171. set wildignore+=*.sw?                            " Vim swap files
  172. set wildignore+=*.DS_Store                       " OSX bullshit
  173. set wildignore+=*.luac                           " Lua byte code
  174. set wildignore+=migrations                       " Django migrations
  175. set wildignore+=go/pkg                       " Go static files
  176. set wildignore+=go/bin                       " Go bin files
  177. set wildignore+=go/bin-vagrant               " Go bin-vagrant files
  178. set wildignore+=*.pyc                            " Python byte code
  179. set wildignore+=*.orig                           " Merge resolution files
  180.  
  181. let g:deoplete#sources#clang#libclang_path = "/usr/lib/libclang.so"
  182. let g:deoplete#sources#clang#clang_header = "/usr/lib/clang/6.0.0/include/"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement