-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
117 lines (89 loc) · 2.83 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
108
109
110
111
112
113
114
115
116
117
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/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()
Plug 'w0ng/vim-hybrid'
Plug 'vim-scripts/mayansmoke'
Plug 'airblade/vim-gitgutter'
Plug 'scrooloose/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
" Plug 'rust-lang/rust.vim'
" Plug 'tpope/vim-surround'
" Plug 'mxw/vim-jsx'
Plug 'junegunn/goyo.vim', { 'for': 'markdown' }
" Plug 'leafgarland/typescript-vim'
" Plug 'ctrlpvim/ctrlp.vim'
" Plug 'ludovicchabant/vim-gutentags'
" Plug 'vim-syntastic/syntastic', { 'for': 'haskell' }
call plug#end()
" let g:easytags_cmd = '/usr/local/bin/ctags'
" let g:gutentags_cache_dir='~/.tags/'
" let g:gutentags_ctags_auto_set_tags=1
set statusline=%<\ %n:%f\ %m%r%y%=%-35.(line:\ %l\ of\ %L,\ col:\ %c%V\ (%P)%)
filetype plugin indent on
set nocompatible
syntax on
set backspace=indent,eol,start
set splitright " when splitting
set splitbelow
set autoread " auto reread changed files
set number " line numbers
set cursorline " highlight cursor line
set hlsearch " highlight search matches
set mouse=a
set mousehide
set showmatch
set ignorecase
set smartcase
set autoindent
set smartindent
set history=1000
if has("unnamedplus")
set clipboard=unnamedplus
elseif has("clipboard")
set clipboard=unnamed
endif
set expandtab
set shiftwidth=2
set tabstop=2
set softtabstop=2
set laststatus=2
" set gfn=Consolas:h14:cANSI
colorscheme mayansmoke
highlight LineNr ctermfg=grey ctermbg=white
" Some useful quickfix shortcuts
":cc see the current error
":cn next error
":cp previous error
":clist list all errors
map <C-n> :cn<CR>
map <C-m> :cp<CR>
" This comes first, because we have mappings that depend on leader
" With a map leader it's possible to do extra key combinations
" i.e: <leader>w saves the current file
let mapleader = ","
let g:mapleader = ","
" Remove search highlight and close quickfix
nnoremap <leader><space> :nohlsearch<CR>:cclose<CR>
" ,. for tag search
nnoremap <leader>. :CtrlPTag<cr>
" tags files shouldn't be in each repo
" au FileType json setlocal equalprg=json
" au FileType go setlocal equalprg=gofmt
" au FileType go setlocal makeprg=go\ build
if !has("gui_running")
" NERDTree open when started with no args
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | wincmd p | endif
endif
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
cnoreabbrev ag Ack!
" Ignore node_modules for Ctrl-P and nerdtree
set wildignore+=node_modules,__pycache__
let g:NERDTreeIgnore=['node_modules', '__pycache__']
let timeoutlen=2500
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif