-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
129 lines (107 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
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
118
119
120
121
122
123
124
125
126
127
128
129
set nocompatible " be iMproved
filetype off " required!
syntax enable
let mapleader=" "
set hidden
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"===================
" VUNDLE/PLUGINS
"===================
" let Vundle manage Vundle
Plugin 'gmarik/Vundle.vim'
Plugin 'lifepillar/vim-solarized8'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-fugitive'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'rking/ag.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'tmux-plugins/vim-tmux-focus-events'
Plugin 'airblade/vim-gitgutter'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'pearofducks/ansible-vim'
"Plugin 'Lokaltog/vim-easymotion'
"Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
"Plugin 'L9'
"Plugin 'FuzzyFinder'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - list configured plugins
" :PluginInstall(!) - install (update) plugins
" :PluginSearch(!) foo - search (or refresh cache first) for foo
" :PluginClean(!) - confirm (or auto-approve) removal of unused plugins
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"===================
" PLUGIN OPTIONS
"===================
"airline/powerline
let g:airline_powerline_fonts=1
let g:airline#extensions#tabline#enabled = 1
set laststatus=2
set noshowmode
"nerdtree
map <leader>n :NERDTreeToggle<CR>
nmap <leader>j :NERDTreeFind<CR>
let NERDTreeShowHidden=1
"truecolor
if (has("termguicolors"))
set termguicolors
endif
"Sometimes setting 'termguicolors' is not enough and one has to set the t_8f and t_8b options explicitly
":h xterm-true-color
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
"solarized8
set background=dark
colorscheme solarized8_flat
"transparent bg
hi Normal ctermbg=none
hi NonText ctermbg=none
"gitgutter
set signcolumn=yes
"===================
" VIM SETTINGS
"===================
set number
set relativenumber
set autoread
set colorcolumn=90
set pastetoggle=<F3>
set hlsearch
set nowrap
" canonical dirs for backups and swap files
set backupdir=~/.vim/backup//
set directory=~/.vim/swp//
" Esc search
"nnoremap <silent> <Esc> :nohlsearch<Bar>:echo<CR>
" Quick reload of .vimrc
nmap <leader>r :source ~/.vimrc<CR>
" keymap to toggle line numbers
nmap <F2> :set invnumber invrelativenumber<CR>
" Toggle relative numbers on FocusLost
autocmd FocusLost * :set number norelativenumber
" Using vim-tmux-navigator, on FocusLost ^[[O was left behind
" https://github.com/tmux-plugins/vim-tmux-focus-events/issues/2
autocmd FocusLost * silent redraw!
autocmd FocusGained * :set number relativenumber
" Toggle relative numbers in insert mode
autocmd InsertEnter * :set number norelativenumber
autocmd InsertLeave * :set number relativenumber
"quick change modes
if ! has('gui_running')
set ttimeoutlen=10
augroup FastEscape
autocmd!
au InsertEnter * set timeoutlen=0
au InsertLeave * set timeoutlen=1000
augroup END
endif