Advertisement
Guest User

Untitled

a guest
May 25th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.33 KB | None | 0 0
  1. " \ ************** \
  2. " \ Plugin Manager \
  3. " \ ************** \
  4.  
  5. " Auto install Plug if not installed. Runs PlugInstall afterwards.
  6. if empty(glob('~/.vim/autoload/plug.vim'))
  7. silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
  8. \https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
  9. autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
  10. endif
  11.  
  12. call plug#begin('~/.vim/plugged')
  13. " Make sure you use single quotes
  14.  
  15. " ----- Editing ------------------------------------------------------------------------------
  16. Plug 'tpope/vim-surround' " Surrounds edit. Good for HTML/XML editing.
  17. Plug 'tpope/vim-commentary' " Comments+text objects.
  18. Plug 'junegunn/vim-easy-align' " Aligning
  19.  
  20. " ----- Code navigation ----------------------------------------------------------------------
  21. Plug 'xolox/vim-easytags' " Gen ctags
  22. Plug 'xolox/vim-misc' " Dependency to easy-tags
  23. Plug 'majutsushi/tagbar' " Browse ctag
  24. Plug 'w0rp/ale' " Linting
  25.  
  26. " ----- File navigation ----------------------------------------------------------------------
  27. Plug 'junegunn/fzf.vim' " Fuzzy find
  28. Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
  29.  
  30. " ----- Functionality wrappers ---------------------------------------------------------------
  31. Plug 'tpope/vim-fugitive' " Git wrapper
  32.  
  33. " ----- Languages ----------------------------------------------------------------------------
  34. " Python
  35. Plug 'davidhalter/jedi-vim' " Code completion
  36. Plug 'tmhedberg/SimpylFold' " Folding
  37. Plug 'jmcantrell/vim-virtualenv' " Virtual envs
  38.  
  39. " Web
  40. Plug 'mattn/emmet-vim' " https://emmet.io like
  41. Plug 'elzr/vim-json' " Better JSON
  42.  
  43. " Markdown
  44. Plug 'gabrielelana/vim-markdown' " Better markdown
  45.  
  46. " ----- Appearance ---------------------------------------------------------------------------
  47. Plug 'morhetz/gruvbox'
  48. Plug 'altercation/vim-colors-solarized'
  49.  
  50. " Initialize plugin system
  51. call plug#end()
  52.  
  53.  
  54. " \ ********************* \
  55. " \ General functionality \
  56. " \ ********************* \
  57.  
  58. " ----- Environment --------------------------------------------------------------------------
  59. set encoding=utf-8 " keep the encoding as high as possible in $MYVIMRC
  60. filetype plugin indent on " :help :filetype-overview
  61. set tags=~/code/.tags " ctags dir
  62. set fileformat=unix " gives <EOL> of current buffer
  63.  
  64. " Vim needs a POSIX-Compliant shell. Fish is not.
  65. if $SHELL =~ 'bin/fish' || $SHELL =~ 'bin/zsh'
  66. set shell=/usr/bin/bash
  67. endif
  68.  
  69.  
  70. " ----- Input --------------------------------------------------------------------------------
  71. set mouse= " Mouse can be enabled for different modes.
  72.  
  73.  
  74. " ----- Editor -------------------------------------------------------------------------------
  75. syntax enable " syntax highlight
  76.  
  77. set tabstop=4 " show existing tab with 4 spaces width
  78. set softtabstop=4 " number of spaces tab counts for while editing
  79. set shiftwidth=4 " when indenting with '>', use 4 spaces width
  80. set expandtab " on pressing tab, insert 4 spaces
  81. set autoindent " copy indent from current line
  82.  
  83. set number " show line numbers
  84. set relativenumber " use relative line numbers
  85.  
  86. set textwidth=0 " line's 'max char count
  87. set foldmethod=indent " indent= lines with equal indent create a fold
  88. set foldlevel=95 " folds with a higher level will be closed
  89. set colorcolumn=95 " color column
  90. set backspace=indent,eol,start " backspace behavior in normal mode
  91.  
  92. set splitbelow " split below
  93. set splitright " split to the right
  94.  
  95. set modeline " modeline
  96. set laststatus=2 " if set to `2`, statusline is always displayed
  97.  
  98. highlight ColorColumn
  99. \ ctermbg=0
  100. \ guibg=lightgrey " adds color column of line, width set with `set colorcolumn`
  101.  
  102.  
  103. " ----- Accesibility -------------------------------------------------------------------------
  104. set ruler " show cursor position
  105. set wildmenu " tab-completion for command-line
  106. set scrolloff=1 " minimal number of screen lines to keep above & below cursor
  107. set sidescrolloff=5 " minimal number of screen columns to keep to left and right
  108. set display+=lastline " :help 'display'
  109. set formatoptions+=j " delete comment character when joining commented lines
  110. set autoread " reload files changed externally
  111. set autowrite " :w automatically when a bunch of stuff happens
  112.  
  113.  
  114. set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
  115.  
  116.  
  117. " ----- Languages ----------------------------------------------------------------------------
  118. let g:pymode_python = 'python3' " python 3 as default
  119.  
  120.  
  121. " ----- Performance --------------------------------------------------------------------------
  122. set synmaxcol=200 " Don't highlight anything longer than 200 chars
  123. let did_install_default_menus=1 " Don't load gvim menu stuff
  124. "let loaded_matchparen=1 " Don't hightlight matching parents
  125.  
  126.  
  127. " \ ********** \
  128. " \ Appearance \
  129. " \ ********** \
  130.  
  131. set t_Co=256
  132. colorscheme solarized
  133. set background=dark
  134.  
  135. " Solarized options
  136. let g:solarized_termcolors=16
  137. let g:solarized_termtrans=1
  138.  
  139.  
  140. " \ ********************* \
  141. " \ Settings source files \
  142. " \ ********************* \
  143. source ~/.vim/settings/statusline.vim
  144. source ~/.vim/settings/functions.vim
  145. source ~/.vim/settings/mappings.vim
  146.  
  147.  
  148. " \ ******* \
  149. " \ Sources \
  150. " \ ******* \
  151.  
  152. autocmd BufNewFile,BufRead *.py source ~/.vim/sources/py.vim
  153. autocmd BufNewFile,BufRead *.cpp source ~/.vim/sources/cpp.vim
  154. autocmd BufNewFile,BufRead *.c source ~/.vim/sources/c.vim
  155. autocmd BufNewFile,BufRead *.tex source ~/.vim/sources/tex.vim
  156. autocmd BufNewFile,BufRead *.md source ~/.vim/sources/md.vim
  157.  
  158.  
  159. " ********* \
  160. " \ Templates \
  161. " \ ********* \
  162.  
  163. "au BufNewFile *.py r ~/.vim/templates/temp.py
  164. "au BufNewFile *.sh r ~/.vim/templates/temp.sh
  165. au BufNewFile *.tex r ~/.vim/templates/temp.tex
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement