-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
138 lines (114 loc) · 3.49 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
130
131
132
133
134
135
136
137
138
set nocompatible
syntax on
filetype plugin indent on
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
" tab length exceptions on some file types
autocmd FileType html setlocal shiftwidth=4 tabstop=4 softtabstop=4
autocmd FileType htmldjango setlocal shiftwidth=4 tabstop=4 softtabstop=4
autocmd FileType javascript setlocal shiftwidth=4 tabstop=4 softtabstop=4
set number
set splitbelow
set splitright
" Enable mouse support
set mouse=a
" Always show status bar
set ls=2
" incremental search
set incsearch
" highlight search results
set hlsearch
"set completeopt-=preview
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'flazz/vim-colorschemes'
" Pretty bulky but useful syntax engine + autocompletion
" Disable on pc's with space constraint
" Plugin 'Valloric/YouCompleteMe'
Plugin 'tpope/vim-fugitive'
Plugin 'nvie/vim-flake8'
Plugin 'tpope/vim-surround'
Plugin 'scrooloose/nerdtree'
Plugin 'kien/ctrlp.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'scrooloose/syntastic'
Plugin 'davidhalter/jedi-vim'
Plugin 'scrooloose/nerdcommenter'
Plugin 'easymotion/vim-easymotion'
Plugin 'mattn/emmet-vim'
Plugin 'airblade/vim-gitgutter'
Plugin 'JamshedVesuna/vim-markdown-preview'
" Colorschemes
Plugin 'sickill/vim-monokai'
Plugin 'fisadev/fisa-vim-colorscheme'
call vundle#end()
"" NERDTree
"Open nerdtree when no files specified
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
"Open nerdtree when opening directory
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
"" Aliases
nnoremap <F5> :NERDTreeToggle<CR>
" tabs
nnoremap <C-L> :tabnext<CR>
nnoremap <C-Right> :tabnext<CR>
nnoremap <C-H> :tabp<CR>
nnoremap <C-Left> :tabp<CR>
nnoremap <silent> <C-n> :tabedit <CR>
map tn :tabn<CR>
map tp :tabp<CR>
map tm :tabm
map tt :tabnew
map ts :tab split<CR>
" Save as sudo
ca w!! w !sudo tee "%"
" Tab Navigation
"" For Mac OS
nnoremap ˙ :wincmd h<CR>
nnoremap ∆ :wincmd j<CR>
nnoremap ˚ :wincmd k<CR>
nnoremap ¬ :wincmd l<CR>
"" For Linux
nnoremap <A-Up> :wincmd k<CR>
nnoremap <A-k> :wincmd k<CR>
nnoremap <A-Down> :wincmd j<CR>
nnoremap <A-j> :wincmd j<CR>
nnoremap <A-Left> :wincmd h<CR>
nnoremap <ESC>h :wincmd h<CR>
nnoremap <A-Right> :wincmd l<CR>
nnoremap <A-l> :wincmd l<CR>
" YouCompleteMe
" let g:ycm_global_ycm_extra_conf = "~/.vim/.ycm_extra_conf.py"
" Easymotion
" Fuzzy Search
function! s:config_easyfuzzymotion(...) abort
return extend(copy({
\ 'converters': [incsearch#config#fuzzyword#converter()],
\ 'modules': [incsearch#config#easymotion#module({'overwin': 1})],
\ 'keymap': {"\<CR>": '<Over>(easymotion)'},
\ 'is_expr': 0,
\ 'is_stay': 1
\ }), get(a:, 1, {}))
endfunction
noremap <silent><expr> <Space>/ incsearch#go(<SID>config_easyfuzzymotion())
if (&term =~? 'mlterm\|xterm\|xterm-256\|screen-256') || has('nvim')
let &t_Co = 256
colorscheme Atelier_CaveLight
else
colorscheme industry
endif
" colors for gvim
if has('gui_running')
colorscheme monokai
endif
" when scrolling, keep cursor 3 lines away from screen border
set scrolloff=3
set wildmode=list:longest
"map <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
" \ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
" \ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") .">"<CR>