-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathvimrc
107 lines (89 loc) · 3.64 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
set nocompatible " be iMproved, required
syntax on
filetype plugin indent on
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'elzr/vim-json'
Plugin 'mileszs/ack.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-rhubarb'
Plugin 'isRuslan/vim-es6'
Plugin 'elixir-lang/vim-elixir'
Plugin 'jparise/vim-graphql'
Plugin 'digitaltoad/vim-jade'
Plugin 'jelera/vim-javascript-syntax'
Plugin 'editorconfig/editorconfig-vim'
Plugin 'ekalinin/Dockerfile.vim'
Plugin 'leafgarland/typescript-vim'
Plugin 'GutenYe/json5.vim'
" Above is required for vundle
execute pathogen#infect()
source ~/.vim/typos.vim " Common typos and abbreviations
" == Settings
" For an overview of options see :help options-list
set backspace=indent,eol,start " more powerful backspacing
set backupext=.backup " Backup Extension
set formatoptions=qroct " Format options
set hlsearch " Highlight search results
set incsearch " Enable Incremental Seach ( Search as you type )
set noautowrite " Disable Autowrite
set nobackup " Disable Backup
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set nostartofline " Do not jump to first character with page commands, i.e., keep the cursor in the current column.
set nowrap " Don't wrap
set number " Display the line number
set ruler " Display line and col #; cursor of the screen
set showmatch " Show matching brackets
set showmode " Show current mode
set expandtab " Use spaces instead of tabs
set visualbell " Screw sound, flash the screen instead
set shiftwidth=2 " Shiftwidth
set tabstop=2 " Number of spaces tabs should be converted to
set softtabstop=2
set smartindent " Always indent my tabs when I enter a new line
set title " Set VIM to change the title
set titlestring=vim:\ %F " Format the title
set mouse=a
set smarttab
set tags=tags;/ " keep going up a dir until you find a tags file
set tabpagemax=100
set nofoldenable " disable folds
" == Mapping
" Open a CTAG in a new tab: http://stackoverflow.com/questions/563616/vimctags-tips-and-tricks
map <C-\> :tab split<CR>:exec("tag ".expand("<cword>"))<CR>
" <CTRL>+TAB to cycle through tabs, seems to only work in GVIM
noremap <C-Tab> gt
" Create a new tab
noremap <C-W>tn :tabnew<CR>
"" Use <Ctrl>+N or <CTRL>+P to cycle through tabs:
nnoremap <C-N> gt
nnoremap <C-P> gT
" have <F1> prompt for a help topic, rather than displaying the introduction
" page, and have it do this from any mode:
nnoremap <F1> :help<Space>
" Disable Ex Mode!
nnoremap <S-Q> <Esc>
" For those quick fingers, which can't release the shift key.
nmap :W :w
nmap :Q :q
" When the space bar key is hit, go down 10 spaces
nmap <Space> 10j
set runtimepath+=$GOROOT/misc/vim
" https://github.com/ctrlpvim/ctrlp.vim
let g:ctrlp_map = '<C-f>'
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
" https://github.com/kien/ctrlp.vim/issues/160
let g:ctrlp_prompt_mappings = {
\ 'AcceptSelection("e")': ['<c-t>'],
\ 'AcceptSelection("t")': ['<cr>', '<2-LeftMouse>'],
\ }
" NERD Tree https://github.com/scrooloose/nerdtree
map <C-e> :NERDTreeToggle<CR>
" change these directories because some files may read the tempfiles that vim
" creates
set backupdir=./.backup,.,/tmp
set directory=.,./.backup,/tmp