-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
75 lines (59 loc) · 1.48 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
" Install vim-plug
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
" Configure vim-plug
call plug#begin('~/.vim/plugged')
Plug 'morhetz/gruvbox'
Plug 'scrooloose/nerdtree'
call plug#end()
" Set true color if supported
" https://gist.github.com/XVilka/8346728
if exists("$COLORTERM")
set termguicolors
let &t_8f="\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b="\<Esc>[48;2;%lu;%lu;%lum"
else
let g:gruvbox_termcolors=16
endif
" Setup colorscheme
set background=dark
colorscheme gruvbox
let g:gruvbox_contrast_dark='hard'
let g:gruvbox_invert_selection=0
let g:gruvbox_italic=1
" Tabs to spaces
set expandtab
set smarttab
set tabstop=4
set shiftwidth=0
" Enable syntax highlighting
syntax on
" Highlight search patterns
set hlsearch
" Enable backspace in insert mode
set backspace=indent,eol,start
" Show cursor position
set ruler
" Ignore case while searching
set ignorecase
set smartcase
" Split to the right and below
set splitright
set splitbelow
" Highlight the current line
set cursorline
" Keep 6 lines visible when scrolling
set scrolloff=6
" Escape insert mode with jk
inoremap jk <ESC>
" Optionally force jk to be used to escape
" inoremap <ESC> <NOP>
" Set leader key
let mapleader = ","
" Easily open NERDTree
nnoremap <leader>f :NERDTreeToggle<CR>
" Enable scrolling in iTerm
" set mouse=a