-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
89 lines (74 loc) · 3.17 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
" General settings
set autoindent " auto-indent new lines
set backspace=indent,eol,start " backspace through everything in insert mode
set cursorline " highlight the current line
set expandtab " use spaces, not tabs
set list lcs=tab:▸\ ,trail:·,nbsp:_ " Show "invisible" characters
set nocompatible " choose no compatibility with legacy vi
set nowrap " don't wrap lines
set number " Line numbers - always on all the time
set tabstop=2 shiftwidth=2 " a tab is two spaces
" Vim plugins
" Brief help
" :PlugInstall - installs plugins; append `!` to update or just :PlugUpdate
" :PlugUpdate - update plugins
" :PlugClean - confirms removal of unused plugins; append `!` to auto-approve removal
" :PlugUpgrade - upgrade vim-plug itself
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
" Utilities
Plug 'jiangmiao/auto-pairs' " Insert or delete brackets, parens, quotes in pair
Plug 'mileszs/ack.vim' " :Ack in vim
Plug 'tomtom/tcomment_vim' " comment lines with <Leader>__ (and other cool tricks)
Plug 'tpope/vim-endwise' " end structures automatically
Plug 'https://github.com/tpope/vim-dispatch.git' " run commands in vim asynch
" Color scheme for vim
Plug 'junegunn/seoul256.vim'
" Powerline, but it's Airline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Git utilities
Plug 'airblade/vim-gitgutter' " show git status in the gutter
Plug 'tpope/vim-fugitive' " vim Git wrapper
" Ruby
Plug 'tpope/vim-bundler'
Plug 'tpope/vim-rails'
Plug 'vim-ruby/vim-ruby'
Plug 'preservim/nerdtree' |
\ Plug 'Xuyuanp/nerdtree-git-plugin' |
\ Plug 'ryanoasis/vim-devicons' |
\ Plug 'tiagofumo/vim-nerdtree-syntax-highlight' |
\ Plug 'unkiwii/vim-nerdtree-sync' |
\ Plug 'tyok/nerdtree-ack'
call plug#end()
" Show commits for every source line
nnoremap <Leader>gb :Git blame<CR>
" Color scheme settings
let g:seoul256_background = 234
colorscheme seoul256
" Vim Airline
set laststatus=2
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_theme='simple'
let g:airline#extensions#bufferline#enabled = 0
" NERDTree config
nnoremap <C-n> :NERDTree<CR>
nmap <leader>d :NERDTreeToggle<CR>
nmap <leader>f :NERDTreeFind<CR>
" close the last buffer (file)
nnoremap <leader>c :bp\|bd #<CR>
" Start NERDTree and put the cursor back in the other window.
autocmd VimEnter * NERDTree | wincmd p
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
let g:NERDSpaceDelims = 1
let g:NERDTreeGitStatusUseNerdFonts = 1
let g:NERDTreeHighlightCursorline = 1
let g:NERDTreeShowHidden = 1
let g:airline_powerline_fonts = 1
let g:nerdtree_sync_cursorline = 1